From 346848c3c72bd4b766e36245bd84c6de57c7a8e9 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 6 Nov 2022 14:49:28 +0100 Subject: [PATCH] tshock support for v5 + split v4 to legacy egg --- game_eggs/terraria/tshock/README.md | 6 ++ .../terraria/tshock/egg-tshock-legacy.json | 72 +++++++++++++++++++ game_eggs/terraria/tshock/egg-tshock.json | 12 ++-- 3 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 game_eggs/terraria/tshock/egg-tshock-legacy.json diff --git a/game_eggs/terraria/tshock/README.md b/game_eggs/terraria/tshock/README.md index 16a21fc5..4b660e86 100644 --- a/game_eggs/terraria/tshock/README.md +++ b/game_eggs/terraria/tshock/README.md @@ -25,3 +25,9 @@ New startup: This will remove the autocreate function, and will thus allow you to download mods and generate world. Afterwards, you can change it back with the correct world name to start automatic. Word name is set in the configuration panel. + +Any version older then TShock v5 needs to use the legacy egg, and version newer or v5 must use the normal TShock one. + +## Migration from v4 to v5 + +If you're upgrading from TShock 4, you swith to the new egg copying the tshock configuration folder over (containing the sqlitedb file as well as the json configuration files, etc) to the new server, and starting the new server that way. \ No newline at end of file diff --git a/game_eggs/terraria/tshock/egg-tshock-legacy.json b/game_eggs/terraria/tshock/egg-tshock-legacy.json new file mode 100644 index 00000000..522f0912 --- /dev/null +++ b/game_eggs/terraria/tshock/egg-tshock-legacy.json @@ -0,0 +1,72 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2022-11-06T14:42:12+01:00", + "name": "tshock legacy", + "author": "parker@parkervcp.com", + "description": "The t-shock modded terraria server.\r\n\r\nhttps:\/\/tshock.co\/", + "features": null, + "docker_images": { + "mono": "ghcr.io\/parkervcp\/yolks:mono_latest" + }, + "file_denylist": [], + "startup": "mono TerrariaServer.exe -ip 0.0.0.0 -port {{SERVER_PORT}} -maxplayers {{MAX_PLAYERS}} -world {{WORLD_NAME}}.wld -autocreate {{WORLD_SIZE}}", + "config": { + "files": "{}", + "startup": "{\r\n \"done\": \"Type 'help' for a list of commands\"\r\n}", + "logs": "{}", + "stop": "exit" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\n# Vanilla tModloader Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget jq file unzip\r\n\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/Pryaxis\/TShock\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/Pryaxis\/TShock\/releases\")\r\n\r\nif [ -z \"$TSHOCK_VERSION\" ] || [ \"$TSHOCK_VERSION\" == \"latest\" ]; then\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url)\r\nelse\r\n VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION \"$TSHOCK_VERSION\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"$TSHOCK_VERSION\" == \"$VERSION_CHECK\" ]; then\r\n DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION \"$TSHOCK_VERSION\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url')\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## mkdir and cd to \/mnt\/server\/\r\nmkdir -p \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\n## download release\r\necho -e \"running: wget $DOWNLOAD_LINK\"\r\nwget $DOWNLOAD_LINK\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exeting\"\r\n exit 2 \r\nfi\r\n\r\necho -e \"install complete\"", + "container": "debian:buster-slim", + "entrypoint": "\/bin\/bash" + } + }, + "variables": [ + { + "name": "Max Players", + "description": "The maximum number of players a server will hold.", + "env_variable": "MAX_PLAYERS", + "default_value": "8", + "user_viewable": true, + "user_editable": false, + "rules": "required|numeric|digits_between:1,3", + "field_type": "text" + }, + { + "name": "World Size", + "description": "Defines the worlds size. 3 sizes 1 (small), 2 (medium), 3 (large).", + "env_variable": "WORLD_SIZE", + "default_value": "1", + "user_viewable": true, + "user_editable": false, + "rules": "required|numeric|digits_between:1,3", + "field_type": "text" + }, + { + "name": "World Name", + "description": "The name for the world file.", + "env_variable": "WORLD_NAME", + "default_value": "world", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|max:20", + "field_type": "text" + }, + { + "name": "Tshock Version", + "description": "The version on tshock that will be installed. \r\n\r\nLatest available is: v4.5.18!", + "env_variable": "TSHOCK_VERSION", + "default_value": "v4.5.18", + "user_viewable": true, + "user_editable": false, + "rules": "required|string|max:20", + "field_type": "text" + } + ] +} \ No newline at end of file diff --git a/game_eggs/terraria/tshock/egg-tshock.json b/game_eggs/terraria/tshock/egg-tshock.json index 81b61959..c82cb557 100644 --- a/game_eggs/terraria/tshock/egg-tshock.json +++ b/game_eggs/terraria/tshock/egg-tshock.json @@ -4,16 +4,16 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2022-10-15T14:09:35+02:00", + "exported_at": "2022-11-06T14:39:45+01:00", "name": "tshock", "author": "parker@parkervcp.com", "description": "The t-shock modded terraria server.\r\n\r\nhttps:\/\/tshock.co\/", "features": null, "docker_images": { - "mono": "ghcr.io\/parkervcp\/yolks:mono_latest" + "Dotnet 6": "ghcr.io\/parkervcp\/yolks:dotnet_6" }, "file_denylist": [], - "startup": "mono TerrariaServer.exe -ip 0.0.0.0 -port {{SERVER_PORT}} -maxplayers {{MAX_PLAYERS}} -world {{WORLD_NAME}}.wld -autocreate {{WORLD_SIZE}}", + "startup": ".\/TShock.Server -ip 0.0.0.0 -port {{SERVER_PORT}} -maxplayers {{MAX_PLAYERS}} -world {{WORLD_NAME}}.wld -autocreate {{WORLD_SIZE}}", "config": { "files": "{}", "startup": "{\r\n \"done\": \"Type 'help' for a list of commands\"\r\n}", @@ -22,8 +22,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Vanilla tModloader Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget jq file unzip\r\n\r\nGITHUB_PACKAGE=Pryaxis\/TShock\r\n\r\nif [ -z \"$GITHUB_USER\" ] && [ -z \"$GITHUB_OAUTH_TOKEN\" ] ; then\r\n echo -e \"using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u $GITHUB_USER:$GITHUB_OAUTH_TOKEN '\r\nfi\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/$GITHUB_PACKAGE\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/$GITHUB_PACKAGE\/releases\")\r\n\r\nif [ -z \"$TSHOCK_VERSION\" ] || [ \"$TSHOCK_VERSION\" == \"latest\" ]; then\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url)\r\nelse\r\n VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION \"$TSHOCK_VERSION\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"$TSHOCK_VERSION\" == \"$VERSION_CHECK\" ]; then\r\n DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION \"$TSHOCK_VERSION\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url')\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## mkdir and cd to \/mnt\/server\/\r\nmkdir -p \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\n## download release\r\necho -e \"running: wget $DOWNLOAD_LINK\"\r\nwget $DOWNLOAD_LINK\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exeting\"\r\n exit 2 \r\nfi\r\n\r\necho -e \"install complete\"", - "container": "debian:buster-slim", + "script": "#!\/bin\/bash\r\n# Vanilla tModloader Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget jq file unzip\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/Pryaxis\/TShock\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/Pryaxis\/TShock\/releases\")\r\n\r\nif [ -z \"$TSHOCK_VERSION\" ] || [ \"$TSHOCK_VERSION\" == \"latest\" ]; then\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i \"linux-x64\" | head -1 )\r\nelse\r\n VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION \"$TSHOCK_VERSION\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"$TSHOCK_VERSION\" == \"$VERSION_CHECK\" ]; then\r\n DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION \"$TSHOCK_VERSION\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i \"linux-x64\" | head -1 )\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i \"linux-x64\" | head -1)\r\n fi\r\nfi\r\n\r\n## mkdir and cd to \/mnt\/server\/\r\nmkdir -p \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\n## download release\r\necho -e \"running: wget $DOWNLOAD_LINK\"\r\nwget $DOWNLOAD_LINK -O TShock.zip\r\n\r\nunzip -o TShock.zip\r\n\r\ntar xvf TShock-*.tar\r\n\r\nrm TShock.zip TShock-*.tar\r\n\r\nchmod +x TShock.Server\r\n\r\necho -e \"install complete\"", + "container": "debian:bullseye-slim", "entrypoint": "\/bin\/bash" } }, @@ -69,4 +69,4 @@ "field_type": "text" } ] -} +} \ No newline at end of file