Rooms: leave

Requires authorization

Leave 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/roomId/leave

Parameters

Parameter name Value Description
Path parameters
roomId string The ID of the room.
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#roomLeaveRequest",
  "reason": string,
  "leaveDiagnostics": {
    "kind": "games#roomLeaveDiagnostics",
    "socketsUsed": boolean,
    "androidNetworkType": integer,
    "androidNetworkSubtype": integer,
    "iosNetworkType": integer,
    "networkOperatorName": string,
    "networkOperatorCode": string,
    "peerSession": [
      {
        "kind": "games#peerSessionDiagnostics",
        "participantId": string,
        "connectedTimestampMillis": long,
        "reliableChannel": {
          "kind": "games#peerChannelDiagnostics",
          "numMessagesSent": integer,
          "numMessagesReceived": integer,
          "bytesSent": {
            "kind": "games#aggregateStats",
            "min": long,
            "max": long,
            "sum": long,
            "count": long
          },
          "bytesReceived": {
            "kind": "games#aggregateStats",
            "min": long,
            "max": long,
            "sum": long,
            "count": long
          },
          "numSendFailures": integer,
          "numMessagesLost": integer,
          "roundtripLatencyMillis": {
            "kind": "games#aggregateStats",
            "min": long,
            "max": long,
            "sum": long,
            "count": long
          }
        },
        "unreliableChannel": {
          "kind": "games#peerChannelDiagnostics",
          "numMessagesSent": integer,
          "numMessagesReceived": integer,
          "bytesSent": {
            "kind": "games#aggregateStats",
            "min": long,
            "max": long,
            "sum": long,
            "count": long
          },
          "bytesReceived": {
            "kind": "games#aggregateStats",
            "min": long,
            "max": long,
            "sum": long,
            "count": long
          },
          "numSendFailures": integer,
          "numMessagesLost": integer,
          "roundtripLatencyMillis": {
            "kind": "games#aggregateStats",
            "min": long,
            "max": long,
            "sum": long,
            "count": long
          }
        }
      }
    ]
  }
}
Property name Value Description Notes
kind string Uniquely identifies the type of this resource. Value is always the fixed string games#roomLeaveRequest.
reason string Reason for leaving the match.
Possible values are:
  • "PLAYER_LEFT" - The player chose to leave the room..
  • "GAME_LEFT" - The game chose to remove the player from the room.
  • "REALTIME_ABANDONED" - The player switched to another application and abandoned the room.
  • "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to establish a connection to other peer(s).
  • "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to communicate with the server.
  • "REALTIME_SERVER_ERROR" - The client received an error response when it tried to communicate with the server.
  • "REALTIME_TIMEOUT" - The client timed out while waiting for a room.
  • "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without first calling Leave.
  • "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room.
  • "REALTIME_GAME_CRASHED" - The game crashed.
  • "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed.
  • "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is trying to enter a room.
  • "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying to enter a new room.


Acceptable values are:
  • "GAME_LEFT"
  • "PLAYER_LEFT"
  • "REALTIME_ABANDONED"
  • "REALTIME_CLIENT_DISCONNECTING"
  • "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION"
  • "REALTIME_GAME_CRASHED"
  • "REALTIME_PEER_CONNECTION_FAILURE"
  • "REALTIME_ROOM_SERVICE_CRASHED"
  • "REALTIME_SAME_CLIENT_ROOM_OPERATION"
  • "REALTIME_SERVER_CONNECTION_FAILURE"
  • "REALTIME_SERVER_ERROR"
  • "REALTIME_SIGN_OUT"
  • "REALTIME_TIMEOUT"
