From c1aeca1b128c0ca3073d1af904bf4f56a78b6385 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 10 Jan 2025 13:25:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=9B=E6=88=BF=E4=BD=99=E9=A2=9D?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_game.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index 2e66760..06a7551 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -1355,6 +1355,13 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{ // 创建房间 csp := CoinSceneMgrSingleton.GetCoinScenePool(p.GetPlatform().IdStr, msg.GetGameFreeId()) + + if afterCoin <= 0 || (csp.dbGameFree.GetLimitCoin() > 0 && afterCoin < csp.dbGameFree.GetLimitCoin()) { + code = gamehall.OpResultCode_Game_OPRC_CoinNotEnough_Game + send() + return nil + } + roomId := SceneMgrSingleton.GenOnePrivateSceneId() scene := SceneMgrSingleton.CreateScene(&CreateSceneParam{ CreateId: p.SnId, @@ -1387,12 +1394,6 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{ return nil } - if afterCoin <= 0 || (scene.dbGameFree.GetLimitCoin() > 0 && afterCoin < scene.dbGameFree.GetLimitCoin()) { - code = gamehall.OpResultCode_Game_OPRC_CoinNotEnough_Game - send() - return nil - } - csp.AddScene(scene) sp.CostPayment(scene, p.SnId)