From 30b7f7a053bc480911111ed4500b2499c999c27a Mon Sep 17 00:00:00 2001 From: Amatsu Date: Fri, 20 Oct 2023 22:32:25 -0400 Subject: [PATCH 1/6] Update the terraria-tmodloader template --- terraria-tmodloader/.skip | 1 - terraria-tmodloader/README.md | 24 ++-- terraria-tmodloader/terraria-tmodloader.json | 128 +++++++++++-------- 3 files changed, 90 insertions(+), 63 deletions(-) delete mode 100644 terraria-tmodloader/.skip diff --git a/terraria-tmodloader/.skip b/terraria-tmodloader/.skip deleted file mode 100644 index 8b137891..00000000 --- a/terraria-tmodloader/.skip +++ /dev/null @@ -1 +0,0 @@ - diff --git a/terraria-tmodloader/README.md b/terraria-tmodloader/README.md index 054d396b..838c9db1 100644 --- a/terraria-tmodloader/README.md +++ b/terraria-tmodloader/README.md @@ -1,17 +1,17 @@ -Terarria - tModLoader Template - made for linux non arm +# Template for [tModLoader](https://www.tmodloader.net/) +This template makes it possible to run [tModLoader](https://www.tmodloader.net/) with [PufferPanel](https://www.pufferpanel.com/) on Linux. -How to install mods: -1. Upload the .tmod file into the mods folder -2. Edit the enabled.json inside the mods folder +## Notes +* It features a script for automatic mod enable listing. +* Download your mods and put them in the mods folder. -For example in my mods folder i have three mods (mod1.tmod, mod2.tmod and mod3.tmod) and so my enabled.json looks like this: -[ - "Mod1", - "Mod2", - "Mod3" -] +## Enabling mods -NOTE: Adding mods after the world was first created may not ever work +* If auto enables mod is set to true, mods will be enabled automatically. +* If auto enables mod is set to false : + * Edit the enabled.json inside the mods folder + * For example in my mods folder i have three mods (mod1.tmod, mod2.tmod and mod3.tmod) and so my enabled.json looks like this: [ "Mod1", "Mod2", "Mod3" ] -Do not forget to install the tModLoader also on your PC (https://store.steampowered.com/app/1281930/tModLoader) and also to activate the automatic mod download from the server! + +This only supports Linux. \ No newline at end of file diff --git a/terraria-tmodloader/terraria-tmodloader.json b/terraria-tmodloader/terraria-tmodloader.json index dd1b03e1..52f74623 100644 --- a/terraria-tmodloader/terraria-tmodloader.json +++ b/terraria-tmodloader/terraria-tmodloader.json @@ -1,16 +1,24 @@ { + "name": "terraria-tmodloader", "type": "terraria", "display": "Terraria - tModLoader", "data": { "abr": { - "type": "string", + "type": "integer", "desc": "Sets the announcementbox text messaging range in pixels, -1 for serverwide announcements.", "display": "announcementbox-range", "required": true, "value": "-1" }, + "autoEnableMods": { + "type": "boolean", + "desc": "Automatically enables all mods in the mods folder", + "display": "Auto Enable Mods", + "required": true, + "value": "true" + }, "backups": { - "type": "string", + "type": "integer", "desc": "Sets the number of rolling world backups to keep", "display": "Backups", "required": true, @@ -24,7 +32,7 @@ "value": "banlist.txt" }, "difficulty": { - "type": "string", + "type": "integer", "desc": "This can not be changed after the world was generated - Options: 0 - (normal), 1 - (expert), 2 - (master), 3 - (journey)", "display": "Difficulty", "required": true, @@ -65,7 +73,7 @@ "value": "mods" }, "npcs": { - "type": "string", + "type": "integer", "desc": "Reduces enemy skipping but increases bandwidth usage. The lower the number the less skipping will happen, but more data is sent. 0 is off.", "display": "npcstream", "required": true, @@ -79,28 +87,28 @@ "value": "" }, "players": { - "type": "string", + "type": "integer", "desc": "Max Players", "display": "Players", "required": true, "value": "4" }, "port": { - "type": "string", + "type": "integer", "desc": "What port to bind the server to", "display": "Port", "required": true, "value": "7777" }, "priority": { - "type": "string", + "type": "integer", "desc": "Set priority 0:Realtime, 1:High, 2:Above-Normal, 3:Normal, 4:Below-Normal, 5:Idle", "display": "priority", "required": true, "value": "1" }, "secure": { - "type": "string", + "type": "integer", "desc": "Enable cheat protection = 1 and disable = 0", "display": "secure", "required": true, @@ -111,36 +119,36 @@ "desc": "This can not be changed after the world was generated - Seed of the World", "display": "Seed", "required": true, - "value": "VeryGoodStartingSeed" + "value": "" }, "size": { - "type": "string", + "type": "integer", "desc": "This can not be changed after the world was generated - World Size (1-3 - 3 is biggest)", "display": "World-Size", "required": true, "value": "3" }, "sl": { - "type": "string", + "type": "integer", "desc": "Reduces maximum liquids moving at the same time. If enabled may reduce lags but liquids may take longer to settle.", "display": "maximum liquids moving", "required": true, "value": "1" }, - "tversion": { - "type": "string", - "desc": "tModLoader Version", - "display": "tModLoader Version (Set this to the latest tModLoader version - see https://github.com/tModLoader/tModLoader/releases/latest)", - "required": true, - "value": "0.11.8.6" - }, "upnp": { - "type": "string", + "type": "integer", "desc": "Enable upnp = 1 and disable = 0", "display": "upnp", "required": true, "value": "1" }, + "version": { + "type": "string", + "desc": "tModLoader Version", + "display": "tModLoader Version (Set this to the latest tModLoader version - see https://github.com/tModLoader/tModLoader/releases/latest)", + "required": true, + "value": "v2023.08.3.4" + }, "world": { "type": "string", "desc": "Name of your World", @@ -158,60 +166,80 @@ }, "install": [ { - "files": [ - "https://github.com/tModLoader/tModLoader/releases/download/v${tversion}/tModLoader.Linux.v${tversion}.tar.gz" - ], - "type": "download" + "target": "server", + "type": "mkdir" + }, + { + "target": "${wp}", + "type": "mkdir" }, { + "target": "${mp}", + "type": "mkdir" + }, + { + "type": "command", "commands": [ - "mv ./${mp}/enabled.json ./", - "rm -r ./server", - "mkdir ./server", - "tar -xf tModLoader.Linux.v${tversion}.tar.gz --directory ./server", - "chmod +x ./server/tModLoaderServer", - "chmod +x ./server/tModLoaderServer.bin.x86", - "chmod +x ./server/tModLoaderServer.bin.x86_64", - "mkdir ./${wp}", - "mkdir ./${mp}", - "rm tModLoader.Linux.v${tversion}.tar.gz" - ], - "type": "command" + "wget https://github.com/tModLoader/tModLoader/releases/download/${version}/tModLoader.zip" + ] + }, + { + "type": "writefile", + "target": "EnableAllMods.sh", + "text": "#!/bin/bash\nif [ \"$1\" == \"false\" ]; then\n exit 0\nfi\n\nenabledMods=\"[\"\n\nfor file in ./mods/*.tmod; do\n modName=\"$(basename \"$file\" .tmod)\"\n enabledMods=\"$enabledMods\\n\\t\\\"$modName\\\",\"\n echo \"$modName\"\ndone\n\nenabledMods=\"${enabledMods::-1}\\n]\"\necho -e \"Enabled Mods: $enabledMods\"\necho -e \"$enabledMods\" > \"mods/enabled.json\"" }, { + "type": "writefile", "target": "serverconfig.txt", - "text": "world=../${wp}/${world}.wld\nautocreate=${size}\nseed=${seed}\nworldname=${world}\ndifficulty=${difficulty}\nmaxplayers=${players}\nport=${port}\npassword=${password}\nmotd=${motd}\nworldpath=../${wp}\nbanlist=../${ban}\nsecure=${secure}\nlanguage=${lang}\nupnp=${upnp}\nnpcstream=${npcs}\npriority=${priority}\nslowliquids=${sl}\nworldrollbackstokeep=${backups}", - "type": "writefile" + "text": "world=../${wp}/${world}.wld\nautocreate=${size}\nseed=${seed}\nworldname=${world}\ndifficulty=${difficulty}\nmaxplayers=${players}\nport=${port}\npassword=${password}\nmotd=${motd}\nworldpath=../${wp}\nbanlist=../${ban}\nsecure=${secure}\nlanguage=${lang}\nupnp=${upnp}\nnpcstream=${npcs}\npriority=${priority}\nslowliquids=${sl}\nworldrollbackstokeep=${backups}\nmodpath=../${mp}" }, { - "target": "enabled.jsonn", - "text": "[\n \"Mod1\",\n \"Mod2\",\n \"Mod3\"\n]", - "type": "writefile" + "type": "writefile", + "target": "enabled.json", + "text": "[\n \"*\"\n]" }, { + "type": "command", "commands": [ - "mv ./enabled.jsonn ./${mp}/enabled.json", - "mv ./enabled.json ./${mp}/enabled.json" - ], - "type": "command" + "unzip tModLoader.zip -d ./server", + "chmod +x ./server", + "chmod +x ./server/LaunchUtils/ScriptCaller.sh", + "rm tModLoader.zip", + "chmod +x ./EnableAllMods.sh" + ] + }, + { + "source": "enabled.json", + "target": "${mp}/enabled.json", + "type": "move" } ], "run": { - "command": "./server/tModLoaderServer -ip ${ip} ${disableannouncementbox} -announcementboxrange ${abr} -config ../serverconfig.txt", + "command": "server/LaunchUtils/ScriptCaller.sh -server -ip ${ip} ${disableannouncementbox} -announcementboxrange ${abr} -config ../serverconfig.txt", "stop": "exit", + "environmentVars": {}, "pre": [ { - "target": "serverconfig.txt", - "text": "world=../${wp}/${world}.wld\nautocreate=${size}\nseed=${seed}\nworldname=${world}\ndifficulty=${difficulty}\nmaxplayers=${players}\nport=${port}\npassword=${password}\nmotd=${motd}\nworldpath=../${wp}\nbanlist=../${ban}\nsecure=${secure}\nlanguage=${lang}\nupnp=${upnp}\nnpcstream=${npcs}\npriority=${priority}\nslowliquids=${sl}\nworldrollbackstokeep=${backups}", - "type": "writefile" + "type": "command", + "commands": [ + "./EnableAllMods.sh ${autoEnableMods} " + ] } - ] + ], + "post": [] }, "environment": { "type": "tty" }, + "supportedEnvironments": [ + { + "type": "tty" + } + ], "requirements": { - "binaries": [ "tar" ], + "binaries": [ + "unzip" + ], "os": "linux", "arch": "amd64" } From 68a096d055f0d55b13e1ac31f1e707d99de7b22f Mon Sep 17 00:00:00 2001 From: Amatsu Date: Fri, 20 Oct 2023 23:12:38 -0400 Subject: [PATCH 2/6] fixes after review --- terraria-tmodloader/.skip | 1 + terraria-tmodloader/terraria-tmodloader.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 terraria-tmodloader/.skip diff --git a/terraria-tmodloader/.skip b/terraria-tmodloader/.skip new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/terraria-tmodloader/.skip @@ -0,0 +1 @@ + diff --git a/terraria-tmodloader/terraria-tmodloader.json b/terraria-tmodloader/terraria-tmodloader.json index 52f74623..22bc9ec4 100644 --- a/terraria-tmodloader/terraria-tmodloader.json +++ b/terraria-tmodloader/terraria-tmodloader.json @@ -202,7 +202,6 @@ "type": "command", "commands": [ "unzip tModLoader.zip -d ./server", - "chmod +x ./server", "chmod +x ./server/LaunchUtils/ScriptCaller.sh", "rm tModLoader.zip", "chmod +x ./EnableAllMods.sh" From fd2438fad83d870ee634da5681169bfa2bcece75 Mon Sep 17 00:00:00 2001 From: Amatsu Date: Sat, 11 May 2024 12:02:20 -0400 Subject: [PATCH 3/6] use download operator --- terraria-tmodloader/terraria-tmodloader.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terraria-tmodloader/terraria-tmodloader.json b/terraria-tmodloader/terraria-tmodloader.json index 22bc9ec4..0caf9ee4 100644 --- a/terraria-tmodloader/terraria-tmodloader.json +++ b/terraria-tmodloader/terraria-tmodloader.json @@ -147,7 +147,7 @@ "desc": "tModLoader Version", "display": "tModLoader Version (Set this to the latest tModLoader version - see https://github.com/tModLoader/tModLoader/releases/latest)", "required": true, - "value": "v2023.08.3.4" + "value": "v2024.03.3.2" }, "world": { "type": "string", @@ -178,9 +178,9 @@ "type": "mkdir" }, { - "type": "command", - "commands": [ - "wget https://github.com/tModLoader/tModLoader/releases/download/${version}/tModLoader.zip" + "type": "download", + "files": [ + "https://github.com/tModLoader/tModLoader/releases/download/${version}/tModLoader.zip" ] }, { From b71937c57af64940083048ebba5fee336eba7084 Mon Sep 17 00:00:00 2001 From: Amatsu Date: Sun, 12 May 2024 10:08:03 -0400 Subject: [PATCH 4/6] initial --- corekeeper/README.md | 2 + corekeeper/corekeeper.json | 119 +++++++++++++++++ terraria-tmodloader/README.md | 24 ++-- terraria-tmodloader/terraria-tmodloader.json | 127 ++++++++----------- 4 files changed, 183 insertions(+), 89 deletions(-) create mode 100644 corekeeper/README.md create mode 100644 corekeeper/corekeeper.json diff --git a/corekeeper/README.md b/corekeeper/README.md new file mode 100644 index 00000000..be14f6ee --- /dev/null +++ b/corekeeper/README.md @@ -0,0 +1,2 @@ +## Notes +This only supports Linux. \ No newline at end of file diff --git a/corekeeper/corekeeper.json b/corekeeper/corekeeper.json new file mode 100644 index 00000000..cfe2336b --- /dev/null +++ b/corekeeper/corekeeper.json @@ -0,0 +1,119 @@ +{ + "name": "core-keeper", + "display": "Core Keeper", + "type": "srcds", + "data": { + "world": { + "type": "integer", + "desc": "Which world index to use.", + "display": "World", + "required": true, + "value": "0" + }, + "worldname": { + "type": "string", + "desc": "The name to use for the server.", + "display": "World name", + "required": true, + "value": "Core Keeper Server" + }, + "worldseed": { + "type": "integer", + "desc": "The seed to use for a new world. Set to 0 to generate random seed.", + "display": "World seed", + "required": true, + "value": "0" + }, + "gameid": { + "type": "string", + "desc": "Game ID to use for the server. Needs to be at least 28 characters and alphanumeric, excluding Y,y,x,0,O. Empty or not valid means a new ID will be generated at start.", + "display": "GameID", + "required": false, + "value": "" + }, + "datapath": { + "type": "string", + "desc": "Save file location. If not set it defaults to a subfolder named \"DedicatedServer\" at the default Core Keeper save location.", + "display": "Data path", + "required": true, + "value": "" + }, + "maxplayers": { + "type": "integer", + "desc": "Maximum number of players that will be allowed to connect to server.", + "display": "Max players", + "required": true, + "value": "100" + }, + "worldmode": { + "type": "integer", + "desc": "Sets the world mode for the world. Can be Normal (0), Hard (1), Creative (2), Casual (4). NOTE: Changing between Creative and non-Creative worlds not currently supported.", + "display": "World mode", + "required": true, + "value": "0" + }, + "port": { + "type": "integer", + "desc": "What port to bind to. If not set, then the server will use the Steam relay network. If set, the clients will connect to the server directly and the port needs to be open.", + "display": "Port", + "required": false, + "value": "" + }, + "ip": { + "type": "string", + "desc": "What IP to bind the server to", + "display": "IP", + "required": true, + "value": "0.0.0.0" + }, + "season": { + "type": "integer", + "desc": "Overrides current season by setting to any of None (0), Easter (1), Halloween (2), Christmas (3), Valentine (4), Anniversary (5), CherryBlossom (6), LunarNewYear (7). -1 is default setting where it is set depending on system date. You can use either the season name or the corresponding number.", + "display": "Season", + "required": true, + "value": "-1" + } + }, + "install": [ + { + "appId": "1007", + "type": "steamgamedl" + }, + { + "appId": "1963720", + "type": "steamgamedl" + }, + { + "type": "writefile", + "target": "CoreKeeperServerLog.txt", + "text": "" + }, + { + "type": "writefile", + "target": "_launch.sh", + "text": "#!/bin/bash\n\nxvfbpid=\"\"\nckpid=\"\"\ntailpid=\"\"\ngreppid=\"\"\ninstalldir=\"$(dirname -- \"$0\";)\"\nexepath=\"$installdir/CoreKeeperServer\"\nrequirements=( \"libxi6\" \"xvfb\" )\nshutdown_command=\"shutdown\"\n\nsudo=\"sudo\" && [[ $(id -u) == 0 ]] && sudo=\"\"\nfunction kill_corekeeperserver {\n\tif [[ ! -z \"$ckpid\" ]]; then\n\t\tkill $ckpid\n\t\twait $ckpid\n\tfi\n\tif [[ ! -z \"$xvfbpid\" ]]; then\n\t\tkill $xvfbpid\n\t\twait $xvfbpid\n\tfi\n\tif [[ ! -z \"$tailpid\" ]]; then\n\t\tkill $tailpid\n\t\twait $tailpid\n\tfi\n\tif [[ ! -z \"$greppid\" ]]; then\n\t\tkill $greppid\n\t\twait $greppid\n\tfi\n\texit\n}\n\nfunction shutdown_server {\n\techo \"Shutting down server...\"\n\tkill_corekeeperserver\n}\n\ntrap kill_corekeeperserver EXIT\n\nfor r in \"${requirements[@]}\"\n\ndo\n\techo \"Checking for required package: $r\"\n\tif ! (dpkg -l $r >/dev/null); then\n\t\techo \"Installing missing package: $r\"\n\t\tsleep 1\n\t\t$sudo apt-get update -yy && $sudo apt-get install -yy \"$r\"\n\tfi\ndone\n\nset -m\n\nrm -f /tmp/.X99-lock\n\nXvfb :99 -screen 0 1x1x24 -nolisten tcp &\nxvfbpid=$!\n\nrm -f GameID.txt\n\nchmod +x \"$exepath\"\n\nDISPLAY=:99 LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:$installdir/../Steamworks SDK Redist/linux64/\" \\\n\"$exepath\" -batchmode -logfile CoreKeeperServerLog.txt -world ${world} -worldname \"${worldname}\" -worldseed ${worldseed} -gameid \"${gameid}\" -datapath \"${datapath}\" -maxplayers ${maxplayers} -worldmode ${worldmode} -port ${port} -ip ${ip} -season ${season} \"$@\" &\n\nckpid=$!\n\necho \"Started server process with pid $ckpid\"\n\nwhile [ ! -f GameID.txt ]; do\n\tsleep 0.1\ndone\n\necho \"Game ID: $(cat GameID.txt)\"\n\ntail -f $installdir/CoreKeeperServerLog.txt | grep \"^[userid:[0-9]*] player\" &\ntail_and_grep_pid=$(ps -ho pgid $!)\npids=$(pgrep -ag $tail_and_grep_pid)\ntailpid=$(echo \"$pids\" | awk 'NR==1{print $1}')\ngreppid=$(echo \"$pids\" | awk 'NR==2{print $1}')\n\nwhile true; do\n\tread -p \"\" command\n\tif [ \"$command\" == \"$shutdown_command\" ]; then\n\t\tshutdown_server\n\tfi\ndone" + }, + { + "commands": [ + "chmod +x _launch.sh" + ], + "type": "command" + } + ], + "run": { + "stop": "shutdown", + "command": "./_launch.sh" + }, + "environment": { + "type": "tty" + }, + "supportedEnvironments": [ + { + "type": "tty" + } + ], + "requirements": { + "os": "linux", + "arch": "amd64" + } +} \ No newline at end of file diff --git a/terraria-tmodloader/README.md b/terraria-tmodloader/README.md index 838c9db1..054d396b 100644 --- a/terraria-tmodloader/README.md +++ b/terraria-tmodloader/README.md @@ -1,17 +1,17 @@ -# Template for [tModLoader](https://www.tmodloader.net/) -This template makes it possible to run [tModLoader](https://www.tmodloader.net/) with [PufferPanel](https://www.pufferpanel.com/) on Linux. +Terarria - tModLoader Template - made for linux non arm +How to install mods: -## Notes -* It features a script for automatic mod enable listing. -* Download your mods and put them in the mods folder. +1. Upload the .tmod file into the mods folder +2. Edit the enabled.json inside the mods folder -## Enabling mods +For example in my mods folder i have three mods (mod1.tmod, mod2.tmod and mod3.tmod) and so my enabled.json looks like this: +[ + "Mod1", + "Mod2", + "Mod3" +] -* If auto enables mod is set to true, mods will be enabled automatically. -* If auto enables mod is set to false : - * Edit the enabled.json inside the mods folder - * For example in my mods folder i have three mods (mod1.tmod, mod2.tmod and mod3.tmod) and so my enabled.json looks like this: [ "Mod1", "Mod2", "Mod3" ] +NOTE: Adding mods after the world was first created may not ever work - -This only supports Linux. \ No newline at end of file +Do not forget to install the tModLoader also on your PC (https://store.steampowered.com/app/1281930/tModLoader) and also to activate the automatic mod download from the server! diff --git a/terraria-tmodloader/terraria-tmodloader.json b/terraria-tmodloader/terraria-tmodloader.json index 0caf9ee4..dd1b03e1 100644 --- a/terraria-tmodloader/terraria-tmodloader.json +++ b/terraria-tmodloader/terraria-tmodloader.json @@ -1,24 +1,16 @@ { - "name": "terraria-tmodloader", "type": "terraria", "display": "Terraria - tModLoader", "data": { "abr": { - "type": "integer", + "type": "string", "desc": "Sets the announcementbox text messaging range in pixels, -1 for serverwide announcements.", "display": "announcementbox-range", "required": true, "value": "-1" }, - "autoEnableMods": { - "type": "boolean", - "desc": "Automatically enables all mods in the mods folder", - "display": "Auto Enable Mods", - "required": true, - "value": "true" - }, "backups": { - "type": "integer", + "type": "string", "desc": "Sets the number of rolling world backups to keep", "display": "Backups", "required": true, @@ -32,7 +24,7 @@ "value": "banlist.txt" }, "difficulty": { - "type": "integer", + "type": "string", "desc": "This can not be changed after the world was generated - Options: 0 - (normal), 1 - (expert), 2 - (master), 3 - (journey)", "display": "Difficulty", "required": true, @@ -73,7 +65,7 @@ "value": "mods" }, "npcs": { - "type": "integer", + "type": "string", "desc": "Reduces enemy skipping but increases bandwidth usage. The lower the number the less skipping will happen, but more data is sent. 0 is off.", "display": "npcstream", "required": true, @@ -87,28 +79,28 @@ "value": "" }, "players": { - "type": "integer", + "type": "string", "desc": "Max Players", "display": "Players", "required": true, "value": "4" }, "port": { - "type": "integer", + "type": "string", "desc": "What port to bind the server to", "display": "Port", "required": true, "value": "7777" }, "priority": { - "type": "integer", + "type": "string", "desc": "Set priority 0:Realtime, 1:High, 2:Above-Normal, 3:Normal, 4:Below-Normal, 5:Idle", "display": "priority", "required": true, "value": "1" }, "secure": { - "type": "integer", + "type": "string", "desc": "Enable cheat protection = 1 and disable = 0", "display": "secure", "required": true, @@ -119,36 +111,36 @@ "desc": "This can not be changed after the world was generated - Seed of the World", "display": "Seed", "required": true, - "value": "" + "value": "VeryGoodStartingSeed" }, "size": { - "type": "integer", + "type": "string", "desc": "This can not be changed after the world was generated - World Size (1-3 - 3 is biggest)", "display": "World-Size", "required": true, "value": "3" }, "sl": { - "type": "integer", + "type": "string", "desc": "Reduces maximum liquids moving at the same time. If enabled may reduce lags but liquids may take longer to settle.", "display": "maximum liquids moving", "required": true, "value": "1" }, + "tversion": { + "type": "string", + "desc": "tModLoader Version", + "display": "tModLoader Version (Set this to the latest tModLoader version - see https://github.com/tModLoader/tModLoader/releases/latest)", + "required": true, + "value": "0.11.8.6" + }, "upnp": { - "type": "integer", + "type": "string", "desc": "Enable upnp = 1 and disable = 0", "display": "upnp", "required": true, "value": "1" }, - "version": { - "type": "string", - "desc": "tModLoader Version", - "display": "tModLoader Version (Set this to the latest tModLoader version - see https://github.com/tModLoader/tModLoader/releases/latest)", - "required": true, - "value": "v2024.03.3.2" - }, "world": { "type": "string", "desc": "Name of your World", @@ -166,79 +158,60 @@ }, "install": [ { - "target": "server", - "type": "mkdir" - }, - { - "target": "${wp}", - "type": "mkdir" - }, - { - "target": "${mp}", - "type": "mkdir" - }, - { - "type": "download", "files": [ - "https://github.com/tModLoader/tModLoader/releases/download/${version}/tModLoader.zip" - ] + "https://github.com/tModLoader/tModLoader/releases/download/v${tversion}/tModLoader.Linux.v${tversion}.tar.gz" + ], + "type": "download" }, { - "type": "writefile", - "target": "EnableAllMods.sh", - "text": "#!/bin/bash\nif [ \"$1\" == \"false\" ]; then\n exit 0\nfi\n\nenabledMods=\"[\"\n\nfor file in ./mods/*.tmod; do\n modName=\"$(basename \"$file\" .tmod)\"\n enabledMods=\"$enabledMods\\n\\t\\\"$modName\\\",\"\n echo \"$modName\"\ndone\n\nenabledMods=\"${enabledMods::-1}\\n]\"\necho -e \"Enabled Mods: $enabledMods\"\necho -e \"$enabledMods\" > \"mods/enabled.json\"" + "commands": [ + "mv ./${mp}/enabled.json ./", + "rm -r ./server", + "mkdir ./server", + "tar -xf tModLoader.Linux.v${tversion}.tar.gz --directory ./server", + "chmod +x ./server/tModLoaderServer", + "chmod +x ./server/tModLoaderServer.bin.x86", + "chmod +x ./server/tModLoaderServer.bin.x86_64", + "mkdir ./${wp}", + "mkdir ./${mp}", + "rm tModLoader.Linux.v${tversion}.tar.gz" + ], + "type": "command" }, { - "type": "writefile", "target": "serverconfig.txt", - "text": "world=../${wp}/${world}.wld\nautocreate=${size}\nseed=${seed}\nworldname=${world}\ndifficulty=${difficulty}\nmaxplayers=${players}\nport=${port}\npassword=${password}\nmotd=${motd}\nworldpath=../${wp}\nbanlist=../${ban}\nsecure=${secure}\nlanguage=${lang}\nupnp=${upnp}\nnpcstream=${npcs}\npriority=${priority}\nslowliquids=${sl}\nworldrollbackstokeep=${backups}\nmodpath=../${mp}" + "text": "world=../${wp}/${world}.wld\nautocreate=${size}\nseed=${seed}\nworldname=${world}\ndifficulty=${difficulty}\nmaxplayers=${players}\nport=${port}\npassword=${password}\nmotd=${motd}\nworldpath=../${wp}\nbanlist=../${ban}\nsecure=${secure}\nlanguage=${lang}\nupnp=${upnp}\nnpcstream=${npcs}\npriority=${priority}\nslowliquids=${sl}\nworldrollbackstokeep=${backups}", + "type": "writefile" }, { - "type": "writefile", - "target": "enabled.json", - "text": "[\n \"*\"\n]" + "target": "enabled.jsonn", + "text": "[\n \"Mod1\",\n \"Mod2\",\n \"Mod3\"\n]", + "type": "writefile" }, { - "type": "command", "commands": [ - "unzip tModLoader.zip -d ./server", - "chmod +x ./server/LaunchUtils/ScriptCaller.sh", - "rm tModLoader.zip", - "chmod +x ./EnableAllMods.sh" - ] - }, - { - "source": "enabled.json", - "target": "${mp}/enabled.json", - "type": "move" + "mv ./enabled.jsonn ./${mp}/enabled.json", + "mv ./enabled.json ./${mp}/enabled.json" + ], + "type": "command" } ], "run": { - "command": "server/LaunchUtils/ScriptCaller.sh -server -ip ${ip} ${disableannouncementbox} -announcementboxrange ${abr} -config ../serverconfig.txt", + "command": "./server/tModLoaderServer -ip ${ip} ${disableannouncementbox} -announcementboxrange ${abr} -config ../serverconfig.txt", "stop": "exit", - "environmentVars": {}, "pre": [ { - "type": "command", - "commands": [ - "./EnableAllMods.sh ${autoEnableMods} " - ] + "target": "serverconfig.txt", + "text": "world=../${wp}/${world}.wld\nautocreate=${size}\nseed=${seed}\nworldname=${world}\ndifficulty=${difficulty}\nmaxplayers=${players}\nport=${port}\npassword=${password}\nmotd=${motd}\nworldpath=../${wp}\nbanlist=../${ban}\nsecure=${secure}\nlanguage=${lang}\nupnp=${upnp}\nnpcstream=${npcs}\npriority=${priority}\nslowliquids=${sl}\nworldrollbackstokeep=${backups}", + "type": "writefile" } - ], - "post": [] + ] }, "environment": { "type": "tty" }, - "supportedEnvironments": [ - { - "type": "tty" - } - ], "requirements": { - "binaries": [ - "unzip" - ], + "binaries": [ "tar" ], "os": "linux", "arch": "amd64" } From a6b20d20cf3379f4913647eab62c806ccdb9dbb4 Mon Sep 17 00:00:00 2001 From: Amatsu Date: Sun, 12 May 2024 11:08:40 -0400 Subject: [PATCH 5/6] Modify readme --- corekeeper/README.md | 5 ++++- corekeeper/corekeeper.json | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/corekeeper/README.md b/corekeeper/README.md index be14f6ee..34d44e99 100644 --- a/corekeeper/README.md +++ b/corekeeper/README.md @@ -1,2 +1,5 @@ ## Notes -This only supports Linux. \ No newline at end of file +This only supports Linux. + +## Important +**Make sure to stop the server, if you kill it, the server will still run in the background.** \ No newline at end of file diff --git a/corekeeper/corekeeper.json b/corekeeper/corekeeper.json index cfe2336b..261f6658 100644 --- a/corekeeper/corekeeper.json +++ b/corekeeper/corekeeper.json @@ -75,10 +75,6 @@ } }, "install": [ - { - "appId": "1007", - "type": "steamgamedl" - }, { "appId": "1963720", "type": "steamgamedl" From 47ed1867de7459ea6693f9060002c6c65bbf07f1 Mon Sep 17 00:00:00 2001 From: Amatsu <91038682+Amatsu-Kami@users.noreply.github.com> Date: Sun, 12 May 2024 11:10:08 -0400 Subject: [PATCH 6/6] Update README.md --- corekeeper/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corekeeper/README.md b/corekeeper/README.md index 34d44e99..2eacde10 100644 --- a/corekeeper/README.md +++ b/corekeeper/README.md @@ -2,4 +2,4 @@ This only supports Linux. ## Important -**Make sure to stop the server, if you kill it, the server will still run in the background.** \ No newline at end of file +**Make sure to stop the server. If you kill it, the server will still run in the background.**