Current version: 0.1
Description:
perl module for doing rcon stuff with the Source rcon protocol.
As the comments in the module say:
#This module is *extremely* minimal, and possibly broken. #It makes almost no use of the features of this protocol. #Commands block, there is no queue system. That said, #it Does What I Want It To Do(tm), and the protocol implemented by #CS:S is a bit buggy at the moment. #This module is based on the 'radcon' module, written by #Matthew 'Gumby' Lees and myself.
Download: wabzcon.tar.gz
Example script / Documentation:
Usage:
$rcon = new wabzcon(Host=>"127.0.0.1", Port=>27015, Password=>"rconpassword");
This creates a new wabzcon object, AND AUTHENTICATES WITH THE SERVER.
You can immediately check for an error:
$rcon->get_error();
which returns a string with the error message.
$rcon->get_players();
returns an array with two elements, references to hashes, the first containing
player details indexed by their slot number, the second containing
server information (map, current player, max players etc).
$rcon->do("something");
sends the "something" command to the server and returns the string which
the server returns.
$rcon->close();
closes the tcp connection with the server.
Here's an example script (included in the download)
#!/usr/bin/perl -w
use Term::ANSIColor qw(:constants);
use wabzcon;
my $port = 27015;
$port = $ARGV[0] if $ARGV[0];
$rcon = new wabzcon(Host=>"127.0.0.1", Port=>$port, Password=>"rconpass");
(not $e = $rcon->get_error()) or die "Error: $e";
($players, $serv_param) = $rcon->get_players();
%players = %{$players};
%serv_param = %{$serv_param};
foreach $thing (keys %serv_param) {
print CYAN, "$thing:\t", RESET, "$serv_param{$thing}\n", RESET;
}
print "\n";
foreach $id (keys %players) {
print GREEN, "Name:\t", RESET, MAGENTA, "$players{$id}{'name'}", RESET, GREEN,"\tSteamID: ", RESET, "$players{$id}{'uniqueid'}\n", RESET;
}
print $rcon->do("users");
print $rcon->do("status");
$rcon->close();