Bug - Fixed Ignore fake item acquisition messages when PvPing

sporkboy

New member
Running v15.7 r11611

During "pvp loot", the CLI log showed:

Attack 10 of 29
You gain a little swagger
You challenged Lost and won the PvP fight
Attack 11 of 29
Unrecognized item found: SporkBoy gained fame:
You acquire an item: crazy bastard sword SporkBoy gained fame:
You gain a little swagger
You challenged The Chort and won the PvP fight
Attack 12 of 29
You gain a little swagger
You challenged El Acordeonachi and won the PvP fight

(color added for emphasis). The huggler archive shows that those three fights gave me a flower, an orcish meat locker, and a corpse on the beach.
 

lostcalpolydude

Developer
Staff member
The easy way to prevent that is to not parse that page for item acquisition (that's how it is normally handled), but that would make it also not pick up items that you steal in pvp.
 

roippi

Developer
Code:
        if ( urlString.startsWith( "mall.php" ) ||
            urlString.startsWith( "searchmall.php" ) ||
            urlString.startsWith( "account.php" ) ||
            urlString.startsWith( "records.php" ) ||
            ( urlString.startsWith( "peevpee.php" ) && this.getFormField( "lid" ) != null ) )
        {
            // These pages cannot possibly contain an actual item
            // drop, but may have a bogus "You acquire an item:" as
            // part of a store name, profile quote, familiar name, etc.
            this.containsUpdate = false;
        }

Guess something's not working as intended? What's the "lid" formfield?
 

lostcalpolydude

Developer
Staff member
Viewing an archived fight result, which could have been a fight from weeks ago potentially or could be the same fight viewed 50 times. That is doing exactly what I intended it to do, with the limitation I would expect.

If you attack someone for loot or flowers, the page will have a legitimate item gain message (if you win), which should be parsed (you will see the page exactly once). The same page also has messages generated by other people, which can apparently be incorrectly parsed as acquiring an item.
 

lostcalpolydude

Developer
Staff member
I wonder if checking for a <b> tag before "You acquire" would eliminate all of those cases without resulting in false negatives.
 

syrinxlui

Member
Parsing PvP Fights

Mafia tries to parse this pvp message as an item:

Lightwolf said: You acquire an item: ';..;'

Here is the text from the CLI:

Attack 3 of 21
Unrecognized item found: You gain a little swagger
You acquire an item: ';..;' You gain a little swagger
You challenged Lightwolf and won the PvP fight, 3 to 2!

Props to Lightwolf for being so clubby.
 

Lxndr

Member
Pvp Baio?

I have bolded the part that is confusing to me.
My inventory obviously has no Baio.

> swagger

Attack 1 of 29
You gain a little swagger
You challenged Skippito Friskito and won the PvP fight
Attack 2 of 29
Unrecognized item found: Lxndr gained fame:
You acquire an item: Talisman of Baio Lxndr gained fame:
You gain a little swagger
You challenged drdr and won the PvP fight
Attack 3 of 29
You gain a little swagger
You challenged sceptre boy and lost the PvP fight
Attack 4 of 29
You gain a little swagger
You challenged SchrodingerCat and won the PvP fight
Attack 5 of 29
You gain a little swagger
You challenged MMGdW and won the PvP fight
Attack 6 of 29
You gain a little swagger
You challenged Onion and won the PvP fight
Attack 7 of 29
You gain a little swagger
You challenged mat9h and lost the PvP fight
Attack 8 of 29
You gain a little swagger
You challenged Comicality and won the PvP fight
Attack 9 of 29
You gain a little swagger
You challenged Jererry and won the PvP fight
Attack 10 of 29
You gain a little swagger
You challenged weakandweary and won the PvP fight
Attack 11 of 29
You gain a little swagger
You challenged Sniper 101 and lost the PvP fight
Attack 12 of 29
You gain a little swagger
You challenged Gargamelli and lost the PvP fight
Attack 13 of 29
You gain a little swagger
You challenged starspiritgeno and won the PvP fight
Attack 14 of 29
You gain a little swagger
You challenged Madison14 and lost the PvP fight
Attack 15 of 29
You gain a little swagger
You challenged Gruddlefitt and lost the PvP fight
Attack 16 of 29
You gain a little swagger
You challenged Gruddlefitt and lost the PvP fight
Attack 17 of 29
You gain a little swagger
You challenged forsureman and won the PvP fight
Attack 18 of 29
You gain a little swagger
You challenged Woods415 and lost the PvP fight
Attack 19 of 29
You gain a little swagger
You challenged Demonsquiggle and won the PvP fight
Attack 20 of 29
You gain a little swagger
You challenged Deus Ex Machina and lost the PvP fight
Attack 21 of 29
You gain a little swagger
You challenged Gargamelli and won the PvP fight
Attack 22 of 29
You gain a little swagger
You challenged Aevylmar and lost the PvP fight
Attack 23 of 29
You gain a little swagger
You challenged Mookster and lost the PvP fight
Attack 24 of 29
You gain a little swagger
You challenged Tectle and lost the PvP fight
Attack 25 of 29
You gain a little swagger
You challenged Divine Jester and lost the PvP fight
Attack 26 of 29
You gain a little swagger
You challenged stuffandthings and won the PvP fight
Attack 27 of 29
You gain a little swagger
You challenged Velcrow and won the PvP fight
Attack 28 of 29
You gain a little swagger
You challenged AbrahamDrinkin and won the PvP fight
Attack 29 of 29
You gain a little swagger
You challenged Tectle and lost the PvP fight
You have 0 attacks remaining.
 

Cool12309

Member
Someone could place a "You acquire an item: 1 Meat" in their lose message and it will trick mafia:

Attack 15 of 28
Unrecognized item found: Cool12309 gained fame:
You acquire an item: 1 Meat Cool12309 gained fame:
You gain a little swagger
You challenged kirByllAmA and won the PvP fight

Perhaps it should just ignore the message they say.
 

Theraze

Active member
I thought that was already ignored due to the sword messages... does that not go for fake-meat as well as fake-items?
 

Darzil

Developer
Code:
        if ( urlString.startsWith( "mall.php" ) ||
            urlString.startsWith( "searchmall.php" ) ||
            urlString.startsWith( "account.php" ) ||
            urlString.startsWith( "records.php" ) ||
            ( urlString.startsWith( "peevpee.php" ) && this.getFormField( "lid" ) != null ) )
        {
            // These pages cannot possibly contain an actual item
            // drop, but may have a bogus "You acquire an item:" as
            // part of a store name, profile quote, familiar name, etc.
            this.containsUpdate = false;
        }

Guess something's not working as intended? What's the "lid" formfield?

I can't find this in the code, are we no longer doing these checks?

I'm guessing a simple 'nearly' fix (given people can add all sorts of html to confuse us and match regex if they really want to) would be to not check for items other than pretty and burnt flowers if we aren't attacking for items.
 

lostcalpolydude

Developer
Staff member
Instead of using standard item drop parsing, regex to check for it and handle it separately would probably work. People can't add HTML, so it should be manageable.
 

Darzil

Developer
I'll try in aftercore when I reach it on Sunday/Monday, if no one does before, and if I remember. Will want to be able to hit for items to test. Lets hope Veracity doesn't get picked as my target so she ignores me.
 

Veracity

Developer
Staff member
You can let KoL pick your target for flowers or fame, but don't you have to intentionally pick a target for items?
 

Bale

Minion
You can just randomly loot. If you do that sort of thing. Picking a target and your objective are separate options.
 
Top