竞技馆房间配置
This commit is contained in:
parent
fccb385f79
commit
40966b52cb
|
|
@ -1206,18 +1206,32 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
|
||||||
send()
|
send()
|
||||||
return nil
|
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()
|
send()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 局数
|
// 局数
|
||||||
if !slices.Contains(cfg.GetRound(), msg.GetRound()) {
|
if !slices.Contains(f(cfg.GetRound()), msg.GetRound()) {
|
||||||
send()
|
send()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 玩家数量
|
// 玩家数量
|
||||||
if !slices.Contains(cfg.GetPlayerNum(), msg.GetPlayerNum()) {
|
if !slices.Contains(f(cfg.GetPlayerNum()), msg.GetPlayerNum()) {
|
||||||
send()
|
send()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue