Drag[en]gine Script Module DragonScript  1.23
Dragengine.Services.User.ServiceUser Interface Reference

Interface for services supporting user information and management. More...

Inheritance diagram for Dragengine.Services.User.ServiceUser:
Dragengine.Services.ServiceEos Dragengine.Services.ServiceModio Dragengine.Services.ServiceMsgdk Dragengine.Services.ServiceSteam

Classes

enum  Errors
 Errors. More...
 

Public Member Functions

void addUserListener (ServiceUserListener listener)
 Add user listener. More...
 
void getAuthToken (ServiceUserListener listener)
 Request authentification token. More...
 
ServiceUserFeatures getUserFeatures ()
 Features supported by this service. More...
 
void getUserInfo (ServiceUserListener listener)
 Retrieve user information. More...
 
void getUserWalletBalance (ServiceUserListener listener)
 Retrieve user wallet balance. More...
 
bool isUserLoggedIn ()
 User is logged in. More...
 
void loadUserResource (String url, ServiceUserListener listener)
 Load resource asynchronously. More...
 
void loginUser (ServiceUserCredentials credentials, ServiceUserListener listener)
 Log in user. More...
 
void logoutUser (ServiceUserListener listener)
 Log out user. More...
 
void removeUserListener (ServiceUserListener listener)
 Remove user listener. More...
 
void reportUser (String id, ServiceUserReport report, ServiceUserListener listener)
 Report user. More...
 

Detailed Description

Interface for services supporting user information and management.

Version
1.23

Member Function Documentation

◆ addUserListener()

void Dragengine.Services.User.ServiceUser.addUserListener ( ServiceUserListener  listener)

Add user listener.

Parameters
listenerListener to add

Implemented in Dragengine.Services.ServiceModio.

◆ getAuthToken()

void Dragengine.Services.User.ServiceUser.getAuthToken ( ServiceUserListener  listener)

Request authentification token.

Requests an encrypted appplication ticket. If one is cached it is returned. The received ticket is Base64 encoded.

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

Implemented in Dragengine.Services.ServiceSteam, Dragengine.Services.ServiceModio, and Dragengine.Services.ServiceEos.

◆ getUserFeatures()

ServiceUserFeatures Dragengine.Services.User.ServiceUser.getUserFeatures ( )

◆ getUserInfo()

void Dragengine.Services.User.ServiceUser.getUserInfo ( ServiceUserListener  listener)

Retrieve user information.

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

Implemented in Dragengine.Services.ServiceSteam, Dragengine.Services.ServiceMsgdk, and Dragengine.Services.ServiceModio.

◆ getUserWalletBalance()

void Dragengine.Services.User.ServiceUser.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.

Implemented in Dragengine.Services.ServiceSteam, Dragengine.Services.ServiceMsgdk, Dragengine.Services.ServiceModio, and Dragengine.Services.ServiceEos.

◆ isUserLoggedIn()

bool Dragengine.Services.User.ServiceUser.isUserLoggedIn ( )

◆ loadUserResource()

void Dragengine.Services.User.ServiceUser.loadUserResource ( String  url,
ServiceUserListener  listener 
)

Load resource asynchronously.

Loaded resources are cached for faster retrieval. Once the resource is cached locally ServiceUserListener.onLoadUserResource() is called with the same URL as used in this function call.

Parameters
urlURL of image to load.
listenerIf not null called once in addition to added listeners.

◆ loginUser()

void Dragengine.Services.User.ServiceUser.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.

Implemented in Dragengine.Services.ServiceSteam, Dragengine.Services.ServiceMsgdk, Dragengine.Services.ServiceModio, and Dragengine.Services.ServiceEos.

◆ logoutUser()

void Dragengine.Services.User.ServiceUser.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.

Implemented in Dragengine.Services.ServiceMsgdk, and Dragengine.Services.ServiceEos.

◆ removeUserListener()

void Dragengine.Services.User.ServiceUser.removeUserListener ( ServiceUserListener  listener)

Remove user listener.

Parameters
listenerListener to remove.

Implemented in Dragengine.Services.ServiceSteam, and Dragengine.Services.ServiceModio.

◆ reportUser()

void Dragengine.Services.User.ServiceUser.reportUser ( String  id,
ServiceUserReport  report,
ServiceUserListener  listener 
)

Report user.

Once finished ServiceUserListener.onReportUser() is called. Can be used if ServiceUserFeatures.canReportUser is true.

Parameters
idIdentifier of user to report.
reportReport to submit.
listenerIf not null called once in addition to added listeners.

Implemented in Dragengine.Services.ServiceEos.


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