Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server extensions framework: custom features, world subs, binaries, and more #204

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

conker-rsc
Copy link
Member

@conker-rsc conker-rsc commented Feb 2, 2025

Major features

  • Private Server Extensions
    • Allows for code contributions to the RSC+ codebase which enable private server-specific features
    • Introduces the concept of private server-based feature flags into the RSC+ source code called "server extensions"
    • Extensions are enabled when selecting a world that specified a server_extension value in its corresponding ini file
    • The currently-active extension is stored when recording a replay and re-activated when playing it back (also noted in the replay queue window)
    • Extensions can be registered as "exclusive" for use with a specific server host or "common" for use by any private server wishing to do so
  • OpenRSC Framework Extension
    • Extension for use by any server host running the OpenRSC server codebase
    • Primarily intended for future development efforts
    • In this first release, bumps lag indicator threshold to 50ms
  • Official OpenRSC Server Extension
    • Extension for use exclusively by the officially-hosted OpenRSC servers
    • Welcome screen message flexes depending on the world type (e.g. "Welcome to RSC Preservation")
    • World population displayed for Preservation and Uranium worlds on the login and welcome screens
    • Will always inherit features which were also defined for the OpenRSC Framework extension
    • Allows for the future development of many desired enhancements previously incompatible with the RSC+ codebase
  • World Subscriptions
    • System for the automatic downloading and management of world files on startup
    • Allows private server operators to register hosted JSON APIs specifying world file data
    • Automatically downloads and adds / modifies / removes worlds on disk during application startup
    • Requires definition of a world_id for each world file pertaining to the private server (e.g. "preservation1")
    • Offers world type selection options (tied to world_id values) in the settings window "Worlds" tab (e.g. Preservation / Uranium)
    • Worlds downloaded from a subscription may not be edited or deleted via the settings GUI and will always appear first in the selection list
    • Each subscription is tied to a specific extension and restricts its usage to world files that match on corresponding registered host domain
    • Extensive validation logic added to prevent improper loading of extensions by incompatible worlds
    • Extension data within each world file is validated and sanitized on startup and when dragged in
    • Feature enabled via launch flag specifying the corresponding server extension identifier
    • Even when not explicitly enabled, world files matching a registered extension get automatically upgraded with certain fields, including extension data
  • Binary Distributions
    • Support for launching RSC+ via pre-built binaries
    • Allows for the creation of binaries that bundle a JRE such that users no longer have to separately install Java to run RSC+
    • Allows for consistent JRE version and heap settings across the userbase
    • When launched in this manner, all application name labels in the client will get prefixed (e.g. "OpenRSCPlus")
    • Optionally supports specifying custom binary-specific window/taskbar icons
    • Binary updating logic detects and prompts users for updates, separate from the JAR update process
    • Server-specific binaries must be tied to a server extension for customization and updating purposes
    • Uses values from specific launch flags that specify the corresponding extension identifier and current application version
  • Default RSC+ Binary
    • Distributed by RSC+ for general-purpose use, intended to replace launching from the JAR for most users
    • Distributed binary will be available for download for the following OS/architectures:
      • Windows 64-bit and 32-bit (windows XP compatible)
        • Distributed via setup.exe installation wizards
          • Adds desktop shortcuts for both the regular and console-based launcher
          • Adds application shortcuts to the start menu
          • Uninstallable via Windows "add/remove program" system menus, will retain non-critical files such as screenshots
      • MacOS ARM and 64-bit, via DMG installers
      • Linux, via an AppImage
    • Bundles the latest JRE (except for win32 builds, which continue to use the existing OJDK171 build)
    • Specifies a 1.5GB max heap size to prevent the extremely common "map loading" issue when a system decides to allocate insufficient heap to the RSC+ process
    • Not tied to any extension or world subscription
    • GitHub CD scripts added to automate the entire binary creation process
  • OpenRSCPlus Binary
    • Distributed by OpenRSC, intended to replace launching from the JAR for most users
    • Same features as noted for the default RSC+ binary above, with the following differences:
    • Enables the OpenRSC world subscription for automatic OpenRSC world file downloads
    • World files obtained from the subscription specify and enable the Official OpenRSC private server extension
    • Customized window / taskbar icons (thanks Logg for the new graphic!)
    • GitHub CD scripts hosted in a separate repository, under the RSCPlus organization

For way, way, more on all of the above, see the Private Server Extension Framework README

