diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index cee2e80..5efa1a1 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -1398,6 +1398,12 @@ func CSGetPrivateRoomListHandler(s *netlib.Session, packetId int, data interface Channel: []string{p.LastChannel}, }) for _, v := range scenes { + // 隐藏关闭的房间 + cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[v.CustomParam.GetRoomConfigId()] + if cfg == nil || cfg.GetOn() != common.On { + continue + } + needPassword := 0 if v.GetPassword() != "" { needPassword = 1 diff --git a/worldsrv/customroommgr.go b/worldsrv/customroommgr.go index 543e46d..56fd77c 100644 --- a/worldsrv/customroommgr.go +++ b/worldsrv/customroommgr.go @@ -125,9 +125,14 @@ func (c *CustomRoomMgr) GetRoomList(plt string) []*gamehall.PrivateRoomInfo { } var ret []*gamehall.PrivateRoomInfo for _, v := range d.List { - if v != nil && v.PrivateRoomInfo != nil { - ret = append(ret, v.PrivateRoomInfo) + if v == nil || v.PrivateRoomInfo == nil { + continue } + cfg := PlatformMgrSingleton.GetConfig(plt).RoomConfig[v.RoomConfigId] + if cfg == nil || cfg.GetOn() != common.On { + continue + } + ret = append(ret, v.PrivateRoomInfo) } return ret } diff --git a/worldsrv/playernotify.go b/worldsrv/playernotify.go index 3d45bf7..36f6c07 100644 --- a/worldsrv/playernotify.go +++ b/worldsrv/playernotify.go @@ -90,7 +90,7 @@ func (p *PlayerNotify) SendToClient(tp common.NotifyType, platform string, packe //} roomConfigId := d.GetDatas()[0].GetRoomConfigId() cfg := PlatformMgrSingleton.GetConfig(platform).RoomConfig[roomConfigId] - if cfg == nil { + if cfg == nil || cfg.GetOn() != common.On { return }