This commit is contained in:
Matthew Tran
2025-05-04 00:41:07 -07:00
parent 3e5a59d513
commit cb8f88fd33
13 changed files with 65 additions and 48 deletions
+4 -2
View File
@@ -17,7 +17,10 @@ UIDS = {
PORTS = {
"game": [
"25565:25565",
"25565:25565", # minecraft
"19132:19132/udp", # minecraft_bedrock
"19133:19133/udp",
"7777:7777", # terraria
],
}
@@ -280,7 +283,6 @@ if __name__ == "__main__":
# TODO add rest of containers
# add core to nas group
# TODO script to backup => restore backup if desired
# TODO enable bedrock => check idle cpu
# TODO reduce disk logging?
+17 -1
View File
@@ -10,6 +10,8 @@ SOURCE_DIR = "/var/source"
IMAGES = {
"game": [
"minecraft",
"minecraft_bedrock",
"terraria",
],
}
@@ -17,7 +19,21 @@ def generate(cfg):
# minecraft
shutil.copy("minecraft/server.default", "minecraft/server.properties")
with open("minecraft/server.properties", "a") as f:
f.write(f"level-name=data/{cfg["minecraft"]["world"]}")
f.write(f"level-name=data/{cfg["minecraft"]["world"]}\n")
# minecraft_bedrock
shutil.copy("minecraft_bedrock/server.default", "minecraft_bedrock/server.properties")
with open("minecraft_bedrock/server.properties", "a") as f:
f.write(f"level-name={cfg["minecraft_bedrock"]["world"]}\n")
# terraria
shutil.copy("terraria/config.default", "terraria/config.txt")
with open("terraria/config.txt", "a") as f:
f.write(f"world=/root/data/worlds/{cfg["terraria"]["world"]}.wld\n")
f.write(f"autocreate={cfg["terraria"]["autogen"]["size"]}\n") # 1=small, 2=medium, 3=large
f.write(f"difficulty={cfg["terraria"]["autogen"]["difficulty"]}\n") # 0=normal, 1=expert, 2=master, 3=journey
with open("terraria/password.txt", "w") as f:
f.write(cfg["terraria"]["password"])
def run(cmds):
try: