From: Rudolf Polzer Date: Fri, 10 Sep 2010 21:23:17 +0000 (+0200) Subject: Merge remote branch 'refs/remotes/origin/mrbougo/rcon2irc_fix' X-Git-Tag: xonotic-v0.1.0preview~233 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=898ec1745ef1d81e7fa083ec7fdd5e1f9bfd7a09;hp=5e879f31dde79fc7c29c8e3ab03a4f6e4bc40f95 Merge remote branch 'refs/remotes/origin/mrbougo/rcon2irc_fix' --- diff --git a/server/rcon2irc/rcon2irc.pl b/server/rcon2irc/rcon2irc.pl index c1c2a4ef..b5d3c89e 100755 --- a/server/rcon2irc/rcon2irc.pl +++ b/server/rcon2irc/rcon2irc.pl @@ -1321,12 +1321,20 @@ sub cond($) return irc_joinstage(0); } ], - # Catch joins of people in a channel the bot is in and catch our own joins of a channel + # Catch joins of people in a channel the bot is in and catch our own joins of a channel, + # detect channel join message and note hostname length to get the maximum allowed line length [ irc => q{:(([^! ]*)![^ ]*) JOIN (#.+)} => sub { my ($hostmask, $nick, $chan) = @_; + + if ($nick eq $store{irc_nick}) { + $store{irc_maxlen} = 510 - length($hostmask); + $store{irc_joined_channel} = 1; + print "* detected maximum line length for channel messages: $store{irc_maxlen}\n"; + } + return 0 unless ($store{irc_quakenet_users}); - if ($nick eq $config{irc_nick}) { + if ($nick eq $store{irc_nick}) { out irc => 0, "PRIVMSG Q :users $chan"; # get auths for all users } else { $store{quakenet_hosts}->{$nick} = $hostmask; @@ -1395,14 +1403,6 @@ sub cond($) return 0; } ], - # detect channel join message and note hostname length to get the maximum allowed line length - [ irc => q{(:(?i:(??{$store{irc_nick}}))![^ ]* )(?i:JOIN) :(?i:(??{$config{irc_channel}}))} => sub { - $store{irc_maxlen} = 510 - length($1); - $store{irc_joined_channel} = 1; - print "* detected maximum line length for channel messages: $store{irc_maxlen}\n"; - return 0; - } ], - # chat: Xonotic server -> IRC channel [ dp => q{\001(.*?)\^7: (.*)} => sub { my ($nick, $message) = map { color_dp2irc $_ } @_; @@ -1727,7 +1727,7 @@ schedule sub { 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}";