disable autopair and desk fix
This commit is contained in:
parent
ee63a16c22
commit
2de7793c33
@ -152,6 +152,7 @@ const QMap<QString, AOClient::CommandInfo> AOClient::COMMANDS{
|
||||
{"kick_other", {{ACLRole::NONE}, 0, &AOClient::cmdKickOther}},
|
||||
{"jukebox_skip", {{ACLRole::CM}, 0, &AOClient::cmdJukeboxSkip}},
|
||||
{"desk", {{ACLRole::NONE}, 0, &AOClient::cmdDesk}},
|
||||
{"autopair", {{ACLRole::NONE}, 0, &AOClient::cmdAutopair}},
|
||||
{"play_ambience", {{ACLRole::NONE}, 1, &AOClient::cmdPlayAmbience}}};
|
||||
|
||||
void AOClient::clientDisconnected()
|
||||
|
@ -103,6 +103,7 @@ class AOClient : public QObject
|
||||
QString getIpid() const;
|
||||
|
||||
bool hide_desk = false;
|
||||
bool autopair = true;
|
||||
|
||||
/**
|
||||
* @brief Getter for the client's HWID.
|
||||
@ -700,6 +701,7 @@ class AOClient : public QObject
|
||||
*/
|
||||
void cmdLogin(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"`.
|
||||
|
@ -553,4 +553,16 @@ void AOClient::cmdDesk(int argc, QStringList argv)
|
||||
}else{
|
||||
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.");
|
||||
}
|
||||
}
|
@ -84,6 +84,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
||||
<< "5";
|
||||
QString l_incoming_deskmod = l_incoming_args[0].toString();
|
||||
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)) {
|
||||
// **WARNING : THIS IS A HACK!**
|
||||
// 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;
|
||||
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;
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
if (area->m_autopair[i] == client.m_char_id) {
|
||||
@ -331,7 +332,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
||||
continue;
|
||||
}
|
||||
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;
|
||||
autopaired = true;
|
||||
l_other_name = l_client->m_current_iniswap;
|
||||
|
Loading…
Reference in New Issue
Block a user