Пример #1
0
 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);
 }
Пример #2
0
        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();
        }
Пример #3
0
        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);
        }
Пример #4
0
 void OnUpdateLoaded(int current_time_int)
 {
     m_state            = TestCombatClientState.WaitingForStart;
     m_state_start_time = current_time_int;
     m_last_update_time = current_time_int;
 }
Пример #5
0
 public void OnGameOver(GameResult game_result)
 {
     m_state = TestCombatClientState.GameOver;
 }
Пример #6
0
 void OnAllResourceCached()
 {
     m_render_world.OnUpdate(0, 0);
     m_state = TestCombatClientState.Loaded;
 }