test war report

This commit is contained in:
shoopea 2020-02-09 15:30:40 +08:00
parent e0bf821444
commit bb8ba76404
2 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@
{ {
"prio": 5000, "prio": 5000,
"descn": "Player war report", "descn": "Player war report",
"rule": "^(?P<Castle>[🐉🦅🐺🦈🦌🥔🌑])(\\[(?P<Guild>[A-Z0-9]{1,3})\\]){0,1}(?P<User>([A-Za-z0-9 ]*)) ⚔:(?P<Attack>[0-9]+)(?P<AttackMod>\\((-|\\+)[0-9]+\\)){0,1} 🛡:(?P<Defense>[0-9]+) Lvl: (?P<Level>[0-9]+)\\nYour result on the battlefield:\\n(🔥Exp: (?P<Exp>[0-9]+)){0,1}(\\n)*(💰Gold: (?P<Gold>\\-{0,1}[0-9]+)){0,1}(\\n)*(📦Stock: (?P<Stock>\\-{0,1}[0-9]+)){0,1}(\\n)*(❤Hp: (?P<HP>\\-[0-9]+)){0,1}(\\n)*((?P<Stamina>(🔋Stamina restored))){0,1}(\\n(?P<Crit>(⚡Critical strike))){0,1}$", "rule": "^(?P<Castle>[🐉🦅🐺🦈🦌🥔🌑])(\\[(?P<Guild>[A-Z0-9]{1,3})\\]){0,1}(?P<User>([A-Za-z0-9 ]*)) ⚔:(?P<Attack>[0-9]+)(?P<AttackMod>\\((-|\\+)[0-9]+\\)){0,1} 🛡:(?P<Defense>[0-9]+) Lvl: (?P<Level>[0-9]+)\\nYour result on the battlefield:\\n(🔥Exp: (?P<Exp>[0-9]+)){0,1}(\\n)*(💰Gold: (?P<Gold>\\-{0,1}[0-9]+)){0,1}(\\n)*(📦Stock: (?P<Stock>\\-{0,1}[0-9]+)){0,1}(\\n)*(❤Hp: (?P<HP>\\-[0-9]+)){0,1}(\\n)(?P<Extra>(?s:.*))$",
"msg_type": "msg_report_ack", "msg_type": "msg_report_ack",
"chat_id": 0, "chat_id": 0,
"user_id": 0 "user_id": 0

1
msg.go
View File

@ -175,6 +175,7 @@ func parseSubTypeMessageStockAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWar
func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageReportAck, error) { func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageReportAck, error) {
cwm := ChatWarsMessageReportAck{} cwm := ChatWarsMessageReportAck{}
log.Printf("parseSubTypeMessageReport : Extra : %s\n", r.ReplaceAllString(m.Text, "${Extra}"))
/* /*
log.Printf("parseSubTypeMessageReport : War report identified\n") log.Printf("parseSubTypeMessageReport : War report identified\n")
log.Printf("parseSubTypeMessageReport : Castle : %s\n", r.ReplaceAllString(m.Text, "${Castle}")) log.Printf("parseSubTypeMessageReport : Castle : %s\n", r.ReplaceAllString(m.Text, "${Castle}"))