From 4eee248f20d2ecb21d92ec794b099d661e724009 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sat, 7 Sep 2024 16:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=8A=80=E9=A6=86=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E8=A7=A3=E6=95=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/tienlen/scenedata_tienlen.go | 3 +++ gamesrv/tienlen/scenepolicy_tienlen.go | 3 --- worldsrv/action_game.go | 2 +- worldsrv/gamesess.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gamesrv/tienlen/scenedata_tienlen.go b/gamesrv/tienlen/scenedata_tienlen.go index 0269621..43c0797 100644 --- a/gamesrv/tienlen/scenedata_tienlen.go +++ b/gamesrv/tienlen/scenedata_tienlen.go @@ -287,6 +287,9 @@ func (this *TienLenSceneData) OnPlayerLeave(p *base.Player, reason int) { } } } + if !this.GetDestroyed() && this.IsCustom() && len(this.players) == 0 { + this.SceneDestroy(true) + } } func (this *TienLenSceneData) SceneDestroy(force bool) { diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 6a90360..07d2891 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -148,9 +148,6 @@ func (this *ScenePolicyTienLen) OnPlayerLeave(s *base.Scene, p *base.Player, rea } sceneEx.OnPlayerLeave(p, reason) s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(reason)}) - if s.IsCustom() && len(s.Players) == 0 { - s.Destroy(true) - } } // 玩家掉线 diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index de81b77..2d3a724 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -1341,8 +1341,8 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{ sp.CostPayment(scene, p) } + code = gamehall.OpResultCode_Game_OPRC_Sucess_Game pack = &gamehall.SCCreatePrivateRoom{ - OpRetCode: gamehall.OpResultCode_Game_OPRC_Sucess_Game, GameFreeId: msg.GetGameFreeId(), RoomTypeId: msg.GetRoomTypeId(), RoomConfigId: msg.GetRoomConfigId(), diff --git a/worldsrv/gamesess.go b/worldsrv/gamesess.go index 5ee4209..d395c4c 100644 --- a/worldsrv/gamesess.go +++ b/worldsrv/gamesess.go @@ -174,8 +174,8 @@ func (this *GameSession) AddScene(args *AddSceneParam) { Match: args.S.MatchParam, Params: args.S.params, } - if args.S.GetRoomTypeId() != 0 { - cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomTypeId()] + if args.S.GetRoomConfigId() != 0 { + cfg := PlatformMgrSingleton.GetConfig(args.S.limitPlatform.IdStr).RoomConfig[args.S.GetRoomConfigId()] if cfg != nil { for _, v := range cfg.GetReward() { msg.Items = append(msg.Items, &server_proto.Item{