mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 16:45:13 +00:00
Use first-class closures in more places
This commit is contained in:
@ -197,7 +197,7 @@ class NetworkSession{
|
||||
|
||||
$this->setHandler(new SessionStartPacketHandler(
|
||||
$this,
|
||||
fn() => $this->onSessionStartSuccess()
|
||||
$this->onSessionStartSuccess(...)
|
||||
));
|
||||
|
||||
$this->manager->add($this);
|
||||
@ -787,9 +787,7 @@ class NetworkSession{
|
||||
|
||||
$this->cipher = EncryptionContext::fakeGCM($encryptionKey);
|
||||
|
||||
$this->setHandler(new HandshakePacketHandler(function() : void{
|
||||
$this->onServerLoginSuccess();
|
||||
}));
|
||||
$this->setHandler(new HandshakePacketHandler($this->onServerLoginSuccess(...)));
|
||||
$this->logger->debug("Enabled encryption");
|
||||
}));
|
||||
}else{
|
||||
@ -818,9 +816,7 @@ class NetworkSession{
|
||||
public function notifyTerrainReady() : void{
|
||||
$this->logger->debug("Sending spawn notification, waiting for spawn response");
|
||||
$this->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::PLAYER_SPAWN));
|
||||
$this->setHandler(new SpawnResponsePacketHandler(function() : void{
|
||||
$this->onClientSpawnResponse();
|
||||
}));
|
||||
$this->setHandler(new SpawnResponsePacketHandler($this->onClientSpawnResponse(...)));
|
||||
}
|
||||
|
||||
private function onClientSpawnResponse() : void{
|
||||
|
Reference in New Issue
Block a user