diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index 61e09b8..de81b77 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -1206,18 +1206,32 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{ send() return nil } + + f := func(param []int32) []int32 { + if len(param) == 0 { + return nil + } + if param[0] == 0 { + return param[1:] + } + if param[0] > 0 && int(param[0]) < len(param) { + return []int32{param[param[0]]} + } + return nil + } + // 场次 - if !slices.Contains(cfg.GetGameFreeId(), msg.GetGameFreeId()) { + if !slices.Contains(f(cfg.GetGameFreeId()), msg.GetGameFreeId()) { send() return nil } // 局数 - if !slices.Contains(cfg.GetRound(), msg.GetRound()) { + if !slices.Contains(f(cfg.GetRound()), msg.GetRound()) { send() return nil } // 玩家数量 - if !slices.Contains(cfg.GetPlayerNum(), msg.GetPlayerNum()) { + if !slices.Contains(f(cfg.GetPlayerNum()), msg.GetPlayerNum()) { send() return nil }