add iniswap toggle command

This commit is contained in:
in1tiate 2021-04-14 16:38:38 -05:00
parent 89c9692924
commit 461c4f9d6e
2 changed files with 19 additions and 0 deletions

View File

@ -1537,6 +1537,15 @@ class AOClient : public QObject {
*/ */
void cmdForceImmediate(int argc, QStringList argv); void cmdForceImmediate(int argc, QStringList argv);
/**
* @brief Toggles whether iniswaps are allowed in the current area.
*
* @details No arguments.
*
* @iscommand
*/
void cmdAllowIniswap(int argc, QStringList argv);
///@} ///@}
/** /**
@ -1777,6 +1786,8 @@ class AOClient : public QObject {
{"unshake", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnShake}}, {"unshake", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnShake}},
{"forceimmediate", {ACLFlags.value("CM"), 1, &AOClient::cmdForceImmediate}}, {"forceimmediate", {ACLFlags.value("CM"), 1, &AOClient::cmdForceImmediate}},
{"force_noint_pres", {ACLFlags.value("CM"), 1, &AOClient::cmdForceImmediate}}, {"force_noint_pres", {ACLFlags.value("CM"), 1, &AOClient::cmdForceImmediate}},
{"allowiniswap", {ACLFlags.value("CM"), 1, &AOClient::cmdAllowIniswap}},
{"allow_iniswap", {ACLFlags.value("CM"), 1, &AOClient::cmdAllowIniswap}},
}; };
/** /**

View File

@ -1529,6 +1529,14 @@ void AOClient::cmdForceImmediate(int argc, QStringList argv)
sendServerMessage("Forced immediate text processing in this area is now " + state); sendServerMessage("Forced immediate text processing in this area is now " + state);
} }
void AOClient::cmdAllowIniswap(int argc, QStringList argv)
{
AreaData* area = server->areas[current_area];
area->iniswap_allowed = !area->iniswap_allowed;
QString state = area->iniswap_allowed ? "allowed." : "disallowed.";
sendServerMessage("Iniswapping in this area is now " + state);
}
QStringList AOClient::buildAreaList(int area_idx) QStringList AOClient::buildAreaList(int area_idx)
{ {
QStringList entries; QStringList entries;