This commit is contained in:
shoopea 2020-02-09 16:36:54 +08:00
parent 3cabcae6a9
commit fdffad7532

6
msg.go
View File

@ -186,7 +186,9 @@ func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
`(You were healed by (?P<Healer>.*))|` + `(You were healed by (?P<Healer>.*))|` +
`(You were poisoned by (?P<Poisoner>.*))|` + `(You were poisoned by (?P<Poisoner>.*))|` +
`(Got hit by an arrow from (?P<Archer>.*), (?P<Skill>.*) skill decreased)|` + `(Got hit by an arrow from (?P<Archer>.*), (?P<Skill>.*) skill decreased)|` +
`(Got hit by an arrow from (?P<Archer>.*))|` +
`(Your (?P<Broken>.*) has been broken)|` + `(Your (?P<Broken>.*) has been broken)|` +
`(⚡Battle Cry. You were inspired by (?P<CryInspirer>.*))|` +
`.+)`) `.+)`)
for i, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Extra}"), -1) { for i, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Extra}"), -1) {
if len(re.ReplaceAllString(l[0], "${Cry}")) != 0 { if len(re.ReplaceAllString(l[0], "${Cry}")) != 0 {
@ -209,8 +211,12 @@ func parseSubTypeMessageReportAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
// 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 { } 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}")) // log.Printf("parseSubTypeMessageReport : Extra[%d] : Archer : %s / Skill : %s\n", i, re.ReplaceAllString(l[0], "${Archer}"), re.ReplaceAllString(l[0], "${Skill}"))
} else if len(re.ReplaceAllString(l[0], "${Archer}")) != 0 {
// log.Printf("parseSubTypeMessageReport : Extra[%d] : Archer : %s\n", i, re.ReplaceAllString(l[0], "${Archer}"))
} else if len(re.ReplaceAllString(l[0], "${Broken}")) != 0 { } else if len(re.ReplaceAllString(l[0], "${Broken}")) != 0 {
// log.Printf("parseSubTypeMessageReport : Extra[%d] : Broken\n", i) // log.Printf("parseSubTypeMessageReport : Extra[%d] : Broken\n", i)
} else if len(re.ReplaceAllString(l[0], "${CryInspirer}")) != 0 {
// log.Printf("parseSubTypeMessageReport : Extra[%d] : CryInspirer\n", i)
} else { } else {
log.Printf("parseSubTypeMessageReport : Extra[%d] : %s\n", i, l[0]) log.Printf("parseSubTypeMessageReport : Extra[%d] : %s\n", i, l[0])
} }