This commit is contained in:
shoopea 2019-05-13 10:25:03 +08:00
parent db95640467
commit a3961fcab6
2 changed files with 15 additions and 15 deletions

1
sql.go
View File

@ -1275,6 +1275,7 @@ func resetMsgParsingRules() {
`Battle (?P<Time>[0-9]{2}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2})$")*/`
,(4000, ` + strconv.Itoa(objSubTypeMessageMiniWar) + `, "Mini War", "^Battle results:\\n` +
`(?P<Gardian1>🔱){0,1}.*(?P<Loot1>(Moonlight|Wolfpack|Deerhorn|Dragonscale|Sharkteeth|Potato|Highnest)):.*\\n` +
`(?P<Gardian2>🔱){0,1}.*(?P<Loot2>(Moonlight|Wolfpack|Deerhorn|Dragonscale|Sharkteeth|Potato|Highnest)):.*\\n` +
`(?s:.*)` +
`Battle (?P<Time>[0-9]{2}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2})$")
;`)

View File

@ -169,23 +169,22 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot7}")] = rep
//b, err := json.Marshal(cwm)
if len(r.ReplaceAllString(m.Text, "${Loot1}")) < 6 || len(r.ReplaceAllString(m.Text, "${Loot1}")) > 11 {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : NOT MATCHED \nLoot1: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), m.Text)
} else {
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : MATCHED!\nLoot1: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), m.Text)
}
/*
if (len(r.ReplaceAllString(m.Text, "${Loot1}")) < 6 || len(r.ReplaceAllString(m.Text, "${Loot1}")) > 11) ||
(len(r.ReplaceAllString(m.Text, "${Loot2}")) < 6 || len(r.ReplaceAllString(m.Text, "${Loot2}")) > 11) {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : NOT MATCHED \nLoot1: %s\nLoot2: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), r.ReplaceAllString(m.Text, "${Loot2}"), m.Text)
} else {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : MATCHED!\nLoot1: %s\nLoot2: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), r.ReplaceAllString(m.Text, "${Loot2}"), m.Text)
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : objSubTypeMessageMiniWar\n%s\n", string(b))
if len(r.ReplaceAllString(m.Text, "${Loot1}")) < 6 || len(r.ReplaceAllString(m.Text, "${Loot1}")) > 11 {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : NOT MATCHED \nLoot1: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), m.Text)
}
*/
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : MATCHED!\nLoot1: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), m.Text)
if (len(r.ReplaceAllString(m.Text, "${Loot1}")) < 6 || len(r.ReplaceAllString(m.Text, "${Loot1}")) > 11) ||
(len(r.ReplaceAllString(m.Text, "${Loot2}")) < 6 || len(r.ReplaceAllString(m.Text, "${Loot2}")) > 11) {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : NOT MATCHED \nLoot1: %s\nLoot2: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), r.ReplaceAllString(m.Text, "${Loot2}"), m.Text)
}
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : MATCHED!\nLoot1: %s\nLoot2: %s\n%s\n", r.ReplaceAllString(m.Text, "${Loot1}"), r.ReplaceAllString(m.Text, "${Loot2}"), m.Text)
//log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : objSubTypeMessageMiniWar\n%s\n", string(b))
/*
if err == nil {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : War time : %s (%d)\n", r.ReplaceAllString(m.Text, "${Time}"), objId)
}
/*
if err == nil {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : War time : %s (%d)\n", r.ReplaceAllString(m.Text, "${Time}"), objId)
}
*/
case objSubTypeMessageAuctionAnnounce: