mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-23 22:58:21 -05:00
feat: wait for server to be accessible on open
This commit is contained in:
parent
7bc0169dda
commit
640cc80758
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR.Protocol;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Minecraft_Realms_Emulator.Attributes;
|
||||
using Minecraft_Realms_Emulator.Data;
|
||||
@ -676,6 +677,20 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers
|
||||
|
||||
_context.SaveChanges();
|
||||
|
||||
var connection = _context.Connections.FirstOrDefault(c => c.World.Id == wId);
|
||||
var query = new MinecraftServerQuery().Query(connection.Address);
|
||||
|
||||
while (query == null)
|
||||
{
|
||||
|
||||
var newQuery = new MinecraftServerQuery().Query(connection.Address);
|
||||
|
||||
if (newQuery != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user