From 3354a118e3ee7c438b85acf96cc782738332334d Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 25 Jun 2020 18:53:17 +0200 Subject: [PATCH] test auction --- data/msg_rules.json | 4 ++-- def.go | 1 + msg.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/msg_rules.json b/data/msg_rules.json index 4b6bde0..4c71c7a 100644 --- a/data/msg_rules.json +++ b/data/msg_rules.json @@ -10,7 +10,7 @@ { "prio": 5000, "descn": "Auction annouce", - "rule": "^Lot #(?P[0-9]+) : (?P.*)\\n(Quality: (?P.*)\\n){0,1}(Condition: (?P.*)\\n){0,1}Seller: (?P[πŸ‰πŸ¦…πŸΊπŸ¦ˆπŸ¦ŒπŸ₯”πŸŒ‘])( ){0,1}(\\[(?P[A-Z0-9]{1,3})\\]){0,1}(?P.*){0,1}\\nCurrent price: (?P[0-9]+) pouch\\(es\\)\\nBuyer: (None|(?P[πŸ‰πŸ¦…πŸΊπŸ¦ˆπŸ¦ŒπŸ₯”πŸŒ‘])( ){0,1}(\\[(?P[A-Z0-9]{1,3})\\]){0,1}(?P.*){0,1})\\nEnd At: (?P.*)\\nStatus: (?P.*)(\\n)*(?s:.*)", + "rule": "^Lot #(?P[0-9]+) : (?P.*)\\n(Quality: (?P.*)\\n){0,1}(Condition: (?P.*)\\n){0,1}(Modifiers:\\n(?P( .*\\n)*)){0,1}Seller: (?P[πŸ‰πŸ¦…πŸΊπŸ¦ˆπŸ¦ŒπŸ₯”πŸŒ‘])( ){0,1}(\\[(?P[A-Z0-9]{1,3})\\]){0,1}(?P.*){0,1}\\nCurrent price: (?P[0-9]+) pouch\\(es\\)\\nBuyer: (None|(?P[πŸ‰πŸ¦…πŸΊπŸ¦ˆπŸ¦ŒπŸ₯”πŸŒ‘])( ){0,1}(\\[(?P[A-Z0-9]{1,3})\\]){0,1}(?P.*){0,1})\\nEnd At: (?P.*)\\nStatus: (?P.*)(\\n)*(?s:.*)", "msg_type": "msg_auction_announce", "chat_id": 0, "user_id": 0 @@ -58,7 +58,7 @@ { "prio": 5000, "descn": "Pillage Win", - "rule": "^You successfully defeated (\\[(?P[A-Z0-9]{1,3})\\]){0,1}(?P.*). As he was crawling away, you picked up some of the gold he left behind. Received (?P[0-9]+) gold and (?P[0-9]+) exp.$", + "rule": "^You successfully defeated (\\[(?P[A-Z0-9]{1,3})\\]){0,1}(?P.*). As he was crawling away, you picked up some of the gold he left behind.*(\n){0,1}Received (?P[0-9]+) gold and (?P[0-9]+) exp.$", "msg_type": "msg_pillage_win", "chat_id": 0, "user_id": 0 diff --git a/def.go b/def.go index 10b419e..554b4b7 100644 --- a/def.go +++ b/def.go @@ -351,6 +351,7 @@ type ChatWarsMessageAuctionAnnounce struct { LotID int32 `json:"lot_id"` ItemID64 int64 `json:"item_id"` Cond string `json:"cond"` + Mod string `json:"mod"` Quality string `json:"quality"` SellerUserID64 int64 `json:"seller_id"` SellerGuildID64 int64 `json:"seller_guild_id"` diff --git a/msg.go b/msg.go index 69e388b..4a90a84 100644 --- a/msg.go +++ b/msg.go @@ -287,6 +287,7 @@ func parseSubTypeMessageAuctionAnnounce(m *ChatWarsMessage, r *regexp.Regexp) (* cwm.LotID = int32(l) cwm.ItemID64 = getObjItemID(``, r.ReplaceAllString(m.Text, "${Item}")) cwm.Cond = r.ReplaceAllString(m.Text, "${Cond}") + cwm.Mod = r.ReplaceAllString(m.Text, "${Mod}") cwm.Quality = r.ReplaceAllString(m.Text, "${Quality}") cwm.SellerUserID64 = getObjUserID(r.ReplaceAllString(m.Text, "${SellerUser}")) cwm.SellerGuildID64 = getObjGuildID(r.ReplaceAllString(m.Text, "${SellerGuild}"))