Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Services.Mods.ServiceMods Interface Reference

Interface for services supporting managing game modifications. More...

Inheritance diagram for Dragengine.Services.Mods.ServiceMods:
Dragengine.Services.ServiceModio

Classes

enum  ManagementEvent

Public Member Functions

void activateMods ()
 Activate subscribed and installed modifications.
void addModsListener (ServiceModsListener listener)
 Add modification listener.
Dictionary getActiveMods ()
 Active mods.
ServiceModProgress getCurrentModUpdate ()
 Current mod install or update progress information.
void getModInfo (String id, ServiceModsListener listener)
 Retrieve information about game modification.
ServiceModsFeatures getModsFeatures ()
 Features supported by this service.
void getModTags (ServiceModsListener listener)
 Tags that can be used for ServiceModFilter.
bool getPauseModManagement ()
 Mod management is paused.
void getPurchasedMods (ServiceModsListener listener)
 Purchased mods.
Dictionary getSubscribedMods ()
 User subscribed mods.
Dictionary getSystemMods ()
 System mods.
bool isModManagementBusy ()
 Service is busy managing modifications.
void listAllMods (ServiceModFilter filter, ServiceModsListener listener)
 Filtered list of available game modifications.
void loadModResource (String url, ServiceModsListener listener)
 Load resource asynchronously.
bool modHasMatchingFiles (String id, String directory, bool recursive, Set patterns)
 Modification has files matching one or more patterns.
void purchaseMod (String id, String price, ServiceModsListener listener)
 Purchase mod.
void removeModsListener (ServiceModsListener listener)
 Remove modification listener.
void reportMod (String id, ServiceModReport report, ServiceModsListener listener)
 Report modification.
void revokeModRating (String id, ServiceModsListener listener)
 Revoke rating for modification.
void setModDisabled (String id, bool disabled, ServiceModsListener listener)
 Disable modification.
void setPauseModManagement (bool pause)
 Pause mod management.
void submitModRating (String id, int rating, ServiceModsListener listener)
 Submit rating for modification.
void subscribeMod (String id, ServiceModsListener listener)
 Subscribe to modification.
void unsubscribeMod (String id, ServiceModsListener listener)
 Unsubscribe from modification.

Detailed Description

Interface for services supporting managing game modifications.

Version
1.23

This interface is designed for services using a remote host to store modifications and user profiles with the installed and active mods. For this reason the majority of calls are asynchronous. This does not prevent local host only services to use this interface.

Member Function Documentation

◆ activateMods()

void Dragengine.Services.Mods.ServiceMods.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().

Implemented in Dragengine.Services.ServiceModio.

References subscribeMod().

Referenced by isModManagementBusy().

◆ addModsListener()

void Dragengine.Services.Mods.ServiceMods.addModsListener ( ServiceModsListener listener)

Add modification listener.

Parameters
listenerListener to add

Implemented in Dragengine.Services.ServiceModio.

References removeModsListener().

Referenced by getModsFeatures().

◆ getActiveMods()

Dictionary Dragengine.Services.Mods.ServiceMods.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.

Implemented in Dragengine.Services.ServiceModio.

References submitModRating().

Referenced by getSubscribedMods().

◆ getCurrentModUpdate()

ServiceModProgress Dragengine.Services.Mods.ServiceMods.getCurrentModUpdate ( )

Current mod install or update progress information.

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

Implemented in Dragengine.Services.ServiceModio.

References getSystemMods().

Referenced by subscribeMod().

◆ getModInfo()

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

Implemented in Dragengine.Services.ServiceModio.

References revokeModRating().

Referenced by getSystemMods().

◆ getModsFeatures()

ServiceModsFeatures Dragengine.Services.Mods.ServiceMods.getModsFeatures ( )

Features supported by this service.

Implemented in Dragengine.Services.ServiceModio.

References addModsListener(), and getModsFeatures().

Referenced by getModsFeatures().

◆ getModTags()

void Dragengine.Services.Mods.ServiceMods.getModTags ( ServiceModsListener listener)

Tags that can be used for ServiceModFilter.

