testtesttest

This commit is contained in:
shoopea 2019-05-25 19:24:58 +08:00
parent 8c96f664e0
commit e5ce916228
2 changed files with 9 additions and 12 deletions

View File

@ -96,19 +96,16 @@ func resetMsgParsingRules() {
,(5000, ` + strconv.Itoa(objSubTypeMessageDepositAck) + `, "Deposit Ack #2", "^Deposited successfully: (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\)$")
,(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(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<StatusUnion>(easily defended|defended successfully|breached.|easily breached.|closely breached.))(Attackers have pillage union for (?<Loot>[0-9]+) stock):\\n` +
`(🎖Attack leaders: (?P<AtkUnionCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser1>[^,]+)(,(?P<AtkUnionCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser2>[^,]+)){0,1}(,(?P<AtkUnionCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser3>[^,]+)){0,1}(,(?P<AtkUnionCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefUnionCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser1>[^,]+)(,(?P<DefUnionCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser2>[^,]+)){0,1}(,(?P<DefUnionCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser3>[^,]+)){0,1}(,(?P<DefUnionCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)*` +
`(🎪State of exclusive rights:\\n){0,1}` +
`(((?P<Fair>[A-Z][a-z]+ [A-Z][a-z]+) (?P<StatusFair>(was protected|belongs to)( (?P<Attacker>[A-Z][a-z]+ [A-Z][a-z]+):)\\n` +
`(🎖Attack leaders: (?P<AtkFairCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser1>[^,]+)(,(?P<AtkFairCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser2>[^,]+)){0,1}(,(?P<AtkFairCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser3>[^,]+)){0,1}(,(?P<AtkFairCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefFairCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser1>[^,]+)(,(?P<DefFairCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser2>[^,]+)){0,1}(,(?P<DefFairCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser3>[^,]+)){0,1}(,(?P<DefFairCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)*` +
`$)")*/`
,(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<StatusUnion>(easily defended|defended successfully|breached.|easily breached.|closely breached.))(Attackers have pillage union for (?<Loot>[0-9]+) stock):\\n` +
`(🎖Attack leaders: (?P<AtkUnionCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser1>[^,]+)(,(?P<AtkUnionCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser2>[^,]+)){0,1}(,(?P<AtkUnionCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser3>[^,]+)){0,1}(,(?P<AtkUnionCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUnionUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefUnionCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser1>[^,]+)(,(?P<DefUnionCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser2>[^,]+)){0,1}(,(?P<DefUnionCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser3>[^,]+)){0,1}(,(?P<DefUnionCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUnionUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)*` +
`(🎪State of exclusive rights:\\n){0,1}` +
`$)")
`(((?P<Fair>[A-Z][a-z]+ [A-Z][a-z]+) (?P<StatusFair>(was protected|belongs to)( (?P<Attacker>[A-Z][a-z]+ [A-Z][a-z]+):)\\n` +
`(🎖Attack leaders: (?P<AtkFairCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser1>[^,]+)(,(?P<AtkFairCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser2>[^,]+)){0,1}(,(?P<AtkFairCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser3>[^,]+)){0,1}(,(?P<AtkFairCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkFairUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefFairCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser1>[^,]+)(,(?P<DefFairCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser2>[^,]+)){0,1}(,(?P<DefFairCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser3>[^,]+)){0,1}(,(?P<DefFairCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefFairUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)*` +
`$")
;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules")
}

2
sql.go
View File

@ -1615,7 +1615,7 @@ func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) {
i.MsgTypeID = msgTypeID
i.re = regexp.MustCompile(rule)
m[count] = *i
log.Printf("New rule : %s\n", rule)
// log.Printf("New rule : %s\n", rule)
count++
}