Client Features

  • Config files are now saved to standard directories for each OS type:
    • Locations:
      • Windows: %APPDATA%
      • MacOS: /Library/Application Support/
      • Linux: $XDG_CONFIG_HOME
    • The above locations will always be used when launching RSC+ from a binary distribution
    • When launching from the JAR for the first time, user will be prompted between this new behavior and the old behavior, dubbed "portable mode"
    • These locations will also be used if a user launches the JAR from a location that does not have system write permissions
    • Users who currently use the JAR will be unaffected unless settings are wiped
  • General-purpose world population displaying
    • World files now support a world_population_url field
    • When defined, the specified endpoint will be queried for a population count and the result will be displayed on the welcome and login screens
  • "Import Config" button added to the settings window for convenient loading of pre-existing config.ini files
    • After importing, the old config.ini file is saved to disk with a timestamp suffix
    • This also provides a simple mechanism for existing users who wish to upgrade to the new binary distributions
  • RSC+ will now remember the previously-selected world (based on connection settings) and re-select it on subsequent launches
    • Displays a warning modal to the user when connection details have changed between launches, to prevent users from submitting credentials to unintended destinations
  • Patched out the mudclient 5-second sleep timer invoked during application shutdown
  • When no worlds exist:
    • Displays a slowly-flashing arrow pointing to the settings gear when the user attempts to login
    • Prevent welcome message rendering
    • Prevents skipping to the login screen
    • Conditionally hides the "Sign Up" button on the login screen
  • Specific to macOS binaries:
    • Added options to the tray menu and dock icon for easy launching of additional application instances
    • Hooks the native "About" macOS menu item to launch the RSC+ settings "About" tab
    • Hooks the native "Quit" macOS menu item to properly shut down the application
  • "About" settings tab updated to show current server extension when active
  • Prevents players from adding worlds while logged in (URL checking and server extension validate will the block game thread)

Gameplay features

  • Added option to disable automatic message tab switching (OFF by default, bound to ALT-Y)
  • Added option to disable automatic camera rotation on new account creation (ON by default)
  • Removed sleeping bag shortcut per request from the OpenRSC administration team

Enhancements

  • Screenshots are now saved in per-character subdirectories
  • New default window icons used by all Swing windows (displayed in the windows corner and OS taskbar)
  • Hovering over the world selection boxes on the login window now displays the world name
  • World file contents are now validated on startup
    • Will display an error dialogue to the user on startup when a bad world file exists, explaining why and prompting them to exit or open the world directory
  • The config.ini file is only written to disk when actual changes have been made
  • World files are now only written to disk when actual changes have been made
  • Batches saving of world map-specific settings and only modifies the config.ini file when data has changed
  • Batches saving of bank-specific settings and only modifies the config.ini file when data has changed
  • New safety mechanism to prevent multiple client instances from simultaneously writing to the worlds folder
  • New safety mechanism to prevent multiple client instances from simultaneously attempting to write the config.ini file
    • This also fixes a rare bug that our users have actually encountered in the past wherein the config file can get corrupted
  • Deletes empty world files on startup, in case the user clicked on the "add world" button without meaning to
    • Will also delete the legacy "World 1" file that used to be created by default when no other worlds exist
  • Speedrun file loading only considers files ending in a .bin extension
  • Updated settings defaults:
    • Fatigue drop notifications are now OFF for the default preset
    • The giant fatigue alert is now OFF for the default and "lite" preset
    • The camera displacement is now OFF for the default and "lite" preset
  • Replay folder location now defaults to the same directory as the "save replays" location, such that clicking "play" on the login screens will default to the same location as the user's own recordings
  • Updated various settings labels for clarity in the Settings GUI
  • Added various metadata strings to existing settings for better search hits
  • Moved some settings into a new "Developer settings" section within the General tab
  • Added a footnote to the preset window to remind (or inform) users that tooltips exist
  • Only show the "All" preset when "debug mode" is enabled, to prevent users from crippling their experience
  • Updated the "no worlds" explanation text

Bug fixes / code hardening

  • Enhanced the feature introduced in PR Harden bank UI drawing hook #200 to stop drawing the custom bank interface upon invocation of a logout request
  • Swing window frame showing/hiding now properly queued within the Event-Dispatching Thread
  • Hardens custom dir selection logic to prevent a rare bug in the Swing framework (encountered during development of this PR)
  • Fixed the "no worlds" detection logic which (years ago) regressed to no longer show the explanation about needing to define a world file
  • Fixed improper setting of internal mudclient properties when launched with no worlds
  • Fixed world selection logic when deleting last known world
  • Refactored most (if not all) Closeable resources throughout the codebase to use try-with statements
  • Logs generated before the LOG_VERBOSITY setting has been initialized will now print to the log file (with a special prefix)
    • Logs generated prior to log writer initialization are printed to standard output
  • Fixed the broken notification icon within Linux notify-send notifications
  • Fixed some broken column selection logic within the replay queue window
  • Fixed doubling-up of GET calls during update downloads
  • Separated thresholds between lag indicators and lag logging
  • Fixed the unit test setup
  • Updated ant run script to pass in a sensible max heap flag (1.5GB)
  • No longer displays "null" in the primary window title when no worlds exist
  • Added bounds for alpha value in XP Bar rendering that was causing issues for at least one user

Misc

  • World files now support additional data:
    • Population API
    • Registration API URL (future use)
    • Server Extension
    • World Identifier
    • Downloaded flag
  • Bumped the Google java formatter dependency to the last Java 8-compatible version
  • GitHub build script now runs unit tests
  • Fixed javadoc generation errors (not warnings)
  • Addressed various Spotbugs warnings
  • Lots of other code refactoring and cleanup

Copy link
Member

@Hubcapp Hubcapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L G T M

Thanks for your hard work on this. I look forward to supporting this and expanding upon the Server Extensions feature in the future.

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