Admin menu: make admin / remove admin for players on dedicated servers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 17:52:49 +02:00
co-authored by Claude Opus 5.5
parent ea1b0f74d9
commit 56c3990650
2 changed files with 20 additions and 0 deletions
+12
View File
@@ -561,6 +561,18 @@ namespace MSCO
SendGame(MsgType.Chat, NetSession.Build(w => w.Write("* " + text)));
}
/// <summary>Admin (dedizierter Server): einem Spieler Admin-Rechte geben (9) bzw. nehmen (10).</summary>
public void SetAdmin(int playerId, bool admin)
{
if (session == null || !dedicated) return;
session.SendTo(NetSession.HostId, MsgType.AdminAction, NetSession.Build(w =>
{
w.Write((byte)(admin ? 9 : 10));
w.Write(playerId);
w.Write("");
}));
}
public void AdminAction(bool ban, int playerId, string reason)
{
if (session == null) return;