POE::Component::AssaultCube::ServerQuery::Server - Holds the server info
use POE::Component::AssaultCube::ServerQuery; sub _start { my $query = POE::Component::AssaultCube::ServerQuery->new; $query->register; my $server = POE::Component::AssaultCube::ServerQuery::Server->new( { server => '123.123.123.123', frequency => 60, } ); $query->addserver( $server ); }
Holds the server info
This module represents a server for the PoCo to ping. There are a few values to twiddle.
This module uses Moose, so you can pass either a hash or a hashref to the constructor.
The attributes are:
The server ip.
NOTE: Input in the form of a hostname is not currently supported. Please resolve it before instantiation of this object! A good module to use would be POE::Component::Client::DNS or anything else.
The server port. Defaults to 28763.
WARNING: AssaultCube uses $port+1 for the query port. Please do not do pass $port+1 to the constructor, we do it internally. Maybe in the future AC will use $port+2 or another system, so let us deal with it :)
A number in seconds ( can be floating-point )
How long we should wait before sending the next ping.
Default: 300
Should we also retrieve the playerlist? This is a boolean which defaults to false.
There are some methods you can call on the object:
Returns the PoCo-assigned ID for this server.
Returns how many seconds to the next ping, or 0 if it should be done now.
You can modify some attributes while the server is being pinged:
Same as the constructor
Apocalypse <apocal@cpan.org>
Props goes to Getty and the BS clan for the support!
This project is sponsored by http://cubestats.net
Copyright 2009 by Apocalypse
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Games::AssaultCube, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::AssaultCube
CPAN shell
perl -MCPAN -e shell install Games::AssaultCube
For more information on module installation, please visit the detailed CPAN module installation guide.