mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
NetworkSession: Don't apply handlers to a disconnected session
closes #2756
This commit is contained in:
parent
dce08b4e88
commit
19f0d7f336
@ -166,8 +166,10 @@ class NetworkSession{
|
||||
}
|
||||
|
||||
public function setHandler(SessionHandler $handler) : void{
|
||||
$this->handler = $handler;
|
||||
$this->handler->setUp();
|
||||
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->setUp();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user