Ejemplo n.º 1
0
        void GenerateRandomCommand()
        {
            RandomTestCommand command = new RandomTestCommand();

            command.m_random = m_random_generator.Rand();
            m_combat_client.GetSyncClient().PushLocalCommand(command);
        }
Ejemplo n.º 2
0
        public void HandleCommand(Command command)
        {
            if (m_game_over)
            {
                return;
            }
            if (command.Type == CommandType.RandomTest)
            {
                ++m_command_count;
                m_game_crc = CRC.Calculate(m_current_frame, m_game_crc);
                RandomTestCommand rtc = command as RandomTestCommand;
                m_game_crc = CRC.Calculate(rtc.PlayerPstid, m_game_crc);
                m_game_crc = CRC.Calculate(rtc.SyncTurn, m_game_crc);
                m_game_crc = CRC.Calculate(rtc.m_random, m_game_crc);

                /*
                 * if (m_client)
                 *  UnityEngine.Debug.LogError("Client HandleCommand, " + m_command_count + ", m_current_frame = " + m_current_frame + ", SyncTurn = " + rtc.SyncTurn + ", Random = " + rtc.Random + ", PlayerPstid = " + rtc.PlayerPstid + ", CRC = " + m_game_crc);
                 * else
                 *  UnityEngine.Debug.LogError("Server HandleCommand, " + m_command_count + ", m_current_frame = " + m_current_frame + ", SyncTurn = " + rtc.SyncTurn + ", Random = " + rtc.Random + ", PlayerPstid = " + rtc.PlayerPstid + ", CRC = " + m_game_crc);
                 */
            }
        }