From 5193e11401893d87c4055934ef2be6c960d933f2 Mon Sep 17 00:00:00 2001 From: in1tiate Date: Wed, 5 May 2021 09:32:16 -0500 Subject: [PATCH] add bypass locks permission --- include/aoclient.h | 1 + src/aoclient.cpp | 2 +- src/packets.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/aoclient.h b/include/aoclient.h index 93b14d1..b6e8014 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -229,6 +229,7 @@ class AOClient : public QObject { {"UNCM", 1ULL << 11}, {"SAVETEST", 1ULL << 12}, {"FORCE_CHARSELECT",1ULL << 13}, + {"BYPASS_LOCKS", 1ULL << 14}, {"SUPER", ~0ULL } }; diff --git a/src/aoclient.cpp b/src/aoclient.cpp index 39fc6cd..3784b4a 100644 --- a/src/aoclient.cpp +++ b/src/aoclient.cpp @@ -109,7 +109,7 @@ void AOClient::changeArea(int new_area) sendServerMessage("You are already in area " + server->area_names[current_area]); return; } - if (server->areas[new_area]->locked == AreaData::LockStatus::LOCKED && !server->areas[new_area]->invited.contains(id)) { + if (server->areas[new_area]->locked == AreaData::LockStatus::LOCKED && !server->areas[new_area]->invited.contains(id) && !checkAuth(ACLFlags.value("BYPASS_LOCKS"))) { sendServerMessage("Area " + server->area_names[new_area] + " is locked."); return; } diff --git a/src/packets.cpp b/src/packets.cpp index ba52d85..14dfd73 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -486,7 +486,7 @@ AOPacket AOClient::validateIcPacket(AOPacket packet) // Spectators cannot use IC return invalid; AreaData* area = server->areas[current_area]; - if (area->locked == AreaData::LockStatus::SPECTATABLE && !area->invited.contains(id)) + if (area->locked == AreaData::LockStatus::SPECTATABLE && !area->invited.contains(id) && !checkAuth(ACLFlags.value("BYPASS_LOCKS"))) // Non-invited players cannot speak in spectatable areas return invalid;