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 (C compatible)
Ahmed Castro edited this page Sep 28, 2018
·
25 revisions
void modioGetAllModfiles(void* object, u32 mod_id, ModioFilterCreator filter, void (*callback)(void* object, ModioResponse response, ModioModfile modfiles[], u32 modfiles_size));
Wrapped by: Modfiles#getallmodfiles
API endpoint used: Get All Modfiles
Browse modfiles on mod.io, can be filtered using the ModioFilterCreator.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique identifier. |
filter | ModioFilterCreator* |
ModioFilterCreator object to be customized. |
callback | void (*callback)(void* object, ModioResponse response, ModioModfile modfiles[], u32 modfiles_size) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
modfiles | ModioModfile* |
ModioModfile array containing the returned mods. |
modfiles_size | u32 |
Modfiles array size. |
void onGetAllModfiles(void* object, ModioResponse response, ModioModfile modfiles[], u32 modfiles_size)
{
if(response.code == 200)
{
//Modfiles retrieved successfully
}
}
[...]
ModioFilterCreator filter;
modioInitFilter(&filter);
modioSetFilterLimit(&filter,3);
modioGetAllModfiles(NULL, mod_id, filter, &onGetAllModfiles);
void modioGetModfile(void* object, u32 mod_id, u32 modfile_id, void (*callback)(void* object, ModioResponse response, ModioModfile modfile));
C++ wrapper: Modfiles#getmodfile
API endpoint used: Get Mod File
Get a file.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique identifier. |
modfile_id | u32 |
Modfile's unique identifier. |
callback | void (*callback)(void* object, ModioResponse response, ModioModfile modfile) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
modfile | ModioModfile |
Resulting ModioModfile object. |
void onGetModfile(void* object, ModioResponse response, ModioModfile modfile)
{
if(response.code == 200)
{
//Modfile retrieved successfully
}
}
[...]
modioGetModfile(NULL, mod_id, modfile_id, &onGetModfile);
void modioAddModfile(void* object, u32 mod_id, ModioModfileCreator* modfile_creator, void (*callback)
(void* object, ModioResponse response, const ModioModfile& modfile));
C++ wrapper: Modfiles#addmodfile
API endpoint used: Add Mod File
Uploads a file to a corresponding mod.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique identifier. |
modfile_creator | ModioModfileCreator* |
ModioModfileCreator object containing the data that will be added. |
callback | void (*callback) (void* object, ModioResponse response, const ModioModfile& modfile) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
modfile | const modio::Modfile& |
Resulting ModioModfile object. |
void onModfileAdded(void* object, ModioResponse response, ModioModfile modfile)
{
if(response.code == 201)
{
//Modfile added successfully
}
}
[...]
ModioModfileCreator modfile_creator;
modioInitModfileCreator(&modfile_creator);
modioSetModfilePath(&modfile_creator, "ModExample/modfile/");
modioSetModfileVersion(&modfile_creator, "v1.1.0");
modioSetModfileChangelog(&modfile_creator, "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");
modioAddModfile(NULL, mod.id, modfile_creator, &onModfileAdded);
void modioEditModfile(void* object, u32 mod_id, u32 modfile_id, ModioModfileEditor* modfile_editor, void (*callback)(void* object, ModioResponse response, const ModioModfile& modfile));
C++ wrapper: Modfiles#editmodfile
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 |
---|---|---|
object | void* |
Mod's unique identifier. |
mod_id | u32 |
Mod's unique identifier. |
modfile_id | u32 |
Modfile's unique identifier. |
modfile_editor | ModioModfileEditor* |
ModioModfileEditor object containing the data that will be edited. |
callback | void (*callback)(void* object, ModioResponse response, const ModioModfile& modfile) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Mod's unique identifier. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
modfile | const ModioModfile& |
Resulting ModioModfile object. |
void onModfileEdited(void* object, ModioResponse response, ModioModfile modfile)
{
if(response.code == 200)
{
//Modfile edited successfully
}
}
[...]
ModioModfileEditor modfile_editor;
modioInitModfileEditor(&modfile_editor);
modioSetModfileActive(&modfile_editor,false);
modioSetModfileChangelog(&modfile_editor,(char*)"Stuff was changed on this mod via the examples.");
modioEditModfile(NULL, mod.id, modfile.id, modfile_editor, &onModfileEdited);
void modioDeleteModfile(void* object, u32 mod_id, u32 modfile_id, void (*callback)(void* object, ModioResponse response));
C++ wrapper: Modfiles#deletemodfile
API endpoint used: Delete Mod File
Delete a modfile.
Name | Type | Description |
---|---|---|
object | void* |
Mod's unique identifier. |
mod_id | u32 |
Mod's unique identifier. |
modfile_id | u32 |
Modfile's unique identifier. |
callback | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Mod's unique identifier. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
void onDeleteModfile(void* object, ModioResponse response, ModioModfile modfile)
{
if(response.code == 204)
{
//Modfile deleted successfully
}
}
[...]
modioDeleteModfile(NULL, mod.id, modfile.id, &onDeleteModfile);
- 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