This commit is contained in:
shoopea 2020-06-28 11:36:19 +02:00
parent c9e202ccce
commit b399348c99

5
msg.go
View File

@ -365,7 +365,6 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha
} }
} }
re = regexp.MustCompile(`\n(u[0-9]+)([ᵃᵇᶜᵈᵉ]{0,1}) (.*)`) re = regexp.MustCompile(`\n(u[0-9]+)([ᵃᵇᶜᵈᵉ]{0,1}) (.*)`)
rq = regexp.MustCompile(`[u][0-9]+(?P<Quality>[ᵃᵇᶜᵈᵉ]+)`)
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Stock}"), -1) { for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Stock}"), -1) {
i := getObjItemID(``, l[3]) i := getObjItemID(``, l[3])
if i != 0 { if i != 0 {
@ -374,9 +373,7 @@ func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Cha
Name: l[3], Name: l[3],
ItemID64: i, ItemID64: i,
Quantity: 1, Quantity: 1,
} Quality: l[2],
if rq.MatchString(l[1]) {
item.Quality = rq.ReplaceAllString(l[1], "${Quality}")
} }
log.Printf("Item : %s - %s : %s\n", item.Code, item.Name, item.Quality) log.Printf("Item : %s - %s : %s\n", item.Code, item.Name, item.Quality)
stock = append(stock, item) stock = append(stock, item)