]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - server/rcon2irc/rcon2irc.pl
get a nick before pinging, servers don't seem to like it otherwise and return 451...
[xonotic/xonotic.git] / server / rcon2irc / rcon2irc.pl
index 489a7e17a3eb9a1d7bfbe04bcd639338a96bb9f1..a29a0a1571f9d80245ae571b1e1e95926777b51e 100755 (executable)
@@ -1293,6 +1293,18 @@ sub cond($)
        [ irc => q{:[^ ]* 001 .*} => sub {
                $store{irc_seen_welcome} = 1;
                $store{irc_nick} = $store{irc_nick_requested};
        [ irc => q{:[^ ]* 001 .*} => sub {
                $store{irc_seen_welcome} = 1;
                $store{irc_nick} = $store{irc_nick_requested};
+               
+               # If users for quakenet are listed, parse them into a hash and schedule a sub to query information
+               if ($config{irc_quakenet_authusers} ne '') {
+                       $store{irc_quakenet_users} = { map { $_ => 1 } split / /, $config{irc_quakenet_authusers} };
+       
+                       schedule sub {
+                               my ($timer) = @_;
+                               out irc => 0, "PRIVMSG Q :users " . $config{irc_channel};
+                               schedule $timer => 300;;
+                       } => 1;
+               }
+
                return irc_joinstage(0);
        } ],
 
                return irc_joinstage(0);
        } ],
 
@@ -1688,17 +1700,6 @@ for my $p(split ' ', $config{plugins})
 }
 
 
 }
 
 
-# If users for quakenet are listed, parse them into a hash and schedule a sub to query information
-if ($config{irc_quakenet_authusers} ne '') {
-       $store{irc_quakenet_users} = { map { $_ => 1 } split / /, $config{irc_quakenet_authusers} };
-       
-       schedule sub {
-               my ($timer) = @_;
-               out irc => 0, "PRIVMSG Q :users " . $config{irc_channel};
-               schedule $timer => 300;;
-       } => 1;
-}
-
 
 # verify that the server is up by letting it echo back a string that causes
 # re-initialization of the required aliases
 
 # verify that the server is up by letting it echo back a string that causes
 # re-initialization of the required aliases
@@ -1726,7 +1727,7 @@ schedule sub {
        my ($timer) = @_;
 
        # log on to IRC when needed
        my ($timer) = @_;
 
        # log on to IRC when needed
-       if(exists $store{dp_hostname} && !exists $store{irc_logged_in})
+       if(exists $store{dp_hostname} && !exists $store{irc_seen_welcome})
        {
                $store{irc_nick_requested} = $config{irc_nick};
                out irc => 1, "NICK $config{irc_nick}", "USER $config{irc_user} localhost localhost :$store{dp_hostname}";
        {
                $store{irc_nick_requested} = $config{irc_nick};
                out irc => 1, "NICK $config{irc_nick}", "USER $config{irc_user} localhost localhost :$store{dp_hostname}";