This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Mods
Ahmed Castro edited this page Jan 16, 2019
·
50 revisions
void Instance::getAllMods(modio::FilterCreator& filter_creator, const std::function<void(const modio::Response& response, const std::vector<modio::Mod> & mods)>& callback);
API endpoint used: Get All Mods
Browse mods on mod.io, can be filtered using the modio::FilterCreator.
Name | Type | Description |
---|---|---|
filter_creator | modio::FilterCreator& |
modio::FilterCreator object to be customized. |
callback | const std::function<void(const modio::Response& response, const std::vector<modio::Mod> & mods)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
mods | const std::vector<modio::Mod>& |
Vector containing the returned mods. |
modio::FilterCreator filter_creator;
filter_creator.setLimit(3);
filter_creator.addLikeField("name", "Example Mod");
filter_creator.addLikeField("description", "This mod description was added via the SDK examples. This mod description was added via the SDK examples.");
modio_instance.getAllMods(filter_creator, [&](const modio::Response& response, const std::vector<modio::Mod> & mods)
{
if(response.code == 200)
{
//Mod data successfully retrieved
}
});
void Instance::getMod(u32 mod_id, const std::function<void(const modio::Response& response, const modio::Mod& mod)>& callback);
API endpoint used: Get Mod
Get a mod by providing its id.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
callback | const std::function<void(const modio::Response& response, const modio::Mod& mod)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
mod | const modio::Mod& |
Returned mod. |
modio_instance.getMod(mod_id, [&](const modio::Response& response, const modio::Mod& mod)
{
if(response.code == 200)
{
//Mod successfully retrieved
}
});
void Instance::addMod(modio::ModCreator& mod_creator, const std::function<void(const modio::Response& response, const modio::Mod& mod)>& callback)
API endpoint used: Add Mod
Adds a new Mod to mod.io. Use the modio::ModCreator to set the mods fields before uploading.
Name | Type | Description |
---|---|---|
mod_creator | modio::ModCreator& |
modio::ModCreator object containing the data that will be added. |
callback | const std::function<void(const modio::Response& response, const modio::Mod& mod)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
mod | const modio::Mod& |
Resulting modio::Mod object. |
modio::ModCreator mod_creator;
mod_creator.setLogoPath("ModExample/logo.png");
mod_creator.setName("Example Mod Test30");
mod_creator.setHomepage("http://www.webpage.com");
mod_creator.setSummary("Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples.");
mod_creator.addTag("Easy");
mod_creator.addTag("Medium");
modio_instance.addMod(mod_creator, [&](const modio::Response& response, const modio::Mod& mod)
{
if(response.code == 201)
{
//Mod successfully added
}
});
void Instance::editMod(u32 mod_id, modio::ModEditor& mod_editor, const std::function<void(const modio::Response& response, const modio::Mod& mod)>& callback)
API endpoint used: Edit Mod
Updates the details of a corresponding mod. TODO explain the media functions
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
mod_editor | modio::ModEditor& |
modio::ModEditor object containing the data that will be edited. |
callback | const std::function<void(const modio::Response& response, const modio::Mod& mod)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
mod | const modio::Mod& |
Resulting modio::Mod object. |
modio::ModEditor mod_editor;
mod_editor.setLogoPath("ModExample/logo.png");
mod_editor.setName("Update Example");
mod_editor.setHomepage("http://www.updated.com");
mod_editor.setSummary("Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples. Mod updated via the SDK examples.");
mod_editor.addTag("Easy");
modio_instance.editMod(requested_mod.id, mod_editor, [&](const modio::Response& response, const modio::Mod& mod)
{
if(response.code == 200)
{
//Mod edited successfully
}
});
void Instance::deleteMod(u32 mod_id, const std::function<void(const modio::Response& response)>& callback)
API endpoint used: Delete Mod
Deletes a mod profile.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
callback | const std::function<void(const modio::Response& response)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modio_instance.deleteMod(requested_mod.id, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Mod deleted successfully
}
});
- Home
- Table of Contents
- Getting Started
- SDK Methods
- Creators
- Editors
- Schemas
- modio::Avatar
- modio::Comment
- modio::Dependency
- modio::Download
- modio::Error
- modio::Filehash
- modio::Game
- modio::GameTagOption
- modio::Header
- modio::Icon
- modio::Image
- modio::InstalledMod
- modio::Logo
- modio::Media
- modio::MetadataKVP
- modio::Mod
- modio::ModEvent
- modio::Modfile
- modio::QueuedModDownload
- modio::QueuedModfileUpload
- modio::Rating
- modio::Response
- modio::Stats
- modio::Tag
- modio::User
- Debugging
- Constants
-
C Compatibility
- Methods
- Initialization, Process and Shutdown (C compatible)
- User Authentication (C compatible)
- Mods (C compatible)
- Modfiles (C compatible)
- Media (C compatible)
- Subscriptions (C compatible)
- Events (C compatible)
- Stats (C compatible)
- Tags (C compatible)
- Ratings (C compatible)
- Metadata KVP (C compatible)
- Dependencies (C compatible)
- Comments (C compatible)
- Reports (C compatible)
- Me (C compatible)
- Downloads (C compatible)
- Uploads (C compatible)
- Logs (C compatible)
- External Auth (C compatible)
- Configuration (C compatible)
- Creators
- Editors
- Schemas
- ModioAvatar
- ModioComment
- ModioDependency
- ModioDownload
- ModioError
- ModioFilehash
- ModioGame
- ModioGameTagOption
- ModioHeader
- ModioIcon
- ModioImage
- ModioInstalledMod
- ModioListNode
- ModioLogo
- ModioMedia
- ModioMetadataKVP
- ModioMod
- ModioModEvent
- ModioModfile
- ModioQueuedModDownload
- ModioQueuedModfileUpload
- ModioRating
- ModioResponse
- ModioStats
- ModioTag
- ModioUser
- Methods
- Building