客戶回報聊天室中同類應用程式的更新。僅供遊戲 SDK 進行內部使用。不支援直接呼叫此方法。立即試用。
要求
HTTP 要求
POST https://www.googleapis.com/games/v1/rooms/roomId/reportstatus
參數
參數名稱 | 值 | 說明 |
---|---|---|
路徑參數 | ||
roomId |
string |
會議室的 ID。 |
選用查詢參數 | ||
language |
string |
此方法傳回的字串偏好語言。 |
授權
此要求需要以下範圍的授權:
範圍 |
---|
https://www.googleapis.com/auth/games |
詳情請參閱驗證和授權頁面。
要求主體
在要求內容中,請按照下列結構提供資料:
{ "kind": "games#roomP2PStatuses", "updates": [ { "kind": "games#roomP2PStatus", "participantId": string, "status": string, "connectionSetupLatencyMillis": integer, "unreliableRoundtripLatencyMillis": integer, "error": string, "error_reason": string } ] }
資源名稱 | 值 | 說明 | Notes |
---|---|---|---|
kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#roomP2PStatuses 。 |
|
updates[] |
list |
同類應用程式的更新。 | |
updates[].kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#roomP2PStatus 。 |
|
updates[].participantId |
string |
參與者的 ID。 | |
updates[].status |
string |
會議室在同類中的狀態。 可能的值包括:
可接受的值如下:
|
|
updates[].connectionSetupLatencyMillis |
integer |
與這個對等互連連線建立連線所需的時間 (以毫秒為單位)。 | |
updates[].unreliableRoundtripLatencyMillis |
integer |
在與這個對等互連不穩定的通道上來回傳送封包所需的時間 (以毫秒為單位)。 | |
updates[].error |
string |
故障時出現的錯誤代碼。 可能的值包括:
可接受的值如下:
|
|
updates[].error_reason |
string |
當故障時傳回的詳細診斷訊息。 |
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{ "kind": "games#roomStatus", "roomId": string, "status": string, "participants": [ { "kind": "games#roomParticipant", "id": string, "player": players Resource, "autoMatchedPlayer": { "kind": "games#anonymousPlayer", "displayName": string, "avatarImageUrl": string }, "autoMatched": boolean, "status": string, "clientAddress": { "kind": "games#roomClientAddress", "xmppAddress": string }, "connected": boolean, "leaveReason": string, "capabilities": [ string ] } ], "statusVersion": integer, "autoMatchingStatus": { "kind": "games#roomAutoMatchStatus", "waitEstimateSeconds": integer } }
屬性名稱 | 值 | 說明 | Notes |
---|---|---|---|
kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#roomStatus 。 |
|
roomId |
string |
會議室的全域專屬 ID。 | |
status |
string |
聊天室狀態。 可能的值包括:
可接受的值如下:
|
|
participants[] |
list |
參與會議的參與者及其狀態。包括已退出或拒絕邀請的參與者。 | |
participants[].kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#roomParticipant 。 |
|
participants[].id |
string |
聊天室範圍內的參與者 ID。無法用來識別會議室或其他情況中的玩家。 | |
participants[].player |
nested object |
玩家的相關資訊。如果匿名玩家與要求玩家進行匿名比對,系統不會填入這項資訊。(將設定 player 或 autoMatchedPlayer )。 |
|
participants[].autoMatchedPlayer |
nested object |
針對匿名玩家自動比對的玩家相關資訊。(將設定 player 或 autoMatchedPlayer )。 |
|
participants[].autoMatchedPlayer.kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#anonymousPlayer 。 |
|
participants[].autoMatchedPlayer.displayName |
string |
匿名播放器顯示的名稱。 | |
participants[].autoMatchedPlayer.avatarImageUrl |
string |
匿名播放器所顯示的圖片基準網址。 | |
participants[].autoMatched |
boolean |
如果此參與者已經與配對的玩家自動配對,則為 True。 | |
participants[].status |
string |
與參與者相關的會議室狀態。 可能的值包括:
可接受的值如下:
|
|
participants[].clientAddress |
nested object |
參與者的用戶端位址。 | |
participants[].clientAddress.kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#roomClientAddress 。 |
|
participants[].clientAddress.xmppAddress |
string |
用戶端在 Google 遊戲 XMPP 網路中的 XMPP 地址。 | |
participants[].connected |
boolean |
如果這個參與者是整個聊天室中的整組同儕,則傳回「是」。 | |
participants[].leaveReason |
string |
參與者離開聊天室的原因;如果參與者的狀態為 PARTICIPANT_LEFT ,則已填入。可能的值包括:
可接受的值如下:
|
|
participants[].capabilities[] |
list |
與這位參與者通訊時使用的功能。 | |
statusVersion |
integer |
會議室的狀態版本:不斷增加的計數器,用戶端會使用這個值忽略順序不明的更新。 | |
autoMatchingStatus |
nested object |
這個聊天室的自動比對狀態。如果聊天室目前未處於自動比對佇列中,則未設定。 | |
autoMatchingStatus.kind |
string |
用於識別這項資源的類型。值一律為固定字串 games#roomAutoMatchStatus 。 |
|
autoMatchingStatus.waitEstimateSeconds |
integer |
預估自動比對作業完成所需的時間 (以秒為單位)。 |
試試看!
使用 APIs Explorer 針對即時資料呼叫這個方法,並查看回應。