Once finished ServiceModsListener.onGetTags() is called with the list of ServiceModTagCategory. Each category contains a list of tags usable for this category.

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

References purchaseMod().

Referenced by Dragengine.Services.ServiceModio.requestResponse(), and setModDisabled().

◆ getPauseModManagement()

bool Dragengine.Services.Mods.ServiceMods.getPauseModManagement ( )

Mod management is paused.

Implemented in Dragengine.Services.ServiceModio.

References setPauseModManagement().

Referenced by loadModResource().

◆ getPurchasedMods()

void Dragengine.Services.Mods.ServiceMods.getPurchasedMods ( ServiceModsListener listener)

Purchased mods.

Once finished ServiceModsListener.onGetPurchasedMods() is called with array of ServiceModInfo value.

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

Referenced by modHasMatchingFiles(), and Dragengine.Services.ServiceModio.requestResponse().

◆ getSubscribedMods()

Dictionary Dragengine.Services.Mods.ServiceMods.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.

Implemented in Dragengine.Services.ServiceModio.

References getActiveMods().

Referenced by unsubscribeMod().

◆ getSystemMods()

Dictionary Dragengine.Services.Mods.ServiceMods.getSystemMods ( )

System mods.

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

Implemented in Dragengine.Services.ServiceModio.

References getModInfo().

Referenced by getCurrentModUpdate().

◆ isModManagementBusy()

bool Dragengine.Services.Mods.ServiceMods.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.

Implemented in Dragengine.Services.ServiceModio.

References activateMods().

Referenced by setPauseModManagement().

◆ listAllMods()

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

Implemented in Dragengine.Services.ServiceModio.

References loadModResource().

Referenced by removeModsListener().

◆ loadModResource()

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

Implemented in Dragengine.Services.ServiceModio.

References getPauseModManagement().

Referenced by listAllMods().

◆ modHasMatchingFiles()

bool Dragengine.Services.Mods.ServiceMods.modHasMatchingFiles ( String id,
String directory,
bool recursive,
Set patterns )

Modification has files matching one or more patterns.

Typically used to determine if an installed modification contains specific files. For example if a modification contains script code Engine.restart(String) has to be called to restart the game to re-parse the script. Another example is reloading cached game data if files are touched that have been cached before.

Parameters
idIdentifier of installed and enabled modification to scan for files.
directoryRoot directory to start searching in.
recursiveRecursively scan directories for matching files.
patternsSet of String file patterns without directories.
Exceptions
EInvalidActionModification does not exist or is not installed.

References getPurchasedMods().

Referenced by reportMod(), and Dragengine.Services.ServiceModio.requestResponse().

◆ purchaseMod()

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

Implemented in Dragengine.Services.ServiceModio.

Referenced by getModTags().

◆ removeModsListener()

void Dragengine.Services.Mods.ServiceMods.removeModsListener ( ServiceModsListener listener)

Remove modification listener.

Parameters
listenerListener to remove.

Implemented in Dragengine.Services.ServiceModio.

References listAllMods().

Referenced by addModsListener().

◆ reportMod()

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

Implemented in Dragengine.Services.ServiceModio.

References modHasMatchingFiles().

Referenced by submitModRating().

◆ revokeModRating()

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

Implemented in Dragengine.Services.ServiceModio.

References setModDisabled().

Referenced by getModInfo().

◆ setModDisabled()

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

Implemented in Dragengine.Services.ServiceModio.

References getModTags().

Referenced by revokeModRating().

◆ setPauseModManagement()

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

Implemented in Dragengine.Services.ServiceModio.

References isModManagementBusy().

Referenced by getPauseModManagement().

◆ submitModRating()

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

Implemented in Dragengine.Services.ServiceModio.

References reportMod().

Referenced by getActiveMods().

◆ subscribeMod()

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

Implemented in Dragengine.Services.ServiceModio.

References getCurrentModUpdate(), and unsubscribeMod().

Referenced by activateMods().

◆ unsubscribeMod()

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

Implemented in Dragengine.Services.ServiceModio.

References getSubscribedMods().

Referenced by subscribeMod().


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