Unity v2 Plugin 0.1
mod management for Unity projects
|
Main interface for the mod.io Unity plugin. More...
Static Public Member Functions | |
static bool | IsInitialized () |
You can use this to quickly identify whether or not the plugin has been initialized. More... | |
static void | SetLoggingDelegate (LogMessageDelegate loggingDelegate) |
Assigns the logging delegate the plugin uses to output log messages that otherwise go to UnityEngine.Debug.Log(string) More... | |
static void | InitializeForUser (string userProfileIdentifier, ServerSettings serverSettings, BuildSettings buildSettings, Action< Result > callback) |
Initializes the Plugin using the provided settings for a specified user. Loads the local state of mods installed on the system as well as relevant mods to the user. Loads the state of mods installed on the system as well as the set of mods the specified user has installed on this device. More... | |
static void | InitializeForUser (string userProfileIdentifier, Action< Result > callback) |
Initializes the Plugin using the provided settings for a specified user. Loads the local state of mods installed on the system as well as relevant mods to the user. Loads the state of mods installed on the system as well as the set of mods the specified user has installed on this device. More... | |
static void | Shutdown (Action shutdownComplete) |
Cancels any running public operations, frees plugin resources, and invokes any pending callbacks with a cancelled result code. More... | |
static void | RequestAuthenticationEmail (string emailaddress, Action< Result > callback) |
Sends an email with a security code to the specified Email Address. The security code is then used to Authenticate the user session using ModIOUnity.SubmitEmailSecurityCode() More... | |
static void | SubmitEmailSecurityCode (string securityCode, Action< Result > callback) |
Attempts to Authenticate the current session by submitting a security code received by email from ModIOUnity.RequestAuthenticationEmail() More... | |
static void | GetTermsOfUse (Action< ResultAnd< TermsOfUse > > callback) |
This retrieves the terms of use text to be shown to the user to accept/deny before authenticating their account via a third party provider, eg steam or google. More... | |
static void | AuthenticateUserViaSteam (string steamToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the steam API. More... | |
static void | AuthenticateUserViaGOG (string gogToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the GOG API. More... | |
static void | AuthenticateUserViaItch (string itchioToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the Itch.io API. More... | |
static void | AuthenticateUserViaXbox (string xboxToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the Xbox API. More... | |
static void | AuthenticateUserViaSwitch (string switchToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the switch API. More... | |
static void | AuthenticateUserViaDiscord (string discordToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the Discord API. More... | |
static void | AuthenticateUserViaGoogle (string googleToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the Google API. More... | |
static void | AuthenticateUserViaOculus (OculusDevice oculusDevice, string nonce, long userId, string oculusToken, [CanBeNull] string emailAddress, [CanBeNull] TermsHash? hash, Action< Result > callback) |
Attempts to authenticate a user via the Oculus API. More... | |
static void | IsAuthenticated (Action< Result > callback) |
Informs you if the current user session is authenticated or not. More... | |
static Result | RemoveUserData () |
De-authenticates the current Mod.io user for the current session and clears all user-specific data stored on the current device. Installed mods that do not have other local users subscribed will be uninstalled if ModIOUnity.EnableModManagement() has been used to enable the mod management system. (If ModManagement is enabled). More... | |
static void | GetTagCategories (Action< ResultAnd< TagCategory[]> > callback) |
Gets the existing tags for the current game Id that can be used when searching/filtering mods. More... | |
static void | GetMods (SearchFilter filter, Action< Result, ModPage > callback) |
Uses a SearchFilter to retrieve a specific Mod Page and returns the ModProfiles and total number of mods based on the Search Filter. More... | |
static void | GetMod (ModId modId, Action< ResultAnd< ModProfile > > callback) |
Requests a single ModProfile from the mod.io server by its ModId. More... | |
static void | RateMod (ModId modId, ModRating rating, Action< Result > callback) |
Used to submit a rating for a specified mod. More... | |
static void | SubscribeToMod (ModId modId, Action< Result > callback) |
Adds the specified mod to the current user's subscriptions. More... | |
static void | UnsubscribeFromMod (ModId modId, Action< Result > callback) |
Removes the specified mod from the current user's subscriptions. More... | |
static SubscribedMod[] | GetSubscribedMods (out Result result) |
Retrieves all of the subscribed mods for the current user. More... | |
static void | GetCurrentUser (Action< ResultAnd< UserProfile > > callback) |
Gets the current user's UserProfile struct. Containing their mod.io username, user id, language, timezone and download references for their avatar. More... | |
static void | FetchUpdates (Action< Result > callback) |
This retrieves the user's subscriptions from the mod.io server and synchronises it with our local instance of the user's subscription data. If mod management has been enabled via ModIOUnity.EnableModManagement() then it may begin to install/uninstall mods. More... | |
static Result | EnableModManagement ([CanBeNull] ModManagementEventDelegate modManagementEventDelegate) |
Enables the mod management system. When enabled it will automatically download, install, update and delete mods according to the authenticated user's subscriptions. More... | |
static Result | DisableModManagement () |
Disables the mod management system and cancels any ongoing jobs for downloading or installing mods. More... | |
static ProgressHandle | GetCurrentModManagementOperation () |
Returns a ProgressHandle with information on the current mod management operation. More... | |
static InstalledMod[] | GetSystemInstalledMods (out Result result) |
Gets an array of mods that are installed on the current device. More... | |
static Result | ForceUninstallMod (ModId modId) |
This informs the mod management system that this mod should be uninstalled if not subscribed by the current user. (such as a mod installed by a different user not currently active). More... | |
static bool | IsModManagementBusy () |
Checks if the automatic management process is currently awake and performing a mod management operation, such as installing, downloading, uninstalling, updating. More... | |
static CreationToken | GenerateCreationToken () |
Gets a token that can be used to create a new mod profile on the mod.io server. More... | |
static void | CreateModProfile (CreationToken token, ModProfileDetails modProfileDetails, Action< ResultAnd< ModId > > callback) |
Creates a new mod profile on the mod.io server based on the details provided from the ModProfileDetails object provided. More... | |
static void | EditModProfile (ModProfileDetails modProfile, Action< Result > callback) |
This is used to edit or change data in an existing mod profile on the mod.io server. More... | |
static ProgressHandle | GetCurrentUploadHandle () |
This will return null if no upload operation is currently being performed. More... | |
static void | UploadModfile (ModfileDetails modfile, Action< Result > callback) |
Used to upload a mod file to a mod profile on the mod.io server. A mod file is the actual archive of a mod. This method can be used to update a mod to a newer version (you can include changelog information in ModfileDetails). More... | |
static void | UploadModMedia (ModProfileDetails modfileDetails, Action< Result > callback) |
static void | ArchiveModProfile (ModId modId, Action< Result > callback) |
Removes a mod from being visible on the mod.io server. More... | |
static void | GetCurrentUserCreations (Action< ResultAnd< ModProfile[]> > callback) |
Not implemented yet | |
static void | DownloadTexture (DownloadReference downloadReference, Action< ResultAnd< Texture2D > > callback) |
Downloads a texture based on the specified download reference. More... | |
static void | Report (Report report, Action< Result > callback) |
Reports a specified mod to mod.io. More... | |
Main interface for the mod.io Unity plugin.
Removes a mod from being visible on the mod.io server.
If you want to delete a mod permanently you can do so from a web browser.
modId | the id of the mod to delete |
callback | callback with the result of the operation |
|
static |
Attempts to authenticate a user via the Discord API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the GOG API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the Google API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the Itch.io API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the Oculus API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the steam API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the switch API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Attempts to authenticate a user via the Xbox API.
You will first need to get the terms of use and hash from the ModIOUnity.GetTermsOfUse() method.
steamToken | the user's steam token |
emailAddress | the user's email address |
hash | the TermsHash retrieved from ModIOUnity.GetTermsOfUse() |
callback | Callback to be invoked when the operation completes |
|
static |
Creates a new mod profile on the mod.io server based on the details provided from the ModProfileDetails object provided.
Note that this will create a new profile on the server and can be viewed online through a browser.
token | the token allowing a new unique profile to be created from ModIOUnity.GenerateCreationToken() |
modProfileDetails | the mod profile details to apply to the mod profile being created |
callback | a callback with the Result of the operation and the ModId of the newly created mod profile (if successful) |
|
static |
Disables the mod management system and cancels any ongoing jobs for downloading or installing mods.
void Example() { Result result = ModIOUnity.DisableModManagement();
if (result.Succeeded()) { Debug.Log("disabled mod management"); } else { Debug.Log("failed to disable mod management"); } }
|
static |
Downloads a texture based on the specified download reference.
You can get download references from UserProfiles and ModProfiles
downloadReference | download reference for the texture (eg UserObject.avatar_100x100) |
callback | callback with the Result and Texture2D from the download |
|
static |
This is used to edit or change data in an existing mod profile on the mod.io server.
You need to assign the ModId of the mod you want to edit inside of the ModProfileDetails object included in the parameters
modProfile | the mod profile details to apply to the mod profile being created |
callback | a callback with the Result of the operation and the ModId of the newly created mod profile (if successful) |
|
static |
Enables the mod management system. When enabled it will automatically download, install, update and delete mods according to the authenticated user's subscriptions.
This requires the current session to have an authenticated user, otherwise Result.IsAuthenticationError() from the Result will equal true.
modManagementEventDelegate | A delegate that gets called everytime the ModManagement system runs an event (can be null) |
|
static |
This retrieves the user's subscriptions from the mod.io server and synchronises it with our local instance of the user's subscription data. If mod management has been enabled via ModIOUnity.EnableModManagement() then it may begin to install/uninstall mods.
This requires the current session to have an authenticated user, otherwise Result.IsAuthenticationError() from the Result will equal true.
callback | callback with the Result of the operation |
This informs the mod management system that this mod should be uninstalled if not subscribed by the current user. (such as a mod installed by a different user not currently active).
Normally if you wish to uninstall a mod you should unsubscribe and use ModIOUnity.EnableModManagement() and the process will be handled automatically. However, if you want to uninstall a mod that is subscribed to a different user session this method will mark the mod to be uninstalled to free up disk space. Alternatively you can use ModIOUnity.RemoveUserData() to remove a user from the local registry. If no other users are subscribed to the same mod it will be uninstalled automatically.
modId | The ModId of the mod to uninstall |
|
static |
Gets a token that can be used to create a new mod profile on the mod.io server.
|
static |
Returns a ProgressHandle with information on the current mod management operation.
|
static |
This will return null if no upload operation is currently being performed.
Uploads are not handled by the mod management system, these are handled separately.
|
static |
Gets the current user's UserProfile struct. Containing their mod.io username, user id, language, timezone and download references for their avatar.
This requires the current session to have an authenticated user, otherwise Result.IsAuthenticationError() from the Result will equal true.
callback | callback with the Result and the UserProfile |
|
static |
Requests a single ModProfile from the mod.io server by its ModId.
If there is a specific mod that you want to retrieve from the mod.io database you can use this method to get it.
modId | the ModId of the ModProfile to get |
callback | callback with the Result and ModProfile |
|
static |
Uses a SearchFilter to retrieve a specific Mod Page and returns the ModProfiles and total number of mods based on the Search Filter.
A ModPage contains a group of mods based on the pagination filters in SearchFilter. eg, if you use SearchFilter.SetPageIndex(0) and SearchFilter.SetPageSize(100) then ModPage.mods will contain mods from 1 to 100. But if you set SearchFilter.SetPageIndex(1) then it will have mods from 101 to 200, if that many exist. (note that 100 is the maximum page size).
filter | The filter to apply when searching through mods (also contains pagination parameters) |
callback | callback invoked with the Result and ModPage |
|
static |
Retrieves all of the subscribed mods for the current user.
Note that these are not installed mods only mods the user has opted as 'subscribed'. Also, ensure you have called ModIOUnity.FetchUpdates() at least once during this session in order to have an accurate collection of the user's subscriptions.
result | an out parameter for whether or not the method succeeded |
|
static |
Gets an array of mods that are installed on the current device.
Note that these may not all be subscribed by the current user. If you wish to get all of the current user's installed mods use ModIOUnity.GetSubscribedMods() and check the SubscribedMod.status equals SubscribedModStatus.Installed.
result | an out Result to inform whether or not it was able to get installed mods |
|
static |
Gets the existing tags for the current game Id that can be used when searching/filtering mods.
Tags come in category groups, eg "Color" could be the name of the category and the tags themselves could be { "Red", "Blue", "Green" }
callback | the callback with the result and tags retrieved |
|
static |
This retrieves the terms of use text to be shown to the user to accept/deny before authenticating their account via a third party provider, eg steam or google.
If the callback succeeds it will also provide a TermsOfUse struct that contains a TermsHash struct which you will need to provide when calling a third party authentication method such as ModIOUnity.AuthenticateUserViaSteam()
serviceProvider | The provider you intend to use for authentication, eg steam, google etc. (You dont need to display terms of use to the user if they are authenticating via email security code) |
callback | Callback to invoke once the operation is complete containing a result and a hash code to use for authentication via third party providers. |
|
static |
Initializes the Plugin using the provided settings for a specified user. Loads the local state of mods installed on the system as well as relevant mods to the user. Loads the state of mods installed on the system as well as the set of mods the specified user has installed on this device.
userProfileIdentifier | Name of the directory to store the user's data in. |
callback | Callback to invoke once the initialization is complete. |
|
static |
Initializes the Plugin using the provided settings for a specified user. Loads the local state of mods installed on the system as well as relevant mods to the user. Loads the state of mods installed on the system as well as the set of mods the specified user has installed on this device.
userProfileIdentifier | Name of the directory to store the user's data in. |
serverSettings | Data used by the plugin to connect with the mod.io service. |
buildSettings | Data used by the plugin to interact with the platform. |
callback | Callback to invoke once the initialization is complete. |
|
static |
Informs you if the current user session is authenticated or not.
callback |
|
static |
You can use this to quickly identify whether or not the plugin has been initialized.
|
static |
Checks if the automatic management process is currently awake and performing a mod management operation, such as installing, downloading, uninstalling, updating.
|
static |
Used to submit a rating for a specified mod.
This can be used to change/overwrite previous ratings of the current user.
modId | the m=ModId of the mod being rated |
rating | the rating to give the mod. Allowed values include ModRating.Positive, ModRating.Negative, ModRating.None |
callback | callback with the result of the request |
|
static |
De-authenticates the current Mod.io user for the current session and clears all user-specific data stored on the current device. Installed mods that do not have other local users subscribed will be uninstalled if ModIOUnity.EnableModManagement() has been used to enable the mod management system. (If ModManagement is enabled).
If you dont want to erase a user be sure to use ModIOUnity.Shutdown() instead. If you re-initialize the plugin after a shutdown the user will still be authenticated.
Reports a specified mod to mod.io.
report | the object containing all of the details of the report you are sending |
callback | callback with the Result of the report |
|
static |
Sends an email with a security code to the specified Email Address. The security code is then used to Authenticate the user session using ModIOUnity.SubmitEmailSecurityCode()
The callback will return a Result object. If the email is successfully sent Result.Succeeded() will equal true. If you haven't Initialized the plugin then Result.IsInitializationError() will equal true. If the string provided for the emailaddress is not .NET compliant Result.IsAuthenticationError() will equal true.
emailaddress | the Email Address to send the security code to, eg "JohnDoe@gmail.com" |
callback | Callback to invoke once the operation is complete |
|
static |
Assigns the logging delegate the plugin uses to output log messages that otherwise go to UnityEngine.Debug.Log(string)
If you don't wish to see [mod.io] logs appearing in the Unity console you can set your own delegate for handling logs and ignore them or display them elsewhere.
loggingDelegate | The delegate for receiving log messages |
|
static |
Cancels any running public operations, frees plugin resources, and invokes any pending callbacks with a cancelled result code.
Callback results invoked during a shutdown operation can be checked with Result.IsCancelled()
|
static |
Attempts to Authenticate the current session by submitting a security code received by email from ModIOUnity.RequestAuthenticationEmail()
It is intended that this function is used after ModIOUnity.RequestAuthenticationEmail() is performed successfully.
securityCode | The security code received from an authentication email |
callback | Callback to invoke once the operation is complete |
Adds the specified mod to the current user's subscriptions.
If mod management has been enabled via ModIOUnity.EnableModManagement() then the mod will be downloaded and installed.
modId | ModId of the mod you want to subscribe to |
callback | callback with the result of the request |
Removes the specified mod from the current user's subscriptions.
If mod management has been enabled via ModIOUnity.EnableModManagement() then the mod will be uninstalled at the next opportunity.
modId | ModId of the mod you want to unsubscribe from |
callback | callback with the result of the request |
|
static |
Used to upload a mod file to a mod profile on the mod.io server. A mod file is the actual archive of a mod. This method can be used to update a mod to a newer version (you can include changelog information in ModfileDetails).
modfile | the mod file and details to upload |
callback | callback with the Result of the upload when the operation finishes |