game-common / pragma.gameinstance / LocalProcessGameServerProviderPlugin /

LocalProcessGameServerProviderPlugin #

class LocalProcessGameServerProviderPlugin(service: Service, contentDataNodeService: ContentDataNodeService, processBuilderFactory: ProcessBuilderFactory, fileSystemProxy: FileSystemProxy, provisionedPortManager: ProvisionedPortManager) : GameServerProviderPlugin, ConfigurablePlugin<LocalProcessGameServerProviderPluginConfig>

A GameServerProviderPlugin implementation that will run a game server executable on the local machine.

The plugin will attempt to run the executable defined in the LocalProcessGameServerProviderPluginConfig.serverExecutablePath and pipe the logs to a file in a directory defined in LocalProcessGameServerProviderPluginConfig.serverLogDirectory.

By default, the plugin only supports one game server at a time. However, by changing the available port range using the LocalProcessGameServerProviderPluginConfig.minPort and LocalProcessGameServerProviderPluginConfig.maxPort properties, the amount of concurrent game servers can be adjusted.

Use the LocalProcessGameServerProviderPluginConfig.usePlayInEditorGameServer property when the game server is already running locally. In this scenario, you will need to pass the GameInstanceId to the running game server in some other way.

This plugin only works on a deployment of the pragma-engine with a single GameInstanceService instance, this plugin will not work in a multi-node environment with multiple GameInstanceService instances.

Constructors #

LocalProcessGameServerProviderPlugin

fun LocalProcessGameServerProviderPlugin(service: Service, contentDataNodeService: ContentDataNodeService)

LocalProcessGameServerProviderPlugin

fun LocalProcessGameServerProviderPlugin(service: Service, contentDataNodeService: ContentDataNodeService, processBuilderFactory: ProcessBuilderFactory, fileSystemProxy: FileSystemProxy, provisionedPortManager: ProvisionedPortManager)

Functions #

NameSummary

startAllocationForGameInstance

open suspend override fun startAllocationForGameInstance(gameInstanceId: <ERROR CLASS>, ext: ExtAllocateGameServer, clientTokenFunction: () -> PartnerClientTokens, gameServerVersion: <ERROR CLASS>, gameServerZone: <ERROR CLASS>)

Invoked when GameInstance.GameInstance.allocateGameServer is called on a game instance in the GameInstancePlugin. Used to send a request to a game server hosting provider to allocate a game server. The game server must use the Pragma SDK to call MatchApi::RequestStartGame() with the gameInstanceId to complete the allocation.