数据过滤
This commit is contained in:
parent
dcc921ff91
commit
dc6af2c94b
@ -46,7 +46,9 @@ func (this *modelUserLog) AddUserLog(uid string, itype int32, tag string, data i
|
|||||||
jsonStr []byte
|
jsonStr []byte
|
||||||
logType string
|
logType string
|
||||||
)
|
)
|
||||||
|
if data == nil { // 过滤空数据
|
||||||
|
return
|
||||||
|
}
|
||||||
if jsonStr, err = json.Marshal(data); err != nil {
|
if jsonStr, err = json.Marshal(data); err != nil {
|
||||||
log.Errorln(err)
|
log.Errorln(err)
|
||||||
return
|
return
|
||||||
@ -55,7 +57,10 @@ func (this *modelUserLog) AddUserLog(uid string, itype int32, tag string, data i
|
|||||||
logType = "add" // 新增资源类型
|
logType = "add" // 新增资源类型
|
||||||
} else if itype == 1 {
|
} else if itype == 1 {
|
||||||
logType = "sub" // 消耗资源类型
|
logType = "sub" // 消耗资源类型
|
||||||
|
} else {
|
||||||
|
logType = "undefine"
|
||||||
}
|
}
|
||||||
|
|
||||||
if db.IsCross() { //如果是跨服 直接找到对应的本服
|
if db.IsCross() { //如果是跨服 直接找到对应的本服
|
||||||
if tag, _, b := utils.UIdSplit(uid); b {
|
if tag, _, b := utils.UIdSplit(uid); b {
|
||||||
if conn, err := db.ServerDBConn(tag); err == nil {
|
if conn, err := db.ServerDBConn(tag); err == nil {
|
||||||
|
@ -622,6 +622,9 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
|
|||||||
}
|
}
|
||||||
if len(reward) > 0 {
|
if len(reward) > 0 {
|
||||||
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "StonehengeEventReq", reward)
|
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "StonehengeEventReq", reward)
|
||||||
|
if len(eventConf.CostItem) > 0 {
|
||||||
|
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "StonehengeEventReq", eventConf.CostItem)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ func (this *apiComp) Draw(session comm.IUserSession, req *pb.TurntableDrawReq) (
|
|||||||
|
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "TurntableDrawReq", atno)
|
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "TurntableDrawReq", atno)
|
||||||
|
this.module.WriteUserLog(session.GetUserId(), comm.GMResDelType, "TurntableDrawReq", need)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user