game-common / pragma.party / GameServerCompatibility /

GameServerCompatibility #

class GameServerCompatibility(logger: Logger = LoggerFactory.getLogger(GameServerCompatibility::class.simpleName))

GameServerCompatibility allows for mapping specific game server versions to specific game client versions. The same game client version can match to different game servers versions. If players in a party are compatible with multiple game server versions, the highest game server version (defined by the keys in gameServerVersionCompatibility) will be used for matchmaking purposes.

Valid configuration must be defined on startup or the plugin will throw, preventing startup. If bad configuration is passed in after startup, a warning log will be emitted and the new configuration will not be honored.

The {{USER_DEFINED_GAME_SERVER_VERSION}} value will be passed to the matchmaking service.

When defining your map of client versions, you may end a client version in an * to enable partial wildcard support for matching client versions to server versions. For example, using the game client version test-client-version*, game clients with versions such as test-client-version-pc, test-client-version-ps4, and ``test-client-version-xbx` would all match that pattern to map to an appropriate game server version.

Config requirements:

  • Specify at least one gameServerVersionCompatibility config block when running in production mode.
  • gameServerVersionCompatibility keys must be unique and must be a positive int. Greater ints designate higher priority.
  • {{USER_DEFINED_GAME_SERVER_VERSION}} must be unique and must not be an empty string.
  • clientVersions config block must not be empty.
  • {{USER_DEFINED_GAME_CLIENT_VERSION}} must not be an empty string.

Config options:

  • When running in development mode, the following gameServerVersionCompatibility map is defined by default in the dev-defaults.yml configuration. If not overridden, any game client version will match to the game server version defaultGameServerVersion.
serviceConfigs:
    PartyConfig:
      gameServerVersionCompatibility:
        1:
          "*"

Example of the config:

serviceConfigs:
    PartyConfig:
      gameServerVersionCompatibility:
        1:
          serverVersion: {{USER_DEFINED_GAME_SERVER_VERSION}}
          clientVersions:
            1: "{{USER_DEFINED_GAME_CLIENT_VERSION_1}}"
        2:
          serverVersion: {{USER_DEFINED_GAME_SERVER_VERSION_2}}
          clientVersions:
            1: "{{USER_DEFINED_GAME_CLIENT_VERSION_1}}"
            2: "{{USER_DEFINED_GAME_CLIENT_VERSION_2}}"

Constructors #

GameServerCompatibility

fun GameServerCompatibility(logger: Logger = LoggerFactory.getLogger(GameServerCompatibility::class.simpleName))