Skip to content

Conversation

@JacksonTheMaster
Copy link
Collaborator

@JacksonTheMaster JacksonTheMaster commented Sep 1, 2025

Significant Backend improvements, Connected player tracking, Restore Fixes

Warning

This update includes significant backend improvements and new features. If you encounter any issues, please report them via Discord or GitHub Issues.

Important

To use SSUI with the current Stationeers Beta, visit Config -> Beta Settings -> Use New Terrain and Save System -> True.

New Features

  • Connected Players Dashboard: Introduced a new Web UI section displaying currently connected players, with random Stationeers character images for visual flair. Images persist across sessions until browser tab close, and the list auto-refreshes every 10 seconds for real-time monitoring. Clears automatically on server shutdown.
  • Scheduled Daily Restarts: Added support for automatic daily server restarts at a specified time, with flexible parsing for both 24-hour (e.g., 15:04) and 12-hour (e.g., 03:04PM) formats. Enable via config page -> Scheduled Gameserver Restart setting.
  • Backend Logs Console Tab: Added a console tab in the UI for viewing (info, warn, error) backend logs, with subtile color-coded styling based on log levels for easier troubleshooting.
  • Logs Endpoint: Implemented a new /logs API endpoint (e.g., /logs/info) to stream logs at various levels, including a "backend" mode that shows all levels combined. /logs/debug only shows debug if log level is set to 10.
  • SSUI Identifier Customization: Renamed and expanded the login header customization field in config.json to SSUIIdentifier, which now also appears on the index page (replacing the branch name if set) for personalized branding.

Fixed Hanging / Blocking issues on Windows

The previous logger implementation caused situations where the main thread would hang on Windows due to blocking terminal console I/O operations (syscall.WriteConsole), particularly when the console was in QuickEdit mode or the terminal console buffer was full. This halted the main thread, meaning SSUI would become useless unless enter was pressed on the terminal console, impacting basically every aspect of SSUI. Multiple bugfixing martathons by @JacksonTheMaster have introduced asynchronous logging to prevent server hangs.

This PR addresses these issues by:

  • Making the logger fully non-blocking to ensure server stability on Windows.
  • Preserving log message order across all outputs (console, log files, SSE streams).
  • Providing Aggressive SSE notifications in game server console on UI and in the new backend log tab when the console is blocked.
  • Disabling Windows console QuickEdit mode to reduce blocking scenarios.
  • This means and copying the terminal is no longer possible on Windows. Use the Scrollbar to scroll, and enable logfiles in config.json is you need to access the text.

Completely overhauled the config system...

  • ...to be fully thread safe now. For users, there is no functional change, but code-wise this is a major improvement.
  • config.json now contains values that are a default value for better readability.
  • The random JWT Token is now persisted in config.json, reducing the need to log back in after SSUI restarts.

Bug Fixes

Game related

  • Fixed an issue with save restoration where the gameserver wouldn't load the correct save; now properly updates the DateTime in world_meta.xml for accurate loading.
  • Resolved player tracking inaccuracies on the Stationeers beta branch caused by upstream logging changes.
  • Ignored harmless "Fallback handler could not load library" errors from Stationeers/BepInEx race conditions, reducing unnecessary log spam.

SSUI related

  • Multiple User Support Fix: The user registration system now properly handles multiple users defined in config.json without overwriting existing entries.
  • Ensured CleanUpOldExecutables only runs on the root directory to prevent unintended deletions.
  • Corrected cleanup interval assignment in backup config retrieval.

General Improvements

  • Auto Restart Enhancements: Improved overall auto restart logic, including saving the game state beforehand for safer operations.
  • Backup Management:
    • Backups now auto-refresh every 30 seconds in the UI.
    • Disabled pre-restore HEAD backup logic during restoration.
    • SSUI now Stops the server before restoring a backup and updated the success message for clarity.
  • UI Enhancements:
    • updated page title to say SSUI instead of Game Server Control and include version and SSUI identifier
    • Revamped the backup manager design for better consistency and usability, with improved CSS and mobile-responsive styles for backup controls.
    • added some more funnyMessages to console
    • Enhanced error handling and visibility across backup and restore operations.
  • Logging:
    • Reduced clutter by moving non-essential messages (e.g., backup copy success) to debug level.
    • Implemented asynchronous logging with buffered channels for better performance on windows
    • Added a clean subsystem logger
  • Windows-Specific Tweaks: Disabled QuickEdit in the console to minimize blocking issues during operations.
  • Discord Rich Presence: Updated the library to v1.1.0, adding Windows support alongside Linux.
  • Security and Performance:
    • Backported TLS updates from SteamServerUI for improved secure connections.
    • Updated to Go 1.25.0 for enhanced runtime efficiency and security.
  • Configuration and Setup:
    • Clarified save identifier details in the config page and initial setup wizard with specific world types instead of text where to find them.
    • added supportMode and supportPackage
    • updated PrintConfigDetails to include all config values again
  • Updated error messages (e.g., backup directory issues) for better user guidance.
    ...much more little improvements and bugfixes improving overall code quality

Important

To use SSUI with the current Stationeers Beta, visit Config -> Beta Settings -> Use New Terrain and Save System -> True.

JacksonTheMaster and others added 30 commits August 12, 2025 15:50
…ecific world types for clarity and user guidance
…condition (Stationeers / Bepinex) but no effect on server so can be ignored
… to make the gameserver load the correct save when restoring saves.
- Added styling and automatic fetch at server startup
(removed JXSN.dev Steam fetching api implementations again due to misuse considerations brough up by @mitoskalandiel)
- Added PlayerImages with Stationeers characters instead
Backups fetch every 30 sec, players every 10 sec.
…he user defined in config.json. Now supports multiple users
- Replaced mutex locks with read locks for config getters in getters.go to resolve deadlock issues on main thread
- Updated references to control message ID and buffer flush ticker in discordbot files to use local vars instead of config vars
…ssues on Windows

added logger.SubSystem.Clean to print log messages without prefixes / metadata
@JacksonTheMaster JacksonTheMaster merged commit 733f7cf into main Sep 1, 2025
1 check passed
@JacksonTheMaster JacksonTheMaster deleted the nightly branch September 13, 2025 12:14
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