This commit is contained in:
shoopea 2020-02-09 16:30:16 +08:00
parent 3f622a8e2e
commit 7b94d17fc9

9
msg.go
View File

@ -186,6 +186,7 @@ func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
`(Lost\: (?P<Lost>.*))|` +
`(You were healed by (?P<Healer>.*))|` +
`(You were poisoned by (?P<Poisoner>.*))|` +
`(Got hit by an arrow from (?P<Archer>.*), (?P<Skiller>.*) skill decreased)|` +
`.+)`)
for i, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Extra}"), -1) {
if len(re.ReplaceAllString(l[0], "${Cry}")) != 0 {
@ -201,11 +202,13 @@ func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
} else if len(re.ReplaceAllString(l[0], "${Crit}")) != 0 {
// log.Printf("parseSubTypeMessageReport : Extra[%d] : Crit\n", i)
} else if len(re.ReplaceAllString(l[0], "${Lost}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Lost item : %s\n", i, re.ReplaceAllString(l[0], "${Lost}"))
// log.Printf("parseSubTypeMessageReport : Extra[%d] : Lost item : %s\n", i, re.ReplaceAllString(l[0], "${Lost}"))
} else if len(re.ReplaceAllString(l[0], "${Healer}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Healer : %s\n", i, re.ReplaceAllString(l[0], "${Healer}"))
// log.Printf("parseSubTypeMessageReport : Extra[%d] : Healer : %s\n", i, re.ReplaceAllString(l[0], "${Healer}"))
} else if len(re.ReplaceAllString(l[0], "${Poisoner}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Poisoner : %s\n", i, re.ReplaceAllString(l[0], "${Poisoner}"))
// log.Printf("parseSubTypeMessageReport : Extra[%d] : Poisoner : %s\n", i, re.ReplaceAllString(l[0], "${Poisoner}"))
} else if len(re.ReplaceAllString(l[0], "${Archer}")) != 0 && len(re.ReplaceAllString(l[0], "${Skill}")) != 0 {
log.Printf("parseSubTypeMessageReport : Extra[%d] : Archer : %s / Skill : %s\n", i, re.ReplaceAllString(l[0], "${Archer}"), re.ReplaceAllString(l[0], "${Skill}"))
} else {
log.Printf("parseSubTypeMessageReport : Extra[%d] : %s\n", i, l[0])
}