question

Mikhail Krushelnitsky avatar image
Mikhail Krushelnitsky asked

Start multiplayer server from cloud script

Can I manually start multiplayer game server from cloud script?

In-Game EconomyCustom Game Serversmultiplayergame manager
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

You can call the Multiplayer API RequestMultiplayerServer on CloudScript to launch a Multiplayer Server instance. The code can be something like this. You can use whole method set of multiplayer using multiplayer.[ApiName];.

handlers.requestServers = function (args, context) {
    var apiResult = multiplayer.RequestMultiplayerServer({
        BuildId: "[YourServerBuildId]",
        SessionId: "[YourSessionId]",
        PreferredRegions: [
            "EastUs"
        ]
    });
    if (apiResult != null)
        return apiResult;
    else
        return false;
};
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mikhail Krushelnitsky avatar image Mikhail Krushelnitsky commented ·

Thank you!

0 Likes 0 ·
Mikhail Krushelnitsky avatar image Mikhail Krushelnitsky commented ·

So I spent a whole day researching the problem, it turned out that BuildID is needed to request a multiplayer.RequestMultiplayerServer. The documentation doesn't say that.

0 Likes 0 ·
Jeremy Rose avatar image
Jeremy Rose answered

Could the typing in the projecct https://github.com/PlayFab/SdkTestingCloudScript typescript project be updated with this multiplayer object?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.