This commit is contained in:
shoopea 2019-05-14 10:29:47 +08:00
parent 9f14c3fb48
commit af34558920
2 changed files with 9 additions and 9 deletions

16
sql.go
View File

@ -1479,7 +1479,7 @@ func insertMsgMiniWar(m *ChatWarsMessageMiniWar) error {
}
defer stmt1.Close()
_, err = stmt.Exec(m.ObjID64, m.Time)
_, err = stmt1.Exec(m.ObjID64, m.Time)
if err != nil {
return err
}
@ -1494,19 +1494,19 @@ func insertMsgMiniWar(m *ChatWarsMessageMiniWar) error {
for c, r := range m.Report {
switch c {
case "Deerhorn":
_, err = stmt.Exec(m.ObjID64, castleDeer, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castleDeer, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
case "Dragonscale":
_, err = stmt.Exec(m.ObjID64, castleDragon, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castleDragon, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
case "Highnest":
_, err = stmt.Exec(m.ObjID64, castleHighnest, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castleHighnest, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
case "Moonlight":
_, err = stmt.Exec(m.ObjID64, castleMoon, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castleMoon, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
case "Potato":
_, err = stmt.Exec(m.ObjID64, castlePotato, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castlePotato, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
case "Sharkteeth":
_, err = stmt.Exec(m.ObjID64, castleshark, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castleShark, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
case "Wolfpack":
_, err = stmt.Exec(m.ObjID64, castleWolf, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
_, err = stmt2.Exec(m.ObjID64, castleWolf, r.Gardian, r.Result, r.Gold, r.Stock, r.Points)
}
if err != nil {
return err

View File

@ -102,7 +102,7 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
cwm, err := parseSubTypeMessageMiniWar(m, r)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageMiniWar.")
cwm.ObjID64 = objId
err = insertMsgMiniWar(&cwm)
err = insertMsgMiniWar(cwm)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : insertMsgMiniWar")
err = setObjSubTypeId(objId, objSubTypeMessageMiniWar)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(MiniWar)")