Esempio n. 1
0
 internal PracticeLobbySnapshot(CSODOTALobby msg, CSODOTALobby oldLob)
 {
     lobby = msg;
     oldLobby = oldLob;
 }
Esempio n. 2
0
 internal PracticeLobbySnapshot(CSODOTALobby msg)
 {
     lobby = msg;
 }
Esempio n. 3
0
 internal PracticeLobbyUpdate(CSODOTALobby msg, CSODOTALobby oldLob)
 {
     lobby = msg;
     oldLobby = oldLob;
 }
Esempio n. 4
0
        private void HandleLobbyUpdate(CSODOTALobby lobby)
        {
            if (Lobby == null && lobby != null)
            {
                log.DebugFormat("Entered lobby {0} with state {1}.", lobby.lobby_id, lobby.state.ToString("G"));
                if(lobby.pass_key != "wltest" || lobby.state >= CSODOTALobby.State.POSTGAME) DotaGCHandler.LeaveLobby();

            }else if (Lobby != null && lobby == null)
            {
                log.DebugFormat("Exited lobby {0}.", Lobby.lobby_id);
            }

            if(lobby != null)
                _state.Fire(lobby.state == CSODOTALobby.State.UI || string.IsNullOrEmpty(lobby.connect) ? Trigger.DotaEnteredLobbyUI : Trigger.DotaEnteredLobbyPlay);
            else
                _state.Fire(Trigger.DotaNoLobby);

#if TEST_IMPL
            if (lobby != null)
            {
            /*
                if (lobby.state == CSODOTALobby.State.UI &&
                    lobby.members.Count(
                        m =>
                            m.team == DOTA_GC_TEAM.DOTA_GC_TEAM_BAD_GUYS ||
                            m.team == DOTA_GC_TEAM.DOTA_GC_TEAM_GOOD_GUYS) >= 2) 
                    DotaGCHandler.LaunchLobby();
                    */

                if (lobby.game_state == DOTA_GameState.DOTA_GAMERULES_STATE_POST_GAME)
                {
                    log.Debug("Client has connected successfully and we've entered postgame.. Testing shutdown.");
                    Stop();
                }
            }
#endif

            Lobby = lobby;
        }