This commit is contained in:
shoopea 2019-05-28 12:24:11 +08:00
parent c7517bf038
commit 4114beff23
2 changed files with 3 additions and 8 deletions

3
msg.go
View File

@ -29,8 +29,9 @@ func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
func parseSubTypeMessageMeAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageMeAck, error) {
cwm := ChatWarsMessageMeAck{}
log.Printf("parseSubTypeMessageReport : War report identified\n")
log.Printf("parseSubTypeMessageReport : Me report identified\n")
log.Printf("parseSubTypeMessageReport : Player : %s\n", r.ReplaceAllString(m.Text, "${Player}"))
log.Printf("parseSubTypeMessageReport : Class : %s\n", r.ReplaceAllString(m.Text, "${Class}"))
log.Printf("parseSubTypeMessageReport : Castle : %s\n", r.ReplaceAllString(m.Text, "${Castle}"))
log.Printf("parseSubTypeMessageReport : Level : %s\n", r.ReplaceAllString(m.Text, "${Level}"))
log.Printf("parseSubTypeMessageReport : Atk : %s\n", r.ReplaceAllString(m.Text, "${Atk}"))

View File

@ -120,7 +120,7 @@ func resetMsgParsingRules() {
,(4900, ` + strconv.Itoa(objSubTypeMessageUnionWar) + `, "Union war rep only fair", "^(🏠Trade union news:\n){0}(?P<Union>(?s:.*))(🎪State of exclusive rights:\n)(?P<Fair>(?s:.*))$")
,(5000, ` + strconv.Itoa(objSubTypeMessageTimeout) + `, "Generic timeout", "^Too late. Action is not available.$")
,(5000, ` + strconv.Itoa(objSubTypeMessageMeAck) + `, "Me ack", "^(?s:.*)Battle of the seven castles in .* minutes!\\n(?s:.*)\\n` +
`(?P<CastleIcon>.)(?P<Player>.*) of (?P<Castle>[a-zA-Z]*) Castle\\n` +
`(?P<CastleIcon>.)(?P<Player>.*) ((?P<Class>(Knight|Ranger|Sentinel|Collector|Blacksmith|Alchemist) ){0,1}of (?P<Castle>[a-zA-Z]*) Castle\\n` +
`.Level: (?P<Level>[0-9]+)\\n` +
`.Atk: (?P<Atk>[0-9]+) .Def: (?P<Def>[0-9]+)\\n` +
`.Exp: (?P<ExpNow>[0-9]+)/(?P<ExpLvl>[0-9]+)\\n` +
@ -129,12 +129,6 @@ func resetMsgParsingRules() {
`🎽Equipment \\+(?P<AtkGear>[0-9]+).\\+(?P<DefGear>[0-9]+).\\n` +
`🎒Bag: (?P<BagUsed>[0-9]+)/(?P<BagDispo>[0-9]+) /inv\\n\\n` +
`State:\\n(?P<State>.*)\\n\\n` +
`More: /hero(?s:.*)$")
,(4000, ` + strconv.Itoa(objSubTypeMessageMeAck) + `, "Me ack", "^(?s:.*)Battle of the seven castles in .* minutes!\\n(?s:.*)\\n` +
`(.(?P<Gold>(-){0,1}[0-9]+)){0,1}( .(?P<Pogs>[0-9]+)){0,1}( .(?P<Gems>[0-9]+)){0,1}\\n\\n` +
`🎽Equipment \\+(?P<AtkGear>[0-9]+).\\+(?P<DefGear>[0-9]+).\\n` +
`🎒Bag: (?P<BagUsed>[0-9]+)/(?P<BagDispo>[0-9]+) /inv\\n\\n` +
`State:\\n(?P<State>.*)\\n\\n` +
`More: /hero(?s:.*)$")
;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules")