上分修改
This commit is contained in:
parent
06c6284116
commit
82cf0a550a
|
@ -2994,11 +2994,13 @@ func init() {
|
|||
addcoin, err = strconv.ParseInt(msg.Count, 10, 64)
|
||||
if err != nil {
|
||||
logger.Logger.Error("Unmarshal webapi.PlatfromUpScoreReq strconv.ParseInt error:", err)
|
||||
jsonDataRsp, err = json.Marshal(pack)
|
||||
return common.ResponseTag_ParamError, jsonDataRsp
|
||||
}
|
||||
|
||||
if addcoin <= 0 {
|
||||
logger.Logger.Error("/api/platform/upscore addcoin:%v less 0", addcoin)
|
||||
jsonDataRsp, err = json.Marshal(pack)
|
||||
return common.ResponseTag_ParamError, jsonDataRsp
|
||||
}
|
||||
|
||||
|
@ -3051,18 +3053,12 @@ func init() {
|
|||
pack.Code = int(webapiproto.TagCode_SUCCESS)
|
||||
pack.Message = data.(error).Error()
|
||||
} else {
|
||||
//player.Coin += addcoin
|
||||
player.AddCoin(addcoin, 0, common.GainWayPlatformUpScore, "platform", "平台上分")
|
||||
player.SendDiffData()
|
||||
}
|
||||
|
||||
pack.Data.Count = player.Coin
|
||||
|
||||
// 玩家在游戏内
|
||||
if player.scene != nil {
|
||||
|
||||
}
|
||||
|
||||
jsonDataRsp, err = json.Marshal(pack)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("/api/platform/upscore err: %v", err)
|
||||
|
@ -3172,17 +3168,19 @@ func init() {
|
|||
addcoin = -player.Coin
|
||||
remainNum = player.Coin
|
||||
platform := player.Platform
|
||||
////玩家在游戏内
|
||||
//if player.scene != nil {
|
||||
// pack.Code = int(webapiproto.TagCode_FAILED)
|
||||
// pack.Message = "Unsupported!!! because player in scene!"
|
||||
// return common.ResponseTag_ParamError, pack
|
||||
//}
|
||||
//玩家在游戏内
|
||||
if player.scene != nil {
|
||||
pack.Code = int(webapiproto.TagCode_FAILED)
|
||||
pack.Message = "Unsupported!!! because player in scene!"
|
||||
jsonDataRsp, err = json.Marshal(pack)
|
||||
return common.ResponseTag_ParamError, jsonDataRsp
|
||||
}
|
||||
|
||||
if len(platform) <= 0 {
|
||||
pack.Code = int(webapiproto.TagCode_FAILED)
|
||||
pack.Message = "player platform forbit!"
|
||||
return common.ResponseTag_ParamError, pack
|
||||
jsonDataRsp, err = json.Marshal(pack)
|
||||
return common.ResponseTag_ParamError, jsonDataRsp
|
||||
}
|
||||
|
||||
//增加帐变记录
|
||||
|
|
Loading…
Reference in New Issue