gpg:: PlayerManager
#include <player_manager.h>
Gets and sets various player-related data.
Summary
Public types |
|
---|---|
FetchCallback
|
typedefstd::function< void(const FetchResponse &)>
Defines a callback type that receives a FetchResponse. |
FetchListCallback
|
typedefstd::function< void(const FetchListResponse &)>
Defines a callback type that receives a FetchListResponse. |
FetchSelfCallback
|
typedefstd::function< void(const FetchSelfResponse &)>
Defines a callback type that receives a FetchSelfResponse. |
Public functions |
|
---|---|
Fetch(const std::string & player_id, FetchCallback callback)
|
void
Asynchronously loads all data for a specific player.
|
Fetch(DataSource data_source, const std::string & player_id, FetchCallback callback)
|
void
Asynchronously loads all data for a specific player.
|
FetchBlocking(const std::string & player_id)
|
Synchronously loads all data for a specific player, directly returning the FetchResponse.
|
FetchBlocking(DataSource data_source, const std::string & player_id)
|
Synchronously loads all data for a specific player, directly returning the FetchResponse.
|
FetchBlocking(Timeout timeout, const std::string & player_id)
|
Synchronously loads all data for a specific player, directly returning the FetchResponse.
|
FetchBlocking(DataSource data_source, Timeout timeout, const std::string & player_id)
|
Synchronously loads all data for a specific player, directly returning returning the FetchResponse.
|
FetchConnected(DataSource data_source, FetchListCallback callback)
|
void
Asynchronously loads all players which have connected to the current game, and which the signed-in player has permission to know about.
|
FetchConnected(FetchListCallback callback)
|
void
Overload of FetchConnected which uses a default data_source of CACHE_OR_NETWORK.
|
FetchConnectedBlocking(DataSource data_Source, Timeout timeout)
|
Deprecated.
Blocking version of FetchConnected.
|
FetchConnectedBlocking(DataSource data_source)
|
Deprecated.
Overload of FetchConnectedBlocking which uses a default timeout of 10 years.
|
FetchConnectedBlocking(Timeout timeout)
|
Deprecated.
Overload of FetchConnectedBlocking which uses a default data_source of CACHE_OR_NETWORK.
|
FetchConnectedBlocking()
|
Deprecated.
Overload of FetchConnectedBlocking which uses a default data_source of CACHE_OR_NETWORK and a default timeout of 10 years.
|
FetchInvitable(DataSource data_source, FetchListCallback callback)
|
void
Asynchronously loads all players which are in the local player's circles (and can receive invites from the local player).
|
FetchInvitable(FetchListCallback callback)
|
void
Overload of FetchInvitable which uses a default data_source of CACHE_OR_NETWORK.
|
FetchInvitableBlocking(DataSource data_source, Timeout timeout)
|
Deprecated.
Blocking version of FetchInvitable.
|
FetchInvitableBlocking(DataSource data_source)
|
Deprecated.
Overload of FetchInvitableBlocking which uses a default timeout of 10 years.
|
FetchInvitableBlocking(Timeout timeout)
|
Deprecated.
Overload of FetchInvitableBlocking which uses a default data_source of CACHE_OR_NETWORK.
|
FetchInvitableBlocking()
|
Deprecated.
Overload of FetchInvitableBlocking which uses a default data_source of CACHE_OR_NETWORK and a default timeout of 10 years.
|
FetchRecentlyPlayed(DataSource data_source, FetchListCallback callback)
|
void
Asynchronously loads all recently played players.
|
FetchRecentlyPlayed(FetchListCallback callback)
|
void
Overload of FetchRecentlyPlayed which uses a default data_source of CACHE_OR_NETWORK.
|
FetchRecentlyPlayedBlocking(DataSource data_source, Timeout timeout)
|
Blocking version of FetchRecentlyPlayed.
|
FetchRecentlyPlayedBlocking(DataSource data_source)
|
Overload of FetchRecentlyPlayedBlocking which uses a default timeout of 10 years.
|
FetchRecentlyPlayedBlocking(Timeout timeout)
|
Overload of FetchRecentlyPlayedBlocking which uses a default data_source of CACHE_OR_NETWORK.
|
FetchRecentlyPlayedBlocking()
|
Overload of FetchRecentlyPlayedBlocking which uses a default data_source of CACHE_OR_NETWORK and a default timeout of 10 years.
|
FetchSelf(FetchSelfCallback callback)
|
void
Asynchronously loads all data for all currently signed-in players.
|
FetchSelf(DataSource data_source, FetchSelfCallback callback)
|
void
Asynchronously loads all data for all currently signed-in players.
|
FetchSelfBlocking()
|
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
|
FetchSelfBlocking(DataSource data_source)
|
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
|
FetchSelfBlocking(Timeout timeout)
|
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
|
FetchSelfBlocking(DataSource data_source, Timeout timeout)
|
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
|
Structs |
|
---|---|
gpg:: |
A response which contains a vector of players. |
gpg:: |
|
gpg:: |
Holds all player data, along with a response status. |
Public types
FetchCallback
std::function< void(const FetchResponse &)> FetchCallback
Defines a callback type that receives a FetchResponse.
This callback type is provided to the Fetch(*)
functions below.
FetchListCallback
std::function< void(const FetchListResponse &)> FetchListCallback
Defines a callback type that receives a FetchListResponse.
This callback type is provided to the Fetch(*)
functions below.
FetchSelfCallback
std::function< void(const FetchSelfResponse &)> FetchSelfCallback
Defines a callback type that receives a FetchSelfResponse.
This callback type is provided to the FetchSelf(*)
functions below.
Public functions
Fetch
void Fetch( const std::string & player_id, FetchCallback callback )
Asynchronously loads all data for a specific player.
Calls the provided FetchCallback on operation completion. Not specifying data_source makes this function call equivalent to calling Fetch(DataSource data_source, const std::string& player_id, FetchCallback callback)
, with data_source specified as CACHE_OR_NETWORK.
Fetch
void Fetch( DataSource data_source, const std::string & player_id, FetchCallback callback )
Asynchronously loads all data for a specific player.
Calls the provided FetchCallback on operation completion. Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY.
FetchBlocking
FetchResponse FetchBlocking( const std::string & player_id )
Synchronously loads all data for a specific player, directly returning the FetchResponse.
Specifying neither data_source nor timeout makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source, timeout timeout), with DataSource specified as CACHE_OR_NETWORK, and timeout specified as 10 years.
FetchBlocking
FetchResponse FetchBlocking( DataSource data_source, const std::string & player_id )
Synchronously loads all data for a specific player, directly returning the FetchResponse.
Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Leaving timeout unspecified makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source, Timeout timeout), with your specified data_source value, and timeout specified as 10 years.
FetchBlocking
FetchResponse FetchBlocking( Timeout timeout, const std::string & player_id )
Synchronously loads all data for a specific player, directly returning the FetchResponse.
Specify timeout as an arbitrary number of milliseconds. Leaving data_source unspecified makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source, Timeout timeout), with data_source specified as CACHE_OR_NETWORK and timeout, containing your specified value.
FetchBlocking
FetchResponse FetchBlocking( DataSource data_source, Timeout timeout, const std::string & player_id )
Synchronously loads all data for a specific player, directly returning returning the FetchResponse.
Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Specify timeout as an arbitrary number of milliseconds.
FetchConnected
void FetchConnected( DataSource data_source, FetchListCallback callback )
Asynchronously loads all players which have connected to the current game, and which the signed-in player has permission to know about.
Calls the provided FetchCallback on operation completion. Specify data_source as either CACHE_OR_NETWORK or NETWORK_ONLY.
Note that this function may return Player objects where Player.HasLevelInfo returns false. In such cases, level information can be retrieved by re-requesting the given player through the Fetch API. Deprecated.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchConnected
void FetchConnected( FetchListCallback callback )
Overload of FetchConnected which uses a default data_source of CACHE_OR_NETWORK.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchConnectedBlocking
FetchListResponse FetchConnectedBlocking( DataSource data_Source, Timeout timeout )
Blocking version of FetchConnected.
Allows the caller to specify a timeout in ms. After the specified time elapses, the function returns ERROR_TIMEOUT
. Note that on iOS this blocking version cannot be called from the UI thread, as the underlying plus service which provides the data must run operations on the UI thread.
Deprecated.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchConnectedBlocking
FetchListResponse FetchConnectedBlocking( DataSource data_source )
Overload of FetchConnectedBlocking which uses a default timeout of 10 years.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchConnectedBlocking
FetchListResponse FetchConnectedBlocking( Timeout timeout )
Overload of FetchConnectedBlocking which uses a default data_source of CACHE_OR_NETWORK.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchConnectedBlocking
FetchListResponse FetchConnectedBlocking()
Overload of FetchConnectedBlocking which uses a default data_source of CACHE_OR_NETWORK and a default timeout of 10 years.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchInvitable
void FetchInvitable( DataSource data_source, FetchListCallback callback )
Asynchronously loads all players which are in the local player's circles (and can receive invites from the local player).
Note that if an invitable player has not connected to the current game, they may not receive any notification that they have been invited.
Calls the provided FetchCallback on operation completion. Specify data_source as either CACHE_OR_NETWORK or NETWORK_ONLY.
Note that this function may return Player objects where Player.HasLevelInfo returns false. In such cases, level information can be retrieved by re-requesting the given player through the Fetch API. Deprecated.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchInvitable
void FetchInvitable( FetchListCallback callback )
Overload of FetchInvitable which uses a default data_source of CACHE_OR_NETWORK.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchInvitableBlocking
FetchListResponse FetchInvitableBlocking( DataSource data_source, Timeout timeout )
Blocking version of FetchInvitable.
Allows the caller to specify a timeout in ms. After the specified time elapses, the function returns ERROR_TIMEOUT
. Note that on iOS this blocking version cannot be called from the UI thread, as the underlying plus service which provides the data must run operations on the UI thread.
Deprecated.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchInvitableBlocking
FetchListResponse FetchInvitableBlocking( DataSource data_source )
Overload of FetchInvitableBlocking which uses a default timeout of 10 years.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchInvitableBlocking
FetchListResponse FetchInvitableBlocking( Timeout timeout )
Overload of FetchInvitableBlocking which uses a default data_source of CACHE_OR_NETWORK.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchInvitableBlocking
FetchListResponse FetchInvitableBlocking()
Overload of FetchInvitableBlocking which uses a default data_source of CACHE_OR_NETWORK and a default timeout of 10 years.
- Returned list will be empty. See: https://android-developers.googleblog.com/2016/12/games-authentication-adopting-google.html
FetchRecentlyPlayed
void FetchRecentlyPlayed( DataSource data_source, FetchListCallback callback )
Asynchronously loads all recently played players.
Calls the provided FetchCallback on operation completion. Specify data_source as either CACHE_OR_NETWORK or NETWORK_ONLY.
FetchRecentlyPlayed
void FetchRecentlyPlayed( FetchListCallback callback )
Overload of FetchRecentlyPlayed which uses a default data_source of CACHE_OR_NETWORK.
FetchRecentlyPlayedBlocking
FetchListResponse FetchRecentlyPlayedBlocking( DataSource data_source, Timeout timeout )
Blocking version of FetchRecentlyPlayed.
Allows the caller to specify a timeout in ms. After the specified time elapses, the function returns ERROR_TIMEOUT
.
FetchRecentlyPlayedBlocking
FetchListResponse FetchRecentlyPlayedBlocking( DataSource data_source )
Overload of FetchRecentlyPlayedBlocking which uses a default timeout of 10 years.
FetchRecentlyPlayedBlocking
FetchListResponse FetchRecentlyPlayedBlocking( Timeout timeout )
Overload of FetchRecentlyPlayedBlocking which uses a default data_source of CACHE_OR_NETWORK.
FetchRecentlyPlayedBlocking
FetchListResponse FetchRecentlyPlayedBlocking()
Overload of FetchRecentlyPlayedBlocking which uses a default data_source of CACHE_OR_NETWORK and a default timeout of 10 years.
FetchSelf
void FetchSelf( FetchSelfCallback callback )
Asynchronously loads all data for all currently signed-in players.
Calls the provided FetchSelfCallback on operation completion. Not specifying data_source makes this function call equivalent to calling FetchSelf(DataSource data_source, FetchSelfCallback callback)
, with data_source specified as CACHE_OR_NETWORK.
FetchSelf
void FetchSelf( DataSource data_source, FetchSelfCallback callback )
Asynchronously loads all data for all currently signed-in players.
Calls the provided FetchSelfCallback on operation completion. Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY.
FetchSelfBlocking
FetchSelfResponse FetchSelfBlocking()
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
Not specifying data_source or timeout makes this function call equivalent to calling FetchSelfResponse FetchSelfBlocking(DataSource data_source, Timeout timeout), with data_source specified as CACHE_OR_NETWORK, and timeout specified as 10 years.
FetchSelfBlocking
FetchSelfResponse FetchSelfBlocking( DataSource data_source )
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Not specifying timeout makes this function call equivalent to calling FetchSelfResponse FetchSelfBlocking(DataSource data_source, Timeout timeout), with your specified data_source value, and timeout specified as 10 years.
FetchSelfBlocking
FetchSelfResponse FetchSelfBlocking( Timeout timeout )
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
Specify timeout as an arbitrary number of milliseconds. Not specifying data_source makes this function call equivalent to calling FetchSelfResponse FetchSelfBlocking(DataSource data_source, Timeout timeout), with data_source specified as CACHE_OR_NETWORK, and timeout containing your specified value.
FetchSelfBlocking
FetchSelfResponse FetchSelfBlocking( DataSource data_source, Timeout timeout )
Synchronously loads all data for all currently signed-in players, directly returning the FetchSelfResponse.
Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Specify timeout as an arbitrary number of milliseconds.