update main shop ack parse

This commit is contained in:
shoopea 2020-02-06 10:44:10 +08:00
parent 8d6fbd9e70
commit 8f36668dfb
2 changed files with 13 additions and 3 deletions

11
def.go
View File

@ -368,9 +368,14 @@ type ChatWarsMessageTributesStatsAck struct {
}
type ChatWarsMessageShopMainAck struct {
Msg *ChatWarsMessage `json:"msg"`
Name string `json:"name"`
Number string `json:"number"`
Msg *ChatWarsMessage `json:"msg"`
Name string `json:"name"`
Number string `json:"number"`
User string `json:"userr"`
Mana string `json:"mana"`
ManaTotal string `json:"mana_total"`
Class string `json:"class"`
Castle string `json:"castle"`
}
type MessageParsingRule struct {

5
msg.go
View File

@ -304,6 +304,11 @@ func parseSubTypeMessageShopMainAck(m *ChatWarsMessage, r *regexp.Regexp) (*Chat
cwm.Name = r.ReplaceAllString(m.Text, "${Name}")
cwm.Number = r.ReplaceAllString(m.Text, "${Number}")
cwm.User = r.ReplaceAllString(m.Text, "${User}")
cwm.Mana = r.ReplaceAllString(m.Text, "${Mana}")
cwm.ManaTotal = r.ReplaceAllString(m.Text, "${ManaTotal}")
cwm.Class = r.ReplaceAllString(m.Text, "${Class}")
cwm.Castle = r.ReplaceAllString(m.Text, "${Castle}")
log.Printf("parseSubTypeMessageShopMainAck : Name : %s\n", cwm.Name)
log.Printf("parseSubTypeMessageShopMainAck : Number : %s\n", cwm.Number)