Feature - Rejected Adding a /kolmafia chat channel by extending api.php with CDMoyer's help

Ulti

Member
The idea to my request is to have an extra chat channel added to the game (e.g. /kolmafia) where players running kolmafia can chat with each other (by means of a 3rd party server) with their KoL usernames . The "channel" would display in-game like all other channels and would show the usernames of the users in the channel. All players running kolmafia by default would not be listening to the channel. They gain access to the channel by /l kolmafia. Since it is a fake channel from the game's perspective you cannot switch to it -- only listen to it.

The main issue would be authenticating users. For this, I believe the best way would be to bother CDMoyer, linking him to my thread here, to implement a way for api.php to generate a read-only session to correspond to your signed in session.

Thus a request to api.php?what=generate-read-only-session would generate a random readonly session e.g. 767a59512f9f87e407409920ec7154db.
A second call would generate the same hash until the user's PHPSESSID changes when they log out and back in.
The 3rd party server would make a request to api.php?what=authenticate-read-only-session
And send the read-only session as a cookie: READONLYSESSION=767a59512f9f87e407409920ec7154db.
It would response with a JSON:
Code:
{
"valid":true,
"username":"Ultibot",
"userid":1487928
}
Then the 3rd party would trust the result of the JSON. Thus if Ultibot tried to type "hello" to /kolmafia, we would initate an HTTP Request through KoLMafia to example.com/?msg=hello&lastseen=1366592881575 with a cookie set: READONLYSESSION=767a59512f9f87e407409920ec7154db
And the /kolmafia channel would ping example.com/?lastseen=1366592957902 on an interval to check for new messages.
Etc

It will take a while to get CDMoyer's cooperation... but once that is solved, hopefully by your efforts, is this a feature we could look forward to?
 

lostcalpolydude

Developer
Staff member
I don't think there's much use for this feature.

Even if it's ultimately decided that this is a good idea, at first glance it seems complicated. No active developer knows mafia's chat code very well right now. If they did, then a better starting point would be proper support for new chat.
 
Top