diff --git a/server/match/server/match.go b/server/match/server/match.go index 00999e6..b35cc8a 100644 --- a/server/match/server/match.go +++ b/server/match/server/match.go @@ -40,9 +40,17 @@ func (s *MatchService) getGameUser(uid int64) (*user.GameUser, pb.ErrCode) { func (s *MatchService) onMatchRoom(iMsg *ipb.InternalMsg, req *pb.C2SMatchRoom) { ksync.GoSafe(func() { // color game无需进入匹配队列 - switch pb.ServiceTypeId(req.PlayType) { + playType := pb.ServiceTypeId(req.PlayType) + switch playType { case pb.ServiceTypeId_STI_ColorGame: - s.SendServiceMsg(service.TopicEx(iMsg.ServiceName), iMsg.ConnId, iMsg.UserId, int32(pb.MsgId_S2CMatchRoomId), req) + node, err := s.bindService.RandServiceNode(playType) + if err != nil { + log.ErrorF("db service node error:%v", err) + s.SendServiceMsg(service.TopicEx(iMsg.ServiceName), iMsg.ConnId, iMsg.UserId, + int32(pb.MsgId_S2CMatchRoomId), &pb.S2CMatchRoom{Code: pb.ErrCode_SystemErr}) + return + } + s.SendServiceMsg(service.TopicEx(node.Name), iMsg.ConnId, iMsg.UserId, int32(pb.MsgId_C2SMatchRoomId), req) return }