diff --git a/model/config.go b/model/config.go index cf916cc..cc94888 100644 --- a/model/config.go +++ b/model/config.go @@ -522,3 +522,17 @@ func (cm *ConfigMgr) GetLotteryConfig(plt string, id int64) *webapi.LotteryInfo } return nil } + +func (cm *ConfigMgr) CustomIsOn(plt string, configId int32) bool { + cfg := cm.GetConfig(plt).RoomConfig[configId] + if cfg == nil || cfg.GetOn() != common.On { + return false + } + + cfgT := cm.GetConfig(plt).RoomType[cfg.GetRoomType()] + if cfgT == nil || cfgT.GetOn() != common.On { + return false + } + + return true +} diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index 5efa1a1..1d6bf24 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -1399,8 +1399,7 @@ func CSGetPrivateRoomListHandler(s *netlib.Session, packetId int, data interface }) for _, v := range scenes { // 隐藏关闭的房间 - cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[v.CustomParam.GetRoomConfigId()] - if cfg == nil || cfg.GetOn() != common.On { + if !PlatformMgrSingleton.CustomIsOn(p.Platform, v.CustomParam.GetRoomConfigId()) { continue } diff --git a/worldsrv/customroommgr.go b/worldsrv/customroommgr.go index 56fd77c..d25d937 100644 --- a/worldsrv/customroommgr.go +++ b/worldsrv/customroommgr.go @@ -128,8 +128,7 @@ func (c *CustomRoomMgr) GetRoomList(plt string) []*gamehall.PrivateRoomInfo { if v == nil || v.PrivateRoomInfo == nil { continue } - cfg := PlatformMgrSingleton.GetConfig(plt).RoomConfig[v.RoomConfigId] - if cfg == nil || cfg.GetOn() != common.On { + if !PlatformMgrSingleton.CustomIsOn(plt, v.RoomConfigId) { continue } ret = append(ret, v.PrivateRoomInfo) diff --git a/worldsrv/scenemgr.go b/worldsrv/scenemgr.go index 7ca93a1..c104853 100644 --- a/worldsrv/scenemgr.go +++ b/worldsrv/scenemgr.go @@ -399,6 +399,9 @@ func (m *SceneMgr) FindCustomInviteRoom(p *Player) *Scene { if len(v.Channel) > 0 && !slices.Contains(v.Channel, p.AppChannel) { continue } + if !PlatformMgrSingleton.CustomIsOn(p.Platform, v.CustomParam.GetRoomConfigId()) { + continue + } ret = append(ret, v) }