1
0
mirror of https://github.com/CyberL1/MyMcRealms.git synced 2024-11-21 13:38: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 playerName = cookie.Split(";")[1].Split("=")[1];
string gameVerision = cookie.Split(";")[2].Split("=")[1];
List<WorldResponse> allWorlds = [];
@ -37,6 +38,7 @@ namespace MyMcRealms.Controllers
foreach (var world in AllServers.Servers)
{
Console.WriteLine(world.ServerName);
WorldResponse response = new()
{
Id = AllServers.Servers.IndexOf(world),
@ -56,7 +58,7 @@ namespace MyMcRealms.Controllers
DaysLeft = 0,
Expired = false,
ExpiredTrial = false,
Compatibility = "COMPATIBLE"
Compatibility = world.GameVersion == gameVerision ? "COMPATIBLE" : "INCOMPATIBLE"
};
allWorlds.Add(response);

View File

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