Drag[en]gine Script Module DragonScript  1.23
Dragengine.Services.ServiceModio Class Reference

Service providing access to Mod.io functionality if supported. More...

Inheritance diagram for Dragengine.Services.ServiceModio:
Dragengine.ServiceListener Dragengine.Services.Mods.ServiceMods Dragengine.Services.User.ServiceUser

Classes

class  InitParameters
 Service initialization parameters. More...
 
enum  Portal
 Store portal for use with ServiceModio. More...
 

Public Member Functions

void activateMods ()
 Activate subscribed and installed modifications. More...
 
void addModsListener (ServiceModsListener listener)
 Add modification listener. More...
 
void addUserListener (ServiceUserListener listener)
 Add user listener. More...
 
void dispose ()
 Dispose of ModIO service. More...
 
Dictionary getActiveMods ()
 Active mods. More...
 
void getAuthToken (ServiceUserListener listener)
 Request authentification token. More...
 
BaseServiceConversions getConversions ()
 Conversion helper. More...
 
ServiceModProgress getCurrentModUpdate ()
 Current mod install or update progress information. More...
 
void getModInfo (String id, ServiceModsListener listener)
 Retrieve information about game modification. More...
 
ServiceModsFeatures getModsFeatures ()
 Features supported by this service. More...
 
bool getPauseModManagement ()
 Mod management is paused. More...
 
Dictionary getSubscribedMods ()
 User subscribed mods. More...
 
Dictionary getSystemMods ()
 System mods. 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...
 
Boolean isInitialized ()
 Determines if service is initialized and ready to be used. More...
 
bool isModManagementBusy ()
 Service is busy managing modifications. More...
 
bool isUserLoggedIn ()
 User is logged in. More...
 
void listAllMods (ServiceModFilter filter, ServiceModsListener listener)
 Filtered list of available game modifications. More...
 
void loadModResource (String url, ServiceModsListener listener)
 Load resource asynchronously. More...
 
void loginUser (ServiceUserCredentials credentials, ServiceUserListener listener)
 Log in user. More...
 
ServiceModio new (InitParameters params, ServiceInitListener listener)
 Create service ServiceModIO. More...
 
void purchaseMod (String id, String price, ServiceModsListener listener)
 Purchase mod. More...
 
void removeModsListener (ServiceModsListener listener)
 Remove modification listener. More...
 
void removeUserListener (ServiceUserListener listener)
 Remove user listener. More...
 
void reportMod (String id, ServiceModReport report, ServiceModsListener listener)
 Report modification. More...
 
void requestResponse (Service service, UniqueID id, ServiceObject response, bool finished)
 Response received for request. More...
 
void revokeModRating (String id, ServiceModsListener listener)
 Revoke rating for modification. More...
 
void setModDisabled (String id, bool disabled, ServiceModsListener listener)
 Disable modification. More...
 
void setPauseModManagement (bool pause)
 Pause mod management. More...
 
void submitModRating (String id, int rating, ServiceModsListener listener)
 Submit rating for modification. More...
 
void subscribeMod (String id, ServiceModsListener listener)
 Subscribe to modification. More...
 
void unsubscribeMod (String id, ServiceModsListener listener)
 Unsubscribe from modification. More...
 
- Public Member Functions inherited from Dragengine.ServiceListener
void eventReceived (Service service, ServiceObject event)
 Service event received for example notifications. More...
 
void requestFailed (Service service, UniqueID id, ServiceObject error)
 Request failed. More...
 
- Public Member Functions inherited from Dragengine.Services.Mods.ServiceMods
void getModTags (ServiceModsListener listener)
 Tags that can be used for ServiceModFilter. More...
 
void getPurchasedMods (ServiceModsListener listener)
 Purchased mods. More...
 
bool modHasMatchingFiles (String id, String directory, bool recursive, Set patterns)
 Modification has files matching one or more patterns. More...
 
- Public Member Functions inherited from Dragengine.Services.User.ServiceUser
void loadUserResource (String url, ServiceUserListener listener)
 Load resource asynchronously. More...
 
void logoutUser (ServiceUserListener listener)
 Log out user. More...
 
