Example #1
0
    void Update()
    {
        if (_lbClient == null)
        {
            return;
        }

        // clear send/recv pools when getting connected
        if (_lbClient.State == ClientState.Joined && _lbClient.State != _state)
        {
            _packetSend.Clear();
            _packetRecv.Clear();
        }

        if (_lbClient.State == ClientState.JoinedLobby)
        {
            if (_roomUpdateTimer.Expired)
            {
                // update
                BoltNetwork.UpdateSessionList(FetchSessionListFromPhoton());

                //
                _roomUpdateTimer = new Timer(ROOM_UPDATE_RATE);
            }
        }

        // poll in/out
        PollIn();
        PollOut();

        // store state
        _state = _lbClient.State;

        PunchAPI.Service();
    }