mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-12-21 20:08: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");
|
||||
|
||||
// Stop the server
|
||||
ProcessStartInfo serverProcessInfo = new();
|
||||
|
||||
serverProcessInfo.FileName = "docker";
|
||||
serverProcessInfo.Arguments = $"container stop realm-server-{world.Id}";
|
||||
|
||||
Process serverProcess = new();
|
||||
serverProcess.StartInfo = serverProcessInfo;
|
||||
serverProcess.Start();
|
||||
new DockerHelper(world).StopServer();
|
||||
|
||||
world.State = nameof(StateEnum.CLOSED);
|
||||
|
||||
|
@ -29,6 +29,17 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Helpers
|
||||
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()
|
||||
{
|
||||
ProcessStartInfo serverProcessInfo = new();
|
||||
|
Loading…
Reference in New Issue
Block a user