From d13e0069eb172498e3f9b33ac6175eb336ca7f6c Mon Sep 17 00:00:00 2001 From: liuxiaobo <1224730913@qq.com> Date: Sat, 7 Jun 2025 22:59:42 +0800 Subject: [PATCH] =?UTF-8?q?match=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/match/server/match.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 }