2.10.11: security levels (no joining servers/hosts below the required level, OUTDATED in the browser), announcements and maintenance notice from the keymaster in the MSCO menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,10 @@ namespace MSCO
|
||||
public int Players;
|
||||
public int MaxPlayers;
|
||||
public string Version;
|
||||
public string ServerVersion = ""; // Programmversion des Servers (z.B. 2.10.6), ältere melden sie nicht
|
||||
public int Security; // Sicherheitsstufe des Servers (0 = alt, ohne Sicherheitsupdates)
|
||||
/// <summary>Fehlen dem Server Sicherheitsupdates? Dann tritt die Mod nicht bei.</summary>
|
||||
public bool Outdated { get { return Security < SiteStatus.RequiredServerSecurity; } }
|
||||
public bool RequireSteam = true; // false = Non-Steam-Server
|
||||
public string Owner; // Besitzer des Lizenzschlüssels
|
||||
public bool Featured; // vom Keymaster-Admin hervorgehoben (steht in der Liste oben)
|
||||
@@ -135,6 +139,8 @@ namespace MSCO
|
||||
Players = MiniJson.Int(o, "players"),
|
||||
MaxPlayers = MiniJson.Int(o, "maxPlayers"),
|
||||
Version = MiniJson.Str(o, "version", ""),
|
||||
ServerVersion = MiniJson.Str(o, "serverVersion", ""),
|
||||
Security = MiniJson.Int(o, "security"),
|
||||
RequireSteam = MiniJson.Bool(o, "requireSteam", true),
|
||||
Owner = MiniJson.Str(o, "owner"),
|
||||
Featured = MiniJson.Bool(o, "featured"),
|
||||
@@ -192,6 +198,9 @@ namespace MSCO
|
||||
entry.MaxPlayers = info.MaxPlayers;
|
||||
entry.Version = info.Version;
|
||||
entry.Ping = info.Ping;
|
||||
// Direkt vom Server - gilt auch für lokale/direkt eingegebene Server ohne Keymaster
|
||||
entry.Security = info.Security;
|
||||
if (!string.IsNullOrEmpty(info.ServerVersion)) entry.ServerVersion = info.ServerVersion;
|
||||
if (info.HasProfile)
|
||||
{
|
||||
entry.RequireSteam = info.RequireSteam;
|
||||
@@ -218,6 +227,9 @@ namespace MSCO
|
||||
public string Owner;
|
||||
public int UptimeSeconds;
|
||||
public List<string> PlayerNames;
|
||||
// Ab Server 2.10.6: Programmversion und Sicherheitsstufe (ältere Server: "" und 0)
|
||||
public string ServerVersion;
|
||||
public int Security;
|
||||
}
|
||||
|
||||
/// <summary>Server direkt nach Name, Spielerzahl und Version fragen (blockierend - im Hintergrund aufrufen).</summary>
|
||||
@@ -261,6 +273,11 @@ namespace MSCO
|
||||
int count = r.ReadInt32();
|
||||
info.PlayerNames = new List<string>();
|
||||
for (int i = 0; i < count && i < 256; i++) info.PlayerNames.Add(r.ReadString());
|
||||
if (r.BaseStream.Position < r.BaseStream.Length)
|
||||
{
|
||||
info.ServerVersion = r.ReadString();
|
||||
info.Security = r.ReadInt32();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user