Skip to main content

Overview

The PlayFab Game Server SDK (GSDK) is provided in C++, C#, and Java versions. The GSDK connects your game server to the PlayFab agent installed on the VM. This agent facilitates key server interactions with the PlayFab Multiplayer platform.

Basic integration

For your game server to be able to communicate with the PlayFab multiplayer platform, you need to integrate with the GSDK. At a minimum, you must implement the Start and ReadyForPlayers methods in your game server.

Logging with the GSDK

When your game server ends, the PlayFab VM agent will zip any log files, and make them available to you. <!—via the GetMultiplayerServerLogs API.—> There are two ways to add log files from your game:
  1. Use the GSDK’s Log method - It will add your own log lines to the GSDK log file.
  2. Write your own log file in the appropriate log directory that the PlayFab VM agent will zip up and upload.

Gracefully shutting down your game server

There are three scenarios in which your game server will end:
  1. Your game server application exits.
  2. PlayFab terminates your game server because there are more game servers available than is necessary for the current player load.
PlayFab will only terminate game servers that are not currently active.
  1. Azure will perform required maintenance on the virtual machine that is hosting your game server.
For (1) above: You control when it happens, and can perform any necessary cleanup before your application exits. For (2) and (3) above: The GSDK provides a way for you to know when they will occur, by specifying a callback method.

Giving PlayFab information about your game server

Currently there are two things you can communicate to PlayFab using the GSDK:
  1. Your game server’s current health status.
  2. A list of players that are currently connected to your game server.
These two pieces of information will be transmitted to PlayFab in the next heartbeat, and can currently be used for reporting.

Getting configuration settings within your game server

There are several PlayFab settings related to your game server that you can retrieve using the GSDK.
Two of these settings are actually passed in to PlayFab by your clients, as part of the call to request a multiplayer server. So those settings will not be available to your game server until it is allocated.
Last modified on October 20, 2026