In-game admin menu can grant and remove admin rights (2.9.4)

AdminAction 9/10 (admins only) runs op/deop for the target player, same as
the console and the web panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 17:52:32 +02:00
co-authored by Claude Opus 5.5
parent 2d38c8bee9
commit 4a9ad55d14
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -435,6 +435,12 @@ public sealed class GameServer
result = SetResetPoint() ? "The current save game is now the reset point" : "No save game to use as reset point";
if (result.StartsWith("The")) Log($"{c.Name} set the current save game as the reset point");
}
else if (action == 9 || action == 10)
{
// Admin geben / nehmen aus dem Admin-Menü im Spiel (wie "op"/"deop" in der Konsole bzw. im Panel)
result = PanelSetAdmin(targetId, action == 9, c.Name);
if (string.IsNullOrWhiteSpace(result)) result = action == 9 ? "Done - the player is now an admin" : "Done - the player is no longer an admin";
}
else if (!clients.TryGetValue(targetId, out var target) || target.State != ClientState.Joined) result = "Player not found";
else if (action == 3)
{