extends |
Protocol |
---|
Battlefield Bad Company 2 Protocol Class NOTE: There are no qualifiers to the response packets sent back from the server as to which response packet belongs to which query request. For now this class assumes the responses are in the same order as the order in which the packets were sent to the server. If this assumption turns out to be wrong there is easy way to tell which response belongs to which query. Hopefully this assumption will hold true as it has in my testing.
Methods | ||
---|---|---|
public
|
processResponse(): array
|
# |
protected
|
decode(Buffer $buffer): array
|
# |
protected
|
processDetails(Buffer $buffer): array
|
# |
protected
|
processVersion(Buffer $buffer): array
|
# |
protected
|
processPlayers(Buffer $buffer): array
|
# |
Properties | |||
---|---|---|---|
protected
|
array
|
$packets = [
self::PACKET_VERSION => "\x00\x00\x00\x00\x18\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00version\x00",
self::PACKET_STATUS => "\x00\x00\x00\x00\x1b\x00\x00\x00\x01\x00\x00\x00\x0a\x00\x00\x00serverInfo\x00",
self::PACKET_PLAYERS => "\x00\x00\x00\x00\x24\x00\x00\x00\x02\x00\x00\x00\x0b\x00\x00\x00listPlayers\x00\x03\x00\x00\x00\x61ll\x00",
]
|
# |
protected
|
array
|
$responses = ["processVersion", "processDetails", "processPlayers"]
|
# |
protected
|
string
|
$transport = self::TRANSPORT_TCP
|
# |
protected
|
string
|
$protocol = 'bfbc2'
|
# |
protected
|
string
|
$name = 'bfbc2'
|
# |
protected
|
string
|
$name_long = "Battlefield Bad Company 2"
|
# |
protected
|
int
|
$port_diff = 29321
|
# |
protected
|
array
|
$normalize = [
'general' => [
'dedicated' => 'dedicated',
'hostname' => 'hostname',
'mapname' => 'map',
'maxplayers' => 'max_players',
'numplayers' => 'num_players',
'password' => 'password',
],
'player' => ['name' => 'name', 'score' => 'score', 'ping' => 'ping'],
'team' => ['score' => 'tickets'],
]
|
# |
Properties inherited from GameQ\Protocol |
---|
$process_methods, $packets_response, $result, $options, $state, $join_link |