mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-21 13:48:21 -05:00
feat(realms): StopServer function
This commit is contained in:
parent
7268cd0da7
commit
28e842b286
@ -329,15 +329,7 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers
|
|||||||
|
|
||||||
if (world == null) return NotFound("World not found");
|
if (world == null) return NotFound("World not found");
|
||||||
|
|
||||||
// Stop the server
|
new DockerHelper(world).StopServer();
|
||||||
ProcessStartInfo serverProcessInfo = new();
|
|
||||||
|
|
||||||
serverProcessInfo.FileName = "docker";
|
|
||||||
serverProcessInfo.Arguments = $"container stop realm-server-{world.Id}";
|
|
||||||
|
|
||||||
Process serverProcess = new();
|
|
||||||
serverProcess.StartInfo = serverProcessInfo;
|
|
||||||
serverProcess.Start();
|
|
||||||
|
|
||||||
world.State = nameof(StateEnum.CLOSED);
|
world.State = nameof(StateEnum.CLOSED);
|
||||||
|
|
||||||
|
@ -29,6 +29,17 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Helpers
|
|||||||
serverProcess.Start();
|
serverProcess.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void StopServer() {
|
||||||
|
ProcessStartInfo serverProcessInfo = new();
|
||||||
|
|
||||||
|
serverProcessInfo.FileName = "docker";
|
||||||
|
serverProcessInfo.Arguments = $"container stop realm-server-{world.Id}";
|
||||||
|
|
||||||
|
Process serverProcess = new();
|
||||||
|
serverProcess.StartInfo = serverProcessInfo;
|
||||||
|
serverProcess.Start();
|
||||||
|
}
|
||||||
|
|
||||||
public void DeleteServer()
|
public void DeleteServer()
|
||||||
{
|
{
|
||||||
ProcessStartInfo serverProcessInfo = new();
|
ProcessStartInfo serverProcessInfo = new();
|
||||||
|
Loading…
Reference in New Issue
Block a user