New Content - Implemented KoLmafia doesn't fully support KoL's built-in tabbed chat

fianor

Member
I assume you all can see the update also. Mafia chat window is working the same as always, but now the new tabbed chat in the relay browser is mostly inoperative with the new update. When I type it does send my chats to the appropriate channel, but I only see what is said in any channel in the mafia window, including what I type in the relay pane.
 

lostcalpolydude

Developer
Staff member
For now you can change KoL to use Older Chat to get mafia chat working again. That doesn't mean this shouldn't be supported, obviously.
 

Grotfang

Developer
It's well past midnight and I can't spend long on this. I've got chat working in the new system, but it is filthy code. Literally just doing what was needed to make it work.

THIS PATCH BREAKS OLD CHAT. It also breaks the Mafia chat client. This is because I currently hijack the old ChatRequest for submitnewchat, adding the j=1 field every time, which is only applicable to the new client. I think the software needs to work out which client you are on from the relay request.

If someone can do the rejex, the presence or absence of j=1 at the end of the relay browser request would tell us whether they are using tabbed or untabbed chat, and from that we could branch the request accordingly, with processing handled separately too, since the response values are different too. I haven't looked into that -- currently I am bypassing most of our chat handling and just passing server responses straight through.

I can probably look at this more tomorrow evening.
 
Last edited:

Grotfang

Developer
I think this new patch allows all the various interfaces to work and old-style chat (and the mafia chat client) will be parsed and logged properly. The next step is to set up the parser to handle the new formatting, but I may well not look at that until later this week (not necessarily tomorrow, or even the day after).

Could someone who compiles from source just patch their version with the attachment below and confirm it works for them before I commit it?
 

Attachments

  • LessBreakyChat.patch
    2.7 KB · Views: 55

Grotfang

Developer
Okay... I've tested this out a bit and I can at least assert that it's probably better than the current setup. The only thing that might be an issue is if you have the mafia chat open at the same time as the relay browser chat in tabbed chat mode.

r10851
 

Bale

Minion
The only thing that might be an issue is if you have the mafia chat open at the same time as the relay browser chat in tabbed chat mode.

Still won't allow me to open chat in the relay browser even though I did not open mafia's chat window.
 

Donavin69

Member
I have both open just fine, the only strange thing is that whatever I type in the relay browser isn't shown in the mafia chat...

My messages through the relay browser also aren't logged in the mafia log...but at least I can quit telling everyone in the clan that there will be a fix for mafia, it works!
 

Bale

Minion
I see that this works in IE & Firefox. It does not work in Opera.

Please fix for opera!
 

Grotfang

Developer
I see that this works in IE & Firefox. It does not work in Opera.

Please fix for opera!

So, current issues that need fixing are:

  1. Test and fix for Opera (and maybe Chrome?)
  2. Integrate old and new chat systems in mafia chat. Using the new system in the relay browser shouldn't prohibit you using the old system at the same time.
  3. Build a parser to log chat under the new system.

The biggest challenge I can see is integrating the two. What I'm currently thinking is to have a similar setup as we do at the moment where we maintain an internal list of messages we receive that we then pass on when requested. The only downside is that I can see us having to pass messages on twice - once to the relay browser and once to the internal client, since one request happens via a relay request and the other happens through the chat poller. What I really need to do is find a way to integrate the browser and the poller properly, so that having both open doesn't lead to us sending two requests for chat messages to the KoL's server constantly.

EDIT: (Idea!)

What we could do is to use the relay browser as a prompt to open the poller, using the new system exclusively through the poller. I don't see a good reason for mafia to maintain the old system natively, and if I build a parser, using the old setup in the relay browser should be readily convertable for mafia's internal use. If the poller starts up and sends requests itself, we can then intercept the relay request and forward on the messages that the relay browser is yet to see. The poller can automagically update mafia's chat and keep a list of messages in the appropriate format to be sent on when the relay browser submits them.
 
Last edited:

Grotfang

Developer
I see that this works in IE & Firefox. It does not work in Opera.

Please fix for opera!

Okay, I'm confused. It's open in Opera and working fine for me. I'm sorry, but I need more info from you - what's not working and is it unrelated to the known problem of having the mafia chat client open at the same time?
 

Bale

Minion
Problem solved. I beleive it was a KoL bug and I found the way to work around it. Description below.

