From 50042e96adfaa08295c952e406dd418e60d39ba4 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Sat, 6 Jul 2024 12:50:51 +0200 Subject: [PATCH] chore: update packages --- .../Minecraft-Realms-Emulator.csproj | 4 +-- .../Realms/Controllers/WorldsController.cs | 29 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj index 22280c8..ca57379 100644 --- a/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj +++ b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj @@ -14,8 +14,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs b/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs index 51e25da..421085a 100644 --- a/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs +++ b/Minecraft-Realms-Emulator/Modes/Realms/Controllers/WorldsController.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SignalR.Protocol; using Microsoft.EntityFrameworkCore; using Minecraft_Realms_Emulator.Attributes; using Minecraft_Realms_Emulator.Data; @@ -667,28 +666,28 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers [CheckActiveSubscription] public async Task> Open(int wId) { - var worlds = await _context.Worlds.ToListAsync(); + var worlds = await _context.Worlds.ToListAsync(); - var world = worlds.Find(w => w.Id == wId); + var world = worlds.Find(w => w.Id == wId); - new DockerHelper(world).StartServer(); + new DockerHelper(world).StartServer(); - world.State = nameof(StateEnum.OPEN); + world.State = nameof(StateEnum.OPEN); - _context.SaveChanges(); + _context.SaveChanges(); - var connection = _context.Connections.FirstOrDefault(c => c.World.Id == wId); - var query = new MinecraftServerQuery().Query(connection.Address); + var connection = _context.Connections.FirstOrDefault(c => c.World.Id == wId); + var query = new MinecraftServerQuery().Query(connection.Address); - while (query == null) - { - await Task.Delay(1000); - query = new MinecraftServerQuery().Query(connection.Address); - } - - return Ok(true); + while (query == null) + { + await Task.Delay(1000); + query = new MinecraftServerQuery().Query(connection.Address); } + return Ok(true); + } + [HttpPut("{wId}/close")] [CheckForWorld] [CheckRealmOwner]