Admin WORLD tab: reset world, backup now, list and restore save backups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 16:43:40 +02:00
co-authored by Claude Opus 5.5
parent 31e630dccb
commit bddc1efe76
4 changed files with 90 additions and 2 deletions
+19
View File
@@ -422,6 +422,18 @@ namespace MSCO
return true;
}
/// <summary>Admin (nur dedizierter Server): Welt zurücksetzen (5), Backup anlegen (6), Backup wiederherstellen (7).</summary>
public void WorldAction(byte action, string backup)
{
if (session == null || !dedicated) return;
session.SendTo(NetSession.HostId, MsgType.AdminAction, NetSession.Build(w =>
{
w.Write(action);
w.Write(-1);
w.Write(backup ?? "");
}));
}
/// <summary>Admin: Bann aufheben (Server: SteamID oder name:..., P2P: Name).</summary>
public void Unban(string id)
{
@@ -1268,6 +1280,13 @@ namespace MSCO
for (int i = 0; i < bans; i++) banned.Add(r.ReadString());
}
overlays.SetBanned(banned);
var backups = new List<string>();
if (r.BaseStream.Length - r.BaseStream.Position >= 4)
{
int n = r.ReadInt32();
for (int i = 0; i < n; i++) backups.Add(r.ReadString());
}
overlays.SetBackups(backups);
break;
}