Bug - Fixed Fun and Games with Mafia Chat when character is not literate.

fronobulax

Developer
Staff member
r8580

For unrelated reasons, I was actually going to venture into chat. However I did so using a new character created to test Ascend. This character has never visited the Altar of Literacy. My attempt to bring up the chat window resulted in repeated "blank page, complain to Jick" messages. These messages continued until I logged out.

The immediate feature request would be to not allow the user to open mafia's chat window if the Altar had not been visited. However, since IIRC mafia uses chat to see whether buffbots are on line there may be other functionality that fails if chat is unavailable.

I recognize this is an edge case and it may be better to just consider it a documentation issue - "don't attempt the following with mafia until you have manually visited the Altar of Literacy".
 

Grotfang

Developer
I'll have a poke (probably tomorrow). This will be hard for me to test though -- I don't really want to create a new character just to test this. Could you keep your character away from the alter for the time being?
 

fronobulax

Developer
Staff member
I'll have a poke (probably tomorrow). This will be hard for me to test though -- I don't really want to create a new character just to test this. Could you keep your character away from the alter for the time being?

Absolutely. The character is such an edge case. No store. No display case. No visit to the Altar (insert marriage joke here). No Terrarium until I remembered to buy one.
 

Grotfang

Developer
Try this out...

I haven't fiddled with buffbots, etc, since I don't think they'll spam chat. The problem with the repeated hits is the ChatPoller which continues hitting the page while ChatManager is logged as running.
 

Attachments

  • ChatManagerAltar.diff
    1.9 KB · Views: 46
Last edited:

fronobulax

Developer
Staff member
Patch correctly detects that character has not visited Altar but mafia still starts up a chat thread that periodically fails with a null pointer exception. The cleanest solution may be to have some kind of canChat property that determines whether the chat thread is allowed to run, or not. However that means that everyone who assumes chat is available needs to be changed to allow for the possibility that chat is no longer available. Alternatively the thread could be allowed to run but it always responds with a null or blank page if the player cannot chat. Not sure how much work is appropriate for an edge case.

If we continue working on the referenced patch we should probably do some substitutions so that it is "altar" and not "alter" unless we are changing something:)
 

Grotfang

Developer
Dammit! Consistency fail :(

Is the thread starting up just through starting chat, is it starting up earlier, or are you doing something else? I assumed that since the initialize routine will return before doing anything, it would be safe for opening chat and anything else (buffbots, etc) would just return null and cause an abort state. Clearly that was wrong, but why is it wrong?

I had initially assumed it was ChatPoller that leads to the repeated blank page issue, but the patch above should prevent Poller from... polling. Hmm... I'll have a look at an earlier stage and see what's going on.

EDIT: I've created a new character to test this, since looking over the code again has given me limited insight into what's going wrong. I think I actually need to try it myself. However, I'm not able to replicate the problem you are having. I logged in, tried to open chat and it (correctly) told me I couldn't. Then nothing. I tried using a buffbot, failed, opened chat again, it told me I couldn't, and then nothing again. In short, for me, the patch is working as I would have expected. Could you give me more details and screenshots to assist? Also, how regularly do you find the messages popping up? I waited a good five minutes and I figured that would be sufficient.
 
Last edited:

Grotfang

Developer
KoLmafiaGUI line 249:

Code:
if ( frameName.equals( "ChatManager" ) )
{
	KoLmafia.updateDisplay( "Initializing chat interface..." );

	ChatManager.initialize();
	RequestThread.enableDisplayIfSequenceComplete();

	return;
}

ChatManager.initialize() should return without doing anything, RequestThread.enableDisplayIfSequenceComplete() should also work as normal, since the initial updateDisplay() is left intact. I don't think it should start a new thread.

EDIT: Attached a patch with correct spellings :) Also, have you had a chance to look at my other chat modifications yet?
 

Attachments

  • ChatManagerAltar.diff
    1.8 KB · Views: 47
Last edited:

fronobulax

Developer
Staff member
OK. This time it behaved...

My first report had all three of your chat patches. I backed them all out and then reapplied just the misspelled version of the Altar patch. Now it works. Go figure.

I logged on and pressed the Chat icon and it behaved as expected (i.e. the patch really does work in spite of my previous experience). I then opened the Buffbot window and the checked of one was online. I got a blank page message but the response that the buffbot was probably not online. That was reasonable behavior.

I doubt that there is any interaction between the patches but I will check since the alternative explanation is operator error on my part.
 

Grotfang

Developer
My test had all of my changes too, but I would appreciate a second person checking with them applied. Cheers!
 

fronobulax

Developer
Staff member
What happens when you're banned? Does it still work?

This thread is ridiculous btw and you should feel bad

@Grotfang - the patch with the spelling fix did not take but otherwise all three played nicely for me, given that I don't have enough experience with chat to trust my testing ;-) My initial failure may have had more to do with a bottle of wine than I realized or it could have been the difference between "make" and "make clean".

@forgot - I don't understand chat enough to understand your question. Perhaps you could expand upon it, using words of three syllables or less and use nouns that match KoL or KoLmafia objects or features and not just pronouns? I sense there is a legitimate concern behind the question but I just can't articulate it well enough to address it.

Of course "This thread is ridiculous btw and you should feel bad" also makes no sense to me and suggests I might be making a mistake in trying to take your comment seriously.
 

Grotfang

Developer
What happens when you're banned? Does it still work?

This thread is ridiculous btw and you should feel bad

What happens when you are banned? I honestly don't know. I have never been banned. Try it and see, let me know and if anything goes wrong I will try and fix it. Probably by getting mafia to exit.

@Fronobulax -- my apologies, the patch should apply correctly if you do it straight to ChatManager.java, but not to the src folder. The one below will attach as normal. I do NOT know what is going on with me lately... By the way, have you tried the altaration (hehe :)) with the other patches applied again?
 

Attachments

  • ChatManagerAltar.diff
    1.9 KB · Views: 18
Top