Bug - Fixed Native Mafia Chat not rainbow for Holiday Fun!

seeing the Holiday Fun, yay!

But still seeing this:

Code:
20:15] System Message: The system will go down for nightly maintenance in 15 minutes.
[20:15] [radio] Sheepdip: logitech?
[20:20] System Message: The system will go down for nightly maintenance in 10 minutes.
[20:20] [wizards] Ninamo: gg

Sorry to be the bearer of news.

I seriously appreciate the effort you are putting into this.
 
When chat polls for messages, KoL returns all messages - events, system messages, private messages, channel messages - that have been posted since the last poll. We split the response text into individual ChatMessages. It's not quite as easy as "one line per message", since, apparently, every message in /haiku is three lines. Since I've never actually been in that channel, I can't say I've seen it.

Looking at your report, it looks like when the poll includes a System Message, the following line - normal channel messages, in the example you gave - is considered to be part of the same message and thus both lines are send to the [Events] tab. This doesn't happen if we strip out all fonts before splitting the response into messages, but does if we don't do that.

I'm not seeing any issue with normal Event messages or private messages - but a System Message is, apparently, a "channel" message (as are Mod Announcement and Mod Warning messages - which I have never, ever seen in my time in KoL since I never, ever go in to moderated chat channels.)

I took a multi, started up the chat GUI, /listen to newbie and hardcore and haiku, and am letting him sit there idle. I figure those first two channels will generate enough traffic to have a good chance of having a message get glommed on to a System Message, should one arrive - especially with the reduced polling rate in "away" mode. And I am curious to see what a message from channel haiku looks like.

He's running with DEBUG logging turned on: no browser interactions, no decorated responses, yes chat messages. I am completely dependent on KoL giving me a System Message. I know they will start at 10 PM my time, but we can hope there will be one earlier than that.

I can't solve this issue without seeing a System Message followed by a channel message in the same response, so, let's hope this will do it. Eventually.
 
Just go into /trade and start babbling about sports or something. You'll get a mod message very quickly. Just don't read what people are saying.

Jokes aside. /trade has lots of system messages from mods.
 
Been in there for almost 4 hours. No mod messages. On the other hand, I found this amusing:

[16:40] Shoo86: selling ghost pencils, skull capacitor, UKS outfit piece, and taking reservations on ZHOA items. PM me!
[16:46] Shoo86: mellinm ghmsm penmmls, skuml mammcitmr, UMM outmit piece, and makmng memervations on ZMOM mtemm. MM me! -hic-
 
Don't worry about it. At worst, it is another channel with (some) traffic, to improve the chances of multiple messages getting glommed together. At best, I'll get to see a mod message and see if there is anything different about them, much as there seems to be something different about System messages. (when you fetch messages with mchat, rather than lchat, protocol, they all get tagged as type "system")
 
