Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Services.ServiceMsgdk Class Reference

Service providing access to Microsoft GDK functionality if supported. More...

Inheritance diagram for Dragengine.Services.ServiceMsgdk:
Dragengine.Services.Stats.ServiceStats Dragengine.Services.User.ServiceUser Dragengine.ServiceListener

Classes

class  InitParameters
 Service initialization parameters. More...

Public Member Functions

void addStatListener (ServiceStatsListener listener)
 Add stats and achievements listener.
void dispose ()
 Dispose of Microsoft GDK service.
BaseServiceConversions getConversions ()
 Conversion helper.
void getStatsAndAchievements (Set stats, Set achievements, ServiceStatsListener listener)
 Get stats and achievements.
ServiceUserFeatures getUserFeatures ()
 Features supported by this service.
void getUserInfo (ServiceUserListener listener)
 Retrieve user information.
void getUserWalletBalance (ServiceUserListener listener)
 Retrieve user wallet balance.
void loginUser (ServiceUserCredentials credentials, ServiceUserListener listener)
 Log in user.
void logoutUser (ServiceUserListener listener)
 Log out user.
ServiceMsgdk new (InitParameters params)
 Create service ServiceMsgdk.
void removeStatsListener (ServiceStatsListener listener)
 Remove stats and achievements listener.
void requestResponse (Service service, UniqueID id, ServiceObject response, bool finished)
 Response received for request.
Public Member Functions inherited from Dragengine.Services.Stats.ServiceStats
void resetAllStats (bool resetAchievements)
 Reset all stats on service provider.
void setStatsAndAchievements (Dictionary stats, Dictionary achievements, ServiceStatsListener listener)
 Set stats and achievements.
Public Member Functions inherited from Dragengine.Services.User.ServiceUser
void addUserListener (ServiceUserListener listener)
 Add user listener.
void getAuthToken (ServiceUserListener listener)
 Request authentification token.
bool isUserLoggedIn ()
 User is logged in.
void loadUserResource (String url, ServiceUserListener listener)
 Load resource asynchronously.
void removeUserListener (ServiceUserListener listener)
 Remove user listener.
void reportUser (String id, ServiceUserReport report, ServiceUserListener listener)
 Report user.
Public Member Functions inherited from Dragengine.ServiceListener
void eventReceived (Service service, ServiceObject event)
 Service event received for example notifications.
void requestFailed (Service service, UniqueID id, ServiceObject error)
 Request failed.

Static Public Member Functions

static bool isServiceSupported ()
 Checks if Microsoft GDK service is supported.

Public Attributes

BaseServiceConversions pConversions
InitParameters pInitParameters
Dictionary pOnceListeners
Service pService
SafeArray pStatsListeners

Static Public Attributes

static final String authProviderId = "xboxLive"
 Authentification provider identifier.

Detailed Description

Service providing access to Microsoft GDK functionality if supported.

Version
1.23

Provides access to these functionalities:

  • Stats/Achievements
  • User

Member Function Documentation

◆ addStatListener()

void Dragengine.Services.ServiceMsgdk.addStatListener ( ServiceStatsListener listener)

Add stats and achievements listener.

Parameters
listenerListener to add

Implements Dragengine.Services.Stats.ServiceStats.

References dispose().

Referenced by requestResponse().

◆ dispose()

void Dragengine.Services.ServiceMsgdk.dispose ( )

Dispose of Microsoft GDK service.

References new(), pConversions, pInitParameters, pOnceListeners, pService, and pStatsListeners.

Referenced by addStatListener().

◆ getConversions()

BaseServiceConversions Dragengine.Services.ServiceMsgdk.getConversions ( )

Conversion helper.

Referenced by requestResponse().

◆ getStatsAndAchievements()

void Dragengine.Services.ServiceMsgdk.getStatsAndAchievements ( Set stats,
Set achievements,
ServiceStatsListener listener )

Get stats and achievements.

Requests from the service provider the set of stats and achievements with the matching api names. Once retrieved calls ServiceStatsListener#onGetStats().

Parameters
statsStats.
achievementsAchievements.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Stats.ServiceStats.

Referenced by requestResponse().

