From 483e89d5cf2a5fbce184e366f567a53b26a25d92 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Tue, 9 Mar 2021 17:17:18 -0600 Subject: [PATCH] add /area --- include/aoclient.h | 2 ++ src/commands.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) 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;