leaveDiagnostics nested object Diagnostics for a player leaving the room.
leaveDiagnostics.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#roomLeaveDiagnostics.
leaveDiagnostics.socketsUsed boolean Whether or not sockets were used.
leaveDiagnostics.androidNetworkType integer Android network type. http://developer.android.com/reference/android/net/NetworkInfo.html#getType()
leaveDiagnostics.androidNetworkSubtype integer Android network subtype. http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype()
leaveDiagnostics.iosNetworkType integer iOS network type as defined in Reachability.h.
leaveDiagnostics.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
leaveDiagnostics.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
leaveDiagnostics.peerSession[] list Diagnostics about all peer sessions.
leaveDiagnostics.peerSession[].kind string Uniquely identifies the type of this resource. Value is always the fixed string games#peerSessionDiagnostics.
leaveDiagnostics.peerSession[].participantId string The participant ID of the peer.
leaveDiagnostics.peerSession[].connectedTimestampMillis long Connected time in milliseconds.
leaveDiagnostics.peerSession[].reliableChannel nested object Reliable channel diagnostics.
leaveDiagnostics.peerSession[].reliableChannel.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#peerChannelDiagnostics.
leaveDiagnostics.peerSession[].reliableChannel.numMessagesSent integer Number of messages sent.
leaveDiagnostics.peerSession[].reliableChannel.numMessagesReceived integer Number of messages received.
leaveDiagnostics.peerSession[].reliableChannel.bytesSent nested object Number of bytes sent.
leaveDiagnostics.peerSession[].reliableChannel.bytesSent.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.
leaveDiagnostics.peerSession[].reliableChannel.bytesSent.min long The minimum amount.
leaveDiagnostics.peerSession[].reliableChannel.bytesSent.max long The maximum amount.
leaveDiagnostics.peerSession[].reliableChannel.bytesSent.sum long The total number of bytes sent for messages between a pair of peers.
leaveDiagnostics.peerSession[].reliableChannel.bytesSent.count long The number of messages sent between a pair of peers.
leaveDiagnostics.peerSession[].reliableChannel.bytesReceived nested object Number of bytes received.
leaveDiagnostics.peerSession[].reliableChannel.bytesReceived.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.
leaveDiagnostics.peerSession[].reliableChannel.bytesReceived.min long The minimum amount.
leaveDiagnostics.peerSession[].reliableChannel.bytesReceived.max long The maximum amount.
leaveDiagnostics.peerSession[].reliableChannel.bytesReceived.sum long The total number of bytes sent for messages between a pair of peers.
leaveDiagnostics.peerSession[].reliableChannel.bytesReceived.count long The number of messages sent between a pair of peers.
leaveDiagnostics.peerSession[].reliableChannel.numSendFailures integer Number of send failures.
leaveDiagnostics.peerSession[].reliableChannel.numMessagesLost integer Number of messages lost.
leaveDiagnostics.peerSession[].reliableChannel.roundtripLatencyMillis nested object Roundtrip latency stats in milliseconds.
leaveDiagnostics.peerSession[].reliableChannel.roundtripLatencyMillis.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.
leaveDiagnostics.peerSession[].reliableChannel.roundtripLatencyMillis.min long The minimum amount.
leaveDiagnostics.peerSession[].reliableChannel.roundtripLatencyMillis.max long The maximum amount.
leaveDiagnostics.peerSession[].reliableChannel.roundtripLatencyMillis.sum long The total number of bytes sent for messages between a pair of peers.
leaveDiagnostics.peerSession[].reliableChannel.roundtripLatencyMillis.count long The number of messages sent between a pair of peers.
leaveDiagnostics.peerSession[].unreliableChannel nested object Unreliable channel diagnostics.
leaveDiagnostics.peerSession[].unreliableChannel.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#peerChannelDiagnostics.
leaveDiagnostics.peerSession[].unreliableChannel.numMessagesSent integer Number of messages sent.
leaveDiagnostics.peerSession[].unreliableChannel.numMessagesReceived integer Number of messages received.
leaveDiagnostics.peerSession[].unreliableChannel.bytesSent nested object Number of bytes sent.
leaveDiagnostics.peerSession[].unreliableChannel.bytesSent.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.
leaveDiagnostics.peerSession[].unreliableChannel.bytesSent.min long The minimum amount.
leaveDiagnostics.peerSession[].unreliableChannel.bytesSent.max long The maximum amount.
leaveDiagnostics.peerSession[].unreliableChannel.bytesSent.sum long The total number of bytes sent for messages between a pair of peers.
leaveDiagnostics.peerSession[].unreliableChannel.bytesSent.count long The number of messages sent between a pair of peers.
leaveDiagnostics.peerSession[].unreliableChannel.bytesReceived nested object Number of bytes received.
leaveDiagnostics.peerSession[].unreliableChannel.bytesReceived.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.
leaveDiagnostics.peerSession[].unreliableChannel.bytesReceived.min long The minimum amount.
leaveDiagnostics.peerSession[].unreliableChannel.bytesReceived.max long The maximum amount.
leaveDiagnostics.peerSession[].unreliableChannel.bytesReceived.sum long The total number of bytes sent for messages between a pair of peers.
leaveDiagnostics.peerSession[].unreliableChannel.bytesReceived.count long The number of messages sent between a pair of peers.
leaveDiagnostics.peerSession[].unreliableChannel.numSendFailures integer Number of send failures.
leaveDiagnostics.peerSession[].unreliableChannel.numMessagesLost integer Number of messages lost.
leaveDiagnostics.peerSession[].unreliableChannel.roundtripLatencyMillis nested object Roundtrip latency stats in milliseconds.
leaveDiagnostics.peerSession[].unreliableChannel.roundtripLatencyMillis.kind string Uniquely identifies the type of this resource. Value is always the fixed string games#aggregateStats.
leaveDiagnostics.peerSession[].unreliableChannel.roundtripLatencyMillis.min long The minimum amount.
leaveDiagnostics.peerSession[].unreliableChannel.roundtripLatencyMillis.max long The maximum amount.
leaveDiagnostics.peerSession[].unreliableChannel.roundtripLatencyMillis.sum long The total number of bytes sent for messages between a pair of peers.
leaveDiagnostics.peerSession[].unreliableChannel.roundtripLatencyMillis.count long The number of messages sent between a pair of peers.

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.