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); } } }
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); } }
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); } } }
/// <summary> /// 通过连接对象获取用户 /// </summary> /// <param name="token"></param> /// <returns></returns> public USER getUser(UserToken token) { return(userBiz.get(token)); }
public User getUser(int id) { return(userBiz.get(id)); }
public UserModelDao getUser(UserToken token) { return(userBiz.get(token)); }