REST Resource: players

資源:Player

玩家資源。

JSON 表示法
{
  "kind": string,
  "playerId": string,
  "displayName": string,
  "avatarImageUrl": string,
  "bannerUrlPortrait": string,
  "bannerUrlLandscape": string,
  "originalPlayerId": string,
  "profileSettings": {
    object (ProfileSettings)
  },
  "name": {
    "familyName": string,
    "givenName": string
  },
  "experienceInfo": {
    object (PlayerExperienceInfo)
  },
  "title": string,
  "friendStatus": enum (FriendStatus),
  "gamePlayerId": string
}
欄位
kind

string

專門用於識別這項資源的類型。值一律為固定字串 games#player

playerId

string

玩家的 ID。

displayName

string

播放器的顯示名稱。

avatarImageUrl

string

代表播放器的圖片基準網址。

bannerUrlPortrait

string

直向模式的播放器橫幅圖片網址。

bannerUrlLandscape

string

橫向模式播放器橫幅圖片的網址。

originalPlayerId

string

此玩家首次登入相關遊戲時使用的玩家 ID。這只會針對發出請求的玩家而填入 Player.get,只有在玩家 ID 之後變更時,且只有支援重新對應玩家 ID 的用戶端才會填入。

profileSettings

object (ProfileSettings)

玩家的個人資料設定。控管是否要向其他玩家顯示玩家的個人資料。

name

object

玩家名稱個別元件的物件表示法。部分播放器可能不會顯示這些欄位。

name.familyName

string

此玩家的系列名稱。這個名稱在某些地方稱為「姓氏」,

name.givenName

string

此玩家的給定名稱。在某些地方,這個名稱稱為「名字」。

experienceInfo

object (PlayerExperienceInfo)

代表玩家 Play 遊戲體驗資訊的物件。

title

string

獎勵玩家的遊戲活動提供獎勵。

friendStatus

enum (FriendStatus)

指定玩家相對於要求者的好友狀態。如果玩家未與遊戲分享好友名單,系統就不會設定這個選項。

gamePlayerId

string

個別應用程式的玩家 ID。

ProfileSettings

個人資料設定

JSON 表示法
{
  "kind": string,
  "profileVisible": boolean,
  "friendsListVisibility": enum (FriendsListVisibility)
}
欄位
kind

string

專門用於識別這項資源的類型。值一律為固定字串 games#profileSettings

profileVisible

boolean

是否向目前登入的玩家可見玩家的個人資料。

friendsListVisibility

enum (FriendsListVisibility)

FriendsListVisibility

是否要向這款遊戲顯示玩家的好友名單,或允許對方索取。這個欄位只會填入目前登入的玩家。

列舉
VISIBLE 目前遊戲可以看到好友名單。
REQUEST_REQUIRED 開發人員無法存取好友名單,但可以呼叫 Android API 以顯示同意聲明對話方塊。
UNAVAILABLE 此使用者目前無法使用好友清單,且目前無法要求存取權,因為使用者已永久拒絕,或對方無法使用好友功能。在這個狀態下,任何嘗試要求好友名單的存取權都會失敗。

PlayerExperienceInfo

與玩家體驗相關的第一方/第三方中繼資料。

JSON 表示法
{
  "kind": string,
  "currentExperiencePoints": string,
  "lastLevelUpTimestampMillis": string,
  "currentLevel": {
    object (PlayerLevel)
  },
  "nextLevel": {
    object (PlayerLevel)
  }
}
欄位
kind

string

專門用於識別這項資源的類型。值一律為固定字串 games#playerExperienceInfo

currentExperiencePoints

string (int64 format)

玩家目前的經驗點數數量。

lastLevelUpTimestampMillis

string (int64 format)

玩家升級時的時間戳記,以 Unix 紀元 (UTC) 起算的毫秒數。

currentLevel

object (PlayerLevel)

玩家目前等級。

nextLevel

object (PlayerLevel)

玩家的下一關。如果目前等級是最高等級,則該等級必須與目前的等級相同。

PlayerLevel

使用者層級的第一方/第三方中繼資料。

JSON 表示法
{
  "kind": string,
  "level": integer,
  "minExperiencePoints": string,
  "maxExperiencePoints": string
}
欄位
kind

string

專門用於識別這項資源的類型。值一律為固定字串 games#playerLevel

level

integer

使用者等級。

minExperiencePoints

string (int64 format)

這個等級的最低經驗值。

maxExperiencePoints

string (int64 format)

這個等級的最高經驗值。

FriendStatus

定義玩家之間的友誼。

列舉
NO_RELATIONSHIP 玩家之間沒有關係。
FRIEND 玩家與要求者為好友。

方法

get

擷取具有指定 ID 的玩家資源。

getMultipleApplicationPlayerIds

在與發出呼叫應用程式的相同開發人員要求的所有遊戲中,取得目前驗證玩家的應用程式播放器 ID。

getScopedPlayerIds

為目前已驗證的使用者擷取限定範圍的玩家 ID。

list

取得目前已驗證使用者的玩家集合。