Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
turupawn edited this page Feb 6, 2019 · 50 revisions

Welcome to the mod.io SDK wiki. This wiki explains how to setup, use and build mod.io SDK in your game or modding tool.

The SDK simplifies the mod.io integration, working as an intermediary. However, this can also be achieved by using the API directly or by using engine specific plugins, for more information visit our Getting Started guide.

The mod.io SDK provides all the functionality needed to access the mod.io backend. See the SDK Getting Started guide to start integrating the SDK on your project. Before diving into the SDK you should see if there is an existing plugin for your specific engine.

Testing Environment

mod.io offers two different environments: testing and live. Testing is located in test.mod.io website it will only be visible for the developers, its meant to be a safe sandbox to prepare before going to the Live environment. The environment is set as a parameter in the Initialization method.

User Authentication

Users need to be authenticated to accomplish certain task such as creating, editing or subscribing to mods. mod.io offers a secure and easy authentication flow through email. You can find more information in User Authentication.

Creating Mods and Uploading Modfiles

Creating a Mod

This are the steps to create a mod profile which can be found in the mod.io API and web. This function creates the mod profile as hidden, to go live you will need to Upload a Modfile.

  1. Initialize a modio::ModCreator, which will have the Mod's data.
  2. Fill the Mod's data using the modio::ModCreator functions.
  3. Call the function addMod by sending modio::ModCreator as a parameter.
  4. The callback Response Code should be 201 CREATED.

Uploading a Modfile

In order for your mod to go live you will need to upload a modfile. Modfiles can't be edited, if you want to make a change upload a new one as a newer version.

  1. Initialize a modio::ModfileCreator, which will have the Modfile's data.
  2. Fill the Modfile's data using the modio::ModfileCreator functions.
  3. Call the function addModfile by sending modio::ModfileCreator as a parameter.
  4. The callback Response Code should be 201 CREATED.

Editing Mods

In case changes are wanted it follows a similar process as creating a mod.

  1. Initialize a modio::ModEditor, which will have the Mod's data.
  2. Fill the Mod's data to be edited using the modio::ModEditor functions.
  3. Call the function editMod by sending modio::ModEditor and the mod's id as a parameters.
  4. The callback Response Code should be 200 OK.

Browsing

You can browse Mod's data and filter the result so you retrieve only the mods you want.

  1. Initialize a modio::FilterCreator to define which would be the query criteria.
  2. Fill the filters data using the modio::FilterCreator function on the request you want to make.
  3. Call getMods by sending the modio::FilterCreator as parameter.
  4. The callback Response Code should be 200 OK and a collection of Mods should be returned.

Additionally you can obtain the authenticated user's Mods using the getUserMods and getUserSubscriptions methods or a specific mod by using the getMod method.

Installing Mods

The mod.io SDK features with a download queue and an installed mod list which gives you a variety of functions to handle local mods. See the Downloads documentation for details.

Automatic Updates

When a mod is updated through any method (web, API, SDK or plugin) it also updates itself locally. This will happen as long as the automatic option is enabled, additionally if a user subscribes to a mod it will be installed automatically.

Deleting

Mods can not be permanently deleted but they can be archived so its only seen by the modder. You can delete a Mod by calling deleteMod by sending the mod ID as parameter.

Examples

Each method in the documentation displays an example but If you want a complete working example you could go to the official examples list.

Errors and Logging

Every callback returns an HTTP Response Code so you can check if there were any errors in your request, you could also review the log placed in .modio/log for details.

Going Further

If you want an integration with more features, you could see the complete method list in the Table of Contents.

Contents

Clone this wiki locally