NAME
Games::AssaultCube::MasterserverQuery::Response - Holds the various data from a MasterserverQuery response
SYNOPSIS
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";
}
ABSTRACT
This module holds the various data from a MasterserverQuery response
DESCRIPTION
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.
Attributes
You can get the various data by fetching the attribute. Valid attributes are:
masterserver
The URI of the masterserver we queried
servers
An arrayref of hashrefs of servers in the list
The hashref contains the following keys: ip and port
num_servers
A convenience accessor returning the number of servers in the list
response
The HTTP::Response object in case you wanted to poke around
tohash
A convenience accessor returning "vital" data in a hashref for easy usage
AUTHOR
Apocalypse <apocal@cpan.org>
Props goes to Getty and the BS clan for the support!
This project is sponsored by http://cubestats.net
COPYRIGHT AND LICENSE
Copyright 2009 by Apocalypse
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.