mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +00:00
Fix RCON packet structure #1278
This commit is contained in:
parent
8e1cd2d6bd
commit
85f8613803
@ -104,7 +104,11 @@ class RCONInstance extends Thread{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function writePacket($client, $requestID, $packetType, $payload){
|
private function writePacket($client, $requestID, $packetType, $payload){
|
||||||
return socket_write($client, Utils::writeLInt(strlen($payload)).Utils::writeLInt((int) $requestID).Utils::writeLInt((int) $packetType).($payload === "" ? "\x00":$payload)."\x00");
|
$pk = Utils::writeLInt((int) $requestID)
|
||||||
|
. Utils::writeLInt((int) $packetType)
|
||||||
|
. $payload
|
||||||
|
. "\x00\x00"; //Terminate payload and packet
|
||||||
|
return socket_write($client, Utils::writeLInt(strlen($pk)).$pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function readPacket($client, &$size, &$requestID, &$packetType, &$payload){
|
private function readPacket($client, &$size, &$requestID, &$packetType, &$payload){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user