From 3a7d3b9f2e294fb156df9331c294880ad7e5768b Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 9 Sep 2024 17:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=8D=A1=E8=BF=94=E5=9B=9E=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/tienlen/scenepolicy_tienlen.go | 2 +- worldsrv/action_game.go | 9 +++++++++ worldsrv/scenepolicydata.go | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index b76f130..329f4af 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -2659,7 +2659,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { // 刷新存钱罐 playerEx := s.GetPlayer(o_player.UserId) - if playerEx != nil && (!(s.IsFreePublic() || s.IsMatchScene())) { + if playerEx != nil && (!(s.IsFreePublic() || s.IsMatchScene() || s.IsCustom())) { playerEx.UpdatePigBankCoin(o_player.GainCoin) } diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index 829aede..c1f902a 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -103,6 +103,15 @@ func (this *CSEnterRoomHandler) Process(s *netlib.Session, packetid int, data in logger.Logger.Trace("CSEnterRoomHandler password error") goto failed } + // 房费是否充足 + if scene.IsCustom() { + cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[scene.RoomConfigId] + if !scene.sp.CostEnough(int(scene.CostType), scene.playerNum, cfg, p) { + code = gamehall.OpResultCode_Game_OPRC_CostNotEnough + logger.Logger.Trace("CSEnterRoomHandler cost error") + goto failed + } + } dbGameFree = scene.dbGameFree if dbGameFree != nil { diff --git a/worldsrv/scenepolicydata.go b/worldsrv/scenepolicydata.go index 4d5545c..db5642d 100644 --- a/worldsrv/scenepolicydata.go +++ b/worldsrv/scenepolicydata.go @@ -32,7 +32,7 @@ func (spd *ScenePolicyData) OnStart(s *Scene) { func (spd *ScenePolicyData) OnStop(s *Scene) { s.NotifyPrivateRoom(common.ListDel) // 房主付费,房间没有玩就解散了,返还房主建房费用 - if s.IsCustom() && s.GetCostType() == 1 && s.currRound == 0 { + if s.IsCustom() && s.GetCostType() == 2 && s.currRound == 0 { spd.GiveCostPayment(s, s.creator) } }