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.
  • 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:

  • Set enableGameServerVersionDefault to true to serve a default game server version to all game clients that are not served by the gameServerVersionCompatibility map.
  • gameServerVersionDefault’s {{USER_DEFINED_GAME_SERVER_VERSION_DEFAULT}} field will be served to clients when the default game server version has been picked.

Example of the config: serviceConfigs: PartyConfig: enableGameServerVersionDefault: true gameServerVersionDefault: {{USER_DEFINED_GAME_SERVER_VERSION_DEFAULT}} 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))