次の方法で共有


Multiplayer Server - Request Multiplayer Server

Request a multiplayer server session. Accepts tokens for title and if game client access is enabled, allows game client to request a server with player entity token.

POST https://titleId.playfabapi.com/MultiplayerServer/RequestMultiplayerServer

Request Header

Name Required Type Description
X-EntityToken True

string

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Request Body

Name Required Type Description
PreferredRegions True

AzureRegion[]

The preferred regions to request a multiplayer server from. The Multiplayer Service will iterate through the regions in the specified order and allocate a server from the first one that has servers available.

SessionId True

string

A guid string session ID created track the multiplayer server session over its life.

BuildAliasParams

BuildAliasParams

The identifiers of the build alias to use for the request.

BuildId

string

The guid string build ID of the multiplayer server to request.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

InitialPlayers

string[]

Initial list of players (potentially matchmade) allowed to connect to the game. This list is passed to the game server when requested (via GSDK) and can be used to validate players connecting to it.

SessionCookie

string

Data encoded as a string that is passed to the game server when requested. This can be used to to communicate information such as game mode or map through the request flow.

Responses

Name Type Description
200 OK

RequestMultiplayerServerResponse

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-EntityToken

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

AzureRegion
BuildAliasParams
ConnectedPlayer
Port
ProtocolType
PublicIpAddress
RequestMultiplayerServerRequest

Requests a multiplayer server session from a particular build in any of the given preferred regions.

RequestMultiplayerServerResponse
RoutingType

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

AzureRegion

Name Type Description
AustraliaEast

string

AustraliaSoutheast

string

BrazilSouth

string

CentralIndia

string

CentralUs

string

EastAsia

string

EastUs

string

EastUs2

string

FranceCentral

string

JapanEast

string

JapanWest

string

KoreaCentral

string

NorthCentralUs

string

NorthEurope

string

SouthAfricaNorth

string

SouthCentralUs

string

SoutheastAsia

string

SwedenCentral

string

UaeNorth

string

UkSouth

string

WestCentralUs

string

WestEurope

string

WestUs

string

WestUs2

string

BuildAliasParams

Name Type Description
AliasId

string

The guid string alias ID to use for the request.

ConnectedPlayer

Name Type Description
PlayerId

string

The player ID of the player connected to the multiplayer server.

Port

Name Type Description
Name

string

The name for the port.

Num

number

The number for the port.

Protocol

ProtocolType

The protocol for the port.

ProtocolType

Name Type Description
TCP

string

UDP

string

PublicIpAddress

Name Type Description
FQDN

string

FQDN of the public IP

IpAddress

string

Server IP Address

RoutingType

RoutingType

Routing Type of the public IP.

RequestMultiplayerServerRequest

Requests a multiplayer server session from a particular build in any of the given preferred regions.

Name Type Description
BuildAliasParams

BuildAliasParams

The identifiers of the build alias to use for the request.

BuildId

string

The guid string build ID of the multiplayer server to request.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

InitialPlayers

string[]

Initial list of players (potentially matchmade) allowed to connect to the game. This list is passed to the game server when requested (via GSDK) and can be used to validate players connecting to it.

PreferredRegions

AzureRegion[]

The preferred regions to request a multiplayer server from. The Multiplayer Service will iterate through the regions in the specified order and allocate a server from the first one that has servers available.

SessionCookie

string

Data encoded as a string that is passed to the game server when requested. This can be used to to communicate information such as game mode or map through the request flow.

SessionId

string

A guid string session ID created track the multiplayer server session over its life.

RequestMultiplayerServerResponse

Name Type Description
BuildId

string

The identity of the build in which the server was allocated.

ConnectedPlayers

ConnectedPlayer[]

The connected players in the multiplayer server.

FQDN

string

The fully qualified domain name of the virtual machine that is hosting this multiplayer server.

IPV4Address

string

The public IPv4 address of the virtual machine that is hosting this multiplayer server.

LastStateTransitionTime

string

The time (UTC) at which a change in the multiplayer server state was observed.

Ports

Port[]

The ports the multiplayer server uses.

PublicIPV4Addresses

PublicIpAddress[]

The list of public Ipv4 addresses associated with the server.

Region

AzureRegion

The region the multiplayer server is located in.

ServerId

string

The string server ID of the multiplayer server generated by PlayFab.

SessionId

string

The guid string session ID of the multiplayer server.

State

string

The state of the multiplayer server.

VmId

string

The virtual machine ID that the multiplayer server is located on.

RoutingType

Name Type Description
Internet

string

Microsoft

string

Error Codes

Name Code
APINotEnabledForGameClientAccess 1082
MultiplayerServerBadRequest 1382
MultiplayerServerForbidden 1384
MultiplayerServerInternalServerError 1387
MultiplayerServerNotFound 1385
MultiplayerServerTooManyRequests 1380
MultiplayerServerUnauthorized 1383
MultiplayerServerUnavailable 1388