From d223ee38455b7d347b3e4ab5fed6d4bfc7c4ca1f Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Tue, 17 Dec 2024 10:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=91=E9=97=B2=E5=B9=B3=E5=8F=B0=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/trascate_webapi.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/worldsrv/trascate_webapi.go b/worldsrv/trascate_webapi.go index 70b0de8..ea5d1d6 100644 --- a/worldsrv/trascate_webapi.go +++ b/worldsrv/trascate_webapi.go @@ -2999,7 +2999,7 @@ func init() { player := PlayerMgrSington.GetPlayerByUsername(msg.Username) //玩家在线 - if player != nil && player.IsOnLine() { + if player != nil { remainNum = player.Coin platform := player.Platform @@ -3069,6 +3069,7 @@ func init() { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { findPlayer, _ := model.GetPlayerDataBySnId("1", int32(acc.SnId), false, true) if findPlayer != nil { + remainNum = findPlayer.Coin //增加帐变记录 coinlogex := model.NewCoinLogEx(&model.CoinLogParam{ @@ -3154,7 +3155,7 @@ func init() { var logtype = int32(common.GainWayPlatformDownScore) //玩家在线 - if player != nil && player.IsOnLine() { + if player != nil { addcoin = -player.Coin remainNum = player.Coin @@ -3165,18 +3166,12 @@ func init() { pack.Message = "Unsupported!!! because player in scene!" return common.ResponseTag_ParamError, pack } - if len(platform) > 0 { + if len(platform) <= 0 { pack.Code = int(webapiproto.TagCode_FAILED) pack.Message = "player platform forbit!" return common.ResponseTag_ParamError, pack } - if player.Coin+addcoin < 0 { - pack.Code = int(webapiproto.TagCode_FAILED) - pack.Message = "coin not enough!" - return common.ResponseTag_ParamError, pack - } - //增加帐变记录 coinlogex := model.NewCoinLogEx(&model.CoinLogParam{ Platform: player.Platform, @@ -3238,6 +3233,7 @@ func init() { findPlayer, _ := model.GetPlayerDataBySnId(acc.Platform, int32(acc.SnId), false, true) if findPlayer != nil { + remainNum = findPlayer.Coin addcoin = -findPlayer.Coin //增加帐变记录 @@ -3320,7 +3316,7 @@ func init() { player := PlayerMgrSington.GetPlayerByUsername(msg.Username) //玩家在线 - if player != nil && player.IsOnLine() { + if player != nil { pack.Code = int(webapiproto.TagCode_SUCCESS) pack.Message = "返回成功" pack.Success = true