disable autopair and desk fix
Some checks failed
CI / check-clang-format (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / build-linux (push) Has been cancelled

This commit is contained in:
simio 2025-03-30 18:21:10 -03:00
parent ee63a16c22
commit 2de7793c33
4 changed files with 18 additions and 2 deletions

View File

@ -152,6 +152,7 @@ const QMap<QString, AOClient::CommandInfo> AOClient::COMMANDS{
{"kick_other", {{ACLRole::NONE}, 0, &AOClient::cmdKickOther}}, {"kick_other", {{ACLRole::NONE}, 0, &AOClient::cmdKickOther}},
{"jukebox_skip", {{ACLRole::CM}, 0, &AOClient::cmdJukeboxSkip}}, {"jukebox_skip", {{ACLRole::CM}, 0, &AOClient::cmdJukeboxSkip}},
{"desk", {{ACLRole::NONE}, 0, &AOClient::cmdDesk}}, {"desk", {{ACLRole::NONE}, 0, &AOClient::cmdDesk}},
{"autopair", {{ACLRole::NONE}, 0, &AOClient::cmdAutopair}},
{"play_ambience", {{ACLRole::NONE}, 1, &AOClient::cmdPlayAmbience}}}; {"play_ambience", {{ACLRole::NONE}, 1, &AOClient::cmdPlayAmbience}}};
void AOClient::clientDisconnected() void AOClient::clientDisconnected()

View File

@ -103,6 +103,7 @@ class AOClient : public QObject
QString getIpid() const; QString getIpid() const;
bool hide_desk = false; bool hide_desk = false;
bool autopair = true;
/** /**
* @brief Getter for the client's HWID. * @brief Getter for the client's HWID.
@ -700,6 +701,7 @@ class AOClient : public QObject
*/ */
void cmdLogin(int argc, QStringList argv); void cmdLogin(int argc, QStringList argv);
void cmdDesk(int argc, QStringList argv); void cmdDesk(int argc, QStringList argv);
void cmdAutopair(int argc, QStringList argv);
/** /**
* @brief Starts the authorisation type change from `"simple"` to `"advanced"`. * @brief Starts the authorisation type change from `"simple"` to `"advanced"`.

View File

@ -554,3 +554,15 @@ void AOClient::cmdDesk(int argc, QStringList argv)
sendServerMessage("Mostrando escritorio."); sendServerMessage("Mostrando escritorio.");
} }
} }
void AOClient::cmdAutopair(int argc, QStringList argv)
{
Q_UNUSED(argc);
Q_UNUSED(argv);
autopair = !autopair;
if(autopair){
sendServerMessage("Emparejando automaticamente en wit.");
}else{
sendServerMessage("Dejando de emparejar automaticamente en wit.");
}
}

View File

@ -84,6 +84,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
<< "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; client.hide_desk = l_incoming_deskmod == "0" || client.hide_desk;
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!**
// A proper solution would be to deprecate chat as an argument on the clientside // A proper solution would be to deprecate chat as an argument on the clientside
@ -304,7 +305,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
} }
bool autopaired = false; bool autopaired = false;
if (!l_pairing) { if (!l_pairing) {
if (client.m_pos == "wit" && area->status() != AreaData::Status::CASING) { if (client.autopair && client.m_pos == "wit" && area->status() != AreaData::Status::CASING) {
int pair_index = -1; int pair_index = -1;
for (int i = 0; i < 2; ++i) { for (int i = 0; i < 2; ++i) {
if (area->m_autopair[i] == client.m_char_id) { if (area->m_autopair[i] == client.m_char_id) {
@ -331,7 +332,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
continue; continue;
} }
AOClient *l_client = client.getServer()->getClientByID(l_client_id); AOClient *l_client = client.getServer()->getClientByID(l_client_id);
if (l_client->m_char_id == l_other_charid && l_client->m_pos == client.m_pos) { if (l_client->m_char_id == l_other_charid && l_client->autopair && l_client->m_pos == client.m_pos) {
client_found = true; client_found = true;
autopaired = true; autopaired = true;
l_other_name = l_client->m_current_iniswap; l_other_name = l_client->m_current_iniswap;