r3675 - trunk/Docs/server/rcon2irc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Jun 1 14:26:40 EDT 2008
Author: div0
Date: 2008-06-01 14:26:40 -0400 (Sun, 01 Jun 2008)
New Revision: 3675
Modified:
trunk/Docs/server/rcon2irc/rcon2irc.pl
Log:
make rcon2irc support votes (start)
Modified: trunk/Docs/server/rcon2irc/rcon2irc.pl
===================================================================
--- trunk/Docs/server/rcon2irc/rcon2irc.pl 2008-06-01 18:20:42 UTC (rev 3674)
+++ trunk/Docs/server/rcon2irc/rcon2irc.pl 2008-06-01 18:26:40 UTC (rev 3675)
@@ -389,6 +389,7 @@
our %channels = ();
our %store = (
irc_nick => "",
+ playernick_0 => "(console)",
);
our %config = (
irc_server => undef,
@@ -979,6 +980,60 @@
return 0;
} ],
+ # chat: Nexuiz server -> IRC channel, nick change/set
+ [ dp => q{:(name|join):(\d+):(.*)} => sub {
+ my ($type, $id, $nick) = @_;
+ $nick = color_dp2irc $nick;
+ my $oldnick = $store{"playernick_$id"};
+ if($type eq 'name')
+ {
+ out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 is now known as $nick";
+ }
+ $store{"playernick_$id"} = $nick;
+ return 0;
+ } ],
+
+ # chat: Nexuiz server -> IRC channel, vote call
+ [ dp => q{:vote:vcall:(\d+):(.*)} => sub {
+ my ($id, $command) = @_;
+ $command = color_dp2irc $command;
+ my $oldnick = $store{"playernick_$id"};
+ out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 calls a vote for $command";
+ return 0;
+ } ],
+
+ # chat: Nexuiz server -> IRC channel, vote stop
+ [ dp => q{:vote:vstop:(\d+)} => sub {
+ my ($id) = @_;
+ my $oldnick = $store{"playernick_$id"};
+ out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 stopped the vote";
+ return 0;
+ } ],
+
+ # chat: Nexuiz server -> IRC channel, master login
+ [ dp => q{:vote:vlogin:(\d+)} => sub {
+ my ($id) = @_;
+ my $oldnick = $store{"playernick_$id"};
+ out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 logged in as master";
+ return 0;
+ } ],
+
+ # chat: Nexuiz server -> IRC channel, master do
+ [ dp => q{:vote:vdo:(\d+):(.*)} => sub {
+ my ($id, $command) = @_;
+ my $oldnick = $store{"playernick_$id"};
+ out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 used his master status to do $command";
+ return 0;
+ } ],
+
+ # chat: Nexuiz server -> IRC channel, result
+ [ dp => q{:vote:v(yes|no|timeout):(\d+):(\d+):(\d+):(\d+):-?(\d+)} => sub {
+ my ($result, $yes, $no, $abstain, $not, $min) = @_;
+ my $spam = "$yes:$no" . (($min >= 0) ? " ($min needed)" : "") . " $abstain didn't care, $not didn't vote";
+ out irc => 0, "PRIVMSG $config{irc_channel} :* the vote ended with $result: $spam";
+ return 0;
+ } ],
+
# chat: IRC channel -> Nexuiz server
[ irc => q{:([^! ]*)![^ ]* (?i:PRIVMSG) (?i:(??{$config{irc_channel}})) :(?i:(??{$store{irc_nick}}))(?: |: ?)(.*)} => sub {
my ($nick, $message) = @_;
More information about the nexuiz-commits
mailing list