mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2025-04-02 14:08:36 -04:00
Compare commits
3 Commits
7bc0169dda
...
50042e96ad
Author | SHA1 | Date | |
---|---|---|---|
50042e96ad | |||
c1353de565 | |||
640cc80758 |
@ -14,8 +14,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotNetEnv" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.5">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
@ -676,6 +676,15 @@ 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)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
query = new MinecraftServerQuery().Query(connection.Address);
|
||||
}
|
||||
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
@ -894,9 +903,19 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("v1/{wId}/join/pc")]
|
||||
public ActionResult<Connection> Join(int wId)
|
||||
public async Task<ActionResult<Connection>> Join(int wId)
|
||||
{
|
||||
var connection = _context.Connections.FirstOrDefault(x => x.World.Id == wId);
|
||||
var connection = _context.Connections.Include(c => c.World).FirstOrDefault(x => x.World.Id == wId);
|
||||
|
||||
var query = new MinecraftServerQuery().Query(connection.Address);
|
||||
|
||||
if (query == null) new DockerHelper(connection.World).StartServer();
|
||||
|
||||
while (query == null)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
query = new MinecraftServerQuery().Query(connection.Address);
|
||||
}
|
||||
|
||||
return Ok(connection);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user