HandshakePacketHandler no longer depends on NetworkSession

This commit is contained in:
Dylan K. Taylor
2020-04-24 23:18:29 +01:00
parent 7d9df6af6f
commit c869a7f099
3 changed files with 84 additions and 8 deletions

View File

@@ -548,7 +548,9 @@ class NetworkSession{
$this->cipher = new NetworkCipher($encryptionKey);
$this->setHandler(new HandshakePacketHandler($this));
$this->setHandler(new HandshakePacketHandler(function() : void{
$this->onLoginSuccess();
}));
$this->logger->debug("Enabled encryption");
}));
}else{
@@ -557,7 +559,7 @@ class NetworkSession{
}
}
public function onLoginSuccess() : void{
private function onLoginSuccess() : void{
$this->loggedIn = true;
$this->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::LOGIN_SUCCESS));