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:
@@ -675,7 +675,7 @@ namespace MSCO
|
||||
string name = string.IsNullOrEmpty(displayName) ? info.Name : displayName;
|
||||
int max = info.MaxPlayers > 0 ? info.MaxPlayers : maxPlayers;
|
||||
|
||||
if (info.Version != MSCO.ModVersion)
|
||||
if (!MSCO.Compatible(info.Version))
|
||||
{
|
||||
PendingVersionWarning = new VersionWarning { Host = host, Port = port, Name = name, MaxPlayers = max, ServerVersion = info.Version };
|
||||
SetStatus("Version mismatch: server v" + info.Version + ", you v" + MSCO.ModVersion);
|
||||
@@ -1064,7 +1064,7 @@ namespace MSCO
|
||||
byte[] ticket = SteamLobby.CreateAuthTicket();
|
||||
session.SendTo(NetSession.HostId, MsgType.Hello, NetSession.Build(w =>
|
||||
{
|
||||
w.Write(MSCO.ModVersion);
|
||||
w.Write(MSCO.ProtocolVersion); // nur die Netzwerk-Version: ältere Hosts vergleichen genau
|
||||
w.Write(name);
|
||||
// Steam-Identität: dedizierte Server lassen nur Spieler mit Steam rein
|
||||
w.Write(SteamLobby.OwnSteamId);
|
||||
@@ -1392,7 +1392,7 @@ namespace MSCO
|
||||
|
||||
string version = r.ReadString();
|
||||
string name = r.ReadString();
|
||||
if (version != MSCO.ModVersion)
|
||||
if (!MSCO.Compatible(version))
|
||||
{
|
||||
Reject(peerId, "Version mismatch (host " + MSCO.ModVersion + ", you " + version + ")");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user