game-common / / OrderedGameServerCompatibilityPlugin /

OrderedGameServerCompatibilityPlugin #

class OrderedGameServerCompatibilityPlugin(service: Service, contentDataNodeService: ContentDataNodeService) : GameServerCompatibilityPlugin, ConfigurablePlugin<OrderedGameServerCompatibilityPlugin.Config>

Implementation of GameServerCompatibilityPlugin that 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 versionCompatibility) will be used for matchmaking purposes. The {{USER_DEFINED_GAME_SERVER_VERSION}} value will be passed to the matchmaking service. 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.

Config requirements:

  • Specify at least one versionCompatibility config block.
  • versionCompatibility 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.

Example of the config: pluginConfigs: PartyService.gameServerCompatibilityPlugin: class: "" config: versionCompatibility: 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 #


fun OrderedGameServerCompatibilityPlugin(service: Service, contentDataNodeService: ContentDataNodeService, logger: Logger)


fun OrderedGameServerCompatibilityPlugin(service: Service, contentDataNodeService: ContentDataNodeService)

Functions #



open override fun calculateGameServerVersion(party: Party, newPlayer: PartyPlayer?): String?

Used to determine an appropriate game server version for the party.


open override fun getValidGameClientVersions(): List<String>

Used to retrieve a list of valid game client versions that will be passed into the Client SDK when a party is shutdown in order to notify clients to update their GameClientVersions for PartyRpc.RemovalReason.GAME_CLIENTS_INCOMPATIBLE_WITH_GAME_SERVER.