From 893bc4cbbb3435a7a9a5efb75fca0e844edf7ced Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 19 Dec 2024 17:23:46 +0800 Subject: [PATCH] =?UTF-8?q?modify:=E6=88=BF=E8=B4=B9=E6=89=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_game.go | 11 +++++++---- worldsrv/scenepolicydata.go | 5 ----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index 08ff02b..299a3f0 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -180,6 +180,11 @@ func (this *CSEnterRoomHandler) Process(s *netlib.Session, packetid int, data in p.matchCtx = mc } } + if scene.IsCustom() { + if scene.CustomParam.GetCostType() == 1 { + sp.CostPayment(scene, p.SnId) + } + } if !scene.PlayerEnter(p, -1, true) { code = gamehall.OpResultCode_Game_OPRC_Error_Game @@ -1342,15 +1347,13 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{ csp.AddScene(scene) + sp.CostPayment(scene, p.SnId) + if !scene.PlayerEnter(p, -1, true) { send() return nil } - if costType == 2 { - sp.CostPayment(scene, p.SnId) - } - code = gamehall.OpResultCode_Game_OPRC_Sucess_Game pack = &gamehall.SCCreatePrivateRoom{ GameFreeId: msg.GetGameFreeId(), diff --git a/worldsrv/scenepolicydata.go b/worldsrv/scenepolicydata.go index 595043b..c1a2de3 100644 --- a/worldsrv/scenepolicydata.go +++ b/worldsrv/scenepolicydata.go @@ -57,11 +57,6 @@ func (spd *ScenePolicyData) OnTick(s *Scene) { func (spd *ScenePolicyData) OnPlayerEnter(s *Scene, snid int32) { s.NotifyPrivateRoom(common.ListModify) - if s.IsCustom() { - if s.CustomParam.GetCostType() == 1 { // AA - spd.CostPayment(s, snid) - } - } } func (spd *ScenePolicyData) OnPlayerLeave(s *Scene, snid int32) {