more rcon2irc fun
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Thu, 24 Sep 2009 14:41:13 +0000 (14:41 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Thu, 24 Sep 2009 14:41:13 +0000 (14:41 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@7894 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

server/rcon2irc/rbiserver.pl
server/rcon2irc/rcon2irc.pl

index 9bfbcbf..2afac95 100644 (file)
@@ -93,12 +93,19 @@ sub markmap($$$$;$)
        out irc => 0, "PRIVMSG $config{irc_channel} :\001ACTION thinks $nick refuses to tell us which file is modified\001";
        return 0;
 } ],
+[ dp => q{pure: \*DETAIL_CVAR (.*) (\S+) (.*)$} => sub {
+       my ($nick, $cvar, $value) = @_;
+       $nick = color_dp2irc $nick;
+       out irc => 0, "PRIVMSG $config{irc_channel} :\001ACTION thinks $nick has changed $cvar to $value\001";
+       return 0;
+} ],
 [ dp => q{:recordset:(\d+):.*} => sub {
        my ($id) = @_;
        my $ip = $store{"playerip_byid_$id"};
        my $slot = $store{"playerslot_byid_$id"};
        my $name = $config{irc_nick};
        $name =~ s/Nex//; # haggerNexCTF -> haggerCTF
+       $name =~ s/^rm/hagger/g; # rmRace -> haggerRace
        my $map = $store{map};
        $map =~ s/^[a-z]*_//;
        $ip =~ s/\./-/g;
index 37e9a16..f1f3bcb 100755 (executable)
@@ -201,10 +201,10 @@ sub color_dp2irc($)
                        my $oldcolor = $color;
                        $color = $color_dp2irc_table[$data];
 
-                       $color == $oldcolor        ? '' :
-                       $color < 0                 ? "\017" :
-                       index '0123456789,', $next ? "\003$color\002\002" :
-                                                    "\003$color";
+                       $color == $oldcolor               ? '' :
+                       $color < 0                        ? "\017" :
+                       (index '0123456789,', $next) >= 0 ? "\003$color\002\002" :
+                                                           "\003$color";
                } :
                        die "Invalid type";
        }