From 8669019991834d2d3e2c0929a67acb67761ed9ea Mon Sep 17 00:00:00 2001 From: Hayden Date: Sun, 26 Jun 2022 13:10:54 +0800 Subject: [PATCH] Allow Facepunch administrators to execute commands --- src/AdminRestrictions/CommandRestrictor.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/AdminRestrictions/CommandRestrictor.cs b/src/AdminRestrictions/CommandRestrictor.cs index 5755b19..2390d3d 100644 --- a/src/AdminRestrictions/CommandRestrictor.cs +++ b/src/AdminRestrictions/CommandRestrictor.cs @@ -88,6 +88,18 @@ bool IsCommandPermitted(ConsoleSystem.Arg arg) } } + // Allow Facepunch administrators to execute commands + var developers = Facepunch.Application.Manifest?.Administrators; + if (developers != null) + { + var steamIdString = arg.Connection.userid.ToString(); + for (int i = 0; i < developers.Length; i++) + { + if (developers[i].UserId == steamIdString) + return true; + } + } + var steamId = arg.Connection.userid; // Time to iterate over all the group configs in the configuration