gpg::GameServices::Builder

#include <builder.h>

Used for creating and configuring an instance of the GameServices class.

Summary

Constructors and Destructors

Builder()
~Builder()

Public types

OnAuthActionFinishedCallback typedef
std::function< void(AuthOperation, AuthStatus)>
The type of authentication action finished callback that can be provided to the SDK.
OnAuthActionStartedCallback typedef
std::function< void(AuthOperation)>
The type of the authentication action started callback that can be provided to the SDK.
OnLogCallback typedef
std::function< void(LogLevel, const std::string &)>
The type of logging callback that can be provided to the SDK.
OnMultiplayerInvitationEventCallback typedef
std::function< void(MultiplayerEvent, std::string, MultiplayerInvitation)>
The type of the multiplayer invitation callback that can be provided to the SDK.
OnTurnBasedMatchEventCallback typedef
std::function< void(MultiplayerEvent event, std::string, TurnBasedMatch)>
The type of the turn based multiplayer event callback that can be provided to the SDK.

Public functions

AddOauthScope(const std::string & scope)
Scopes beyond the required Play Games scope to request.
Create(const PlatformConfiguration & platform)
std::unique_ptr< GameServices >
Takes a platform configuration and attempts to return a newly instantiated GameServices object.
EnableSnapshots()
Enable Snapshots.
SetDefaultOnLog(LogLevel min_level)
Specifies that logging should use the DEFAULT_ON_LOG_CALLBACK at the specified log level.
SetLogging(OnLogCallback callback, LogLevel min_level) Deprecated. Prefer SetOnLog and SetDefaultOnLog. Registers a callback which will be used to perform logging. min_level specifies the minimum log level at which the callback is invoked. Possible levels are: VERBOSE, INFO, WARNING, and ERROR.
SetLogging(OnLogCallback callback) Deprecated. Prefer SetOnLog and SetDefaultOnLog. Registers a callback which will be used to perform logging. the same as calling SetLogging(OnLogCallback, LogLevel) with a LogLevel of INFO.
SetOnAuthActionFinished(OnAuthActionFinishedCallback callback)
Registers a callback to be called when authorization has finished.
SetOnAuthActionStarted(OnAuthActionStartedCallback callback)
Registers a callback to be called when authorization has begun.
SetOnLog(OnLogCallback callback, LogLevel min_level)
Registers a callback which will be used to perform logging.
SetOnLog(OnLogCallback callback)
Registers a callback which will be used to perform logging.
SetOnMultiplayerInvitationEvent(OnMultiplayerInvitationEventCallback callback)
Registers a callback to be called when an event occurrs for a multiplayer invitation.
SetOnTurnBasedMatchEvent(OnTurnBasedMatchEventCallback callback)
Registers a callback to be called when an event occurrs for a turn based multiplayer match.
SetShowConnectingPopup(bool show_popup)
Sets whether a "connecting" popup should be displayed automatically at the start of the sign-in flow.

Public types

OnAuthActionFinishedCallback

std::function< void(AuthOperation, AuthStatus)> OnAuthActionFinishedCallback

The type of authentication action finished callback that can be provided to the SDK.

OnAuthActionStartedCallback

std::function< void(AuthOperation)> OnAuthActionStartedCallback

The type of the authentication action started callback that can be provided to the SDK.

OnLogCallback

std::function< void(LogLevel, const std::string &)> OnLogCallback

The type of logging callback that can be provided to the SDK.

OnMultiplayerInvitationEventCallback

std::function< void(MultiplayerEvent, std::string, MultiplayerInvitation)> OnMultiplayerInvitationEventCallback

The type of the multiplayer invitation callback that can be provided to the SDK.

Valid() only returns true for the MultiplayerInvitation on UPDATED events.

OnTurnBasedMatchEventCallback

std::function< void(MultiplayerEvent event, std::string, TurnBasedMatch)> OnTurnBasedMatchEventCallback

The type of the turn based multiplayer event callback that can be provided to the SDK.

Valid() only returns true for the TurnBasedMatch parameter on UPDATED events.

Public functions

AddOauthScope

Builder & AddOauthScope(
  const std::string & scope
)

Scopes beyond the required Play Games scope to request.

Details on authorization scopes at https://developers.google.com/+/api/oauth#scopes.

Builder

 Builder()

Create

std::unique_ptr< GameServices > Create(
  const PlatformConfiguration & platform
)

Takes a platform configuration and attempts to return a newly instantiated GameServices object.

Will return nullptr if given an invalid PlatformConfiguration (i.e. !platform.Valid()), and may also return nullptr if another GameServices object has already been instantiated.

For more information, see the documentation on IosPlatformConfiguration, AndroidPlatformConfiguration, and PlatformConfiguration: https://developers.google.com/games/services/cpp/api/platform__configuration_8h

EnableSnapshots

Builder & EnableSnapshots()

Enable Snapshots.

This is equivalent to AddOauthScope(kSnapshotScope). See SnapshotManager for more details.

SetDefaultOnLog

Builder & SetDefaultOnLog(
  LogLevel min_level
)

Specifies that logging should use the DEFAULT_ON_LOG_CALLBACK at the specified log level.

min_level specifies the minimum log level at which the default callback is invoked. Possible levels are: VERBOSE, INFO, WARNING, and ERROR. This is equivalent to calling SetOnLog(OnLogCallback, LogLevel) with OnLogCallback set to DEFAULT_ON_LOG_CALLBACK and a LogLevel of min_level.

SetLogging

Builder & SetLogging(
  OnLogCallback callback,
  LogLevel min_level
)

Deprecated. Prefer SetOnLog and SetDefaultOnLog. Registers a callback which will be used to perform logging. min_level specifies the minimum log level at which the callback is invoked. Possible levels are: VERBOSE, INFO, WARNING, and ERROR.

SetLogging

Builder & SetLogging(
  OnLogCallback callback
)

Deprecated. Prefer SetOnLog and SetDefaultOnLog. Registers a callback which will be used to perform logging. the same as calling SetLogging(OnLogCallback, LogLevel) with a LogLevel of INFO.

SetOnAuthActionFinished

Builder & SetOnAuthActionFinished(
  OnAuthActionFinishedCallback callback
)

Registers a callback to be called when authorization has finished.

SetOnAuthActionStarted

Builder & SetOnAuthActionStarted(
  OnAuthActionStartedCallback callback
)

Registers a callback to be called when authorization has begun.

SetOnLog

Builder & SetOnLog(
  OnLogCallback callback,
  LogLevel min_level
)

Registers a callback which will be used to perform logging.

min_level specifies the minimum log level at which the callback is invoked. Possible levels are: VERBOSE, INFO, WARNING, and ERROR.

SetOnLog

Builder & SetOnLog(
  OnLogCallback callback
)

Registers a callback which will be used to perform logging.

This is equivalent to calling SetOnLog(OnLogCallback, LogLevel) with a LogLevel of INFO.

SetOnMultiplayerInvitationEvent

Builder & SetOnMultiplayerInvitationEvent(
  OnMultiplayerInvitationEventCallback callback
)

Registers a callback to be called when an event occurrs for a multiplayer invitation.

SetOnTurnBasedMatchEvent

Builder & SetOnTurnBasedMatchEvent(
  OnTurnBasedMatchEventCallback callback
)

Registers a callback to be called when an event occurrs for a turn based multiplayer match.

SetShowConnectingPopup

Builder & SetShowConnectingPopup(
  bool show_popup
)

Sets whether a "connecting" popup should be displayed automatically at the start of the sign-in flow.

By default this is enabled.

~Builder

 ~Builder()