mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
NetworkSession: Don't crash on failure to decode compressed batches
this could be an outdated version (pre-1.1 for example).
This commit is contained in:
parent
cc84ec8629
commit
622fe99982
@ -144,7 +144,13 @@ class NetworkSession{
|
|||||||
|
|
||||||
//TODO: decryption if enabled
|
//TODO: decryption if enabled
|
||||||
|
|
||||||
$stream = new PacketStream(NetworkCompression::decompress($payload));
|
try{
|
||||||
|
$stream = new PacketStream(NetworkCompression::decompress($payload));
|
||||||
|
}catch(\ErrorException $e){
|
||||||
|
$this->server->getLogger()->debug("Failed to decompress packet from " . $this->ip . " " . $this->port . ": " . bin2hex($payload));
|
||||||
|
$this->disconnect("Compressed packet batch decode error (incompatible game version?)", false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
while(!$stream->feof() and $this->connected){
|
while(!$stream->feof() and $this->connected){
|
||||||
$this->handleDataPacket(PacketPool::getPacket($stream->getString()));
|
$this->handleDataPacket(PacketPool::getPacket($stream->getString()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user