NAME

POE::Component::AssaultCube::ServerQuery::Server - Holds the server info

SYNOPSIS

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 );
}

ABSTRACT

Holds the server info

DESCRIPTION

This module represents a server for the PoCo to ping. There are a few values to twiddle.

Constructor

This module uses Moose, so you can pass either a hash or a hashref to the constructor.

The attributes are:

server

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.

port

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 :)

frequency

A number in seconds ( can be floating-point )

How long we should wait before sending the next ping.

Default: 300

get_players

Should we also retrieve the playerlist? This is a boolean which defaults to false.

Methods

There are some methods you can call on the object:

ID

Returns the PoCo-assigned ID for this server.

nextping

Returns how many seconds to the next ping, or 0 if it should be done now.

Attributes

You can modify some attributes while the server is being pinged:

frequency

Same as the constructor

get_players

Same as the constructor

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.