add /area

This commit is contained in:
in1tiate 2021-03-09 17:17:18 -06:00
parent d0dbd41232
commit 483e89d5cf
2 changed files with 13 additions and 0 deletions

View File

@ -188,6 +188,7 @@ class AOClient : public QObject {
void cmdUnLock(int argc, QStringList argv);
void cmdGetAreas(int argc, QStringList argv);
void cmdGetArea(int argc, QStringList argv);
void cmdArea(int argc, QStringList argv);
void cmdSetBackground(int argc, QStringList argv);
void cmdBgLock(int argc, QStringList argv);
void cmdBgUnlock(int argc, QStringList argv);
@ -255,6 +256,7 @@ class AOClient : public QObject {
{"spectatable", {ACLFlags.value("CM"), 0, &AOClient::cmdSpectatable}},
{"unlock", {ACLFlags.value("CM"), 0, &AOClient::cmdUnLock}},
{"timer", {ACLFlags.value("CM"), 0, &AOClient::cmdTimer}},
{"area", {ACLFlags.value("NONE"), 1, &AOClient::cmdArea}},
};
QString partial_packet;

View File

@ -637,6 +637,17 @@ void AOClient::cmdTimer(int argc, QStringList argv)
}
}
void AOClient::cmdArea(int argc, QStringList argv)
{
bool ok;
int new_area = argv[0].toInt(&ok);
if (!ok) {
sendServerMessage("That does not look like a valid area ID.");
return;
}
changeArea(new_area);
}
QStringList AOClient::buildAreaList(int area_idx)
{
QStringList entries;