支持多人数对局与 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
+7 -5
View File
@@ -89,11 +89,13 @@ type WSSettingS struct {
OriginPatterns []string // 允许的 Origin 域名列表:浏览器调试用,小游戏连接通常不带 Origin
// ===== 以下为房间 / 匹配预留(第二步填充) =====
ReconnectGraceSec int // 掉线后保留座位的时长(秒):超时未重连则判负或平局
RoomIdleTimeoutSec int // 房间空闲自动关闭的时长(秒)
MatchTimeoutSec int // 匹配排队超过该时长(秒)自动取消
QueueTickMs int // 匹配队列的扫描间隔(毫秒)
MaxRooms int // 同时存在的房间数上限,防止内存失控
ReconnectGraceSec int // 掉线后保留座位的时长(秒):超时未重连则判负或平局
RoomIdleTimeoutSec int // 房间空闲自动关闭的时长(秒)
MatchTimeoutSec int // 匹配排队超过该时长(秒)自动取消
QueueTickMs int // 匹配队列的扫描间隔(毫秒)
MaxRooms int // 同时存在的房间数上限,防止内存失控
AIEnabled bool // 匹配超时后是否用 AI 补齐空位(对外不可感知)
AIWaitSec int // 排队超过该秒数仍未凑满则补 AI;0 表示不启用
}
func (s *Setting) ReadSection(k string, v any) error {