Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: ./ts2_tcpserver.inc
TeamSpeak2 TCP Server Interface Classes - php-ts2

ts2_tcpserver

ts2_tcpserver

PHP TeamSpeak2 TCPServer Interface

 

public class ts2_tcpserver

PHP TeamSpeak2 TCPServer Interface
This is the basic class for the TCP server interface of TeamSpeak servers.It handles the connection and data retrieval stuff.It doesn't handle any output to the user, this is done by descending classes.

AuthorsThomas Liske <thomas@fiasko.dyndns.org>
Version0.0.5

 
Direct known subclasses: ts2_tabledump

Public Method Summary

bool

connect(string $host, [ integer $tcpport, integer $timeout ])

Initializes a connection to a TeamSpeak server.
void

close()

Finishes a connection to a TeamSpeak server - should be handled like a destructor.
array

general_informations()

Retrieves an associated array with general informations about the TeamSpeak server at all.
array

server_list()

Retrieves a list of running virtual servers at the TeamSpeak server.
array

server_informations(integer $port)

Retrieves an associated array with general informations about a TeamSpeak virtual server.
array

player_list(integer $port)

Retrieves an associated array with the current player list. The channel_id could be used with the result array of
array

channel_list(integer $port)

Retrieves an associated array of the current channel list.
string

channel_flags_short(integer $flag)

Converts the integer representation of the channel flags from channel_list() into a space seperated string of flag abreviations.
string

channel_flags_long(integer $flag)

Converts the integer representation of the channel flags from channel_list() into a comma seperated string of flag names.
string

player_flags_short(integer $flag)

Converts the integer representation of the player flags from player_list() into a space seperated string of flag abreviations.
string

player_flags_long(integer $flag)

Converts the integer representation of the player flags from player_list() into a comma seperated string of flag names.
string

player_pprivs_short(integer $flag)

Converts the integer representation of the player privileges from player_list() into a space seperated string of privilege abreviations.
string

player_pprivs_long(integer $flag)

Converts the integer representation of the player privileges from player_list() into a comma seperated string of privilege names.
string

player_cprivs_short(integer $flag)

Converts the integer representation of the current player privileges from player_list() into a space seperated string of privilege abreviations.
string

player_cprivs_long(integer $flag)

Converts the integer representation of the current player privileges from player_list() into a comma seperated string of privilege names.

Private Method Summary

void

cmp_channels(array $a, array $b)

Public Field Summary

integer

$last_errno

If an error has occurd, contains the last error number.
string

$last_errstr

If an error has occurd, contains the last error message.
array

$CPRIVS

Defines readable names for the current client privileges.
array

$PPRIVS

Defines readable names for the current player privileges.
array

$PFLAGS

Defines readable names for the current player flags.
array

$CFLAGS

Defines readable names for the channel flags.

Private Field Summary

integer

$tcp_conn

TCP connection handle to the TeamSpeak server.
array

$player_cols

Defines readable names for a current player entry columns.
array

$channel_cols

Defines readable names for a current channel entry columns.

Public Method Details

connect

public bool connect( string $host, [ integer $tcpport, integer $timeout ] )

  Initializes a connection to a TeamSpeak server.

Parameter
string $host
The hostname or IP where the TeamSpeak server is running.
integer $tcpport = >>51234<<
The TCP port for the TCP interface.
integer $timeout = >>5<<
The connection timeout in seconds.
Returns bool

Returns TRUE if the connection was established else FALSE is returned.

See Also $last_errno, $last_errstr, close()

close

public void close( )

  Finishes a connection to a TeamSpeak server - should be handled like a destructor.

Returns void


general_informations

public array general_informations( )

  Retrieves an associated array with general informations about the TeamSpeak server at all.

Returns array

General server informations, returns FALSE if there was an error.

See Also $last_errno, $last_errstr

server_list

public array server_list( )

  Retrieves a list of running virtual servers at the TeamSpeak server.

Returns array

Array with the server ports, returns FALSE if there was an error.

See Also $last_errno, $last_errstr

server_informations

public array server_informations( integer $port )

  Retrieves an associated array with general informations about a TeamSpeak virtual server.

Parameter
integer $port
The port of the virtual server to query for.
Returns array

General server informations, returns FALSE if there was an error.

See Also $last_errno, $last_errstr, server_list()

player_list

public array player_list( integer $port )

  Retrieves an associated array with the current player list. The channel_id could be used with the result array of
result array from the channel_list function.

Parameter
integer $port
The port of the virtual server to query for.
Returns array

Array with the actual players, returns FALSE if there was an error.

See Also $last_errno, $last_errstr, channel_list()

channel_list

public array channel_list( integer $port )

  Retrieves an associated array of the current channel list.

Parameter
integer $port
The port of the virtual server to query for.
Returns array

Array with the actual players, returns FALSE if there was an error.

See Also $last_errno, $last_errstr

channel_flags_short

public string channel_flags_short( integer $flag )

  Converts the integer representation of the channel flags from channel_list() into a space seperated string of flag abreviations.

Parameter
integer $flag
The integer representation of the channel flags.
Returns string

A space seperated string of abreviations of the channel flags.

See Also channel_list()

channel_flags_long

