Games::AssaultCube::MasterserverQuery::Response - Holds the various data from a MasterserverQuery response
use Games::AssaultCube::MasterserverQuery; my $query = Games::AssaultCube::MasterserverQuery->new; #my $query = Games::AssaultCube::MasterserverQuery->new( 'http://foo.com/get.do' ); #my $query = Games::AssaultCube::MasterserverQuery->new({ server => 'http://foo.com/get.do', timeout => 5 }); my $response = $query->run; if ( defined $response ) { print "There is a total of " . $response->num_servers " servers in the list!\n"; } else { print "Masterserver is not responding!\n"; }
This module holds the various data from a MasterserverQuery response
This module holds the response data from an AssaultCube MasterserverQuery. Normally you will not use this class directly, but via the Games::AssaultCube::MasterserverQuery class.
You can get the various data by fetching the attribute. Valid attributes are:
The URI of the masterserver we queried
An arrayref of hashrefs of servers in the list
The hashref contains the following keys: ip and port
A convenience accessor returning the number of servers in the list
The HTTP::Response object in case you wanted to poke around
A convenience accessor returning "vital" data in a hashref for easy usage
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.