This repository was 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 Dec 20, 2017
·
20 revisions
void modioGetMods(void* object, ModioFilterHandler* filter, void (*callback)(void* object, ModioResponse response, ModioMod* mods, int mods_size));
Wrapped by: Mods#modiogetmods
API endpoint used: Get All Mods
Browse mods on mod.io, can be filtered using the FilterHandler handle.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
filter | ModioFilterHandler* |
ModioFilterHandler object to be customized. |
callback | void (*callback)(void* object, ModioResponse response, ModioMod* mods, int mods_size) |
Function called once the process finished. |
ModioResponse* response, ModioMod* mods, int mods_size)
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 | int |
Mod array size. |
void onModsGet(void* object, ModioResponse response, ModioMod* mods, int mods_size)
{
if(response.code == 200)
{
//Mods successfully retrieved
}
}
[...]
ModioFilterHandler filter;
modioInitFilter(&filter);
modioSetFilterLimit(&filter,3);
modioGetMods(NULL,filter, &onModsGet);
void MODIO_DLL modioAddMod(void* object, ModioModHandler* mod_handler, void (*callback)(void* object, ModioResponse response, ModioMod* mod));
Wrapped by: Mods#modioaddmod
API endpoint used: Add Mod
Adds a new Mod to mod.io. Use the ModioModHandler to set the mods fields before uploading.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_handler | ModioModHandler* |
ModioModHandler 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 successfully added
}
}
[..]
ModioModHandler mod_handler;
modioInitModHandler(&mod_handler);
modioSetLogoPath(&mod_handler, (char*)"ModExample/logo.png");
modioSetName(&mod_handler, (char*)"Example Mod Test");
modioSetHomepage(&mod_handler, (char*)"http://www.webpage.com");
modioSetSummary(&mod_handler, (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_handler, (char*)"Easy");
modioAddTag(&mod_handler, (char*)"Medium");
modioSetPrice(&mod_handler, 1.99);
modioSetStock(&mod_handler, 25);
modioSetDescription(&mod_handler, (char*)"This mod description was added via the SDK examples. This mod description was added via the SDK examples.");
modioSetMetadata(&mod_handler, (char*)"Optional metadata");
modioAddMod(NULL, mod_handler, &onModAdded);
void MODIO_DLL modioEditMod(void* object, int mod_id, ModioModHandler* mod_handler, void (*callback)(void* object, ModioResponse response, ModioMod* mod));
Wrapped by: Mods#modioeditmod
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 | int |
Mod's unique identifier. |
mod_handler | ModioModHandler* |
ModioModHandler 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 successfully edited
}
}
[...]
ModioModHandler mod_handler;
modioInitModHandler(&mod_handler);
modioSetLogoPath(&mod_handler, (char*)"ModExample/logo.png");
modioSetName(&mod_handler, (char*)"Update Example");
modioSetHomepage(&mod_handler, (char*)"http://www.updated.com");
modioSetSummary(&mod_handler, (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_handler, (char*)"Easy");
modioSetPrice(&mod_handler, 2.99);
modioSetDescription(&mod_handler, (char*)"This mod description was updated via the SDK examples. This mod description was updated via the SDK examples.");
modioSetMetadata(&mod_handler, (char*)"Optional updated metadata");
modioEditMod(NULL, mod.id, mod_handler, &onModEdited);
void MODIO_DLL modioDeleteMod(void* object, int mod_id, void (*callback)(void* object, ModioResponse response, int mod_id));
Wrapped by: Mods#modiodeletemod
API endpoint used: Delete Mod
Deletes a mod profile.
Name | Type | Description |
---|---|---|
object | void* |
Context parameter. |
mod_id | int |
Mod's unique identifier. |
callback | void (*callback)(void* object, ModioResponse response, int mod_id) |
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 | int |
Deleted mod id. |
void onModDeleted(void* object, ModioResponse response, int mod_id)
{
if(response.code == 204)
{
//Mod successfully deleted
}
}
[...]
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