Merge branch 'dev_login' of git.pogorockgames.com:mango-games/server/game into dev_login
This commit is contained in:
commit
faeab1bbec
|
@ -3010,42 +3010,14 @@ func init() {
|
||||||
|
|
||||||
//玩家在线
|
//玩家在线
|
||||||
if player != nil {
|
if player != nil {
|
||||||
|
|
||||||
remainNum = player.Coin
|
remainNum = player.Coin
|
||||||
platform := player.Platform
|
|
||||||
|
|
||||||
if player.Coin+addcoin < 0 {
|
if player.Coin+addcoin < 0 {
|
||||||
pack.Code = int(webapiproto.TagCode_FAILED)
|
pack.Code = int(webapiproto.TagCode_FAILED)
|
||||||
pack.Message = "coin not enough!"
|
pack.Message = "coin not enough!"
|
||||||
return common.ResponseTag_ParamError, pack
|
return common.ResponseTag_ParamError, pack
|
||||||
}
|
}
|
||||||
|
|
||||||
//增加帐变记录
|
|
||||||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
|
||||||
Platform: player.Platform,
|
|
||||||
SnID: player.SnId,
|
|
||||||
UserName: player.Username,
|
|
||||||
Channel: player.Channel,
|
|
||||||
ChangeType: common.BillTypeCoin,
|
|
||||||
ChangeNum: addcoin,
|
|
||||||
RemainNum: remainNum + addcoin,
|
|
||||||
Add: 0,
|
|
||||||
LogType: logtype,
|
|
||||||
GameID: 0,
|
|
||||||
GameFreeID: 0,
|
|
||||||
BaseCoin: 0,
|
|
||||||
Operator: "休闲平台",
|
|
||||||
Remark: "在线平台上分",
|
|
||||||
})
|
|
||||||
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
err := model.InsertCoinLog(coinlogex)
|
|
||||||
if err != nil {
|
|
||||||
//回滚到对账日志
|
|
||||||
model.RemoveCoinLogOne(platform, coinlogex.LogId)
|
|
||||||
logger.Logger.Errorf("model.InsertCoinLogs err:%v log:%v", err, coinlogex)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
||||||
|
|
||||||
|
@ -3191,32 +3163,7 @@ func init() {
|
||||||
return common.ResponseTag_ParamError, jsonDataRsp
|
return common.ResponseTag_ParamError, jsonDataRsp
|
||||||
}
|
}
|
||||||
|
|
||||||
//增加帐变记录
|
|
||||||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
|
||||||
Platform: player.Platform,
|
|
||||||
SnID: player.SnId,
|
|
||||||
UserName: player.Username,
|
|
||||||
Channel: player.Channel,
|
|
||||||
ChangeType: common.BillTypeCoin,
|
|
||||||
ChangeNum: -player.Coin,
|
|
||||||
RemainNum: remainNum + player.Coin,
|
|
||||||
Add: 0,
|
|
||||||
LogType: logtype,
|
|
||||||
GameID: 0,
|
|
||||||
GameFreeID: 0,
|
|
||||||
BaseCoin: 0,
|
|
||||||
Operator: "休闲平台",
|
|
||||||
Remark: "在线平台下分",
|
|
||||||
})
|
|
||||||
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
err := model.InsertCoinLog(coinlogex)
|
|
||||||
if err != nil {
|
|
||||||
//回滚到对账日志
|
|
||||||
model.RemoveCoinLogOne(platform, coinlogex.LogId)
|
|
||||||
logger.Logger.Errorf("model.InsertCoinLogs err:%v log:%v", err, coinlogex)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue