test
This commit is contained in:
parent
988e0db5fb
commit
c2149a105e
4
obj.go
4
obj.go
@ -385,7 +385,7 @@ func getObjMsgDate(objID64 int64) (time.Time, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func addObjXP(userID64 int64, val int64, target int64, level int64, date time.Time) (int64, error) {
|
func addObjXP(userID64 int64, expNow int64, expLvl int64, level int64, date time.Time) (int64, error) {
|
||||||
tx, err := db.Begin()
|
tx, err := db.Begin()
|
||||||
logOnError(err, "addObjXP : start transaction")
|
logOnError(err, "addObjXP : start transaction")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -418,7 +418,7 @@ func addObjXP(userID64 int64, val int64, target int64, level int64, date time.Ti
|
|||||||
}
|
}
|
||||||
defer stmt.Close()
|
defer stmt.Close()
|
||||||
|
|
||||||
_, err = stmt.Exec(objId, userID64, val, target, level, date)
|
_, err = stmt.Exec(objId, userID64, expNow, expLvl, level, date)
|
||||||
logOnError(err, "addObjXP : exec insert obj_xp")
|
logOnError(err, "addObjXP : exec insert obj_xp")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err2 := tx.Rollback()
|
err2 := tx.Rollback()
|
||||||
|
@ -145,7 +145,7 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
|
|||||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageMeAck.")
|
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageMeAck.")
|
||||||
cwm.Msg = m
|
cwm.Msg = m
|
||||||
clientMsgMeAck(cwm)
|
clientMsgMeAck(cwm)
|
||||||
_, err = addObjXP(cwm.UserID64, cwm.ExpVal, cwm.ExpTarget, cwm.Level, m.Date)
|
_, err = addObjXP(cwm.UserID64, cwm.ExpNow, cwm.ExpLvl, cwm.Level, m.Date)
|
||||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : addObjXP(MeAck)")
|
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : addObjXP(MeAck)")
|
||||||
err = setObjSubTypeId(objId, objSubTypeMessageMeAck)
|
err = setObjSubTypeId(objId, objSubTypeMessageMeAck)
|
||||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(MeAck)")
|
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(MeAck)")
|
||||||
|
Loading…
Reference in New Issue
Block a user