mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-09 16:08:21 -05:00
fix: deserialize strings
This commit is contained in:
parent
c5594b3460
commit
bbf669f95b
@ -2,6 +2,7 @@
|
|||||||
using Minecraft_Realms_Emulator.Attributes;
|
using Minecraft_Realms_Emulator.Attributes;
|
||||||
using Minecraft_Realms_Emulator.Data;
|
using Minecraft_Realms_Emulator.Data;
|
||||||
using Minecraft_Realms_Emulator.Responses;
|
using Minecraft_Realms_Emulator.Responses;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Minecraft_Realms_Emulator.Controllers
|
namespace Minecraft_Realms_Emulator.Controllers
|
||||||
{
|
{
|
||||||
@ -36,7 +37,7 @@ namespace Minecraft_Realms_Emulator.Controllers
|
|||||||
|
|
||||||
var news = new NewsResponse
|
var news = new NewsResponse
|
||||||
{
|
{
|
||||||
NewsLink = newsLink.Value
|
NewsLink = JsonConvert.DeserializeObject(newsLink.Value),
|
||||||
};
|
};
|
||||||
|
|
||||||
return news;
|
return news;
|
||||||
|
@ -5,6 +5,7 @@ using Minecraft_Realms_Emulator.Data;
|
|||||||
using Minecraft_Realms_Emulator.Entities;
|
using Minecraft_Realms_Emulator.Entities;
|
||||||
using Minecraft_Realms_Emulator.Requests;
|
using Minecraft_Realms_Emulator.Requests;
|
||||||
using Minecraft_Realms_Emulator.Responses;
|
using Minecraft_Realms_Emulator.Responses;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Minecraft_Realms_Emulator.Controllers
|
namespace Minecraft_Realms_Emulator.Controllers
|
||||||
{
|
{
|
||||||
@ -165,7 +166,7 @@ namespace Minecraft_Realms_Emulator.Controllers
|
|||||||
var subscription = new Subscription
|
var subscription = new Subscription
|
||||||
{
|
{
|
||||||
StartDate = DateTime.UtcNow,
|
StartDate = DateTime.UtcNow,
|
||||||
SubscriptionType = SubscriptionType.NORMAL.ToString()
|
SubscriptionType = "NORMAL"
|
||||||
};
|
};
|
||||||
|
|
||||||
world.Name = body.Name;
|
world.Name = body.Name;
|
||||||
@ -173,10 +174,12 @@ namespace Minecraft_Realms_Emulator.Controllers
|
|||||||
world.State = "OPEN";
|
world.State = "OPEN";
|
||||||
world.Subscription = subscription;
|
world.Subscription = subscription;
|
||||||
|
|
||||||
|
var defaultServerAddress = _context.Configuration.FirstOrDefault(x => x.Key == "defaultServerAddress");
|
||||||
|
|
||||||
var connection = new Connection
|
var connection = new Connection
|
||||||
{
|
{
|
||||||
World = world,
|
World = world,
|
||||||
Address = _context.Configuration.FirstOrDefault(x => x.Key == "defaultServerAddress").Value
|
Address = JsonConvert.DeserializeObject(defaultServerAddress.Value)
|
||||||
};
|
};
|
||||||
|
|
||||||
_context.Worlds.Update(world);
|
_context.Worlds.Update(world);
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
namespace Minecraft_Realms_Emulator.Entities
|
|
||||||
{
|
|
||||||
public enum SubscriptionType
|
|
||||||
{
|
|
||||||
NORMAL,
|
|
||||||
RECURRING
|
|
||||||
}
|
|
||||||
}
|
|
@ -15,6 +15,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user