fix parsing of stock

This commit is contained in:
shoopea 2019-08-22 17:38:16 +08:00
parent ca30463b0e
commit 6abb634e8e

2
msg.go
View File

@ -31,7 +31,7 @@ func parseSubTypeMessageStockAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWar
log.Printf("parseSubTypeMessageReport : Used : %s\n", r.ReplaceAllString(m.Text, "${Used}"))
log.Printf("parseSubTypeMessageReport : Available : %s\n", r.ReplaceAllString(m.Text, "${Available}"))
re := regexp.MustCompile(`\n[a-zA-Z ]+ \([0-9]+\)`)
re := regexp.MustCompile(`\n([a-zA-Z ]+) \(([0-9]+)\)`)
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Items}"), -1) {
i := getObjItemID(``, l[1])
q, _ := strconv.ParseInt(l[2], 10, 64)