void reportUser (String id, ServiceUserReport report, ServiceUserListener listener)
 Report user. More...
 

Static Public Member Functions

static bool isServiceSupported ()
 Checks if ModIO service is supported. More...
 

Public Attributes

BaseServiceConversions pConversions
 
ServiceInitListener pInitListener
 
InitParameters pInitParameters
 
Boolean pIsInitialized
 
bool pIsManagementBusy
 
SafeArray pModsListeners
 
Dictionary pOnceListeners
 
bool pPauseManagement
 
Portal pPortal
 
Service pService
 

Detailed Description

Service providing access to Mod.io functionality if supported.

Version
1.23

Provides access to these functionalities:

  • Mod browsing
  • Mod installing
  • Mod deinstalling

Member Function Documentation

◆ activateMods()

void Dragengine.Services.ServiceModio.activateMods ( )

Activate subscribed and installed modifications.

Installing modifications does not automatically activate them. This avoids interrupting a running game flow while modifications are beeing installed. A typical use case is calling activateMods() upon leaving the modification management dialog. This ensures modifications start affecting the game at a well known point in time.

Unsubscribing from a modification calls activateMods() to avoid the game potentially accessing to be deleted modification files.

Disabling and re-enabling modifications does not trigger activateMods().

Activating modifications runs immediately.

Starting a game automatically calls activateMods().

Implements Dragengine.Services.Mods.ServiceMods.

◆ addModsListener()

void Dragengine.Services.ServiceModio.addModsListener ( ServiceModsListener  listener)

Add modification listener.

Parameters
listenerListener to add

Implements Dragengine.Services.Mods.ServiceMods.

◆ addUserListener()

void Dragengine.Services.ServiceModio.addUserListener ( ServiceUserListener  listener)

Add user listener.

Parameters
listenerListener to add

Implements Dragengine.Services.User.ServiceUser.

◆ dispose()

void Dragengine.Services.ServiceModio.dispose ( )

Dispose of ModIO service.

◆ getActiveMods()

Dictionary Dragengine.Services.ServiceModio.getActiveMods ( )

Active mods.

Returns all active modifications (subscribed and enabled). Active modifications are changed when activateMods() is called. This call is useful to know if a game save state has been created with the same set of active modifications. Returns dictionary with String modification identifier and ServiceModStatus value.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getAuthToken()

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

Implements Dragengine.Services.User.ServiceUser.

◆ getConversions()

BaseServiceConversions Dragengine.Services.ServiceModio.getConversions ( )

Conversion helper.

◆ getCurrentModUpdate()

ServiceModProgress Dragengine.Services.ServiceModio.getCurrentModUpdate ( )

Current mod install or update progress information.

If no suitable mod management action is in progress null is returned.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getModInfo()

void Dragengine.Services.ServiceModio.getModInfo ( String  id,
ServiceModsListener  listener 
)

Retrieve information about game modification.

Once finished ServiceModsListener::onGetModInfo() is called.

Parameters
idIdentifier of modification to retrieve.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getModsFeatures()

ServiceModsFeatures Dragengine.Services.ServiceModio.getModsFeatures ( )

Features supported by this service.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getPauseModManagement()

bool Dragengine.Services.ServiceModio.getPauseModManagement ( )

Mod management is paused.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getSubscribedMods()

Dictionary Dragengine.Services.ServiceModio.getSubscribedMods ( )

User subscribed mods.

Returns modifications are potentially not installed. Use ServiceModStatus::status to filter modifications of interest. Returns dictionary with String modification identifier and ServiceModStatus value.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getSystemMods()

Dictionary Dragengine.Services.ServiceModio.getSystemMods ( )

System mods.

Returns all modifications installed on the system by all users. Returns dictionary with String modification identifier and ServiceModStatus value.

Implements Dragengine.Services.Mods.ServiceMods.

◆ getUserFeatures()

ServiceUserFeatures Dragengine.Services.ServiceModio.getUserFeatures ( )

Features supported by this service.

Implements Dragengine.Services.User.ServiceUser.

◆ getUserInfo()

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

