Merge pull request #121 from AttorneyOnline/bypass-locks

Allow users with the BYPASS_LOCKS permission to... bypass locks.
This commit is contained in:
scatterflower 2021-05-05 09:45:07 -05:00 committed by GitHub
commit 90ef45c681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -229,6 +229,7 @@ class AOClient : public QObject {
{"UNCM", 1ULL << 11}, {"UNCM", 1ULL << 11},
{"SAVETEST", 1ULL << 12}, {"SAVETEST", 1ULL << 12},
{"FORCE_CHARSELECT",1ULL << 13}, {"FORCE_CHARSELECT",1ULL << 13},
{"BYPASS_LOCKS", 1ULL << 14},
{"SUPER", ~0ULL } {"SUPER", ~0ULL }
}; };

View File

@ -109,7 +109,7 @@ void AOClient::changeArea(int new_area)
sendServerMessage("You are already in area " + server->area_names[current_area]); sendServerMessage("You are already in area " + server->area_names[current_area]);
return; 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."); sendServerMessage("Area " + server->area_names[new_area] + " is locked.");
return; return;
} }

View File

@ -486,7 +486,7 @@ AOPacket AOClient::validateIcPacket(AOPacket packet)
// Spectators cannot use IC // Spectators cannot use IC
return invalid; return invalid;
AreaData* area = server->areas[current_area]; 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 // Non-invited players cannot speak in spectatable areas
return invalid; return invalid;