From 151a739dab201f7bbbb9cdf49647248a52cf2917 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 2 Sep 2024 16:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=88=BF=E9=97=B4=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/scene.go | 6 ++++++ worldsrv/scenemgr.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/worldsrv/scene.go b/worldsrv/scene.go index cba5275..333f90e 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -135,6 +135,12 @@ func NewScene(args *CreateSceneParam) *Scene { } } } + if s.MatchParam == nil { + s.MatchParam = new(serverproto.MatchParam) + } + if s.CustomParam == nil { + s.CustomParam = new(serverproto.CustomParam) + } s.sp.OnStart(s) return s } diff --git a/worldsrv/scenemgr.go b/worldsrv/scenemgr.go index 864f2ca..42c33e6 100644 --- a/worldsrv/scenemgr.go +++ b/worldsrv/scenemgr.go @@ -155,7 +155,7 @@ func (m *SceneMgr) GetScenesByGameFreeId(gameFreeId int32) []*Scene { func (m *SceneMgr) GetMatchRoom(sortId int64) []*Scene { var scenes []*Scene for _, value := range m.scenes { - if value.MatchSortId == sortId { + if value.GetMatchSortId() == sortId { s := m.GetScene(value.sceneId) if s != nil { scenes = append(scenes, value)