hide desk + pair desk hide
This commit is contained in:
parent
77b4b6c029
commit
69f0507e0b
@ -151,6 +151,7 @@ const QMap<QString, AOClient::CommandInfo> AOClient::COMMANDS{
|
|||||||
{"toggle_shouts", {{ACLRole::CM}, 0, &AOClient::cmdToggleShouts}},
|
{"toggle_shouts", {{ACLRole::CM}, 0, &AOClient::cmdToggleShouts}},
|
||||||
{"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}},
|
||||||
{"play_ambience", {{ACLRole::NONE}, 1, &AOClient::cmdPlayAmbience}}};
|
{"play_ambience", {{ACLRole::NONE}, 1, &AOClient::cmdPlayAmbience}}};
|
||||||
|
|
||||||
void AOClient::clientDisconnected()
|
void AOClient::clientDisconnected()
|
||||||
|
@ -102,6 +102,8 @@ class AOClient : public QObject
|
|||||||
*/
|
*/
|
||||||
QString getIpid() const;
|
QString getIpid() const;
|
||||||
|
|
||||||
|
bool hide_desk = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Getter for the client's HWID.
|
* @brief Getter for the client's HWID.
|
||||||
*
|
*
|
||||||
@ -697,6 +699,7 @@ class AOClient : public QObject
|
|||||||
* @iscommand
|
* @iscommand
|
||||||
*/
|
*/
|
||||||
void cmdLogin(int argc, QStringList argv);
|
void cmdLogin(int argc, QStringList argv);
|
||||||
|
void cmdDesk(int argc, QStringList argv);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Starts the authorisation type change from `"simple"` to `"advanced"`.
|
* @brief Starts the authorisation type change from `"simple"` to `"advanced"`.
|
||||||
|
@ -542,3 +542,15 @@ void AOClient::cmdFirstPerson(int argc, QStringList argv)
|
|||||||
QString l_str_en = m_first_person ? "enabled" : "disabled";
|
QString l_str_en = m_first_person ? "enabled" : "disabled";
|
||||||
sendServerMessage("First person mode " + l_str_en + ".");
|
sendServerMessage("First person mode " + l_str_en + ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOClient::cmdDesk(int argc, QStringList argv)
|
||||||
|
{
|
||||||
|
Q_UNUSED(argc);
|
||||||
|
Q_UNUSED(argv);
|
||||||
|
hide_desk = !hide_desk;
|
||||||
|
if(hide_desk){
|
||||||
|
sendServerMessage("Escondiendo escritorio.");
|
||||||
|
}else{
|
||||||
|
sendServerMessage("Mostrando escritorio.");
|
||||||
|
}
|
||||||
|
}
|
@ -82,7 +82,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
|||||||
<< "3"
|
<< "3"
|
||||||
<< "4"
|
<< "4"
|
||||||
<< "5";
|
<< "5";
|
||||||
QString l_incoming_deskmod = l_incoming_args[0].toString();
|
QString l_incoming_deskmod = client.hide_desk ? "0" : l_incoming_args[0].toString();
|
||||||
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
|
||||||
@ -91,7 +91,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
|||||||
l_args.append("1");
|
l_args.append("1");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
l_args.append(l_incoming_args[0].toString());
|
l_args.append(l_incoming_deskmod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -293,11 +293,11 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
|||||||
for (int l_client_id : area->joinedIDs()) {
|
for (int l_client_id : area->joinedIDs()) {
|
||||||
AOClient *l_client = client.getServer()->getClientByID(l_client_id);
|
AOClient *l_client = client.getServer()->getClientByID(l_client_id);
|
||||||
if (l_client->m_pairing_with == client.m_char_id && l_other_charid != client.m_char_id && l_client->m_char_id == client.m_pairing_with && l_client->m_pos == client.m_pos) {
|
if (l_client->m_pairing_with == client.m_char_id && l_other_charid != client.m_char_id && l_client->m_char_id == client.m_pairing_with && l_client->m_pos == client.m_pos) {
|
||||||
|
l_pairing = true;
|
||||||
l_other_name = l_client->m_current_iniswap;
|
l_other_name = l_client->m_current_iniswap;
|
||||||
l_other_emote = l_client->m_emote;
|
l_other_emote = l_client->m_emote;
|
||||||
l_other_offset = l_client->m_offset;
|
l_other_offset = l_client->m_offset;
|
||||||
l_other_flip = l_client->m_flipping;
|
l_other_flip = l_client->m_flipping;
|
||||||
l_pairing = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -337,6 +337,7 @@ AOPacket *PacketMS::validateIcPacket(AOClient &client) const
|
|||||||
l_other_emote = l_client->m_emote;
|
l_other_emote = l_client->m_emote;
|
||||||
l_other_flip = l_client->m_flipping;
|
l_other_flip = l_client->m_flipping;
|
||||||
int offset = pair_index == 0 ? -25 : 25;
|
int offset = pair_index == 0 ? -25 : 25;
|
||||||
|
if(l_client->hide_desk || client.hide_desk) l_args[0] = "0";
|
||||||
new_offset = QString::number(offset);
|
new_offset = QString::number(offset);
|
||||||
if(l_client->m_offset == "0&0" || l_client->m_offset == "") {
|
if(l_client->m_offset == "0&0" || l_client->m_offset == "") {
|
||||||
l_other_offset = QString::number(offset * -1);
|
l_other_offset = QString::number(offset * -1);
|
||||||
|
Loading…
Reference in New Issue
Block a user