The latest version of the mod.io Unreal Plugin can be found at https://github.com/modio/modio-sdk.
Welcome to the legacy mod.io SDK repository, built using C and C++. This SDK allows game developers to host and automatically install user-created mods in their games. It connects to the mod.io API, and documentation for its functions can be viewed here.
Feature | Supported |
---|---|
Windows / Linux / MacOS | âś” |
Standalone | âś” |
Open Source | âś” |
Free | âś” |
Async Callbacks | âś” |
Events | âś” |
Prebuilt download and upload queue | âś” |
Automatic downloads and updates | âś” |
Email / Steam / GOG authentication | âś” |
Browse / search / tag mods | âś” |
Mod dependencies / comments / stats | âś” |
Multilanguage C interface | âś” |
MIT license | âś” |
modio::FilterCreator filter_creator;
filter_creator.setLimit(5); // limit the number of results
filter_creator.setOffset(0); // paginate through the results by using a limit and offset together
filter_creator.setSort("date_updated", false); // the filtering system allows flexible queries
modio_instance.getAllMods(filter_creator, [&](const modio::Response& response, const std::vector<modio::Mod> & mods)
{
if(response.code == 200)
{
// Mod data retrieved!
}
});
Authentication enables automatic installs and updates under the hood.
First step is to request a security code to your email.
modio_instance.emailRequest("example@mail.com", [&](const modio::Response& response)
{
if (response.code == 200)
{
// Authentication code successfully sent to the e-mail
}
});
Finish authentication by submitting the 5-digit code.
modio_instance.emailExchange("50AD4", [&](const modio::Response& response)
{
if (response.code == 200)
{
// Email exchanged successfully, you are now authenticated
}
});
If your game is running inside a popular distribution platform such as Steam or GOG Galaxy you can authenticate 100% seamlessly.
modio_instance.galaxyAuth(appdata, terms_agreed, [&](const modio::Response &response)
{
if (response.code == 200)
{
// Successful Galaxy authentication
}
});
modio_instance.oculusAuth(nonce, oculus_user_id, access_token, email, date_expires, terms_agreed, [&](const modio::Response &response)
{
if (response.code == 200)
{
// Successful Oculus authentication
}
});
modio_instance.steamAuth(rgubTicket, cubTicket, terms_agreed, [&](const modio::Response &response)
{
if (response.code == 200)
{
// Successful Steam authentication
}
});
Download mods automatically by subscribing, uninstall them by unsubscribing.
modio_instance.subscribeToMod(mod_id, [&](const modio::Response& response, const modio::Mod& mod)
{
if(response.code == 201)
{
// Subscribed to mod successfully, the mod will be added automatically to the download queue
}
});
modio_instance.unsubscribeFromMod(mod_id, [&](const modio::Response& response)
{
if(response.code == 204)
{
// Unsubscribed from mod successfully, it will be uninstalled from local storage
}
});
modio_instance.addModRating(mod_id, 1 /*or -1 for negative rating*/, [&](const modio::Response& response)
{
if(response.code == 201)
{
// Mod rating submitted successfully
}
});
Share mods by creating a mod profile and attaching modfiles to it.
modio::ModCreator mod_creator;
mod_creator.setName("Graphics Overhaul Mod");
mod_creator.setLogoPath("path/to/image.jpg");
mod_creator.setHomepage("http://www.garphicsoverhaulmod.com");
mod_creator.setSummary("Short descriptive summary here.");
mod_creator.addTag("Graphics");
mod_creator.addTag("HD");
modio_instance.addMod(mod_creator, [&](const modio::Response& response, const modio::Mod& mod)
{
if(response.code == 201)
{
// Mod profile successfully added
}
});
modio::ModfileCreator modfile_creator;
modfile_creator.setModfilePath("path/to/mod_folder/");
modfile_creator.setModfileVersion("v1.1.0");
modfile_creator.setModfileChangelog("<p>Rogue Knights v1.2.0 Changelog</p></p>New Featu...");
modio_instance.addModfile(requested_mod.id, modfile_creator);
modio_instance.setDownloadListener([&](u32 response_code, u32 mod_id) {
if (response_code == 200)
{
// Mod successfully downloaded. Call the modio_instance.installDownloadedMods(); to install, keep in mind this is not an async function.
}
});
modio_instance.setUploadListener([&](u32 response_code, u32 mod_id) {
if (response_code == 201)
{
//Mod successfully uploaded
}
});
Visit the wiki to learn how to integrate dependencies, comments, stats, reports and more.
If you are a game developer, first step is to add mod support to your game. Once mod support is up and running, create your games profile on mod.io, to get an API key and access to all functionality mod.io offers. Next, download the latest SDK release and unpack it into your project, then head over to the GitHub Wiki and follow the guides corresponding to your setup.
#include "modio.h"
// ...
modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, MY_GAME_ID, "MY API KEY");
// ...
void myGameTick()
{
modio_instance.process();
}
Our SDK is public and open source. Game developers are welcome to utilize it directly, to add support for mods in their games, or fork it to create plugins and wrappers for other engines and codebases. Many of these contributions are shared here. Want to make changes to our SDK? Submit a pull request with your recommended changes to be reviewed.
mod.io SDK wrappers are available for the following languages and engines:
- Haxe wrapper for game engines such as OpenFL, Kha or awe5.
- Unreal Engine integration tutorial and plugin.
Are you creating a wrapper? Let us know!
Learn how to build mod.io SDK in our building instruction guide.
- Fork it
- Add new features
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
- Create a pull request
If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
Our aim with mod.io, is to provide an open modding API. You are welcome to view, fork and contribute to our other codebases in use.