Mark AFK players in the player list (#390)
* Mark AFK players in the player list * it works now * remove accidental net debug
This commit is contained in:
parent
3ddd53e121
commit
1c13786214
@ -198,6 +198,9 @@ void AOClient::handlePacket(AOPacket *packet)
|
||||
if (m_is_afk)
|
||||
sendServerMessage("You are no longer AFK.");
|
||||
m_is_afk = false;
|
||||
if (characterName().endsWith(" [AFK]")) {
|
||||
setCharacterName(characterName().remove(" [AFK]"));
|
||||
}
|
||||
m_afk_timer->start(ConfigManager::afkTimeout() * 1000);
|
||||
}
|
||||
|
||||
@ -556,8 +559,10 @@ bool AOClient::isSpectator() const
|
||||
|
||||
void AOClient::onAfkTimeout()
|
||||
{
|
||||
if (!m_is_afk)
|
||||
if (!m_is_afk) {
|
||||
sendServerMessage("You are now AFK.");
|
||||
setCharacterName(characterName() + " [AFK]");
|
||||
}
|
||||
m_is_afk = true;
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,6 @@ QStringList AOClient::buildAreaList(int area_idx)
|
||||
char_entry.insert(0, "[CM] ");
|
||||
if (m_authenticated)
|
||||
char_entry += " (" + l_client->getIpid() + "): " + l_client->name();
|
||||
if (l_client->m_is_afk)
|
||||
char_entry += " [AFK]";
|
||||
entries.append(char_entry);
|
||||
}
|
||||
}
|
||||
|
@ -387,6 +387,7 @@ void AOClient::cmdAfk(int argc, QStringList argv)
|
||||
|
||||
m_is_afk = true;
|
||||
sendServerMessage("You are now AFK.");
|
||||
setCharacterName(characterName() + " [AFK]");
|
||||
}
|
||||
|
||||
void AOClient::cmdCharCurse(int argc, QStringList argv)
|
||||
|
Loading…
Reference in New Issue
Block a user