修改ChannelId
This commit is contained in:
parent
821f3d7274
commit
eba92ed00b
|
@ -243,7 +243,7 @@ func init() {
|
||||||
admin.MyAdminApp.Route("/api/player/update_tel", WorldSrvApi)
|
admin.MyAdminApp.Route("/api/player/update_tel", WorldSrvApi)
|
||||||
// 删除账号
|
// 删除账号
|
||||||
admin.MyAdminApp.Route("/api/player/delete", WorldSrvApi)
|
admin.MyAdminApp.Route("/api/player/delete", WorldSrvApi)
|
||||||
//添加道具
|
// 添加道具
|
||||||
admin.MyAdminApp.Route("/api/player/AddItem", WorldSrvApi)
|
admin.MyAdminApp.Route("/api/player/AddItem", WorldSrvApi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1964,6 +1964,65 @@ func init() {
|
||||||
pack.Msg = "no any data"
|
pack.Msg = "no any data"
|
||||||
return common.ResponseTag_Ok, pack
|
return common.ResponseTag_Ok, pack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f := func(plt string, snid int32) {
|
||||||
|
var alipayAcc, alipayAccName, bankAccount, bankAccName, channelId string
|
||||||
|
if val, ok := playerMap["AlipayAccount"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
alipayAcc = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["AlipayAccName"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
alipayAccName = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["BankAccount"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
bankAccount = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["BankAccName"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
bankAccName = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["ChannelId"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
channelId = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if alipayAcc != "" || alipayAccName != "" {
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
|
||||||
|
alipayAccName, alipayAcc, 2)
|
||||||
|
return nil
|
||||||
|
}), nil, "NewBankBindLog").Start()
|
||||||
|
}
|
||||||
|
if bankAccount != "" || bankAccName != "" {
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
|
||||||
|
bankAccName, bankAccount, 2)
|
||||||
|
return nil
|
||||||
|
}), nil, "NewBankBindLog").Start()
|
||||||
|
}
|
||||||
|
if channelId != "" {
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
a, err := model.GetAccountBySnid(plt, snid)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("GetAccountBySnid error: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
a.ChannelId = channelId
|
||||||
|
if err = model.UpdateAccount(a); err != nil {
|
||||||
|
logger.Logger.Errorf("UpdateAccount error: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}), nil).StartByExecutor("UpdateChannelId")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pack.Tag = webapiproto.TagCode_SUCCESS
|
pack.Tag = webapiproto.TagCode_SUCCESS
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(msg.SnId)
|
player := PlayerMgrSington.GetPlayerBySnId(msg.SnId)
|
||||||
if player != nil {
|
if player != nil {
|
||||||
|
@ -1985,7 +2044,7 @@ func init() {
|
||||||
if v.FieldByName(k).CanInterface() {
|
if v.FieldByName(k).CanInterface() {
|
||||||
switch f.Type.Kind() {
|
switch f.Type.Kind() {
|
||||||
case reflect.Int64, reflect.Int32:
|
case reflect.Int64, reflect.Int32:
|
||||||
a, _ := strconv.ParseInt((fmt.Sprintf("%v", n)), 10, 64)
|
a, _ := strconv.ParseInt(fmt.Sprintf("%v", n), 10, 64)
|
||||||
s.FieldByName(k).SetInt(a)
|
s.FieldByName(k).SetInt(a)
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
s.FieldByName(k).SetBool(n.(bool))
|
s.FieldByName(k).SetBool(n.(bool))
|
||||||
|
@ -2002,42 +2061,8 @@ func init() {
|
||||||
pd = SetInfo(pd, *pd, playerMap)
|
pd = SetInfo(pd, *pd, playerMap)
|
||||||
player.dirty = true
|
player.dirty = true
|
||||||
player.SendDiffData()
|
player.SendDiffData()
|
||||||
var alipayAcc, alipayAccName, bankAccount, bankAccName string
|
|
||||||
if val, ok := playerMap["AlipayAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAcc = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["AlipayAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccount = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if alipayAcc != "" || alipayAccName != "" {
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
|
|
||||||
alipayAccName, alipayAcc, 2)
|
|
||||||
return nil
|
|
||||||
}), nil, "NewBankBindLog").Start()
|
|
||||||
}
|
|
||||||
if bankAccount != "" || bankAccName != "" {
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
|
|
||||||
bankAccName, bankAccount, 2)
|
|
||||||
return nil
|
|
||||||
}), nil, "NewBankBindLog").Start()
|
|
||||||
}
|
|
||||||
pack.Msg = "success"
|
pack.Msg = "success"
|
||||||
|
f(pd.Platform, pd.SnId)
|
||||||
return common.ResponseTag_Ok, pack
|
return common.ResponseTag_Ok, pack
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2053,35 +2078,7 @@ func init() {
|
||||||
//直接操作数据库
|
//直接操作数据库
|
||||||
err := model.UpdatePlayerElement(msg.Platform, msg.SnId, playerMap)
|
err := model.UpdatePlayerElement(msg.Platform, msg.SnId, playerMap)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var alipayAcc, alipayAccName, bankAccount, bankAccName string
|
f(msg.Platform, msg.SnId)
|
||||||
if val, ok := playerMap["AlipayAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAcc = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["AlipayAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccount = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if alipayAcc != "" || alipayAccName != "" {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
|
|
||||||
alipayAccName, alipayAcc, 2)
|
|
||||||
}
|
|
||||||
if bankAccount != "" || bankAccName != "" {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
|
|
||||||
bankAccName, bankAccount, 2)
|
|
||||||
}
|
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
logger.Logger.Error("UpdatePlayerElement task marshal data error:", err)
|
logger.Logger.Error("UpdatePlayerElement task marshal data error:", err)
|
||||||
}
|
}
|
||||||
|
@ -3730,6 +3727,7 @@ func init() {
|
||||||
})).StartByExecutor(fmt.Sprint(msg.GetSnid()))
|
})).StartByExecutor(fmt.Sprint(msg.GetSnid()))
|
||||||
return common.ResponseTag_TransactYield, pack
|
return common.ResponseTag_TransactYield, pack
|
||||||
}))
|
}))
|
||||||
|
|
||||||
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/player/AddItem", WebAPIHandlerWrapper(
|
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/player/AddItem", WebAPIHandlerWrapper(
|
||||||
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
||||||
pack := &webapiproto.SAAddItemById{}
|
pack := &webapiproto.SAAddItemById{}
|
||||||
|
|
Loading…
Reference in New Issue