(f26b88b8c) Ignore revision number (the last digit of the version number) when determining client/server compatibility. Allows us to release hotfixes etc with a different version number without breaking compatibility. Also incremented version number to make the next version incompatible with older ones.

This commit is contained in:
Joonas Rikkonen
2019-06-15 13:27:33 +03:00
parent 5b92be044b
commit 3edae38d05
5 changed files with 40 additions and 9 deletions
@@ -339,13 +339,14 @@ namespace Barotrauma.Networking
return;
}
if (clVersion != GameMain.Version.ToString())
bool? isCompatibleVersion = IsCompatible(clVersion, GameMain.Version.ToString());
if (isCompatibleVersion.HasValue && !isCompatibleVersion.Value)
{
DisconnectUnauthClient(inc, unauthClient, DisconnectReason.InvalidVersion,
$"DisconnectMessage.InvalidVersion~[version]={GameMain.Version.ToString()}~[clientversion]={clVersion}");
Log(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (wrong game version)", ServerLog.MessageType.Error);
DebugConsole.NewMessage(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (wrong game version)", Color.Red);
Log(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (incompatible game version)", ServerLog.MessageType.Error);
DebugConsole.NewMessage(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (incompatible game version)", Color.Red);
return;
}