Using Opera, I start KoLmafia and then open the relay browser. Chat options have already been set to "Modern Chat (with Tabs)". I then click on "Enter the Chat" in the right side panel. The panel turns white and a chat box opens at the bottom and then it freezes like that, without anyplace to display messages or any tabs.

That was the problem as I originally knew it, but I just discovered something interesting. By fiddling with the chat options I can make it work: If I uncheck "Send events (green messages) to the active tab" then the chat works! Alternately I can uncheck "Combine all channels in the main tab". The problem only occurs when I don't combine channels and I do send events to the main tab.

For the sake of completeness I decided to list my chat tabs. Maybe it will even be relevant to solving the problem. My chat channels are: trade, haiku, hardcore, hauntedhouse. I figure that while it is neat to still have hantedhouse, it is tough for you to replicate. I can't ever get that back on my list again, but I'll make it easy. Goodbye hauntedhouse. Oh bugger me with a fork, it works now.

Problem solved.
 
Last edited:

Bale

Minion
I can see chat in the relay browser that I'm no longer listening to the channel, so I think so.
 

Grotfang

Developer
Hi folks,

Just bumping this to

a) Keep me on my toes; and
b) Give you a quick update on where I'm at.

Bale -- still can't replicate your issue and I have /hauntedhouse open and working just fine. I've been using it to test the /announce feature :). However, that doesn't mean it's not an issue -- all sorts of things have been brought to my attention and most of them seem to be KoL bugs rather than mafia's (specially since we currently just forward requests back and forth in the relay browser...). The bugs I am aware of are:

1) Chat printing repeated KoL away messages in firefox (every 30 seconds after 15 minutes have passed) -- reported by TurtleBomb13/TurtleX.
2) Bale's report of events making the chat pane freeze in Opera.
3) Chat stopping updating (seems to effect multiple browsers) reported on the forums.

If there are people on here who are experiencing these bugs routinely (as in, you can replicate them on demand), I would love it if you could post the chat frame's source code on here so I can see if there are javascript differences that can explain it. Remember, it is not the source code for the whole page I need, just the chat frame (right click > this frame > view frame source).

More general update -- I've written classes for each of the message types KoL deals with and have used the JSONObject, etc classes from JSON.org to adapt the parser. This has turned into quite a big project, but I think I'm getting there!
 

Bale

Minion
My bug sometimes appears, though no longer reliably. Curiously I can make chat finish initializing by typing /help in the chat box.
 

Grotfang

Developer
My bug sometimes appears, though no longer reliably. Curiously I can make chat finish initializing by typing /help in the chat box.

Is this mafia-specific, or does it happen in vanilla KoL too? I'm kinda curious as to what is causing problems, but I am doubtful I will fix it for the time being if it is errors in the javascript KoL sends through (or something similar). At the moment that script seems to be changing slightly every couple of days, so I want to wait until CDMoyer has sorted things out himself before jumping into anything.

The most crucial thing from my perspective is that the new GET requests (the ones using j=1) work consistently, since I am likely to move all of our chat over to that soon.
 

Bale

Minion
Is this mafia-specific, or does it happen in vanilla KoL too? I'm kinda curious as to what is causing problems, but I am doubtful I will fix it for the time being if it is errors in the javascript KoL sends through (or something similar). At the moment that script seems to be changing slightly every couple of days, so I want to wait until CDMoyer has sorted things out himself before jumping into anything.

This has never happened to me in vanilla KoL. Even when it was happening every single time it never happened when I tried it in vanilla KoL. It also never happened in IE or Firefox. Now it is not so reliably reproducible.
 

Grotfang

Developer
Just had an interesting moment -- went in to Opera and experienced a similar issue to the one you were describing, Bale. I refreshed the browser and the problem disappeared. I assume therefore that my encounter with this was due to a cached script somewhere. Now it works fine as per usual.

http://dl.dropbox.com/u/2477024/OperaChat.png

Could you confirm this bug stays the same for you after using the refresh button?

Sorry for pulling back to such basic questions, but these bugs are killing me! I genuinely can't suss out why they are happening. Mafia is forwarding requests to and fro -- that is literally it. Grr!

EDIT: Should add in case it isn't obvious -- in the image above I have separated out the messages and am sending events to the active tab, as per Bale's description.
 
Last edited:

Bale

Minion
It used to stay the same when I used the refresh button. Now on those rare occasions when it occurs refresh will sometimes, but not always fix it.
 
Top