This commit is contained in:
shoopea 2019-12-29 16:42:31 +08:00
parent 93d41febb1
commit 60efc6105b
2 changed files with 6 additions and 6 deletions

2
def.go
View File

@ -87,7 +87,7 @@ type ChatWarsItem struct {
Code string `json:"code"` Code string `json:"code"`
Name string `json:"name"` Name string `json:"name"`
Weight int64 `json:"weight"` Weight int64 `json:"weight"`
Exchange string `json:"exchange"` Exchange bool `json:"exchange"`
Auction bool `json:"auction"` Auction bool `json:"auction"`
Craft ChatWarsItemCraft `json:"craft"` Craft ChatWarsItemCraft `json:"craft"`
} }

View File

@ -335,9 +335,9 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
//logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : msgRegex.") //logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : msgRegex.")
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Message unidentified (%d)\n%s\n", objId, m.Text) log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Message unidentified (%d)\n%s\n", objId, m.Text)
} else { } else {
err = setObjSubTypeId(objId, rule.MsgTypeID) err = setObjSubTypeId(objId, rule.MsgTypeID64)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId") logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId")
switch rule.MsgTypeID { switch rule.MsgTypeID64 {
case objSubTypeMessageGRolesReq: case objSubTypeMessageGRolesReq:
case objSubTypeMessageGo: case objSubTypeMessageGo:
case objSubTypeMessageReportReq: case objSubTypeMessageReportReq:
@ -499,16 +499,16 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
_, err := parseSubTypeMessageQuestResult(m, rule.re) _, err := parseSubTypeMessageQuestResult(m, rule.re)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResult.") logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Parsing objSubTypeMessageQuestResult.")
default: default:
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknwon message type in rule %d : %d (%d)\n%s\n", msgParsingRules[i].ID, msgParsingRules[i].MsgTypeID, objId, m.Text) //log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknwon message type in rule %d : %d (%d)\n%s\n", msgParsingRules[i].ID, msgParsingRules[i].MsgTypeID64, objId, m.Text)
} }
muxCallbacks.Lock() muxCallbacks.Lock()
if mc1, mok1 := callbacks[m.TGUserID64]; mok1 { if mc1, mok1 := callbacks[m.TGUserID64]; mok1 {
if mc2, mok2 := mc1[rule.MsgTypeID]; mok2 { if mc2, mok2 := mc1[rule.MsgTypeID64]; mok2 {
for j := range mc2 { for j := range mc2 {
err := rescheduleJob(mc2[j], m.ObjID64, time.Now().UTC()) err := rescheduleJob(mc2[j], m.ObjID64, time.Now().UTC())
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : callbacks triggering") logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : callbacks triggering")
} }
mc1[rule.MsgTypeID] = nil mc1[rule.MsgTypeID64] = nil
} }
} }
muxCallbacks.Unlock() muxCallbacks.Unlock()