Configuration #

This system provides dynamically reloadable configuration, allowing users to configure a running service without requiring a service restart.

The platform start-up parameters accept a config file (or files) read from disk, and periodically polled for changes after. All defined config parameters must be supplied either as a baked-in default or through a configuration file, otherwise the platform will fail to start.

Config Overrides and Priority #

The priority for configuration overrides are:

  • Highest priority: config file
  • Middle priority: embedded universal config overrides
  • Lowest priority: code level default

Config defaults can be specified in code where the configuration values are defined, with the option to specify defaults for development or production. These defaults are overridden if the config value is specified in a higher priority format.

The universal config override file allows a studio to specify overrides without modifying code-level engine defaults. This is helpful when configuring standard values such as studio-specific plugins.

Dynamic Config #

The platform periodically checks the config file for changes, and loads them if found. Not all configuration is safe to be dynamically reloaded, such as changing to a different database host. In these cases a service restart will be required.

Quick Guides #

Setting up configuration files #

The following code block is a sample of LocalConfig.yml (for testing) or CommonConfig.yml (for production):

social:
  core:
    clusterName: "social"
    logging:
      fileLoggerEnabled: true
  serviceConfigs:
    SystemReporterNodeServiceConfig:
      secret: "encryptedSecretCode"
    GameDaoConfig:
      databaseConfig:
        driver: "MYSQLDB"
        hostPortSchema: "db.location.com:port/game"
        username: "secureUsername"
        password: "encryptedSecurePassword"
    UnsafeIdentityDaoConfig:
      databaseConfig:
        driver: "MYSQLDB"
        hostPortSchema: "db.location.com:port/unsafe_identity_provider"
        username: "secureUsername"
        password: "encryptedSecurePassword"
    AccountDaoConfig:
      databaseConfig:
        driver: "MYSQLDB"
        hostPortSchema: "db.location.com:port/account"
        username: "secureUsername"
        password: "encryptedSecurePassword"

game:
  core:
    clusterName: "game"
    logging:
      fileLoggerEnabled: true
  serviceConfigs:
    GameOperatorGatewayConfig:
      schema: "https"
      websocketSchema: "wss"
      authenticateHost: "shardName.yourcompany.com"
      socialHost: "shardName.yourcompany.com"
      gameHost: "shardName.yourcompany.com"
    GamePartnerGatewayConfig:
      schema: "https"
      websocketSchema: "wss"
      authenticateHost: "shardName.yourcompany.com"
      socialHost: "shardName.yourcompany.com"
      gameHost: "shardName.yourcompany.com"
    GamePlayerGatewayConfig:
      schema: "https"
      websocketSchema: "wss"
      authenticateHost: "shardName.yourcompany.com"
      socialHost: "shardName.yourcompany.com"
      gameHost: "shardName.yourcompany.com"
    LobbyConfig:
      gameServerVersion: "LATEST"
    MatchLifecycleServiceConfig:
      matchFoundBuilderStrategy: "YourMatchFoundBuilderStrategy"
  pluginConfigs:
    LobbyService.lobbyStrategy:
      class: "LobbyStrategy"
    MatchCapacityService.capacityProvider:
      class: "PragmaNomadCapacityProvider"
      config:
        url: "https://nomad.shardName.yourcompany.com"
        jobName: "us-east-2-exec"
        executableName: "yourServerExecutable.sh"
        args:
          0: "-PragmaDebug=0"
          1: "-PragmaBackendAddress=https://shardName.yourcompany.com:Port"
    MatchmakingService.matchmakingStrategy:
      class: "CooperativeWarmBodyMatchmakingStrategy"
      config:
        numberOfPlayers: 3