Closed Nivek-C94 closed 8 years ago
The event is fired correctly. Maybe you don't display the message on your MCPE client because that event is fired on PlayerPreLogin. Then don't use echo or print when you want to log something on PocketMine console, use the PocketMine internal logger instead
I just used that to test and make sure the code was being ran..
/* * * @param ServerAuthAuthenticateEvent $ev / public function onAuthenticate(ServerAuthAuthenticateEvent $ev) { $player = $ev->getPlayer(); if($this->getPlugin()->clientExist($player->getName())) { $client = $this->getPlugin()->getClient($player->getName()); }else if($this->getPlugin()->getClientFromId($player->getClientId()) !== false) { $client = $this->getPlugin()->getClientFromId($player->getClientId()); }else{ $client = $this->getPlugin()->registerNewClient($player); } $this->getPlugin()->initClient($client, $player); }
From what i saw it would only run when the command is entered..i never tried to send a message to the client just used var_dumps and echos.
Event` is not fired when player is automatically logged in from last ip.