mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
I noticed this morning that my script that I have been using for the past 6 years failed to properly register on particular IRC networks while using Beta 7.05. I had never had any issues previously using prior versions including 6.35.

This seems to be specific to certain IRCD's. I have no issues connecting to the Twit or DALnet networks. However FreeNode and EFnet both exhibited problems.

To confirm, I have no ON LOGON events. If I disable raw (/raw off) completely I have no issues with the registration.

With RAW ON (/raw on) [Which DOES NOT register properly]:
Code:
-> irc.freenode.net CAP LS
-> irc.freenode.net NICK myn-test
-> irc.freenode.net USER myn 0 * :myn
<- :kornbluth.freenode.net NOTICE * :*** Looking up your hostname...
<- :kornbluth.freenode.net NOTICE * :*** Checking Ident
<- :kornbluth.freenode.net NOTICE * :*** Found your hostname
<- :kornbluth.freenode.net NOTICE * :*** Got Ident response
<- :kornbluth.freenode.net CAP * LS :identify-msg multi-prefix sasl



With RAW off (/raw off) [which registers properly]

Code:
-> irc.freenode.net CAP LS
-> irc.freenode.net NICK myn-test
-> irc.freenode.net USER myn 0 * :myn
<- :wolfe.freenode.net NOTICE * :*** Looking up your hostname...
<- :wolfe.freenode.net NOTICE * :*** Checking Ident
<- :wolfe.freenode.net NOTICE * :*** Found your hostname
<- :wolfe.freenode.net NOTICE * :*** Got Ident response
<- :wolfe.freenode.net CAP * LS :identify-msg multi-prefix sasl
-> irc.freenode.net CAP REQ :multi-prefix
<- :wolfe.freenode.net CAP myn-test ACK :multi-prefix 
-> irc.freenode.net CAP END



As you can see from the debug tracing 7.05 initiates a CAP LS but never completes the CAP envelope when raw is on.

To remedy this issue I had to add the following to my script:

Code:
;mIRC 7.05 Beta additions to support registration on certian networks
raw CAP:*LS*:{ .quote CAP REQ :multi-prefix }
raw CAP:*ACK*:{ .quote CAP END }








Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Please provide the events that cause the issue, not the ones that fix it. You mentioned you are running a script which clearly has RAW events (as /raw off solves the problem). One of these scripts is the problem.

It's impossible to confirm this as a bug without steps to reproduce it. Given the report, it could easily just be a bug in the script, or an incompatibility with 7.x. Provide a minimal test case or steps to reproduce the issue.

Thanks.



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
With /events off and /raw on the problem persists so it is definitely associated to the raw handling.

As you can see from my debug output above there is no RAW numeric event messages being processed. This all happens before the first raw event (001) is ever triggered. See below for the complete debug log which now includes my CAP fix. Note that the CAP envelope ends before a raw numeric event is ever triggered.

Code:
-> irc.freenode.net CAP LS
-> irc.freenode.net NICK myn-test
-> irc.freenode.net USER myn 0 * :myn
<- :pratchett.freenode.net NOTICE * :*** Looking up your hostname...
<- :pratchett.freenode.net NOTICE * :*** Checking Ident
<- :pratchett.freenode.net NOTICE * :*** Found your hostname
<- :pratchett.freenode.net NOTICE * :*** Got Ident response
<- :pratchett.freenode.net CAP * LS :identify-msg multi-prefix sasl
-> irc.freenode.net CAP REQ :multi-prefix
<- :pratchett.freenode.net CAP myn-test ACK :multi-prefix 
-> irc.freenode.net CAP END
<- :pratchett.freenode.net 001 myn-test :Welcome to the freenode Internet Relay Chat Network myn-test
<- :pratchett.freenode.net 002 myn-test :Your host is pratchett.freenode.net[192.168.25.107/6667], running version ircd-seven-1.0.2
<- :pratchett.freenode.net 003 myn-test :This server was created Wed Feb 3 2010 at 12:17:40 PST
<- :pratchett.freenode.net 004 myn-test pratchett.freenode.net ircd-seven-1.0.2 DOQRSZaghilopswz CFILMPQbcefgijklmnopqrstvz bkloveqjfI
<- :pratchett.freenode.net 005 myn-test CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQcgimnprstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 

