public void StartCombat(int current_time_int, int latency) { m_state = TestCombatClientState.Running; m_state_start_time = current_time_int; m_last_update_time = 0; m_sync_client.Start(0, m_local_player_pstid, latency); }
public void Initializa(long local_player_pstid) { m_local_player_pstid = local_player_pstid; m_state = TestCombatClientState.Loading; m_waiting_cnt = 0; m_logic_world = new TestLogicWorld(this, true); m_render_world = new TestRenderWorld(this, m_logic_world); m_sync_client = new MNLPSyncClient(); m_sync_client.Init(m_logic_world); ++m_waiting_cnt; m_render_world.LoadScene(); }
void OnUpdateGameOver(int current_time_int) { m_sync_client.Stop(); List <Command> commands = m_sync_client.GetOutputCommands(); if (commands.Count > 0) { NetworkMessages_SyncCommands msg = new NetworkMessages_SyncCommands(); msg.PlayerPstid = m_local_player_pstid; for (int i = 0; i < commands.Count; ++i) { msg.AddCommand(commands[i]); } m_network.SendToServer(msg); m_sync_client.ClearOutputCommand(); } m_state = TestCombatClientState.Ending; NetworkMessages_GameOver msg2 = new NetworkMessages_GameOver(); msg2.PlayerPstid = m_local_player_pstid; msg2.m_crc = m_logic_world.GetCRC(); m_network.SendToServer(msg2); }
void OnUpdateLoaded(int current_time_int) { m_state = TestCombatClientState.WaitingForStart; m_state_start_time = current_time_int; m_last_update_time = current_time_int; }
public void OnGameOver(GameResult game_result) { m_state = TestCombatClientState.GameOver; }
void OnAllResourceCached() { m_render_world.OnUpdate(0, 0); m_state = TestCombatClientState.Loaded; }