Drag[en]gine Script Module DragonScript
1.23
|
Service providing access to Mod.io functionality if supported. More...
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 |
Service providing access to Mod.io functionality if supported.
Provides access to these functionalities:
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.
void Dragengine.Services.ServiceModio.addModsListener | ( | ServiceModsListener | listener | ) |
Add modification listener.
listener | Listener to add |
Implements Dragengine.Services.Mods.ServiceMods.
void Dragengine.Services.ServiceModio.addUserListener | ( | ServiceUserListener | listener | ) |
Add user listener.
listener | Listener to add |
Implements Dragengine.Services.User.ServiceUser.
void Dragengine.Services.ServiceModio.dispose | ( | ) |
Dispose of ModIO service.
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.
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.
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.User.ServiceUser.
BaseServiceConversions Dragengine.Services.ServiceModio.getConversions | ( | ) |
Conversion helper.
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.
void Dragengine.Services.ServiceModio.getModInfo | ( | String | id, |
ServiceModsListener | listener | ||
) |
Retrieve information about game modification.
Once finished ServiceModsListener::onGetModInfo() is called.
id | Identifier of modification to retrieve. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
ServiceModsFeatures Dragengine.Services.ServiceModio.getModsFeatures | ( | ) |
Features supported by this service.
Implements Dragengine.Services.Mods.ServiceMods.
bool Dragengine.Services.ServiceModio.getPauseModManagement | ( | ) |
Mod management is paused.
Implements Dragengine.Services.Mods.ServiceMods.
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.
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.
ServiceUserFeatures Dragengine.Services.ServiceModio.getUserFeatures | ( | ) |
Features supported by this service.
Implements Dragengine.Services.User.ServiceUser.
void Dragengine.Services.ServiceModio.getUserInfo | ( | ServiceUserListener | listener | ) |
Retrieve user information.
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.User.ServiceUser.
void Dragengine.Services.ServiceModio.getUserWalletBalance | ( | ServiceUserListener | listener | ) |
Retrieve user wallet balance.
Can be used if ServiceUserFeatures::hasMarketplace is true.
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.User.ServiceUser.
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.
bool Dragengine.Services.ServiceModio.isModManagementBusy | ( | ) |
Service is busy managing modifications.
Typical actions causing true to be returned are (non conclusive list):
While this method returns true certain functions will fail.
Implements Dragengine.Services.Mods.ServiceMods.
|
static |
bool Dragengine.Services.ServiceModio.isUserLoggedIn | ( | ) |
User is logged in.
Implements Dragengine.Services.User.ServiceUser.
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.
filter | Filter to use. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
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.
url | URL of image to load. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
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.
credentials | Credentials for manual logging in. Use null for automatic logging in. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.User.ServiceUser.
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.
params | Init parameters. |
listener | Listener called if initialization finished. Can be null. |
EInvalidParam | ModIO service module is not present. |
EInvalidParam | One or more of the provided parameters is not valid. |
void Dragengine.Services.ServiceModio.purchaseMod | ( | String | id, |
String | price, | ||
ServiceModsListener | listener | ||
) |
Purchase mod.
Once finished ServiceModsListener::onPurchaseMod() is called.
id | Identifier of modification to purchase. |
price | Price shown to the user. Used to verify the price matches. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
void Dragengine.Services.ServiceModio.removeModsListener | ( | ServiceModsListener | listener | ) |
Remove modification listener.
listener | Listener to remove. |
Implements Dragengine.Services.Mods.ServiceMods.
void Dragengine.Services.ServiceModio.removeUserListener | ( | ServiceUserListener | listener | ) |
Remove user listener.
listener | Listener to remove. |
Implements Dragengine.Services.User.ServiceUser.
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.
id | Identifier of modification to report. |
report | Report to submit. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
void Dragengine.Services.ServiceModio.requestResponse | ( | Service | service, |
UniqueID | id, | ||
ServiceObject | response, | ||
bool | finished | ||
) |
Response received for request.
service | Service receiving the response. |
id | Identifier of request this response belongs to. |
response | Response data. |
finished | True if the request finished or false if more responses will be received. |
Implements Dragengine.ServiceListener.
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.
id | Identifier of modification to revoke rating for. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
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.
id | Identifier of modification to revoke rating for. |
disabled | Disabled state. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
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.
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.
id | Identifier of modification to submit rating for. |
rating | Rating to submit. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
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.
token | Authentication token. |
id | Identifier of modification to subscribe to. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
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.
token | Authentication token. |
id | Identifier of modification to unsubscribe from. |
listener | If not null called once in addition to added listeners. |
Implements Dragengine.Services.Mods.ServiceMods.
BaseServiceConversions Dragengine.Services.ServiceModio.pConversions |
ServiceInitListener Dragengine.Services.ServiceModio.pInitListener |
InitParameters Dragengine.Services.ServiceModio.pInitParameters |
Boolean Dragengine.Services.ServiceModio.pIsInitialized |
bool Dragengine.Services.ServiceModio.pIsManagementBusy |
SafeArray Dragengine.Services.ServiceModio.pModsListeners |
Dictionary Dragengine.Services.ServiceModio.pOnceListeners |
bool Dragengine.Services.ServiceModio.pPauseManagement |
Portal Dragengine.Services.ServiceModio.pPortal |
Service Dragengine.Services.ServiceModio.pService |