Nick color problem

Known Issues, Bugs Reports, and Work Arounds

Moderators: L|B, cryoa, Riamus, XMog

Nick color problem

Postby NFC » Thu Jun 12, 2003 4:45 am

Sometimes, the color of your own nick seems to "disappear" whereas other colors are good.
If you take a look at the address book you can see that the color of your nick is applied to "me" instead of the real nick.

After using a workaround (I had put manually "$me" in the address book with the right color and it worked well), I have found where is the problem.

Here is the little patch:

file ialias2.mrc
lines 358 and 359
/!\ Be carefull, I have applied the fix pack found on irc (#invision@irchighway)
-----------8<-----------------
while (%ct <= $scon(0)) {
.cnick $iif(($scon(%ct).me != $null && $scon(%ct).me != YourNick),$scon(%ct).me,me) $r.glob(Nick.Colors,Color.4)
-----------8<-----------------

The only modification I made is the replacement of $scid() by $scon().
$scid() uses a parameter which is a connection ID and $scid(0) returns the number of active connections.
$scon() does the same thing but uses an integer rather than an ID so it's better to use it in loops.

The problem here is that connection IDs are incremental.
So, you can have for example 4 connections but there IDs can be greater than 4 (for example: 5, 21, 23, 86).
With theses numbers, the loop used is wrong because it tries to access the connections this way:
-> ID = 1 => $null
-> ID = 2 => $null
-> ID = 3 => $null
-> ID = 4 => $null
-> end of loop because there is only 4 connections

By using $scon() the loop is correct:
-> $scon(1) => $scid(5) => OK
-> $scon(2) => $scid(21) => OK
-> $scon(3) => $scid(23) => OK
-> $scon(4) => $scid(86) => OK
-> end of loop

And here, we don't drop any connection in the loop.


End of the (long) explanation of the problem :wink:

Thanks Cryoa for this great script and also cnils and krypton for their efforts solving problems and releasing fixes.
NFC
Member
Member
 
Posts: 73
Joined: Tue Jan 07, 2003 3:12 am

Postby cnils » Thu Jun 12, 2003 5:27 am

And thank you for this.
I'll see to that this and perhaps some other stuff makes it into the fixes.
I was really hoping for cryoa to release a new build some day, making the fix pack superfluous.
But it seems we have to live with it for a while longer.
cnils
Member
Member
 
Posts: 426
Joined: Wed Oct 09, 2002 9:01 pm

Postby NFC » Thu Jun 12, 2003 5:07 pm

I was wondering also if this line is correct:
------8<-------
$iif(($scon(%ct).me != $null && $scon(%ct).me != YourNick),$scon(%ct).me,me)
------8<-------

it seems a bit twited:
at the end, it seems more logical to have "$me" instead of "me" and why the comparison with the string "YourNick" ?

I have not changed that because the main problem was the use of $scid but maybe Cryoa (or another one) can help me understand this line cause I'm a bit confused with this $iif()
NFC
Member
Member
 
Posts: 73
Joined: Tue Jan 07, 2003 3:12 am

Postby cnils » Fri Jun 13, 2003 12:50 am

Since YourNick is the default nick for Invision, a check is done to see if the user set up his own nick in Main Settings.
I guess Cryoa didn't want the script to fully work if you didn't set it up correctly.
The other check is against a null nick. If it's not set he just use "me" so the command won't fail.
cnils
Member
Member
 
Posts: 426
Joined: Wed Oct 09, 2002 9:01 pm


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 30 guests