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:
parent
3cce73e072
commit
4c60b49c87
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user