Exemplo n.º 1
0
        private void DuelEnd(UserToken hostMes, UserToken playerMes)
        {
            int roomID;
            int playerID  = cache.getId(hostMes);
            int player2ID = cache.getId(playerMes);

            if (userMatch.TryGetValue(playerID, out roomID))
            {
                MatchRoom room;
                if (matchRoomMap.TryRemove(roomID, out room))
                {
                    matchRoomMap.TryRemove(player2ID, out room);
                    RemoveRoomInfo(roomID);
                    room = null;
                    atomic.getAndReduce();
                    Debug.LogTest("销毁比赛房间" + matchRoomMap.Count);

                    cache.addToGameHallAccMap(hostMes);
                    cache.removeRoomAccMap(hostMes);

                    cache.addToGameHallAccMap(playerMes);
                    cache.removeRoomAccMap(playerMes);
                }
            }
        }