mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
NetworkSession: Don't apply handlers to a disconnected session
closes #2756
This commit is contained in:
parent
dce08b4e88
commit
19f0d7f336
@ -166,9 +166,11 @@ class NetworkSession{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setHandler(SessionHandler $handler) : void{
|
public function setHandler(SessionHandler $handler) : void{
|
||||||
|
if($this->connected){ //TODO: this is fine since we can't handle anything from a disconnected session, but it might produce surprises in some cases
|
||||||
$this->handler = $handler;
|
$this->handler = $handler;
|
||||||
$this->handler->setUp();
|
$this->handler->setUp();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $payload
|
* @param string $payload
|
||||||
|
Loading…
x
Reference in New Issue
Block a user