Rooms: create

Requires authorization

Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported. Try it now.

Request

HTTP request

POST https://www.googleapis.com/games/v1/rooms/create

Parameters

Parameter name Value Description
Optional query parameters
consistencyToken long The last-seen mutation timestamp.
language string The preferred language to use for strings returned by this method.

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/games

Request body

In the request body, supply data with the following structure:

{
  "kind": "games#roomCreateRequest",
  "variant": integer,
  "invitedPlayerIds": [
    string
  ],
  "autoMatchingCriteria": {
    "kind": "games#roomAutoMatchingCriteria",
    "minAutoMatchingPlayers": integer,
    "maxAutoMatchingPlayers": integer,
    "exclusiveBitmask": long
  },
  "clientAddress": {
    "kind": "games#roomClientAddress",
    "xmppAddress": string
  },
  "networkDiagnostics": {
    "kind": "games#networkDiagnostics",
    "registrationLatencyMillis": integer,
    "androidNetworkType": integer,
    "androidNetworkSubtype": integer,
    "iosNetworkType": integer,
    "networkOperatorName": string,
    "networkOperatorCode": string
  },
  "capabilities": [
    string
  ],
  "requestId": long
}
Property name Value Description Notes
kind string Uniquely identifies the type of this resource. Value is always the fixed string games#roomCreateRequest.
variant integer The variant / mode of the application to be played. This can be any integer value, or left blank. You should use a small number of variants to keep the auto-matching pool as large as possible.
invitedPlayerIds[] list The player IDs to invite to the room.
autoMatchingCriteria nested object Criteria for auto-matching players into this room.
autoMatchingCriteria.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#roomAutoMatchingCriteria.
autoMatchingCriteria.minAutoMatchingPlayers integer The minimum number of players that should be added to the room by auto-matching.
autoMatchingCriteria.maxAutoMatchingPlayers integer The maximum number of players that should be added to the room by auto-matching.
autoMatchingCriteria.exclusiveBitmask long A bitmask indicating when auto-matches are valid. When ANDed with other exclusive bitmasks, the result must be zero. Can be used to support exclusive roles within a game.
clientAddress nested object Client address for the player creating the room.
clientAddress.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#roomClientAddress.
clientAddress.xmppAddress string The XMPP address of the client on the Google Games XMPP network.
networkDiagnostics nested object Network diagnostics for the client creating the room.
networkDiagnostics.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#networkDiagnostics.
networkDiagnostics.registrationLatencyMillis integer The amount of time in milliseconds it took for the client to establish a connection with the XMPP server.
networkDiagnostics.androidNetworkType integer The Android network type.
networkDiagnostics.androidNetworkSubtype integer The Android network subtype.
networkDiagnostics.iosNetworkType integer iOS network type as defined in Reachability.h.
networkDiagnostics.networkOperatorName string The name of the carrier of the client's network connection. On Android: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
networkDiagnostics.networkOperatorCode string The MCC+MNC code for the client's network connection. On Android: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
capabilities[] list The capabilities that this client supports for realtime communication.
requestId long A randomly generated numeric ID. This number is used at the server to ensure that the request is handled correctly across retries.

Response

If successful, this method returns a Rooms resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Enviar comentarios sobre…

Play Games Services for Web
Play Games Services for Web