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 (C compatible)
Ahmed Castro edited this page Feb 21, 2019
·
20 revisions
void modioGetAllMods(void* object, ModioFilterCreator* filter, void (*callback)(void* object, ModioResponse response, ModioMod* mods, u32 mods_size));
Wrapped by: Mods#getallmods
API endpoint used: Get All Mods
Browse mods on mod.io, can be filtered using the ModioFilterCreator.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
filter | ModioFilterCreator* |
ModioFilterCreator object to be customized. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mods, u32 mods_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. |
mods | ModioMod* |
ModioMod array containing the returned mods. |
mods_size | u32 |
Mod array size. |
void onGetAllMods(void* object, ModioResponse response, ModioMod* mods, u32 mods_size)
{
if(response.code == 200)
{
//Mods retrieved successfully
}
}
[...]
ModioFilterCreator filter;
modioInitFilter(&filter);
modioSetFilterLimit(&filter,3);
modioGetAllMods(NULL,filter, &onGetAllMods);
void modioGetMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response, ModioMod mod));
Wrapped by: Mods#getmod
API endpoint used: Get Mod
Get a mod by providing its id.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique id. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod mod) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mod | ModioMod |
ModioMod object returned. |
void onModGet(void* object, ModioResponse response, ModioMod mod)
{
if(response.code == 200)
{
//Mod retrieved successfully
}
}
[...]
modioGetMod(NULL, mod_id, &onModGet);
void MODIO_DLL modioAddMod(void* object, ModioModCreator* mod_creator, void (*callback)(void* object, ModioResponse response, ModioMod* mod));
Wrapped by: Mods#addmod
API endpoint used: Add Mod
Adds a new Mod to mod.io. Use the ModioModCreator to set the mods fields before uploading.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_creator | ModioModCreator* |
ModioModCreator object containing the data that will be added. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mod) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mod | ModioMod* |
Resulting ModioMod object. |
void onModAdded(void* object, ModioResponse response, ModioMod mod)
{
if(response.code == 201)
{
//Mod added successfully
}
}
[..]
ModioModCreator mod_creator;
modioInitModCreator(&mod_creator);
modioSetModCreatorLogoPath(&mod_creator, (char*)"ModExample/logo.png");
modioSetModCreatorName(&mod_creator, (char*)"Example Mod Test");
modioSetModCreatorHomepage(&mod_creator, (char*)"http://www.webpage.com");
modioSetModCreatorSummary(&mod_creator, (char*)"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.");
modioAddTag(&mod_creator, (char*)"Easy");
modioAddTag(&mod_creator, (char*)"Medium");
modioSetModCreatorPrice(&mod_creator, 1.99);
modioSetModCreatorStock(&mod_creator, 25);
modioSetModCreatorDescription(&mod_creator, (char*)"This mod description was added via the SDK examples. This mod description was added via the SDK examples.");
modioSetModCreatorMetadata(&mod_creator, (char*)"Optional metadata");
modioAddMod(NULL, mod_creator, &onModAdded);
void MODIO_DLL modioEditMod(void* object, u32 mod_id, ModioModEditor* mod_editor, void (*callback)(void* object, ModioResponse response, ModioMod* mod));
Wrapped by: Mods#editmod
API endpoint used: Edit Mod
Updates the details of a corresponding mod. TODO explain the media functions
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
mod_id | u32 |
Mod's unique identifier. |
mod_editor | ModioModEditor* |
ModioModEditor object containing the data that will be edited. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mod) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
mod | ModioMod* |
Resulting ModioMod object. |
void onModEdited(void* object, ModioResponse response, ModioMod mod)
{
if(response.code == 200)
{
//Mod edited successfully
}
}
[...]
ModioModEditor mod_editor;
modioInitModEditor(&mod_editor);
modioSetModEditorName(&mod_editor, (char*)"Update Example");
modioSetModEditorHomepage(&mod_editor, (char*)"http://www.updated.com");
modioSetModEditorSummary(&mod_editor, (char*)"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.");
modioAddTag(&mod_editor, (char*)"Easy");
modioSetModEditorPrice(&mod_editor, 2.99);
modioSetModEditorDescription(&mod_editor, (char*)"This mod description was updated via the SDK examples. This mod description was updated via the SDK examples.");
modioSetModEditorMetadata(&mod_editor, (char*)"Optional updated metadata");
modioEditMod(NULL, mod.id, mod_editor, &onModEdited);
void MODIO_DLL modioDeleteMod(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response));
Wrapped by: Mods#deletemod
API endpoint used: Delete Mod
Deletes a mod profile.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | u32 |
Mod's unique identifier. |
callback | void (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
void onModDeleted(void* object, ModioResponse response)
{
if(response.code == 204)
{
//Mod deleted successfully
}
}
[...]
modioDeleteMod(NULL, mod.id, &onModDeleted);
- 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