mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
Fixed Query-related crash
This commit is contained in:
parent
90777014b6
commit
bf596ebf05
@ -631,9 +631,16 @@ class Server{
|
|||||||
* @param string $payload
|
* @param string $payload
|
||||||
*/
|
*/
|
||||||
public function handlePacket($address, $port, $payload){
|
public function handlePacket($address, $port, $payload){
|
||||||
|
try{
|
||||||
if(strlen($payload) > 2 and substr($payload, 0, 2) === "\xfe\xfd" and $this->queryHandler instanceof QueryHandler){
|
if(strlen($payload) > 2 and substr($payload, 0, 2) === "\xfe\xfd" and $this->queryHandler instanceof QueryHandler){
|
||||||
$this->queryHandler->handle($address, $port, $payload);
|
$this->queryHandler->handle($address, $port, $payload);
|
||||||
} //TODO: add raw packet events
|
}
|
||||||
|
}catch(\Exception $e){
|
||||||
|
if($this->logger instanceof MainLogger){
|
||||||
|
$this->logger->logException($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//TODO: add raw packet events
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2171,7 +2178,13 @@ class Server{
|
|||||||
if(($this->tickCounter & 0b1111) === 0){
|
if(($this->tickCounter & 0b1111) === 0){
|
||||||
$this->titleTick();
|
$this->titleTick();
|
||||||
if(isset($this->queryHandler) and ($this->tickCounter & 0b111111111) === 0){
|
if(isset($this->queryHandler) and ($this->tickCounter & 0b111111111) === 0){
|
||||||
|
try{
|
||||||
$this->queryHandler->regenerateInfo();
|
$this->queryHandler->regenerateInfo();
|
||||||
|
}catch(\Exception $e){
|
||||||
|
if($this->logger instanceof MainLogger){
|
||||||
|
$this->logger->logException($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user