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
Modfiles
Ahmed Castro edited this page Sep 28, 2018
·
31 revisions
void getAllModfiles(u32 mod_id, modio::FilterCreator& filter, const std::function<void(const modio::Response& response, const std::vector<modio::Modfile> & modfiles)>& callback);
API endpoint used: Get All Modfiles
Browse modfiles on mod.io, can be filtered using the modio::FilterCreator.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
filter_creator | modio::FilterCreator& |
modio::FilterCreator object to be customized. |
callback | const std::function<void(const modio::Response& response, const std::vector<modio::Modfile> & modfiles)>& |
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::Modfile> |
Vector containing the returned [Modfile] objects. |
modio::FilterCreator filter_creator;
filter_creator.setFilterLimit(3);
modio_instance.getAllModfiles(filter_creator, [&](const modio::Response& response, const std::vector<modio::Modfiles> & modfiles)
{
if(response.code == 200)
{
//Mod data successfully retrieved
}
});
void getModfile(u32 mod_id, u32 modfile_id, const std::function<void(const modio::Response& response, const modio::Modfile& modfile)>& callback);
API endpoint used: Get Mod File
Get a file.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modfile_id | u32 |
Modfiles's unique identifier. |
callback | const std::function<void(const modio::Response& response, const modio::Modfile& modfile)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& response |
modio::Response object that contains the mod.io response status. |
modfile | const modio::Modfile& |
Resulting modio::Modfile object. |
modio_instance.getModfile(mod_id, modfile_id, [&](const modio::Response& response, const modio::Modfile& modfile)
{
if(response.code == 200)
{
//Modfile successfully retrieved
}
});
void Instance::addModfile(u32 mod_id, modio::ModfileCreator& modfile_creator)
API endpoint used: Add Mod File
Uploads a file to a corresponding mod.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modfile_creator | modio::ModfileCreator& |
modio::ModfileCreator object containing the data that will be added. |
callback | const std::function<void(const modio::Response& response, const modio::Modfile& modfile)>& |
Function called once the process finished. |
modio::ModfileCreator modfile_creator;
modfile_creator.setModfilePath("ModExample/modfile/");
modfile_creator.setModfileVersion("v1.1.0");
modfile_creator.setModfileChangelog("This is a change log, this is a changelog , this is a changelog , this is a changelog , this is a changelog , this is a changelog, this is a changelog , this is a changelog , this is a changelog");
modio_instance.addModfile(requested_mod.id, modfile_creator);
void Instance::editModfile(u32 mod_id, u32 modfile_id, modio::ModfileEditor& modfile_editor, const std::function<void(const modio::Response& response, const modio::Modfile& modfile)>& callback)
API endpoint used: Edit Mod File
Updates the details of a corresponding modfile. Only the changelog
and active
fields are editable. If you want to update another field, you should add a new modfile instead.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modfile_id | u32 |
Modfile's unique identifier. |
modfile_editor | modio::ModfileEditor& |
modio::ModfileEditor object containing the data that will be edited. |
callback | const std::function<void(const modio::Response& response, const modio::Modfile& modfile)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
modfile | const modio::Modfile& |
Resulting modio::Modfile object. |
modio::ModfileEditor modfile_editor;
modfile_editor.setModfileActive(true);
modfile_editor.setModfileChangelog("Stuff was changed on this mod via the examples.");
mod.editModfile(requested_mod.id, requested_mod.modfile.id, modfile_editor, [&](const modio::Response& response, const modio::Modfile& modfile)
{
if(response.code == 200)
{
//Modfile successfully edited
}
});
void Instance::deleteModfile(u32 mod_id, u32 modfile_id, const std::function<void(const modio::Response& response)>& callback)
API endpoint used: Delete Mod File
Delete a modfile.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modfile_id | u32 |
Modfile'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. |
mod.deleteModfile(requested_mod.id, requested_mod.modfile.id, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Modfile successfully deleted
}
});
- 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