Mod 2.8.1: separate mod version from network protocol version

ModVersion (2.8.1, shown in MSCLoader/MSC Launcher) and ProtocolVersion
(2.8) are separate; only the first two digits are compared (P2P host, Steam
lobby, server info, server browser) and only the protocol version is sent,
so minor updates stay compatible with 2.8 servers, hosts and players.
README: how to publish minor and major updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 17:48:07 +02:00
co-authored by Claude Opus 5.5
parent f707e67e5c
commit ea1b0f74d9
6 changed files with 46 additions and 10 deletions
+24 -1
View File
@@ -5,7 +5,30 @@ namespace MSCO
{
public class MSCO : Mod
{
public const string ModVersion = "2.8";
/// <summary>
/// Version der Mod (MSCLoader / MSC Launcher). Kleine Updates: nur die dritte Stelle erhöhen (2.8.1, 2.8.2 ...) -
/// sie bleiben mit 2.8-Servern und -Mitspielern kompatibel.
/// </summary>
public const string ModVersion = "2.8.1";
/// <summary>
/// Netzwerk-Version (die ersten beiden Stellen). Nur erhöhen, wenn sich das Protokoll inkompatibel ändert - dann
/// auch GameServer.ModVersion im Server und eine neue Mod-Version 2.9.0 o.ä.
/// </summary>
public const string ProtocolVersion = "2.8";
/// <summary>Passt eine andere Version (Server, Host, Mitspieler) zu uns? Verglichen werden nur die ersten zwei Stellen.</summary>
public static bool Compatible(string other)
{
return Protocol(other) == ProtocolVersion;
}
/// <summary>"2.8.3" -> "2.8"</summary>
public static string Protocol(string version)
{
if (string.IsNullOrEmpty(version)) return "";
string[] parts = version.Trim().Split('.');
return parts.Length >= 2 ? parts[0] + "." + parts[1] : version.Trim();
}
public override string ID => "MSCO"; // Your (unique) mod ID
public override string Name => "MSCO"; // Your mod name