MultiConnectMultiConnectDocs Website home
MultiConnectSDK › Developer Guide

3. Deploying Updates

From Unity

Open MultiConnect > Build and Deploy Server (Ctrl/Cmd + Shift + M).

The first time, in this project:

  1. On the dashboard, open Access Keys and create a key with Allow deploys (CLI) on. Then open your deployment from the dashboard and attach the key on its page.
  2. Paste the key and secret into the window and press Save and load deployments. They are stored encrypted for this project on this machine, never in your project files.
  3. Pick your server.

Then, for every update, press Build and Deploy. The window:

  1. Builds a Linux Dedicated Server from the scenes enabled in File > Build Profiles, named to match the deployment's Entry Point File. Keep only your server scene enabled when you press it
  2. Zips and uploads it
  3. Rolls it out and shows progress until it is live

Your current build keeps serving until every new container is healthy. If the new build never becomes healthy, the previous one stays in place (Roll back on failure).

Option What it does
Build and Deploy The whole flow. The Editor is busy during the build; the upload and rollout run in the background, even if you close the window
Deploy last build Uploads the last build again without rebuilding
Tag (optional) A label for this build, such as a version or commit. The button beside it fills in your project's version

The Deploy tab also shows the build that is live now, a Ready to deploy? checklist (Linux server build support, scenes, account balance) and your recent deploys from this editor, each with its build number to copy.

Analytics tab: your game as it is being played, for the SDK app linked to this server, refreshing every 15 seconds:

Monitor tab: the same window shows your server as it runs, refreshing every 15 seconds:

Master and game servers: a deployment with separate masters and game servers takes two builds, which always deploy together. The window lists each enabled scene with a Master and a Worker tick-box, so you choose what goes in each build, and a client scene with neither tick stays out. The choice is saved in ProjectSettings/MultiConnectDeploy.json, which is safe to commit.

From the terminal or CI

The window and the MultiConnect CLI share multiconnect.json in your project folder, so a project linked by either works in both, though each keeps its own copy of your key. The file is safe to commit; on a build machine, set MC_ACCESS_KEY and MC_ACCESS_SECRET. To deploy a build you made yourself, point the CLI at its folder.

Keeping the previous build running

Players don't all update at once. Store review takes days, and some players never update. Usually that doesn't matter, because MultiConnectSDK lets an older client keep talking to a newer server. But sometimes the game itself changes, with new rules or new messages, and an older client can't play on the new server.

For those updates, keep the previous build running beside the new one:

  1. Every build gets a build number, such as 1.0.0.8. It is shown on your deployment's page on the dashboard, in the Build and Deploy window, and by the CLI after each deploy.
  2. When you redeploy, turn on Keep the current version running and choose how long: 1 to 90 days, or until you retire it. The current build keeps its own servers and keeps taking players who ask for its build number.
  3. Ship the new client with the new build number in the Server Build field of your MultiConnectClient. Clients you already shipped keep connecting to the build number they were made with.

Up to two older builds can run beside the latest, and a build that is finishing its grace period counts as one of the two. Each kept build bills for its own servers. You get a reminder email while one is running.

When the time you chose is up, or when you press Retire now on the deployment's Versions panel (or run multiconnect versions retire 1.0.0.8), that build stops taking new players. Players already on it finish their matches, and its servers are removed after your grace period.

A client that asks for a build that is no longer running is not sent to the latest one. Its connect fails and McHosting.ServerBuildUnavailable is true, so the game can ask the player to update:

Script 3.1

// The Server Build field sets McHosting.ServerBuild; empty means the latest build.
if (!await McHosting.ConnectAsync(ServerRegions.Any, uniqueClientId: playerId))
{
    if (McHosting.ServerBuildUnavailable)
        ShowUpdateRequired();           // this client's server build has been retired
    else
        ShowRetry(McHosting.LastConnectError);
}

Inside a server, McHostingEnvironment.BuildNumber (MC_BUILD_NUMBER) is that server's own build number. A master only ever uses game servers of its own build, so old and new code never meet in one match.