◆ getUserFeatures()

ServiceUserFeatures Dragengine.Services.ServiceMsgdk.getUserFeatures ( )

Features supported by this service.

Implements Dragengine.Services.User.ServiceUser.

Referenced by requestResponse().

◆ getUserInfo()

void Dragengine.Services.ServiceMsgdk.getUserInfo ( ServiceUserListener listener)

Retrieve user information.

Parameters
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.User.ServiceUser.

References pService.

Referenced by requestResponse().

◆ getUserWalletBalance()

void Dragengine.Services.ServiceMsgdk.getUserWalletBalance ( ServiceUserListener listener)

Retrieve user wallet balance.

Can be used if ServiceUserFeatures#hasMarketplace is true.

Parameters
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.User.ServiceUser.

References pService.

Referenced by requestResponse().

◆ isServiceSupported()

bool Dragengine.Services.ServiceMsgdk.isServiceSupported ( )
static

Checks if Microsoft GDK service is supported.

Service is reported supported if the Microsoft GDK Service Module is present. Creating the service can still fail if Microsoft GDK can not be initialized.

References pService.

Referenced by requestResponse().

◆ loginUser()

void Dragengine.Services.ServiceMsgdk.loginUser ( ServiceUserCredentials credentials,
ServiceUserListener listener )

Log in user.

User can be logged in automatically or manually.

Automatic logging in is used for example Steam where the user has to log into the platform before the game can be launched. Automatic logging in can trigger platform specific log in procedure and terms acknowledge process. Typically this has to be done once and then logging in is automatic.

Manual logging in requires the game to obtain the credentials from the user. This can be useful for developers to not enter credentials each time they launch the game. Production games usually do not require manual logging in unless the service in question does not support automatic logging in.

Manual logging in is also possible using authentification tokens from other services. For example a user can log into certain services using his Steam user account. See ServiceUserFeatures#canAuthProviderLogin obtained from getUserFeatures() to know which other services are supported for manual login using auth tokens.

Once logging in finished ServiceUserListener#onLoginUser() is called.

Parameters
credentialsCredentials for manual logging in. Use null for automatic logging in.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.User.ServiceUser.

References pOnceListeners.

Referenced by requestResponse().

◆ logoutUser()

void Dragengine.Services.ServiceMsgdk.logoutUser ( ServiceUserListener listener)

Log out user.

Once logging out finished ServiceUserListener#onLogoutUser() is called.

Parameters
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.User.ServiceUser.

Referenced by requestResponse().

◆ new()

ServiceMsgdk Dragengine.Services.ServiceMsgdk.new ( InitParameters params)

Create service ServiceMsgdk.

Parameters
paramsInit parameters.
Exceptions
EInvalidParamMicrosoft GDK service module is not present.
EInvalidActionMicrosoft GDK can not be initialized.

References new(), and pInitParameters.

Referenced by dispose(), new(), and requestResponse().

◆ removeStatsListener()

void Dragengine.Services.ServiceMsgdk.removeStatsListener ( ServiceStatsListener listener)

Remove stats and achievements listener.

Parameters
listenerListener to remove.

Implements Dragengine.Services.Stats.ServiceStats.

References pStatsListeners.

Referenced by requestResponse().

◆ requestResponse()

Member Data Documentation

◆ authProviderId

final String Dragengine.Services.ServiceMsgdk.authProviderId = "xboxLive"
static

Authentification provider identifier.

Referenced by requestResponse().

◆ pConversions

BaseServiceConversions Dragengine.Services.ServiceMsgdk.pConversions

Referenced by dispose(), and requestResponse().

◆ pInitParameters

InitParameters Dragengine.Services.ServiceMsgdk.pInitParameters

Referenced by dispose(), and new().

◆ pOnceListeners

Dictionary Dragengine.Services.ServiceMsgdk.pOnceListeners

Referenced by dispose(), loginUser(), and requestResponse().

◆ pService

Service Dragengine.Services.ServiceMsgdk.pService

◆ pStatsListeners

SafeArray Dragengine.Services.ServiceMsgdk.pStatsListeners

The documentation for this class was generated from the following file: