test auction

This commit is contained in:
shoopea 2020-06-25 18:53:17 +02:00
parent cf18be8a87
commit 3354a118e3
3 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@
{
"prio": 5000,
"descn": "Auction annouce",
"rule": "^Lot #(?P<Lot>[0-9]+) : (?P<Item>.*)\\n(Quality: (?P<Quality>.*)\\n){0,1}(Condition: (?P<Cond>.*)\\n){0,1}Seller: (?P<SellerCastle>[🐉🦅🐺🦈🦌🥔🌑])( ){0,1}(\\[(?P<SellerGuild>[A-Z0-9]{1,3})\\]){0,1}(?P<SellerUser>.*){0,1}\\nCurrent price: (?P<Price>[0-9]+) pouch\\(es\\)\\nBuyer: (None|(?P<BuyerCastle>[🐉🦅🐺🦈🦌🥔🌑])( ){0,1}(\\[(?P<BuyerGuild>[A-Z0-9]{1,3})\\]){0,1}(?P<BuyerUser>.*){0,1})\\nEnd At: (?P<End>.*)\\nStatus: (?P<Status>.*)(\\n)*(?s:.*)",
"rule": "^Lot #(?P<Lot>[0-9]+) : (?P<Item>.*)\\n(Quality: (?P<Quality>.*)\\n){0,1}(Condition: (?P<Cond>.*)\\n){0,1}(Modifiers:\\n(?P<Mod>( .*\\n)*)){0,1}Seller: (?P<SellerCastle>[🐉🦅🐺🦈🦌🥔🌑])( ){0,1}(\\[(?P<SellerGuild>[A-Z0-9]{1,3})\\]){0,1}(?P<SellerUser>.*){0,1}\\nCurrent price: (?P<Price>[0-9]+) pouch\\(es\\)\\nBuyer: (None|(?P<BuyerCastle>[🐉🦅🐺🦈🦌🥔🌑])( ){0,1}(\\[(?P<BuyerGuild>[A-Z0-9]{1,3})\\]){0,1}(?P<BuyerUser>.*){0,1})\\nEnd At: (?P<End>.*)\\nStatus: (?P<Status>.*)(\\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<Guild>[A-Z0-9]{1,3})\\]){0,1}(?P<Attacker>.*). As he was crawling away, you picked up some of the gold he left behind. Received (?P<Gold>[0-9]+) gold and (?P<Exp>[0-9]+) exp.$",
"rule": "^You successfully defeated (\\[(?P<Guild>[A-Z0-9]{1,3})\\]){0,1}(?P<Attacker>.*). As he was crawling away, you picked up some of the gold he left behind.*(\n){0,1}Received (?P<Gold>[0-9]+) gold and (?P<Exp>[0-9]+) exp.$",
"msg_type": "msg_pillage_win",
"chat_id": 0,
"user_id": 0

1
def.go
View File

@ -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"`

1
msg.go
View File

@ -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}"))