Skip to content

Conversation

@IvayloMarinovSt
Copy link
Contributor

Fix version checking for hytale-downloader and HytaleServer.jar

Problem

The startup script had issues with version checking:

  1. hytale-downloader updates: No check for downloader updates, so it could become outdated.
  2. HytaleServer.jar version checking: Relied on a version.txt file instead of querying the installed jar, which could be inaccurate if the file was out of sync.

Solution

This PR rewrites the version checking logic to:

  1. Check and update hytale-downloader first: Uses hytale-downloader -check-update to update the downloader if needed before checking server versions.
  2. Direct version comparison:
    • Gets the available version from hytale-downloader -print-version
    • Gets the installed version by running java -jar Server/HytaleServer.jar --version and extracting the version string
    • Compares them directly instead of using a version file

Changes

  • ✅ Added hytale-downloader -check-update at startup to keep the downloader up to date
  • ✅ Removed version.txt file-based version tracking
  • ✅ Added direct version extraction from the installed HytaleServer.jar using --version
  • ✅ Improved output cleaning for reliable version comparison (handles carriage returns, whitespace, multi-line output)
  • ✅ Better error handling when version extraction fails

Technical Details

  • Available version: Extracted from hytale-downloader -print-version output (e.g., 2026.01.15-c04fdfe10)
  • Installed version: Extracted from HytaleServer v2026.01.15-c04fdfe10 (release) output by parsing the version string after the v prefix
  • Comparison: Direct string comparison after cleaning both versions
  • Update logic: Downloads and updates only when versions differ or the jar is missing

Testing

The script now:

  • ✅ Updates hytale-downloader automatically when outdated
  • ✅ Accurately detects when HytaleServer.jar needs updating by comparing actual versions
  • ✅ Handles missing jar files gracefully
  • ✅ Provides clear logging about version status and update actions

Backward Compatibility

  • All existing environment variables continue to work
  • The ENABLE_AUTO_UPDATE flag behavior is unchanged
  • Error handling for 403 Forbidden responses is preserved
  • No breaking changes to the Docker setup or volume structure

The script is now more reliable and ensures both the downloader and server are kept up to date.

…d downloader integration. Added checks for available and installed versions, enhanced error handling, and streamlined download process for HytaleServer.jar.
@IvayloMarinovSt
Copy link
Contributor Author

I am not sure if 'hytale-downloader -check-update' will actually update the downloader since there were no new versions of the downloader since 01.09 yet.

@Slowline
Copy link
Owner

Hey, seems indeed like a better way to keep the version up to date.

I also couldn’t find any information on whether the command actually updates the file or just notifies of an available update. The Hytale developers mentioned that they plan to publish another blog post about server hosting sometime soon, so maybe they’ll clarify it there. The dev posted this on X https://x.com/slikey/status/2011653830253977770

@Slowline Slowline merged commit 79861ad into Slowline:main Jan 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants