Class LiveConfigService

java.lang.Object
com.hypixel.hytale.server.core.liveconfig.LiveConfigService

public class LiveConfigService extends Object
HTTP client for fetching pre-evaluated feature flags from the live config service.

Calls GET /server-configs/{patchline}?os={os}&arch={arch}&version={v} with the server's game session token (hytale:server scope). The version is the running server's JAR manifest version; flags whose rollout declares a serverVersionRange are excluded when the version doesn't satisfy the range (and therefore fall through to the caller-provided default).

  • Field Details

    • URL_OVERRIDE_PROPERTY

      public static final String URL_OVERRIDE_PROPERTY
      System property to override the live config service URL. When set, auth token checks are relaxed (for local testing with DEV_MODE services).
      See Also:
  • Constructor Details

    • LiveConfigService

      public LiveConfigService()
  • Method Details

    • hasUrlOverride

      public static boolean hasUrlOverride()
      Returns true if a URL override is configured (test/dev mode).
    • fetchServerConfigs

      @Nullable public LiveConfigSnapshot fetchServerConfigs(@Nonnull String patchline, @Nonnull String os, @Nonnull String arch, @Nullable String version, @Nullable String currentEtag)
      Fetches the resolved server configs for the given patchline and platform.
      Parameters:
      patchline - The patchline (e.g., "release", "pre-release")
      os - Target OS ("windows", "linux", "darwin")
      arch - Target architecture ("amd64", "arm64")
      currentEtag - ETag from the previous fetch, or null for the first fetch
      Returns:
      A new snapshot on 200, or null on 304 (not modified) / error
    • detectOS

      @Nonnull public static String detectOS()
      Detects the current OS for the platform query parameter.
    • detectArch

      @Nonnull public static String detectArch()
      Detects the current architecture for the platform query parameter.