fix: game version checking

This commit is contained in:
CyberL1 2024-04-26 18:08:16 +02:00
parent 38d29cd888
commit e5482aef48

View File

@ -99,7 +99,7 @@ namespace Minecraft_Realms_Emulator.Controllers
foreach (var world in memberWorlds)
{
int versionsCompared = SemVersion.Parse(gameVersion, SemVersionStyles.Strict).ComparePrecedenceTo(SemVersion.Parse(world.ActiveVersion, SemVersionStyles.Strict));
int versionsCompared = SemVersion.Parse(gameVersion, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse(world.ActiveVersion, SemVersionStyles.OptionalPatch));
string isCompatible = versionsCompared == 0 ? "COMPATIBLE" : versionsCompared < 0 ? "NEEDS_DOWNGRADE" : "NEEDS_UPGRADE";
WorldResponse response = new()
@ -146,7 +146,7 @@ namespace Minecraft_Realms_Emulator.Controllers
if (world?.Subscription == null) return NotFound("World not found");
int versionsCompared = SemVersion.Parse(gameVersion, SemVersionStyles.Strict).ComparePrecedenceTo(SemVersion.Parse(world.ActiveVersion, SemVersionStyles.Strict));
int versionsCompared = SemVersion.Parse(gameVersion, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse(world.ActiveVersion, SemVersionStyles.OptionalPatch));
string isCompatible = versionsCompared == 0 ? "COMPATIBLE" : versionsCompared < 0 ? "NEEDS_DOWNGRADE" : "NEEDS_UPGRADE";
WorldResponse response = new()