diff --git a/include/aoclient.h b/include/aoclient.h index 63203ce..b169633 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -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; diff --git a/src/commands.cpp b/src/commands.cpp index dcbacf0..be6a8b7 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -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;