This commit is contained in:
shoopea 2019-05-11 19:51:34 +08:00
parent 1aa2f0ab72
commit 1f1e175286
2 changed files with 46 additions and 1 deletions

2
sql.go
View File

@ -1242,7 +1242,7 @@ func resetMsgParsingRules() {
,(5000, ` + strconv.Itoa(objSubTypeMessageAuctionAnnounce) + `, "Auction annouce", "^Lot #(?P<Lot>[0-9]+) : (?P<Item>.*)\\n(Quality: (?P<Quality>.*)\\n){0,1}(Condition: (?P<Cond>.*)\\n){0,1}Seller: (?P<Seller>.*)\\nCurrent price: (?P<Price>[0-9]+) pouch\\(es\\)\\nBuyer: (?P<Buyer>.*)\\nEnd At: (?P<End>.*)\\nStatus: (?P<Status>.*)(\\n)*(?s:.*)")
,(5000, ` + strconv.Itoa(objSubTypeMessageTimeAck) + `, "Time", "^In Chat Wars world now\\n(?P<Time>.*)\\n(?P<Hour>[0-9]{2}):(?P<Minute>[0-9]{2})\\n(?P<Day>[0-9]{2}) (?P<Month>.+) (?P<Year>[0-9]{4})\\n(?s:.*)$")
,(5000, ` + strconv.Itoa(objSubTypeMessageMiniWar) + `, "Mini War", "^⛳Battle results:\\n(?P<Gardian1>🔱){0,1}(?P<CastleLoot1>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult1>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold1>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock1>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<CastleLoot2>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult2>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold2>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock2>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<CastleLoot3>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult3>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold3>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock3>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<CastleLoot4>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult4>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold4>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock4>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<CastleLoot5>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult5>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold5>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock5>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<CastleLoot6>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult6>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold6>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock6>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<CastleLoot7>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<CastleResult7>(🛡|🛡👌|⚔️|⚔️ ⚡️))( (?P<CastleGold7>(\\-|\\+)[0-9]+)💰){0,1}( (?P<CastleStock7>(\\-|\\+)[0-9]+)📦){0,1}\\n\\n🏆Scores:\\n(?P<CastleScore1>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score1>\\+[0-9]+)\\n(?P<CastleScore2>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score2>\\+[0-9]+)\\n(?P<CastleScore3>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score3>\\+[0-9]+)\\n(?P<CastleScore4>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score4>\\+[0-9]+)\\n(?P<CastleScore5>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score5>\\+[0-9]+)\\n(?P<CastleScore6>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score6>\\+[0-9]+)\\n(?P<CastleScore7>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Score7>\\+[0-9]+)\\n\\nBattle (?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)): (?P<Result1>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold1>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock1>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian2>🔱){0,1}(?P<Loot2>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result2>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold2>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock2>(\\-|\\+)[0-9]+)📦){0,1}\\n(?s:.*)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)): (?P<Result1>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold1>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock1>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian2>🔱){0,1}(?P<Loot2>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result2>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold2>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock2>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian3>🔱){0,1}(?P<Loot3>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result3>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold3>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock3>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian4>🔱){0,1}(?P<Loot4>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result4>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold4>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock4>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian5>🔱){0,1}(?P<Loot5>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result5>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold5>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock5>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian6>🔱){0,1}(?P<Loot6>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result6>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold6>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock6>(\\-|\\+)[0-9]+)📦){0,1}\\n(?P<Gardian7>🔱){0,1}(?P<Loot7>(🌑Moonlight|🐺Wolfpack|🦌Deerhorn|🐉Dragonscale|🦈Sharkteeth|🥔Potato|🦅Highnest)): (?P<Result7>[ 🛡👌⚡️⚔️]*)[ ]*((?P<Gold7>(\\-|\\+)[0-9]+)💰){0,1}[ ]*((?P<Stock7>(\\-|\\+)[0-9]+)📦){0,1}\\n(?s:.*)Battle (?P<Time>[0-9]{2}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2})$")
;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules")
}

View File

@ -123,6 +123,51 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
Stock: int32(s),
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot2}")] = rep
g, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Gold3}"))
s, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Stock3}"))
rep = ChatWarsMessageMiniWarCastle{
Gardian: r.ReplaceAllString(m.Text, "${Gardian3}"),
Result: r.ReplaceAllString(m.Text, "${Result3}"),
Gold: int32(g),
Stock: int32(s),
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot3}")] = rep
g, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Gold4}"))
s, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Stock4}"))
rep = ChatWarsMessageMiniWarCastle{
Gardian: r.ReplaceAllString(m.Text, "${Gardian4}"),
Result: r.ReplaceAllString(m.Text, "${Result4}"),
Gold: int32(g),
Stock: int32(s),
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot4}")] = rep
g, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Gold5}"))
s, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Stock5}"))
rep = ChatWarsMessageMiniWarCastle{
Gardian: r.ReplaceAllString(m.Text, "${Gardian5}"),
Result: r.ReplaceAllString(m.Text, "${Result5}"),
Gold: int32(g),
Stock: int32(s),
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot5}")] = rep
g, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Gold6}"))
s, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Stock6}"))
rep = ChatWarsMessageMiniWarCastle{
Gardian: r.ReplaceAllString(m.Text, "${Gardian6}"),
Result: r.ReplaceAllString(m.Text, "${Result6}"),
Gold: int32(g),
Stock: int32(s),
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot6}")] = rep
g, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Gold7}"))
s, err = strconv.Atoi(r.ReplaceAllString(m.Text, "${Stock7}"))
rep = ChatWarsMessageMiniWarCastle{
Gardian: r.ReplaceAllString(m.Text, "${Gardian7}"),
Result: r.ReplaceAllString(m.Text, "${Result7}"),
Gold: int32(g),
Stock: int32(s),
}
cwm.Report[r.ReplaceAllString(m.Text, "${Loot7}")] = rep
b, err := json.Marshal(cwm)
if len(string(b)) < 80 {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] :\n%s\n", m.Text)