mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-12-21 20:08:21 -05:00
feat: change world on slot switch
This commit is contained in:
parent
cbecb21ea3
commit
b6a73df815
@ -857,6 +857,11 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Controllers
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
var server = new DockerHelper(world);
|
||||
|
||||
server.RunCommand($"sed -i 's#level-name=slot-{world.ActiveSlot}#level-name=slot-{sId}#' server.properties");
|
||||
server.RebootServer();
|
||||
|
||||
world.ActiveSlot = sId;
|
||||
world.Minigame = null;
|
||||
world.WorldType = nameof(WorldTypeEnum.NORMAL);
|
||||
|
@ -128,7 +128,7 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Helpers
|
||||
ProcessStartInfo commandProcessInfo = new();
|
||||
|
||||
commandProcessInfo.FileName = "docker";
|
||||
commandProcessInfo.Arguments = $"exec realm-server-{world.Id} {command}";
|
||||
commandProcessInfo.Arguments = $"exec realm-server-{world.Id} /bin/sh -c \"{command}\"";
|
||||
|
||||
Process commandProcess = new();
|
||||
commandProcess.StartInfo = commandProcessInfo;
|
||||
|
Loading…
Reference in New Issue
Block a user