| Methods |
public
|
__construct(?string $address = null, ?int $queryport = null)
Initializes the CSQuery instance.
Initializes the CSQuery instance.
Overridden by
|
#
|
public
|
__sleep(): array
Returns a list of property names to serialize for object serialization.
Returns a list of property names to serialize for object serialization.
Returns
list of property names to serialize
|
#
|
public
|
getProtocolsMap(): array<string, string>
Returns a map of supported protocols to their implementing class names.
Returns a map of supported protocols to their implementing class names.
Returns
An array with names of the supported protocols
|
#
|
public
|
getSupportedProtocols(): array<string>
Return the names of the supported server protocols.
Return the names of the supported server protocols.
Returns
An array with names of the supported protocols
|
#
|
public
|
getProtocolClass(string $protocolClassname): string
Return the class name for a given protocol.
Return the class name for a given protocol.
Parameters
| $protocolClassname |
the protocol name
|
Returns
the class name for the protocol
|
#
|
public
|
createInstance(string $protocol, string $address, int $port): CSQuery
Create a new instance of a protocol-specific CSQuery subclass.
Create a new instance of a protocol-specific CSQuery subclass.
Parameters
| $protocol |
the protocol name (e.g. 'Csgo', 'Steam')
|
| $address |
the server address
|
| $port |
the query port
|
Returns
a CSQuery object that supports the specified protocol
Throws
|
#
|
public
|
setUdpClient(UdpClient $udpClient): void
Set a custom UDP client (for testing with fixtures).
Set a custom UDP client (for testing with fixtures).
Parameters
| $udpClient |
the UDP client to set
|
|
#
|
public
|
unserialize(string $string): mixed
Use this to restore a object that has been previously serialized with
serialize.
Use this to restore a object that has been previously serialized with
serialize.
Parameters
| $string |
serialized CSQuery object
|
Returns
|
#
|
public
|
getNativeJoinURI(): false|string
Returns a native join URI. Some games are registering an URI type to allow easy joining of games
Returns a native join URI. Some games are registering an URI type to allow easy joining of games
Returns
a native join URI or false if not implemented for the game
Overridden by
|
#
|
public
|
query_server(bool $getPlayers = true, bool $getRules = true): bool
Parameters
| $getPlayers |
whether to retrieve player infos
|
| $getRules |
whether to retrieve rules
|
Returns
Overridden by
|
#
|
public
|
sortPlayers(array<array<string, mixed>> $players, string $sortkey = 'name'): array<array<string, mixed>>
Sorts the given players. You can sort by name, score, frags, deaths, honor and time
Sorts the given players. You can sort by name, score, frags, deaths, honor and time
Parameters
| $players |
players to sort
|
| $sortkey |
sort by the given key
|
Returns
|
#
|
public
|
toJson(): false|string
Returns the server data as JSON string.
Returns the server data as JSON string.
|
#
|
public
|
toHtml(): string
Returns the server data as HTML string.
Returns the server data as HTML string.
|
#
|
protected
|
reset(): void
Resets the object to its initial state.
Resets the object to its initial state.
|
#
|
protected
|
sendCommand(string $address, int $port, string $command): false|string
Send a command to the server.
Send a command to the server.
Parameters
| $address |
Server address
|
| $port |
Server port
|
| $command |
Command to send
|
Returns
The response or false on error
|
#
|