From daf20b6310e3ff153ee63a7cf564f0b0c9cc0bc5 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 19 Dec 2024 17:17:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=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 | 14 ++++++++++---- worldsrv/action_server.go | 2 +- worldsrv/scene.go | 2 +- worldsrv/scenepolicydata.go | 9 --------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/worldsrv/action_game.go b/worldsrv/action_game.go index 4b5e1e5..1e0cd61 100644 --- a/worldsrv/action_game.go +++ b/worldsrv/action_game.go @@ -181,7 +181,14 @@ func (this *CSEnterRoomHandler) Process(s *netlib.Session, packetid int, data in } } + if scene.IsCustom() { + if scene.CustomParam.GetCostType() == 1 { // AA + scene.sp.CostPayment(scene, p.SnId) + } + } + if !scene.PlayerEnter(p, -1, true) { + //todo 退回房卡 code = gamehall.OpResultCode_Game_OPRC_Error_Game } @@ -1364,15 +1371,14 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{ csp.AddScene(scene) + sp.CostPayment(scene, p.SnId) + if !scene.PlayerEnter(p, -1, true) { + //todo 退回房卡 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/action_server.go b/worldsrv/action_server.go index 0b36e81..6714035 100644 --- a/worldsrv/action_server.go +++ b/worldsrv/action_server.go @@ -528,7 +528,7 @@ func init() { } } - if !scene.IsMatchScene() && !scene.IsCustom() { // 比赛没金币是积分 + if !scene.IsMatchScene() { // 比赛没金币是积分 player.Coin = playerBet.GetCoin() player.GameCoinTs = playerBet.GetGameCoinTs() player.GameTax += playerBet.GetTax() diff --git a/worldsrv/scene.go b/worldsrv/scene.go index 21e30af..2465fe9 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -262,7 +262,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool { name := this.GetSceneName() logger.Logger.Tracef("(this *Scene) PlayerEnter(%v) robot(%v) robotlimit(%v)", name, this.robotNum, this.robotLimit) - if !this.IsMatchScene() && !this.IsCustom() { + if !this.IsMatchScene() { flag := false // 本地游戏机器人携带金币 if common.IsLocalGame(this.gameId) { diff --git a/worldsrv/scenepolicydata.go b/worldsrv/scenepolicydata.go index 595043b..5f64ec7 100644 --- a/worldsrv/scenepolicydata.go +++ b/worldsrv/scenepolicydata.go @@ -40,10 +40,6 @@ func (spd *ScenePolicyData) OnStart(s *Scene) { func (spd *ScenePolicyData) OnStop(s *Scene) { s.NotifyPrivateRoom(common.ListDel) - //// 房主付费,房间没有玩就解散了,返还房主建房费用 - //if s.IsCustom() && s.CustomParam.GetCostType() == 2 && s.currRound == 0 { - // s.sp.GiveCostPayment(s, s.creator) - //} // 系统房间解散后自动创建 if s.RoomConfigSystem != nil { CustomRoomMgrSingle.Release(s.platform.IdStr, s.RoomConfigSystem.GetId()) @@ -57,11 +53,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) {