This commit is contained in:
shoopea 2019-05-25 17:57:10 +08:00
parent b39313ae25
commit 50e7af882e
2 changed files with 7 additions and 0 deletions

View File

@ -97,6 +97,10 @@ func resetMsgParsingRules() {
,(5000, ` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "Deposit Ack #1", "^Deposited (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\) successfully$")
,(5000, ` + strconv.Itoa(objSubTypeMessageStockReq) + `, "Stock Req", "^/stock$")
,(5000, ` + strconv.Itoa(objSubTypeMessageMiscReq) + `, "Misc Req", "^/misc$")
,(5000, ` + strconv.Itoa(objSubTypeMessageUnionWar) + `, "Union war report", "^(🏠Trade union news:\\n){0,1}` +
`(((?P<Union>[A-Z][a-z]+ [A-Z][a-z]+) was (?P<Status>(easily defended|defended successfully|breached.|easily breached.|closely breached.))(Attackers have pillage union for (?<Loot>[0-9]+) stock):\\n` +
`(🎖Attack leaders: (?P<AtkCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser1>[^,]+)(,(?P<AtkCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<AtkCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser3>[^,]+)){0,1}(,(?P<AtkCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser1>[^,]+)(,(?P<DefCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<DefCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser3>[^,]+)){0,1}(,(?P<DefCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)+$")
;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules")
}

View File

@ -217,6 +217,9 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
case objSubTypeMessageMiscReq:
err = setObjSubTypeId(objId, objSubTypeMessageMiscReq)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(MiscReq)")
case objSubTypeMessageUnionWar:
err = setObjSubTypeId(objId, objSubTypeMessageUnionWar)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(UnionWar)")
case objSubTypeMessageAuctionAnnounce:
cwm := ChatWarsMessageAuctionAnnounce{
ObjID64: objId,