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