MMatchdock

Quickstart

This walks through a first match end to end. You need a project (we create it with you during early access), its two keys, and a Linux build of your dedicated server.

1. Your keys

Key Looks like Goes where
Client key md_pub_… Inside the game build. It only says which project a request belongs to.
Server key md_sec_… Your CI and the console. It can manage the project - treat it like a password.

2. Make your server Matchdock-aware

Your dedicated server is started once per match with its session in the environment. It has three jobs: admit only the right players, report the result, exit. With the Unity SDK:

var server = MatchdockUnity.TryCreateServerClient(out var session);
transport.Port = (ushort)session.Port;

// when a client presents its join token
if (!await server.AdmitPlayerAsync(userId, joinToken, slot)) connection.Disconnect();

// when the match ends
await server.SubmitWinAsync(winnerUserId, loserUserId, winnerScore, loserScore, durationSeconds);
Application.Quit(0);

Details and the raw HTTP calls: Dedicated server.

3. Upload the build

Zip the build folder and upload it with your server key (or drag it into the console under Builds):

API=https://api.matchdock.io
KEY=md_sec_...            # your server key
PROJECT=your-project-id

BUILD_ID=$(curl -fsS -X POST $API/admin/projects/$PROJECT/builds \
  -H "x-matchdock-key: $KEY" -H 'content-type: application/json' -d '{
    "version": "1.0.0", "source": "ARTIFACT", "runtime": "CONTAINER",
    "containerImage": "arenacloud/unity-runtime:24.04",
    "entrypoint": "Server/server.x86_64", "workingDirectory": "Server",
    "argsTemplate": ["-batchmode", "-nographics", "-logFile", "-", "-port", "{port}"]
  }' | jq -r .id)

curl -fsS -X PUT $API/admin/projects/$PROJECT/builds/$BUILD_ID/artifact \
  -H "x-matchdock-key: $KEY" -H 'content-type: application/zip' --data-binary @server.zip

curl -fsS -X POST $API/admin/projects/$PROJECT/builds/$BUILD_ID/activate -H "x-matchdock-key: $KEY"

The fleet downloads and verifies the build within about half a minute. See Server builds.

4. Find a match from the client

var client = MatchdockUnity.CreateClient(settings);   // API URL + client key
await client.SignInAsync(MatchdockUnity.DeviceId, MatchdockUnity.PlatformName);

var ticket = await new Matchmaker(client).FindMatchAsync(
    new FindMatchOptions { QueueName = "casual_1v1" }, cancelToken);

// connect your netcode to ticket.Host : ticket.Port and present ticket.JoinToken

Run two clients (two editors, or an editor and a device). They are matched against each other, your server starts, and both receive the same host and port.

5. Watch it

Open the console: Live sessions shows the server while it runs, with its CPU and memory; Matches shows the outcome, the score and - if something went wrong - why.