Retrieve user information.

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

Implements Dragengine.Services.User.ServiceUser.

◆ getUserWalletBalance()

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

◆ isInitialized()

Boolean Dragengine.Services.ServiceModio.isInitialized ( )

Determines if service is initialized and ready to be used.

If null is returned the service is still initializing. If returned object has true value the service is initialized and ready to be used. If returned object has false value the service failed to initialized and has to be disposed.

◆ isModManagementBusy()

bool Dragengine.Services.ServiceModio.isModManagementBusy ( )

Service is busy managing modifications.

Typical actions causing true to be returned are (non conclusive list):

  • Installing modification
  • Uninstalling modification
  • Updating modification to latest version
  • Uploading modification

While this method returns true certain functions will fail.

Implements Dragengine.Services.Mods.ServiceMods.

◆ isServiceSupported()

static bool Dragengine.Services.ServiceModio.isServiceSupported ( )
static

Checks if ModIO service is supported.

Service is reported supported if the ModIO Service Module is present. Creating the service can still fail.

◆ isUserLoggedIn()

bool Dragengine.Services.ServiceModio.isUserLoggedIn ( )

User is logged in.

Implements Dragengine.Services.User.ServiceUser.

◆ listAllMods()

void Dragengine.Services.ServiceModio.listAllMods ( ServiceModFilter  filter,
ServiceModsListener  listener 
)

Filtered list of available game modifications.

Requests a list of game modifications using the provided filters. All filter parameters set to null cause default values to be used as defined by the service provider. Filters not supported by the service provider are ignored.

Once finished ServiceModsListener::onListMods() is called.

Receiving the results can take considerable amount of time depending on the load of the service provider.

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

Implements Dragengine.Services.Mods.ServiceMods.

◆ loadModResource()

void Dragengine.Services.ServiceModio.loadModResource ( String  url,
ServiceModsListener  listener 
)

Load resource asynchronously.

Loaded resources are cached for faster retrieval. Once the resource is cached locally ServiceModsListener::onLoadModResource() 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.

Implements Dragengine.Services.Mods.ServiceMods.

◆ loginUser()

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

◆ new()

ServiceModio Dragengine.Services.ServiceModio.new ( InitParameters  params,
ServiceInitListener  listener 
)

Create service ServiceModIO.

The service is asynchronously initialized. Once initialization finished the provided listener is called with success or failure outcome. If the outcome is success the service can be used. If the outcome is failure the service can not be used and should be disposed.

Parameters
paramsInit parameters.
listenerListener called if initialization finished. Can be null.
Exceptions
EInvalidParamModIO service module is not present.
EInvalidParamOne or more of the provided parameters is not valid.

◆ purchaseMod()

void Dragengine.Services.ServiceModio.purchaseMod ( String  id,
String  price,
ServiceModsListener  listener 
)

Purchase mod.

Once finished ServiceModsListener::onPurchaseMod() is called.

Parameters
idIdentifier of modification to purchase.
pricePrice shown to the user. Used to verify the price matches.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

◆ removeModsListener()

void Dragengine.Services.ServiceModio.removeModsListener ( ServiceModsListener  listener)

Remove modification listener.

Parameters
listenerListener to remove.

Implements Dragengine.Services.Mods.ServiceMods.

◆ removeUserListener()

void Dragengine.Services.ServiceModio.removeUserListener ( ServiceUserListener  listener)

Remove user listener.

Parameters
listenerListener to remove.

Implements Dragengine.Services.User.ServiceUser.

◆ reportMod()

void Dragengine.Services.ServiceModio.reportMod ( String  id,
ServiceModReport  report,
ServiceModsListener  listener 
)

Report modification.

Once finished ServiceModsListener::onReportMod() is called. Can be used if ServiceModsFeatures::canReportMods is true.

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

Implements Dragengine.Services.Mods.ServiceMods.

◆ requestResponse()

void Dragengine.Services.ServiceModio.requestResponse ( Service  service,
UniqueID  id,
ServiceObject  response,
bool  finished 
)

Response received for request.

