This commit is contained in:
simio 2025-05-18 08:45:49 -03:00
parent 2de7793c33
commit c6e8d81bc8
2 changed files with 5 additions and 1 deletions

View File

@ -539,6 +539,8 @@ class AOClient : public QObject
*/ */
bool m_authenticated = false; bool m_authenticated = false;
bool m_spoke = false;
/** /**
* @brief The ACL role identifier, used to determine what ACL role the client is linked to. * @brief The ACL role identifier, used to determine what ACL role the client is linked to.
*/ */

View File

@ -83,7 +83,8 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
<< "4" << "4"
<< "5"; << "5";
QString l_incoming_deskmod = l_incoming_args[0].toString(); QString l_incoming_deskmod = l_incoming_args[0].toString();
client.hide_desk = l_incoming_deskmod == "0" || client.hide_desk; bool wit_joined_while_area_idle = !client.m_spoke && l_incoming_args[5].toString().replace("../", "").replace("..\\", "") == "wit" && area->status() != AreaData::Status::CASING;
client.hide_desk = wit_joined_while_area_idle;
if(client.hide_desk) l_incoming_deskmod = "0"; if(client.hide_desk) l_incoming_deskmod = "0";
if (allowed_desk_mods.contains(l_incoming_deskmod)) { if (allowed_desk_mods.contains(l_incoming_deskmod)) {
// **WARNING : THIS IS A HACK!** // **WARNING : THIS IS A HACK!**
@ -130,6 +131,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
QString l_incoming_msg = client.dezalgo(l_incoming_args[4].toString().trimmed()); QString l_incoming_msg = client.dezalgo(l_incoming_args[4].toString().trimmed());
QRegularExpressionMatch match = isTestimonyJumpCommand(client.decodeMessage(l_incoming_msg)); QRegularExpressionMatch match = isTestimonyJumpCommand(client.decodeMessage(l_incoming_msg));
bool msg_is_testimony_cmd = (match.hasMatch() || l_incoming_msg == ">" || l_incoming_msg == "<"); bool msg_is_testimony_cmd = (match.hasMatch() || l_incoming_msg == ">" || l_incoming_msg == "<");
client.m_spoke = true;
if (!client.m_last_message.isEmpty() // If the last message you sent isn't empty, if (!client.m_last_message.isEmpty() // If the last message you sent isn't empty,
&& l_incoming_msg == client.m_last_message // and it matches the one you're sending, && l_incoming_msg == client.m_last_message // and it matches the one you're sending,
&& !msg_is_testimony_cmd) // and it's not a testimony command, && !msg_is_testimony_cmd) // and it's not a testimony command,