1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-11-21 21:48:21 -05:00

feat: game version check

This commit is contained in:
CyberL1 2024-04-21 10:16:57 +02:00
parent 3cce73e072
commit 4c60b49c87
2 changed files with 5 additions and 1 deletions

View File

@ -30,6 +30,7 @@ namespace MyMcRealms.Controllers
string playerUUID = cookie.Split(";")[0].Split(":")[2]; string playerUUID = cookie.Split(";")[0].Split(":")[2];
string playerName = cookie.Split(";")[1].Split("=")[1]; string playerName = cookie.Split(";")[1].Split("=")[1];
string gameVerision = cookie.Split(";")[2].Split("=")[1];
List<WorldResponse> allWorlds = []; List<WorldResponse> allWorlds = [];
@ -37,6 +38,7 @@ namespace MyMcRealms.Controllers
foreach (var world in AllServers.Servers) foreach (var world in AllServers.Servers)
{ {
Console.WriteLine(world.ServerName);
WorldResponse response = new() WorldResponse response = new()
{ {
Id = AllServers.Servers.IndexOf(world), Id = AllServers.Servers.IndexOf(world),
@ -56,7 +58,7 @@ namespace MyMcRealms.Controllers
DaysLeft = 0, DaysLeft = 0,
Expired = false, Expired = false,
ExpiredTrial = false, ExpiredTrial = false,
Compatibility = "COMPATIBLE" Compatibility = world.GameVersion == gameVerision ? "COMPATIBLE" : "INCOMPATIBLE"
}; };
allWorlds.Add(response); allWorlds.Add(response);

View File

@ -14,6 +14,8 @@ namespace MyMcRealms.MyMcAPI.Responses
public class Server public class Server
{ {
public string ServerName { get; set; } = string.Empty;
public string Connect { get; set; } = string.Empty; public string Connect { get; set; } = string.Empty;
public string GameVersion { get; set; } = string.Empty;
} }
} }