test ambush
This commit is contained in:
parent
0c52a28cb3
commit
749979b593
11
msg.go
11
msg.go
@ -432,15 +432,20 @@ func parseSubTypeMessageQuestResultAmbush(m *ChatWarsMessage, r *regexp.Regexp)
|
||||
|
||||
cwm := ChatWarsMessageQuestResultAmbush{}
|
||||
|
||||
re := regexp.MustCompile(`([0-9] x ){0,1}([a-zA-Z ]*) lvl\.([0-9]*)`)
|
||||
re := regexp.MustCompile(`([0-9]){0,1}( x ){0,1}([a-zA-Z ]*) lvl\.([0-9]*)`)
|
||||
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Monsters}"), -1) {
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : %s\n", l[1])
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : %s\n", l[2])
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : %s\n", l[3])
|
||||
lvl, _ := strconv.ParseInt(l[3], 10, 64)
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : lvl : %d\n", lvl)
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : %s\n", l[4])
|
||||
|
||||
qty, _ := strconv.ParseInt(l[1], 10, 64)
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : qty : %d\n", qty)
|
||||
if qty == 0 {
|
||||
qty = 1
|
||||
}
|
||||
lvl, _ := strconv.ParseInt(l[4], 10, 64)
|
||||
log.Printf("parseSubTypeMessageQuestResultAmbush : lvl : %d\n", lvl)
|
||||
level = level + float64(lvl*qty)
|
||||
}
|
||||
cwm.Msg = m
|
||||
|
Loading…
Reference in New Issue
Block a user