public function onPlayerDisconnect($login, $disconnectionReason)
    {
        $playerData = $this->playerStorage->getPlayerInfo($login);

        // dedicated server sends disconnect for server itself when it's closed...
        // so it's time to stop application gracefully.
        if ($playerData->getPlayerId() == 0) {
            // emit event to plugins
            $this->application->stopApplication();
            return;
        }

        $this->playerStorage->onPlayerDisconnect($playerData, $disconnectionReason);
        $this->dispatch(__FUNCTION__, [$playerData, $disconnectionReason]);
    }
public function onPlayerDisconnect($login, $disconnectionReason)
    {
        $playerData = $this->playerStorage->getPlayerInfo($login);

        // dedicated server sends disconnect for server itself when it's closed...
        // so it's time to stop application gracefully.
        if ($playerData->getPlayerId() == 0) {
            // emit event to plugins
            $this->application->stopApplication();
            return;
        }

        $this->playerStorage->onPlayerDisconnect($playerData, $disconnectionReason);
        $this->dispatch(__FUNCTION__, [$playerData, $disconnectionReason]);
    }
public function onPlayerDisconnect ( $ login , $ disconnectionReason ) { $ playerData = $ this -> playerStorage -> getPlayerInfo ( $ login ) ; // dedicated server sends disconnect for server itself when it's closed... // so it's time to stop application gracefully. if ( $ playerData -> getPlayerId ( ) == 0 ) { // emit event to plugins $ this -> application -> stopApplication ( ) ; return ; } $ this -> playerStorage -> onPlayerDisconnect ( $ playerData , $ disconnectionReason ) ; $ this -> dispatch ( __FUNCTION__ , [ $ playerData , $ disconnectionReason ] ) ; }
Called when a player disconnects

@param $login
@param $disconnectionReason
Called when a player disconnects