mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-21 13:48:21 -05:00
feat: rcon
This commit is contained in:
parent
07ae7c6777
commit
7bc0169dda
@ -80,5 +80,18 @@ namespace Minecraft_Realms_Emulator.Modes.Realms.Helpers
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void ExecuteCommand(string command)
|
||||
{
|
||||
ProcessStartInfo commandProcessInfo = new();
|
||||
|
||||
commandProcessInfo.FileName = "docker";
|
||||
commandProcessInfo.Arguments = $"exec realm-server-{world.Id} rcon-cli {command}";
|
||||
|
||||
Process commandProcess = new();
|
||||
commandProcess.StartInfo = commandProcessInfo;
|
||||
|
||||
commandProcess.Start();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
FROM eclipse-temurin:21
|
||||
FROM eclipse-temurin:21-jre-alpine
|
||||
|
||||
WORKDIR /server
|
||||
COPY . .
|
||||
@ -6,10 +6,28 @@ COPY . .
|
||||
RUN mkdir mc
|
||||
WORKDIR mc
|
||||
|
||||
RUN wget -O server.jar https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar
|
||||
RUN apk upgrade
|
||||
RUN apk add openssl
|
||||
|
||||
RUN wget -O rcon-cli.tar.gz https://github.com/itzg/rcon-cli/releases/download/1.6.7/rcon-cli_1.6.7_linux_amd64.tar.gz
|
||||
RUN tar xzf rcon-cli.tar.gz
|
||||
|
||||
RUN rm rcon-cli.tar.gz
|
||||
RUN mv rcon-cli /bin/rcon-cli
|
||||
|
||||
RUN wget -O server.jar https://piston-data.mojang.com/v1/objects/450698d1863ab5180c25d7c804ef0fe6369dd1ba/server.jar
|
||||
|
||||
EXPOSE 25565
|
||||
|
||||
RUN java -jar server.jar
|
||||
|
||||
RUN echo "$(openssl rand -hex 20)" > .rcon-pwd
|
||||
|
||||
RUN echo eula=true > eula.txt
|
||||
RUN echo "enable-rcon=true" >> server.properties
|
||||
RUN echo "rcon.password=$(cat .rcon-pwd)" >> server.properties
|
||||
|
||||
RUN echo "password: $(cat .rcon-pwd)" >> /root/.rcon-cli.yaml
|
||||
|
||||
RUN rm .rcon-pwd
|
||||
CMD ["java", "-jar", "server.jar"]
|
Loading…
Reference in New Issue
Block a user