支持多人数对局与 AI 补位:玩法声明人数范围、匹配分队列与超时补 AI、房间玩家名册

This commit is contained in:
2026-09-28 00:41:28 +08:00
parent fb5a730ef3
commit adb31eec68
17 changed files with 854 additions and 367 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ func RegisterHandlers(hub *wsgateway.Hub, mt *Matcher, mgr *room.Manager) {
c.SendError(env.Seq, 0, "参数错误: "+err.Error())
return
}
if err := mt.Enqueue(c.UserID(), req.GameID); err != nil { // 入队
if err := mt.Enqueue(c.UserID(), req.GameID, req.Seats); err != nil { // 入队(人数由客户端指定)
c.SendError(env.Seq, 0, err.Error()) // 回错误(未注册 / 已在房间 / 已在排队)
return
}