Exemple #1
0
 public void MessageRecevie(AceNetFrameWork.ace.UserToken token, AceNetFrameWork.ace.auto.SocketModel message)
 {
     User user=userBiz.get(token);
     if(user==null)return;
     if (userRoom.ContainsKey(user.id)) {
         int roomId = userRoom[user.id];
         if (roomMap.ContainsKey(roomId)) {
             roomMap[roomId].MessageRecevie(token, message);
         }
     }
 }
Exemple #2
0
        public void MessageRecevie(AceNetFrameWork.ace.UserToken token, AceNetFrameWork.ace.auto.SocketModel message)
        {
            User user = userBiz.get(token);

            if (user == null)
            {
                return;
            }
            if (userFight.ContainsKey(user.id))
            {
                roomMap[userFight[user.id]].MessageRecevie(token, message);
            }
        }
Exemple #3
0
        private void leave(UserToken token)
        {
            User user = userBiz.get(token);

            if (user == null)
            {
                return;
            }
            if (!userMatch.ContainsKey(user.id))
            {
                return;
            }
            int roomId = userMatch[user.id];

            if (nowRoom.ContainsKey(roomId))
            {
                MatchRoom room = nowRoom[roomId];
                if (room.teamOne.Contains(user.id))
                {
                    room.teamOne.Remove(user.id);
                }
                else
                if (room.teamTwo.Contains(user.id))
                {
                    room.teamTwo.Remove(user.id);
                }
                int ri;
                userMatch.TryRemove(user.id, out ri);
                if (room.teamOne.Count + room.teamTwo.Count == 0)
                {
                    MatchRoom r;
                    nowRoom.TryRemove(room.id, out r);
                    cache.Enqueue(room);
                }
            }
        }
Exemple #4
0
 /// <summary>
 /// 通过连接对象获取用户
 /// </summary>
 /// <param name="token"></param>
 /// <returns></returns>
 public USER getUser(UserToken token)
 {
     return(userBiz.get(token));
 }
Exemple #5
0
 public User getUser(int id)
 {
     return(userBiz.get(id));
 }
Exemple #6
0
 public UserModelDao getUser(UserToken token)
 {
     return(userBiz.get(token));
 }