public string channel_flags_long( integer $flag )

  Converts the integer representation of the channel flags from channel_list() into a comma seperated string of flag names.

Parameter
integer $flag
The integer representation of the channel flags.
Returns string

A comma seperated string of names of the channel flags.

See Also channel_list()

player_flags_short

public string player_flags_short( integer $flag )

  Converts the integer representation of the player flags from player_list() into a space seperated string of flag abreviations.

Parameter
integer $flag
The integer representation of the player flags.
Returns string

A space seperated string of abreviations of the player flags.

See Also player_list()

player_flags_long

public string player_flags_long( integer $flag )

  Converts the integer representation of the player flags from player_list() into a comma seperated string of flag names.

Parameter
integer $flag
The integer representation of the player flags.
Returns string

A comma seperated string of names of the player flags.

See Also player_list()

player_pprivs_short

public string player_pprivs_short( integer $flag )

  Converts the integer representation of the player privileges from player_list() into a space seperated string of privilege abreviations.

Parameter
integer $flag
The integer representation of the player privileges.
Returns string

A space seperated string of abreviations of the player privileges.

See Also player_list()

player_pprivs_long

public string player_pprivs_long( integer $flag )

  Converts the integer representation of the player privileges from player_list() into a comma seperated string of privilege names.

Parameter
integer $flag
The integer representation of the player privileges.
Returns string

A comma seperated string of names of the player privileges.

See Also player_list()

player_cprivs_short

public string player_cprivs_short( integer $flag )

  Converts the integer representation of the current player privileges from player_list() into a space seperated string of privilege abreviations.

Parameter
integer $flag
The integer representation of the current player privileges.
Returns string

A space seperated string of abreviations of the player privileges.

See Also player_list()

player_cprivs_long

public string player_cprivs_long( integer $flag )

  Converts the integer representation of the current player privileges from player_list() into a comma seperated string of privilege names.

Parameter
integer $flag
The integer representation of the current player privileges.
Returns string

A comma seperated string of names of the player privileges.

See Also player_list()

Private Method Details

cmp_channels

private void cmp_channels( array $a, array $b )

 

Parameter
array $a
array $b
Returns void


Public Field Details

$last_errno

public integer $last_errno

>><<

If an error has occurd, contains the last error number.


$last_errstr

public string $last_errstr

>><<

If an error has occurd, contains the last error message.


$CPRIVS

public array $CPRIVS

>>array( 1 => array( 'short' => 'CA', 'long' => 'Channel Admin' ), 2 => array( 'short' => 'O', 'long' => 'Operator' ), 4 => array( 'short' => 'V', 'long' => 'Voice' ), 8 => array( 'short' => 'AO', 'long' => 'Auto Operator' ), 16 => array( 'short' => 'AV', 'long' => 'Auto Voice' ), )<<

Defines readable names for the current client privileges.


$PPRIVS

public array $PPRIVS

>>array( 1 => array( 'short' => 'SA', 'long' => 'Server Admin' ), 2 => array( 'short' => 'AR', 'long' => 'Allow Registration' ), 4 => array( 'short' => 'R', 'long' => 'Registered' ), )<<

Defines readable names for the current player privileges.


$PFLAGS

public array $PFLAGS

>>array( 1 => array( 'short' => 'CC', 'long' => 'Channel Commander' ), 2 => array( 'short' => 'VR', 'long' => 'Voice Requested' ), 4 => array( 'short' => 'NW', 'long' => 'No Wisper' ), 8 => array( 'short' => 'AW', 'long' => 'Away' ), 16 => array( 'short' => 'MM', 'long' => 'Microphone Muted' ), 32 => array( 'short' => 'SM', 'long' => 'Sound Muted' ), 64 => array( 'short' => 'RE', 'long' => 'Recording' ) )<<

Defines readable names for the current player flags.


$CFLAGS

public array $CFLAGS

>>array( 1 => array( 'short' => 'U', 'long' => 'Unregistered' ), 2 => array( 'short' => 'M', 'long' => 'Moderated' ), 4 => array( 'short' => 'P', 'long' => 'Password' ), 8 => array( 'short' => 'S', 'long' => 'Sub Channels' ), 16 => array( 'short' => 'D', 'long' => 'Default' ) )<<

Defines readable names for the channel flags.


Private Field Details

$tcp_conn

private integer $tcp_conn

>><<

TCP connection handle to the TeamSpeak server.


$player_cols

private array $player_cols

>>array( 0 => 'player_id', 1 => 'channel_id', 2 => 'packets_in', 3 => 'bytes_in', 4 => 'packets_out', 5 => 'bytes_out', 6 => 'packets_lost', 7 => 'ping', 8 => 'logintime', 9 => 'idletime', 10 => 'cprivs', 11 => 'pprivs', 12 => 'pflags', 13 => 'ip', 14 => 'nick', 15 => 'loginname' )<<

Defines readable names for a current player entry columns.


$channel_cols

private array $channel_cols

>>array( 0 => 'channel_id', 1 => 'codec_id', 2 => 'parent', 3 => 'order', 4 => 'maxusers', 5 => 'name', 6 => 'flags', 7 => 'password', 8 => 'topic' )<<

Defines readable names for a current channel entry columns.



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta