diff --git a/Minecraft-Realms-Emulator/Controllers/McoController.cs b/Minecraft-Realms-Emulator/Controllers/McoController.cs index d7583cf..f03e93a 100644 --- a/Minecraft-Realms-Emulator/Controllers/McoController.cs +++ b/Minecraft-Realms-Emulator/Controllers/McoController.cs @@ -2,6 +2,7 @@ using Minecraft_Realms_Emulator.Attributes; using Minecraft_Realms_Emulator.Data; using Minecraft_Realms_Emulator.Responses; +using Newtonsoft.Json; namespace Minecraft_Realms_Emulator.Controllers { @@ -36,7 +37,7 @@ namespace Minecraft_Realms_Emulator.Controllers var news = new NewsResponse { - NewsLink = newsLink.Value + NewsLink = JsonConvert.DeserializeObject(newsLink.Value), }; return news; diff --git a/Minecraft-Realms-Emulator/Controllers/WorldsController.cs b/Minecraft-Realms-Emulator/Controllers/WorldsController.cs index fadcc2a..0e80380 100644 --- a/Minecraft-Realms-Emulator/Controllers/WorldsController.cs +++ b/Minecraft-Realms-Emulator/Controllers/WorldsController.cs @@ -5,6 +5,7 @@ using Minecraft_Realms_Emulator.Data; using Minecraft_Realms_Emulator.Entities; using Minecraft_Realms_Emulator.Requests; using Minecraft_Realms_Emulator.Responses; +using Newtonsoft.Json; namespace Minecraft_Realms_Emulator.Controllers { @@ -165,7 +166,7 @@ namespace Minecraft_Realms_Emulator.Controllers var subscription = new Subscription { StartDate = DateTime.UtcNow, - SubscriptionType = SubscriptionType.NORMAL.ToString() + SubscriptionType = "NORMAL" }; world.Name = body.Name; @@ -173,10 +174,12 @@ namespace Minecraft_Realms_Emulator.Controllers world.State = "OPEN"; world.Subscription = subscription; + var defaultServerAddress = _context.Configuration.FirstOrDefault(x => x.Key == "defaultServerAddress"); + var connection = new Connection { World = world, - Address = _context.Configuration.FirstOrDefault(x => x.Key == "defaultServerAddress").Value + Address = JsonConvert.DeserializeObject(defaultServerAddress.Value) }; _context.Worlds.Update(world); diff --git a/Minecraft-Realms-Emulator/Entities/SubscriptionType.cs b/Minecraft-Realms-Emulator/Entities/SubscriptionType.cs deleted file mode 100644 index b114278..0000000 --- a/Minecraft-Realms-Emulator/Entities/SubscriptionType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Minecraft_Realms_Emulator.Entities -{ - public enum SubscriptionType - { - NORMAL, - RECURRING - } -} \ No newline at end of file diff --git a/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj index c450798..82c31c9 100644 --- a/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj +++ b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj @@ -15,6 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive +