Feature - Implemented Chat idling shows as offline

Sentrion

Member
Possibly a bug, but I hate reporting bugs when they're not actually bugs, so I marked this as a feature request.

The ash function is_online currently returns false for any players who have idled in chat (recall that the idling system was changed a few months ago). Can this be fixed to show them as online, please?
 

Veracity

Developer
Staff member
For reference:

When I do /whois player, I see a line naming the player, the player id, and the class. This is followed by one of 4 things:

(nothing)
-> the player is not logged in

Online, not in chat
-> This player is currently online.

Online, in chat
-> This player is currently online in channel clan.

Idle in chat
-> This player is currently away from KoL in channel trade and listening to clan.

Perhaps you can be idle and not in chat. If so, it probably just says "This player is currently away from KoL."

The current online check used by KoLmafia:

Code:
	public static boolean isPlayerOnline( final String player )
	{
		String text = KoLmafia.whoisPlayer( player );
		return text != null && text.indexOf( "online" ) != -1;
	}
 

Theraze

Active member
So... changing the check from "online" to "currently" (or "This player is currently", if you want a more definite check) would fix the problem, right? Since all 3 known online statements use that, and the offline does not.
 

xKiv

Active member
Why not
Code:
		return text != null && text.indexOf( "player is not logged in" ) == -1;
instead, or a shorter variant?
 

Veracity

Developer
Staff member
Why not
Code:
		return text != null && text.indexOf( "player is not logged in" ) == -1;
instead, or a shorter variant?
I realize I said

(nothing)
-> the player is not logged in

but to be consistent, I should have said

Not logged in
-> (nothing)

In other words, KoL never actually says "This player is not logged in".

I am not completely sure about this, because KoL now seems to have three states:

not logged in
"online" (logged in and active)
"away from KoL" (logged in and idle)

You are requesting that is_online() include both "online" (in the KoL sense) and "away from KoL". In other words, "logged in".

Fair enough, I guess.

Revision 10259
 
Top