ProcessLoginTask no longer depends on NetworkSession

This commit is contained in:
Dylan K. Taylor
2020-04-22 13:30:37 +01:00
parent dd37d286f0
commit 35d656c6e5
3 changed files with 38 additions and 15 deletions

View File

@@ -163,11 +163,18 @@ class NetworkSession{
$this->connectTime = time();
$this->setHandler(new LoginPacketHandler($this->server, $this, function(PlayerInfo $info) : void{
$this->info = $info;
$this->logger->info("Player: " . TextFormat::AQUA . $info->getUsername() . TextFormat::RESET);
$this->logger->setPrefix($this->getLogPrefix());
}));
$this->setHandler(new LoginPacketHandler(
$this->server,
$this,
function(PlayerInfo $info) : void{
$this->info = $info;
$this->logger->info("Player: " . TextFormat::AQUA . $info->getUsername() . TextFormat::RESET);
$this->logger->setPrefix($this->getLogPrefix());
},
function(bool $isAuthenticated, bool $authRequired, ?string $error, ?PublicKeyInterface $clientPubKey) : void{
$this->setAuthenticationStatus($isAuthenticated, $authRequired, $error, $clientPubKey);
}
));
$this->manager->add($this);
$this->logger->info("Session opened");