New Content - Implemented Chat Change?

Sentrion

Member
I may be mistaken, but I believe a change to chat was made in KoL, which affects mafia. Last night, my mafia-run bots were working fine, but this morning, I noticed that they weren't, despite nothing having changed on my end. One thing to note was that private messages being received don't show up in their proper tabs (I use mafia's chat rather than relay), and instead show up in all tabs as "Player (private): message" in green. Without doing any testing aside from trying to get my bots' normal functions to work via PM, I believe that none of these PMs are being received correctly by chatbotScript. Hopefully I'm not on drugs and someone else running a mafiaBot can confirm this for me (although, anybody using mafia's chat should be able to see how PMs seem to have changed).

Edit: As I suspected, a change was made to try and fix a known problem in KoL: http://forums.kingdomofloathing.com/vb/showpost.php?p=3918865&postcount=38
 

Veracity

Developer
Staff member
I love it how KoL server side changes turn into KoLmafia "Bugs" when they are reported here.
 

Theraze

Active member
Should these sort of things go into new content as well, or is new content reserved for the items/monsters/areas that are added?
 

slyz

Developer
This is the HTML for a private message:
Code:
<a target="mainpane" href="showplayer.php?who=1507094"><font color="blue"><b>Deandra (private):</b></font></a> <font color="blue">hello!</font><br>
Apparently ChatParser.parseLine() looks for "(private)<", it should now look for "(private):<".

This at leasts put received PMs in their own tab in the Mafia chat.

Maybe ChatParser.parsePrivateReceiveMessage() would use some examination too, but just adding a semi-colon on line 248 seems to have done the trick.


EDIT: something else needs to be changed I think. I made a simple chatbotScript that saves PMs in a data file and asked someone to send me "hello!" by PM. The script saved the string "</a></b> hello!".

EDIT2: see new patch in my next post.
 
Last edited:

slyz

Developer
Here is a new patch which also removes the "</a></b>" from private messages. It doesn't change much for the Mafia chat, but at least chatbotScripts should now receive private messages without that HTML.

Maybe Grotfang will be able to implement a more elegant fix though.
 

Attachments

  • PrivateMessage.patch
    787 bytes · Views: 25

Grotfang

Developer
Maybe Grotfang will be able to implement a more elegant fix though.

Nope. That uses the same method we always have to parse methods and seems to work perfectly. My chatbotScript PM logger shows the message perfectly. Many thanks.

Committed r9283
 
Top