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() defer stmt1.Close()
_, err = stmt.Exec(m.ObjID64, m.Time) _, err = stmt1.Exec(m.ObjID64, m.Time)
if err != nil { if err != nil {
return err return err
} }
@ -1494,19 +1494,19 @@ func insertMsgMiniWar(m *ChatWarsMessageMiniWar) error {
for c, r := range m.Report { for c, r := range m.Report {
switch c { switch c {
case "Deerhorn": 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": 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": 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": 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": 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": 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": 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 { if err != nil {
return err return err

View File

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