隐藏关闭的竞技馆配置房间

This commit is contained in:
sk 2024-11-12 16:13:13 +08:00
parent 310156dd35
commit 3eb997c7c3
3 changed files with 14 additions and 3 deletions

View File

@ -1398,6 +1398,12 @@ func CSGetPrivateRoomListHandler(s *netlib.Session, packetId int, data interface
Channel: []string{p.LastChannel}, Channel: []string{p.LastChannel},
}) })
for _, v := range scenes { for _, v := range scenes {
// 隐藏关闭的房间
cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[v.CustomParam.GetRoomConfigId()]
if cfg == nil || cfg.GetOn() != common.On {
continue
}
needPassword := 0 needPassword := 0
if v.GetPassword() != "" { if v.GetPassword() != "" {
needPassword = 1 needPassword = 1

View File

@ -125,9 +125,14 @@ func (c *CustomRoomMgr) GetRoomList(plt string) []*gamehall.PrivateRoomInfo {
} }
var ret []*gamehall.PrivateRoomInfo var ret []*gamehall.PrivateRoomInfo
for _, v := range d.List { for _, v := range d.List {
if v != nil && v.PrivateRoomInfo != nil { if v == nil || v.PrivateRoomInfo == nil {
ret = append(ret, v.PrivateRoomInfo) continue
} }
cfg := PlatformMgrSingleton.GetConfig(plt).RoomConfig[v.RoomConfigId]
if cfg == nil || cfg.GetOn() != common.On {
continue
}
ret = append(ret, v.PrivateRoomInfo)
} }
return ret return ret
} }

View File

@ -90,7 +90,7 @@ func (p *PlayerNotify) SendToClient(tp common.NotifyType, platform string, packe
//} //}
roomConfigId := d.GetDatas()[0].GetRoomConfigId() roomConfigId := d.GetDatas()[0].GetRoomConfigId()
cfg := PlatformMgrSingleton.GetConfig(platform).RoomConfig[roomConfigId] cfg := PlatformMgrSingleton.GetConfig(platform).RoomConfig[roomConfigId]
if cfg == nil { if cfg == nil || cfg.GetOn() != common.On {
return return
} }