public function updatePresence(Game $game = null, $idle = false)
    {
        $idle = ($idle) ? $idle : null;

        if (! is_null($game)) {
            $game = $game->getPublicAttributes();
        }

        $payload = [
            'op' => Op::OP_PRESENCE_UPDATE,
            'd'  => [
                'game'       => $game,
                'idle_since' => $idle,
            ],
        ];

        $this->send($payload);
    }
public function updatePresence(Game $game = null, $idle = false)
    {
        $idle = ($idle) ? $idle : null;

        if (! is_null($game)) {
            $game = $game->getPublicAttributes();
        }

        $payload = [
            'op' => Op::OP_PRESENCE_UPDATE,
            'd'  => [
                'game'       => $game,
                'idle_since' => $idle,
            ],
        ];

        $this->send($payload);
    }
public function updatePresence ( Game $ game = null , $ idle = false ) { $ idle = ( $ idle ) ? $ idle : null ; if ( ! is_null ( $ game ) ) { $ game = $ game -> getPublicAttributes ( ) ; } $ payload = [ 'op' => Op :: OP_PRESENCE_UPDATE , 'd' => [ 'game' => $ game , 'idle_since' => $ idle , ] , ] ; $ this -> send ( $ payload ) ; }
Updates the clients presence.

@param Game $game The game object.
@param bool $idle Whether we are idle.
Updates the clients presence .