I would guess that green messages in clan dungeon channels (which I believe can be done by anyone that can admin clan dungeons, though I don't remember how) have the same format as mod messages.
 
That was a lot harder to find than I expected. The command is "/ann", but they don't show up in the CLI, so it doesn't seem to work for recreating this bug.
 
Here is a System Message:

Code:
<font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=1833465"><font color=black>Zunkin</font></b></a>: I tend to watch a lot animated shorts done by individual artists or small teams. Sadly, those sorts of things almost never get the recognition they deserve.<br><font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=2256604"><font color=black>Soluzar</font></b></a>: Well, yeah. That would be close to what I'd say. Love the concept, not sure of teh execution.<br><font color=red><b><b><a target=mainpane href="showplayer.php?who=-1"><font color=red>System Message</font></b></a>: The system will go down for nightly maintenance in 15 minutes.<br></b></font><font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=2454163"><font color=black>beaverface25</font></b></a>: Eugh, SAO.<br><font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=2094466"><font color=black>Loathmast</font></b></a>: SAO is overrated.<br><!--lastseen:1390562378-->
and the line that contains it:

Code:
<font color=red><b><b><a target=mainpane href="showplayer.php?who=-1"><font color=red>System Message</font></b></a>: The system will go down for nightly maintenance in 15 minutes.<br></b></font>

Here is a Mod Warning:

Code:
<font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=2379039"><font color=black>Sp4ceHamMunchies</font></b></a>: Beep<br><font color=green>[trade]</font> <b><a target=mainpane href="showplayer.php?who=2000986"><font color=black>fortsy</font></b></a>: !*$# niggers and FAGS!<br><font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=984138"><font color=black>BoJengels</font></b></a>: boop<br><font color=green>[trade]</font> <b><a target=mainpane href="showplayer.php?who=2000986"><font color=black>fortsy</font></b></a>: niggers<br><font color=red><font color=green>[trade]</font> <b><a target=mainpane href="showplayer.php?who=21163"><font color=red>Mod Warning</font></b></a>: fortsy has been banned from the chat (1 hour).<br></font><font color=green>[newbie]</font> <b><a target=mainpane href="showplayer.php?who=2379039"><font color=black>Sp4ceHamMunchies</font></b></a>: Bloop<br><!--lastseen:1390564176-->
and the line that contains it:

Code:
<font color=red><font color=green>[trade]</font> <b><a target=mainpane href="showplayer.php?who=21163"><font color=red>Mod Warning</font></b></a>: fortsy has been banned from the chat (1 hour).<br></font>
Both are malformed HTML. Both close "b" and "font" tags AFTER the "br" tag" that ends the line.

I'll see what I can figure out.
 
Last edited:
Revision 14958 fixes both the System Message and Mod Warning, which failed for different reasons.
System Messages now show up in your current channel.
Mod Warnings now show up in the specific channel that was moderated.
Both appear in red.

I wonder if System Messages should be propagated to all channels, much as Events are?
 
Probably by accident.

The method that handles "channel" messages was supposed to detect System Messages and Mod Warnings/Announcements. Both of those come wrapped in <font color=red></font>. We used to strip out all <font></font> before looking at the message. When I made it not strip out those tags, both kinds of red messages stopped working correctly, for different reasons.

- Mod messages did not look like they had a channel, because they started with <font color=red><font color=green> and CHANNEL_PATTERN couldn't handle two fonts like that. Therefore, we interpreted them as Events, rather than as messages associated with a single channel. I strip out the red font tags that surround the whole message and voila - now they show up in red in the correct channel.

- That would probably have made System Messages work as before, too, but while debugging this, I discovered that those didn't work quite right, either. Since they did not have a green font, the single red font they were wrapped in actually did pass CHANNEL_PATTERN, but the <b> tag they are also wrapped in confused SENDER_PATTERN and we couldn't figure out who they were from. As a result, they were interpreted as Event messages and were broadcast to all channels in green, rather than being shown in the current channel in red. That is the behavior you remember. I changed the SENDER_PATTERN to allow the entire message to be wrapped in bold tags, and now they are recognized as System Messages and are shown in red in the current channel.

Now, why did both kinds of messages cause the NEXT line to also get interpreted as an event? That was a result of the malformed HTML for the red messages: the lines ended like this: <br></b></font>. We already had code to move the </b> before the <br>, but not the </font> - and the presence of that tag in the next message made it, too, not look like a "channel" message, and therefore made it an "event". I made it move the badly placed </font> tag before the <br>.

The net result of all those changes is that Mod and System messages now appear in red and appear in a single channel.

What happens in the native chat when a System message comes? If you are running lchat - no tabs - all channels are glommed into the single window and the system message is displayed there, but what if you have multiple tabs? I expect it shows it in your current tab, but does it ALSO put it in to the other tabs? Looking at mchat.js, I see this:

Code:
var whereIGo = function (msg) {
	var where = opts[msg.type == 'system' ? 'event' : msg.type];
	switch (where) {
		case 'main': 
			if (msg.type == 'public') { msg.ctag = true}; 
			return $cw;
		case 'own': return getTab(msg);
		case 'active': return $$('.chatdisplay:visible');
		//default: console.log('missing! ' + where); return $cw;
	}
};
and looking at the "opts" array, I see this:

Code:
	opts = {
		event: 'active',
		public: 'own',
		private: 'own',
		updatetitle: 0,
		showtimes: 0,
		marklast: true,
		active: "clan",
		modifier: 0,
		unreadbadges: 1,
		colortabs: 0,
		channeltag: 1,
		alwayswho: 0,
		tabsonbottom: 0,
		buffer: 500,
		foo: 1

	},
In other words, "event" messages go in to the "active" tab.

That's exactly what we do now. Of course, we do have an Events tab. We could put System Messages there as well as in the active tab. Or, as I posed, we could broadcast them to all tabs, just as we do for other Events.

As of now, our behavior should match that of mchat, which I think is acceptable. BUt I'm thinking that putting System Messages ALSO into Events would be a good idea, so you could go look at them later without having to remember which tab you were in when they arrived.
 
KoL has the setting "Send events (green messages) to the active tab (requires chat restart)". I have that disabled, and I'm pretty sure all my System Messages go just to the events tab.
 
Revision 14949 sends red System Messages to the Events tab as well as to the current channel.
I considered sending them only to the Events tab, but I think they are rare enough (and important enough) that you probably want to see them wherever you are.

Regarding events, I vaguely recall when we started making events get broadcast to all channels as well as to the Events tab. I did not use chat - either the GUI or the browser - at all at the time, so I didn't pay much attention, but it seems to be an all or nothing thing: if you have greenScreenProtection set to true (or are a buffbot), we don't display events anywhere. Otherwise, they go everywhere. I sort of wish we had the equivalent of KoL's setting; I'd be content if all green messages went ONLY to the Events tab. I vaguely remember discussion about that.
 
Revision 14960 makes it so: setting broadcastEvents (defaults to true, to mirror current behavior) determines if events get broadcast to all open chat tabs or only to the Events tab.
 
my broadcastEvents is set to 'true'
System messages, like rollover, are being shunted to Events now, instead of the prior behaviour of seeing it in every channel.

(but mod announcements are working properly)

Thank you again for your efforts on this.
 
Last edited:
Back
Top