Last edited by mynym; 19/06/10 06:29 PM.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
raw CAP:*: triggers (as it should), so any script that matches it needs to behave correctly (which probably means just not /halt'ing it).

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
We've already seen the debug log. Show the relevant raw events in your script. Raw events trigger before raw 001, and your script is clearly triggering a few. Please list those so we have information to reproduce this bug.

Without being able to reproduce the bug, Khaled can't fix it. Without steps to reproduce the bug, nobody here can reproduce it. As you pointed out, it's dependent on your script, which you have yet to provide.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Originally Posted By: Collective
raw CAP:*: triggers (as it should), so any script that matches it needs to behave correctly (which probably means just not /halt'ing it).


The thing is I never had any raw CAP:* handling prior to me adding this fix for the cap envelope today.

Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Here is my complete raw handling minus the fix for CAP envelope handling:

Code:
; <!------------ start raw section ------------!>


; end of /who - /who the next channel in queue, get $ibl(), check chan modes on new chan, etc
raw 315:*: {
  var %x = $+($network,_,$cid,_,$2)
  if ($eval($+(%,synch_,%x),2)) {
    if ($2 ischan) {
      set $+(%,ibl_,%x) 1
      .mode $2 +b
    }
    unset $eval($+(%,synch_,%x),1)
    unset $eval($+(%,synched_,%x),1)
    if ($deltok($eval($+(%,synch_,$network,_,$cid),2),1,32)) {
      set $eval($+(%,synch_,$network,_,$cid),1) $ifmatch
      .scid $cid who $gettok($eval($+(%,synch_,$network,_,$cid),2),1,32) 
    }
    else { unset $eval($+(%,synch_,$network,_,$cid),1) }
    halt
  }
}

; don't show modes if joining channel
raw 324:*: { if ($eval($+(%,synch_,$network,_,$cid,_,$2),2)) { haltdef } }


; end of chan created - gets synch time, shows /scan if enabled
raw 329:*: { 
  if ($chan($2).key) { writeini $userdir(settings.ini) keys $+($network,.,$2) $chan($2).key }
  if ($cfgstat(cmode) != $chan($2).mode && $nick($2,0) == 1) { mode $2 $cfgstat(cmode) }
  var %x = $+($network,_,$cid,_,$2)
  if ($eval($+(%,synched_,%x),2)) { halt }
  elseif ($eval($+(%,synch_,%x),2) && $2 ischan) {
    _tde $2 Synch $2 $+ $brac($chan($2).mode) in $_ticks($eval($+(%,synch_,%x),2))
    set $eval($+(%,synched_,%x),1) yes
    if $cfgstat(scan) == on { scan $2 }
    halt
  }
}

; output for /who if its not a channel we're joining
raw 352:*: { if $eval($+(%,synch_,$network,_,$cid,_,$2),2) { halt } }

; updates servers when you do a /links
raw 364:*: {
  if ($network && !$server($2) && $chr(42) !isin $2 && monitor. !isin $2 && ircd !isin $2 && services !isin $2 && hub !isin $2 && hub !isin $4-) { 
    set $+(%,links_,$cid,_,$server) $calc($eval($+(%,links_,$cid,_,$server),2) + 1)
    .server -a $2 -g $network -d $network $+ : $2 
  } 
}

; end of /links - shows you how many servers were added
raw 365:*: { 
  if $eval($+(%,links_,$cid,_,$server),2) { _tde -a Servers $eval($+(%,links_,$cid,_,$server),2) new servers added for $network }
  unset $+(%,links_,$cid,_,$server) 
}

; dont output end of ban if we're joining
raw 367:*: { if $eval($+(%,ibl_,$network,_,$cid,_,$2),2) { halt } }

; dont show bans if updating $ibl()
raw 368:*: {
  if $eval($+(%,ibl_,$network,_,$cid,_,$2),2) {
    unset $eval($+(%,ibl_,$network,_,$cid,_,$2),1)
    halt
  }
}


;lag check
on ^*:notice:*:?: {
  if ($1 == lagcheck && $nick == $me && $3 isnum) {
    _hadd vortex $+(lag_,$cid) $_ticks($3)
    if ($cfgstat(lagbar) == on) { _lagbarupdate $remove($_ticks($3),s) }
    halt
  }
}

; can't join chan, +k - uses stored keys in memory if available =]
raw 475:*: {
  if ($eval($+(%,key_,$network,_,$2),2)) { .remini $userdir(settings.ini) keys $+($network,.,$2) }
  set -u10 $+(%,key_,$network,_,$2) 1
  var %key = $readini($userdir(settings.ini),keys,$+($network,.,$2))
  if (%key) { 
    scid $cid _tde -a Join Attempting to use stored key %key on $2
    .join $2 $readini($userdir(settings.ini),keys,$+($network,.,$2))
  }
}

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
So what happens if you remove the ON NOTICE event?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Originally Posted By: argv0
So what happens if you remove the ON NOTICE event?


I tried that too. commented out on NOTICE and it still has the registration issue.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Then you'll have to remove/comment out all raw events until you've isolated the correct event.

For reference, in mIRC type the following and paste the results here:

//echo -a $os $version $beta $md5($mircexe,2) $file($mircexe).sig $script(0) $dll(0) $com(0)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Originally Posted By: argv0
Then you'll have to remove/comment out all raw events until you've isolated the correct event.

For reference, in mIRC type the following and paste the results here:

//echo -a $os $version $beta $md5($mircexe,2) $file($mircexe).sig $script(0) $dll(0) $com(0)



7 7.05 beta29 30a0941434b965fe1a150ec80cec14a8 ok 22 0 0

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You have 22 script files loaded. Those are the *only* raw events in the entire 22 scripts?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
I unloaded KTE.mrc (ver 1.5) to see if that may be causing any conflicts.

It appears to be the root cause as unloading KTE.MRC resolves the issue.

So does this mean every script out there that makes use of KTE (which is basically every one) is going to have this issue?

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
"Everyone"? I don't use KTE. I've never even heard of it until now. Not to mention, there have been no reports about it so far, so I don't think this issue is as widespread as you make it seem. But yes, it's likely that script is incompatible with 7.x and needs to be updated.

mIRC tries to retain backward compatibility when it can, but AFAIK a bunch of bug fixes in RAW handling change the way /halt works in raw events which could lead to the issue. Most scripts will eventually break if they're not maintained. Tell the author to update the script for 7.x and it should be fine when mIRC goes out of beta. This is one of the reasons for having the beta in the first place.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Originally Posted By: argv0
"Everyone"? I don't use KTE. I've never even heard of it until now.


KTE has been the defacto MTS theming standard for a number of years. Most "GOOD" scripts employ this as their method for theming. There are about 500 of them listed here: http://www.mircscripts.org/archive/themes

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Are you sure it's KTE that's at fault and not your specific theme?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Originally Posted By: argv0
Are you sure it's KTE that's at fault and not your specific theme?


Yeah I tried 5 different themes.

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
kte-dyn.mrc /haltdef's every raw event except a few related to WATCH (the 6xx series) (kte-dyn.dat lines 696-750), which causes mIRC not to issue its default response to the server's CAPability listing when raw CAP is received.

I can't think of a precedent for this behavior, and I'm not sure how desirable it is either. Does mIRC keep track of what capabilities a script enables?

Joined: Jun 2010
Posts: 13
M
mynym Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Jun 2010
Posts: 13
Originally Posted By: Collective
kte-dyn.mrc /haltdef's every raw event except a few related to WATCH (the 6xx series) (kte-dyn.dat lines 696-750), which causes mIRC not to issue its default response to the server's CAPability listing when raw CAP is received.

I can't think of a precedent for this behavior, and I'm not sure how desirable it is either. Does mIRC keep track of what capabilities a script enables?


Nice catch. I appreciate you digging into it this deep.


Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
Thanks this issue has been fixed for the next version.


Link Copied to Clipboard