From 647cdd9287997691e60b7a471975dddeb0142c28 Mon Sep 17 00:00:00 2001 From: NATroutter Date: Sat, 17 Jan 2026 22:59:53 +0200 Subject: [PATCH] Moved libraries to egg-hytale/lib folder Renamed egg variables for consistency Added option for toggling custom persistent auth Added skipn update when getting downloader version --- Dockerfile | 7 ++++-- README.md | 31 ++++++++++++++++++----- egg-hytale.pelican.json | 32 +++++++++++++++++------- egg-hytale.pterodactyl.json | 24 ++++++++++++------ entrypoint.sh | 49 ++++++++++++++++++++++--------------- lib/downloader.sh | 4 +-- 6 files changed, 101 insertions(+), 46 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d447a2..2ac2e69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,9 +42,12 @@ COPY --chmod=755 ./entrypoint.sh /entrypoint.sh # Strip Windows line endings (\r) just in case the file was edited on Windows RUN sed -i 's/\r$//' /entrypoint.sh +# Create egg-hytale folder +RUN mkdir -p /egg-hytale + # Copy lib directory -COPY --chmod=755 ./lib /lib -RUN sed -i 's/\r$//' /lib/*.sh +COPY --chmod=755 ./lib /egg-hytale/lib +RUN sed -i 's/\r$//' /egg-hytale/lib/*.sh # Create the container user RUN useradd -m -d /home/container -s /bin/bash container diff --git a/README.md b/README.md index 20a760a..b067597 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,31 @@ Both Pelican Panel and Pterodactyl Panel are fully supported with dedicated egg ## Features -- Automated Hytale server installation -- Automatic download of server files from official sources -- Configurable server parameters -- Easy setup and deployment +- Automated Hytale server installation and updates +- Multi-architecture support (x86_64 & ARM64) +- Automatic `hytale-sourcequery` plugin installation +- Built-in server validation tools (World, Assets, Prefabs) +- Performance optimizations via AOT Cache support +- Configurable server parameters and JVM arguments +- Integrated backup management system +- Multiple authentication modes (Standard & GSP) - Support for custom asset packs -- Backup management -- Multiple authentication modes + +## System Requirements + +| Component | Minimum | Recommended | +| --------- | ------- | ----------- | +| RAM | 8 GB | 16 GB+ | +| CPU | Intel Core i5-7500 (or equivalent), AMD Ryzen 3 1200 (or equivalent) | Intel Core i5-10400 (or equivalent), AMD Ryzen 5 3600 (or equivalent) | +| Storage | 10 GB | 20 GB+ | + +## Ports + +| Port | Protocol | Description | +| ---- | -------- | ----------- | +| 5520 | UDP | Game Server Port (Default) | +| 5521 | TCP | Query (Optional) | + ## Installation @@ -132,6 +150,7 @@ This project is licensed under the MIT License - see the LICENSE file for detail - Hytale team for the game and server software - Pelican Panel and Pterodactyl Panel for the hosting platforms +- [physgun-com](https://github.com/physgun-com) for the [hytale-sourcequery](https://github.com/physgun-com/hytale-sourcequery) plugin - Community contributors ## Links diff --git a/egg-hytale.pelican.json b/egg-hytale.pelican.json index 81603ac..5d9caf4 100644 --- a/egg-hytale.pelican.json +++ b/egg-hytale.pelican.json @@ -4,7 +4,7 @@ "version": "PLCN_v3", "update_url": "https://cdn.nat.gg/egg/egg-hytale.pelican.json" }, - "exported_at": "2026-01-17T12:47:20+00:00", + "exported_at": "2026-01-17T20:49:11+00:00", "name": "Hytale", "author": "contact@natroutter.fi", "uuid": "6594b287-2d7b-4249-bc93-4d40283c57e3", @@ -21,9 +21,9 @@ "Hytale": "ghcr.io/natroutter/egg-hytale:latest" }, "file_denylist": [ + "start.sh", "hytale-downloader-linux-amd64", - "hytale-downloader-linux-arm64", - "start.sh" + "hytale-downloader-linux-arm64" ], "startup_commands": { "Default": "./start.sh" @@ -120,7 +120,7 @@ "sort": 7 }, { - "name": "Boot commands", + "name": "Boot Commands", "description": "Comma-separated commands to run on server start (executed synchronously in order)", "env_variable": "BOOT_COMMANDS", "default_value": "", @@ -193,7 +193,7 @@ "sort": 17 }, { - "name": "Force network flush", + "name": "Force Network Flush", "description": "Forces the server to immediately send all pending network data to clients, bypassing normal buffering. This can reduce delays for critical updates but may slightly increase network usage.", "env_variable": "FORCE_NETWORK_FLUSH", "default_value": "0", @@ -270,7 +270,7 @@ "sort": 14 }, { - "name": "Memory overhead", + "name": "Memory Overhead", "description": "The amount of RAM (in MB) kept aside for the system so the server doesn\u2019t use everything. Java will get the rest.", "env_variable": "MEMORY_OVERHEAD", "default_value": "0", @@ -323,7 +323,7 @@ "sort": 12 }, { - "name": "Require valid assets", + "name": "Require Valid Assets", "description": "Causes the server to exit with an error code if assets are invalid.", "env_variable": "VALIDATE_ASSETS", "default_value": "0", @@ -335,7 +335,7 @@ "sort": 21 }, { - "name": "Require valid prefabs", + "name": "Require Valid Prefabs", "description": "Forces the server to stop and exit with an error if any specified prefab types are invalid. Provide a comma-separated list of prefab categories (e.g. PHYSICS,BLOCKS,BLOCK_STATES,ENTITIES,BLOCK_FILLER) to check. Leave empty to skip validation.", "env_variable": "VALIDATE_PREFABS", "default_value": "", @@ -348,7 +348,7 @@ "sort": 20 }, { - "name": "Require valid world generation", + "name": "Require Valid World Generation", "description": "Causes the server to exit with an error code if world gen is invalid.", "env_variable": "VALIDATE_WORLD_GENERATION", "default_value": "0", @@ -372,6 +372,20 @@ "required" ], "sort": 23 + }, + { + "name": "Use Persistent Authentication", + "description": "Enabling this option activates the egg's built-in authentication and credentials storage system for the game. If disabled, it is assumed that you will use the game's own authentication system.", + "env_variable": "USE_PERSISTENT_AUTHENTICATION", + "default_value": "ENABLED", + "user_viewable": true, + "user_editable": true, + "rules": [ + "required", + "string", + "in:ENABLED,DISABLED" + ], + "sort": 27 } ] } \ No newline at end of file diff --git a/egg-hytale.pterodactyl.json b/egg-hytale.pterodactyl.json index 65cc0ad..d3801cb 100644 --- a/egg-hytale.pterodactyl.json +++ b/egg-hytale.pterodactyl.json @@ -4,7 +4,7 @@ "version": "PTDL_v2", "update_url": "https:\/\/raw.githubusercontent.com\/NATroutter\/egg-hytale\/refs\/heads\/main\/egg-hytale.pterodactyl.json" }, - "exported_at": "2026-01-17T14:47:33+02:00", + "exported_at": "2026-01-17T22:46:50+02:00", "name": "Hytale", "author": "contact@natroutter.fi", "description": "Hytale is a block-based sandbox game that blends creative building with RPG adventure. Explore procedurally generated worlds filled with unique biomes, dungeons, and creatures. Build anything from simple homes to grand castles, craft items, and battle monsters. Create custom content with built-in modding tools, host your own servers, and shape the experience with plugins and mods. Play solo or with friends in a world designed for both creation and exploration.\r\n\r\nCredits:\r\n- Made by NATroutter\r\n- https:\/\/natroutter.fi\r\n- https:\/\/github.com\/NATroutter", @@ -151,7 +151,7 @@ "field_type": "text" }, { - "name": "Memory overhead", + "name": "Memory Overhead", "description": "The amount of RAM (in MB) kept aside for the system so the server doesn\u2019t use everything. Java will get the rest.", "env_variable": "MEMORY_OVERHEAD", "default_value": "0", @@ -171,7 +171,7 @@ "field_type": "text" }, { - "name": "Boot commands", + "name": "Boot Commands", "description": "Comma-separated commands to run on server start (executed synchronously in order)", "env_variable": "BOOT_COMMANDS", "default_value": "", @@ -181,7 +181,7 @@ "field_type": "text" }, { - "name": "Force network flush", + "name": "Force Network Flush", "description": "Forces the server to immediately send all pending network data to clients, bypassing normal buffering. This can reduce delays for critical updates but may slightly increase network usage.", "env_variable": "FORCE_NETWORK_FLUSH", "default_value": "0", @@ -211,7 +211,7 @@ "field_type": "text" }, { - "name": "Require valid world generation", + "name": "Require Valid World Generation", "description": "Causes the server to exit with an error code if world gen is invalid.", "env_variable": "VALIDATE_WORLD_GENERATION", "default_value": "0", @@ -221,7 +221,7 @@ "field_type": "text" }, { - "name": "Require valid prefabs", + "name": "Require Valid Prefabs", "description": "Forces the server to stop and exit with an error if any specified prefab types are invalid. Provide a comma-separated list of prefab categories (e.g. PHYSICS,BLOCKS,BLOCK_STATES,ENTITIES,BLOCK_FILLER) to check. Leave empty to skip validation.", "env_variable": "VALIDATE_PREFABS", "default_value": "", @@ -231,7 +231,7 @@ "field_type": "text" }, { - "name": "Require valid assets", + "name": "Require Valid Assets", "description": "Causes the server to exit with an error code if assets are invalid.", "env_variable": "VALIDATE_ASSETS", "default_value": "0", @@ -289,6 +289,16 @@ "user_editable": true, "rules": "required|boolean", "field_type": "text" + }, + { + "name": "Use Persistent Authentication", + "description": "Enabling this option activates the egg's built-in authentication and credentials storage system for the game. If disabled, it is assumed that you will use the game's own authentication system.", + "env_variable": "USE_PERSISTENT_AUTHENTICATION", + "default_value": "ENABLED", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|in:ENABLED,DISABLED", + "field_type": "text" } ] } \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index cf5f84e..6ecbce2 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,12 +1,13 @@ #!/bin/bash -source "$(dirname "$0")/lib/utilities.sh" -source "$(dirname "$0")/lib/authentication.sh" -source "$(dirname "$0")/lib/system.sh" -source "$(dirname "$0")/lib/downloader.sh" -source "$(dirname "$0")/lib/plugins.sh" +source "/egg-hytale/lib/utilities.sh" +source "/egg-hytale/lib/authentication.sh" +source "/egg-hytale/lib/system.sh" +source "/egg-hytale/lib/downloader.sh" +source "/egg-hytale/lib/plugins.sh" DOWNLOAD_URL="https://downloader.hytale.com/hytale-downloader.zip" DOWNLOAD_FILE="hytale-downloader.zip" +DOWNLOADER_DIR="/egg-hytale/downloader" DOWNLOAD_CRED_FILE=".hytale-downloader-credentials.json" AUTH_CACHE_FILE=".hytale-auth-tokens.json" VERSION_FILE="version.txt" @@ -51,31 +52,39 @@ run_update_process validate_server_files install_sourcequery + # Check if GSP mode (tokens provided externally) if [ -n "$OVERRIDE_SESSION_TOKEN" ] && [ -n "$OVERRIDE_IDENTITY_TOKEN" ]; then logger info "Using provided session and identity tokens..." SESSION_TOKEN="$OVERRIDE_SESSION_TOKEN" IDENTITY_TOKEN="$OVERRIDE_IDENTITY_TOKEN" else - # Standard mode: perform authentication - if check_cached_tokens && load_cached_tokens; then - logger info "Using cached authentication..." - if refresh_access_token; then - # Update cache in case refresh token rotated - save_auth_tokens - # Create fresh game session - if ! create_game_session; then - exit 1 + # Default to persistent authentication if not specified + if [ -z "$USE_PERSISTENT_AUTHENTICATION" ]; then + USE_PERSISTENT_AUTHENTICATION="ENABLED" + fi + + if [ "$USE_PERSISTENT_AUTHENTICATION" = "ENABLED" ]; then + # Standard mode: perform authentication + if check_cached_tokens && load_cached_tokens; then + logger info "Using cached authentication..." + if refresh_access_token; then + # Update cache in case refresh token rotated + save_auth_tokens + # Create fresh game session + if ! create_game_session; then + exit 1 + fi + else + # Refresh failed, need full re-auth + logger info "Refresh token expired, re-authenticating..." + rm -f "$AUTH_CACHE_FILE" + perform_authentication fi else - # Refresh failed, need full re-auth - logger info "Refresh token expired, re-authenticating..." - rm -f "$AUTH_CACHE_FILE" + # Perform full authentication if no valid cache exists perform_authentication fi - else - # Perform full authentication if no valid cache exists - perform_authentication fi fi diff --git a/lib/downloader.sh b/lib/downloader.sh index 8674a04..7dc96b6 100644 --- a/lib/downloader.sh +++ b/lib/downloader.sh @@ -39,7 +39,7 @@ run_update_process() { fi # Save version info after initial setup - local DOWNLOADER_VERSION=$($DOWNLOADER -print-version 2>&1) + local DOWNLOADER_VERSION=$($DOWNLOADER -print-version -skip-update-check 2>&1) if [ $? -eq 0 ] && [ -n "$DOWNLOADER_VERSION" ]; then echo "$DOWNLOADER_VERSION" > $VERSION_FILE logger success "Saved version info!" @@ -59,7 +59,7 @@ run_update_process() { logger warn "Version file not found, forcing update" fi - local DOWNLOADER_VERSION=$($DOWNLOADER -print-version 2>&1) + local DOWNLOADER_VERSION=$($DOWNLOADER -print-version -skip-update-check 2>&1) if [ $? -ne 0 ] || [ -z "$DOWNLOADER_VERSION" ]; then logger error "Failed to get downloader version."