Parameters
serviceService receiving the response.
idIdentifier of request this response belongs to.
responseResponse data.
finishedTrue if the request finished or false if more responses will be received.

Implements Dragengine.ServiceListener.

◆ revokeModRating()

void Dragengine.Services.ServiceModio.revokeModRating ( String  id,
ServiceModsListener  listener 
)

Revoke rating for modification.

Once finished ServiceModsListener::onRevokeModRating() is called. Can be used if ServiceModsFeatures::canRateMods is true.

Parameters
idIdentifier of modification to revoke rating for.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

◆ setModDisabled()

void Dragengine.Services.ServiceModio.setModDisabled ( String  id,
bool  disabled,
ServiceModsListener  listener 
)

Disable modification.

Modifications can be disabled by the user or the game if a modification is missbehaving or preventing the game from running. To get the disabled state of a modification use getSubscribedMods().

If modification is not found nothing is done.

Parameters
idIdentifier of modification to revoke rating for.
disabledDisabled state.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

◆ setPauseModManagement()

void Dragengine.Services.ServiceModio.setPauseModManagement ( bool  pause)

Pause mod management.

By default the service automatically downloads, installs and uninstalls mods. This process can be temporarily paused for example during game play.

Implements Dragengine.Services.Mods.ServiceMods.

◆ submitModRating()

void Dragengine.Services.ServiceModio.submitModRating ( String  id,
int  rating,
ServiceModsListener  listener 
)

Submit rating for modification.

Once finished ServiceModsListener::onSubmitModRating() is called. Can be used if ServiceModsFeatures::canRateMods is true.

Parameters
idIdentifier of modification to submit rating for.
ratingRating to submit.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

◆ subscribeMod()

void Dragengine.Services.ServiceModio.subscribeMod ( String  id,
ServiceModsListener  listener 
)

Subscribe to modification.

The user can also subscribe to a modification from outside the game using different means. In both situationsn modifications are installed automatically the next time possible if at least one user is subscribed to them. Hence subscribing and installing are different actions.

Once subscribing finished ServiceModsListener::onSubscribeMod() is called. At this point in time the modification is potentially not yet installed. Mod management installs mods as soon as possible if necessary. Listen to ServiceModsListener::onModManagement() events to know when the modification started and finished installing.

Parameters
tokenAuthentication token.
idIdentifier of modification to subscribe to.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

◆ unsubscribeMod()

void Dragengine.Services.ServiceModio.unsubscribeMod ( String  id,
ServiceModsListener  listener 
)

Unsubscribe from modification.

The user can also unsubscribe from a modification from outside the game using different means. In both situationsn modifications are uninstalled automatically the next time possible if no user is subscribed to them. Hence unsubscribing and uninstalling are different actions.

Once unsubscribing finished ServiceModsListener::onUnsubscribeMod() is called. At this point in time the modification is still installed. Mod management uninstalls mods as soon as possible if necessary. Listen to ServiceModsListener::onModManagement() events to know when the modification started and finished uninstalling.

Parameters
tokenAuthentication token.
idIdentifier of modification to unsubscribe from.
listenerIf not null called once in addition to added listeners.

Implements Dragengine.Services.Mods.ServiceMods.

Member Data Documentation

◆ pConversions

BaseServiceConversions Dragengine.Services.ServiceModio.pConversions

◆ pInitListener

ServiceInitListener Dragengine.Services.ServiceModio.pInitListener

◆ pInitParameters

InitParameters Dragengine.Services.ServiceModio.pInitParameters

◆ pIsInitialized

Boolean Dragengine.Services.ServiceModio.pIsInitialized

◆ pIsManagementBusy

bool Dragengine.Services.ServiceModio.pIsManagementBusy

◆ pModsListeners

SafeArray Dragengine.Services.ServiceModio.pModsListeners

◆ pOnceListeners

Dictionary Dragengine.Services.ServiceModio.pOnceListeners

◆ pPauseManagement

bool Dragengine.Services.ServiceModio.pPauseManagement

◆ pPortal

Portal Dragengine.Services.ServiceModio.pPortal

◆ pService

Service Dragengine.Services.ServiceModio.pService

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