]> jfr.im git - irc/SurrealServices/srsv.git/commitdiff
Fix a problem with parse & networks w/ more than 1 server.
authorerry <redacted>
Fri, 29 Jul 2011 12:18:21 +0000 (12:18 +0000)
committererry <redacted>
Fri, 29 Jul 2011 12:18:21 +0000 (12:18 +0000)
git-svn-id: http://svn.tabris.net/repos/srsv@3551 70d4eda1-72e9-0310-a436-91e5bd24443c

branches/0.5.0/SrSv/Insp/Parse.pm
branches/0.5.0/SrSv/Insp/Send.pm

index f6413e960eef4f24bbb44fd5f4cdd42e97ce06e8..c9774476077e637088b86784a667199aff91f5aa 100644 (file)
@@ -228,17 +228,28 @@ sub PING($) {
        return ('PING', undef, undef, WF_NONE, $1);
 }
 sub UID ($) {
-       #:583 UID 583AAAAAJ 1307703236 erry__ localhost localhost errietta 127.0.0.1 1307703241 + :errietta
-       $_[0] =~ /^(:\S+) UID (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) :(.*)$/;
-       my ($server, $uid, $stamp, $nick, $host, $vhost, $ident, $IP, $ts, $modes, $gecos) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);
-       print "UID $uid " . decodeUUID($uid) . "\n";
-       my $user = { NICK => $nick, ID => decodeUUID($uid) };
-       return ('NICKCONN', undef, undef, WF_NICK, $user, 0, $ts, $ident, $host, $server, $stamp, $modes, $vhost, $gecos,
+       if ($_[0] =~ /^(:\S+) UID (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) :(.*)$/) {
+               print "1111111111111\n";
+                       #:583 UID 583AAAAAJ 1307703236 erry__ localhost localhost errietta 127.0.0.1 1307703241 + :errietta
+               my ($server, $uid, $stamp, $nick, $host, $vhost, $ident, $IP, $ts, $modes, $gecos) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);
+               print "UID $uid " . decodeUUID($uid) . "\n";
+               my $user = { NICK => $nick, ID => decodeUUID($uid) };
+               return ('NICKCONN', undef, undef, WF_NICK, $user, 0, $ts, $ident, $host, $server, $stamp, $modes, $vhost, $gecos,
                        join('.', unpack('C4', MIME::Base64::decode($IP))));
+       }
+       elsif ($_[0] =~ /^(:\S+) UID (\S+) (\d+) (\S+) (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\S+) :(.*)$/) {
+               print "2222222\n";
+               #:965 UID 965AAAAAG 1311863295 erry arceus.pokemonlake.com IceFyre/NetAdmin/erry ~erry 216.14.116.138 1311863255 +IWhiosw   +ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz :erry
+               my ($server, $uid, $stamp, $nick, $host, $vhost, $ident, $IP, $ts, $modes, $snomasks, $gecos) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);
+               $modes .= $snomasks;
+               print "UID $uid " . decodeUUID($uid) . "\n";
+               my $user = { NICK => $nick, ID => decodeUUID($uid) };
+               return ('NICKCONN', undef, undef, WF_NICK, $user, 0, $ts, $ident, $host, $server, $stamp, $modes, $vhost, $gecos,
+                       join('.', unpack('C4', MIME::Base64::decode($IP))));
+       }
 }
 sub EOS($) {
        my $event;
-       print "EOS\n";
        if ($_[1] != "ENDBURST") {
                $_[0] =~ /^(@|:)(\S+) (?:EOS|ES)/; # Sometimes there's extra crap on the end?
                my $server;
@@ -266,7 +277,7 @@ sub EOS($) {
                return ("ENDBURST", undef, undef, WF_ALL, $1);
        }
 }
-
+our %servIds;
 sub SERVER($) {
        #ircd::debug($_[0]) if $debug;
 
@@ -308,12 +319,22 @@ sub SERVER($) {
                return ('SERVER', undef, undef, WF_ALL, $1, $2, $3, $4);
                # src, serverName, numHops, infoLine
        }
-       elsif ($_[0] =~ /SERVER (\S+) (\S+) (\d+) (\S+) :(.*)$/) {
+       elsif ($_[0] =~ /^:(\S+) SERVER (\S+) (\S+) (\d+) (\S+) :(.*)$/) {
+               #:irc.icefyre.org SERVER Services.IceFyre.Org * 1 00B :IceFyre IRC Services
+               my $id = $servIds{$1};
+                create_server($5, $id);
+                return ('SERVER', undef, undef, WF_ALL, $1, $5, $4, $6);
+       }
+       elsif ($_[0] =~ /^SERVER (\S+) (\S+) (\d+) (\S+) :(.*)$/) {
+               print "RIGHT ONE WHOO\n";
                #SERVER inspircd.erry.omg mypass 0 583 :erry World
+               #SERVER irc.icefyre.org mypass 0 965 :IceFyre IRC Hub
+
                #SERVER servername password hopcount SID :Server Desc
                $remoteserv = $4;
                create_server ($4);
                #since from now on we'll be getting commands as sent from the SID it's much wiser to keep that than the name.
+               $servIds{$1} = $4;
                return ("SERVER", undef, undef, WF_ALL, undef, $1, $3, $5, $4);
        }
 }
index 62ffc89dbdc78af68d1fbe1654385c02bbbd0b63..a7aa8f3a5fe80ec15bb7ffa2ac9c33ee1c10ca60 100644 (file)
@@ -163,10 +163,15 @@ sub pong($$$) {
         }
 }
 sub endburst {
-       print "GOT ENDBURST\n";
+       print "ENDBURST\n";
+        agent_sync();
+        flushmodes(\%preconnect_defer_mode);
+        ircd_flush_queue();
+        $ircd_ready = 1;
        ircd_flush_queue();
        ircsendimm ("ENDBURST");
        $ircd_ready = 1; #!
+       
 }
 sub eos {
        print "GOT EOS\n\n";