mirror of
https://github.com/CyberL1/MyMcRealms.git
synced 2025-04-10 18:08:36 -04:00
Compare commits
No commits in common. "ae057c59bb24f59b46d6e106d15a3c8857e31d11" and "5ca12b1530ccf93f3b27ad97d9f3022874c945b7" have entirely different histories.
ae057c59bb
...
5ca12b1530
@ -2,9 +2,7 @@
|
|||||||
using MyMcRealms.Attributes;
|
using MyMcRealms.Attributes;
|
||||||
using MyMcRealms.MyMcAPI.Responses;
|
using MyMcRealms.MyMcAPI.Responses;
|
||||||
using MyMcRealms.Responses;
|
using MyMcRealms.Responses;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Semver;
|
using Semver;
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace MyMcRealms.Controllers
|
namespace MyMcRealms.Controllers
|
||||||
{
|
{
|
||||||
@ -74,7 +72,7 @@ namespace MyMcRealms.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ServersResponse servers = new()
|
ServersResponse servers = new()
|
||||||
{
|
{
|
||||||
Servers = allWorlds
|
Servers = allWorlds
|
||||||
};
|
};
|
||||||
@ -115,12 +113,6 @@ namespace MyMcRealms.Controllers
|
|||||||
whitelistedPlayers.Add(whitelistedPlayer);
|
whitelistedPlayers.Add(whitelistedPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
string cookie = Request.Headers.Cookie;
|
|
||||||
string gameVerision = cookie.Split(";")[2].Split("=")[1];
|
|
||||||
|
|
||||||
int versionsCompared = SemVersion.Parse(gameVerision, SemVersionStyles.OptionalPatch).ComparePrecedenceTo(SemVersion.Parse(world.GameVersion, SemVersionStyles.OptionalPatch));
|
|
||||||
string isCompatible = versionsCompared == 0 ? "COMPATIBLE" : versionsCompared < 0 ? "NEEDS_DOWNGRADE" : "NEEDS_UPGRADE";
|
|
||||||
|
|
||||||
WorldResponse response = new()
|
WorldResponse response = new()
|
||||||
{
|
{
|
||||||
Id = wId,
|
Id = wId,
|
||||||
@ -140,20 +132,7 @@ namespace MyMcRealms.Controllers
|
|||||||
DaysLeft = 7,
|
DaysLeft = 7,
|
||||||
Expired = false,
|
Expired = false,
|
||||||
ExpiredTrial = false,
|
ExpiredTrial = false,
|
||||||
ActiveVersion = world.GameVersion,
|
ActiveVersion = world.GameVersion
|
||||||
Slots =
|
|
||||||
[
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
SlotId = 1,
|
|
||||||
Options = JsonConvert.SerializeObject(new
|
|
||||||
{
|
|
||||||
slotName = "my-mc.link",
|
|
||||||
version = world.GameVersion,
|
|
||||||
compatibility = isCompatible,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
|
@ -9,9 +9,15 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DotNetEnv" Version="3.0.0" />
|
<PackageReference Include="DotNetEnv" Version="3.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||||
<PackageReference Include="Semver" Version="2.3.0" />
|
<PackageReference Include="Semver" Version="2.3.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
namespace MyMcRealms.Responses
|
|
||||||
{
|
|
||||||
public class SlotResponse
|
|
||||||
{
|
|
||||||
public int SlotId { get; set; }
|
|
||||||
public string Options { get; set; } = null!;
|
|
||||||
}
|
|
||||||
}
|
|
@ -18,7 +18,7 @@ namespace MyMcRealms.Responses
|
|||||||
public int? MinigameId { get; set; }
|
public int? MinigameId { get; set; }
|
||||||
public string? MinigameImage { get; set; }
|
public string? MinigameImage { get; set; }
|
||||||
public int ActiveSlot { get; set; } = 1;
|
public int ActiveSlot { get; set; } = 1;
|
||||||
public List<SlotResponse> Slots { get; set; } = [];
|
public JsonDocument[] Slots { get; set; } = [];
|
||||||
public bool Member { get; set; } = false;
|
public bool Member { get; set; } = false;
|
||||||
public string RemoteSubscriptionId { get; set; } = Guid.NewGuid().ToString();
|
public string RemoteSubscriptionId { get; set; } = Guid.NewGuid().ToString();
|
||||||
public int DaysLeft { get; set; } = 30;
|
public int DaysLeft { get; set; } = 30;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user