public function onPlayerConnect($login, $isSpectator = false, $dispatch = true)
    {
        try {
            $playerData = $this->playerStorage->getPlayerInfo($login);
        } catch (\Exception $e) {
            // TODO log that player disconnected very fast.
            return;
        }

        $this->playerStorage->onPlayerConnect($playerData);

        if ($dispatch) {
            $this->dispatch(__FUNCTION__, [$playerData]);
        }
    }
public function onPlayerConnect($login, $isSpectator = false, $dispatch = true)
    {
        try {
            $playerData = $this->playerStorage->getPlayerInfo($login);
        } catch (\Exception $e) {
            // TODO log that player disconnected very fast.
            return;
        }

        $this->playerStorage->onPlayerConnect($playerData);

        if ($dispatch) {
            $this->dispatch(__FUNCTION__, [$playerData]);
        }
    }
public function onPlayerConnect ( $ login , $ isSpectator = false , $ dispatch = true ) { try { $ playerData = $ this -> playerStorage -> getPlayerInfo ( $ login ) ; } catch ( \ Exception $ e ) { // TODO log that player disconnected very fast. return ; } $ this -> playerStorage -> onPlayerConnect ( $ playerData ) ; if ( $ dispatch ) { $ this -> dispatch ( __FUNCTION__ , [ $ playerData ] ) ; } }
Called when a player connects

@param string $login
@param bool $isSpectator
Called when a player connects