コード例 #1
0
 public void OnNetworkMessage_StartLoading(NetworkMessages_StartLoading msg)
 {
     m_combat_client = new TestCombatClient(m_network);
     m_combat_client.Initializa(m_local_player_pstid);
     for (int i = 0; i < msg.m_player_pstids.Count; ++i)
     {
         m_combat_client.AddPlayer(msg.m_player_pstids[i]);
     }
 }
コード例 #2
0
        void CheckAllReady()
        {
            //if (m_players.Count <= 1)
            //    return;
            bool all_ready  = true;
            var  enumerator = m_players.GetEnumerator();

            while (enumerator.MoveNext())
            {
                if (enumerator.Current.Value.m_ready == false)
                {
                    all_ready = false;
                    break;
                }
            }
            if (!all_ready)
            {
                return;
            }

            NetworkMessages_StartLoading msg = new NetworkMessages_StartLoading();

            enumerator = m_players.GetEnumerator();
            while (enumerator.MoveNext())
            {
                msg.AddPlayer(enumerator.Current.Value.m_pstid);
            }
            m_network.SendToClient(msg);

            m_combat_server = new TestCombatServer(m_network);
            m_combat_server.Initializa();
            for (int i = 0; i < msg.m_player_pstids.Count; ++i)
            {
                m_combat_server.AddPlayer(msg.m_player_pstids[i]);
            }
        }