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
Metadata KVP (C compatible)
Ahmed Castro edited this page Sep 3, 2018
·
2 revisions
void modioGetAllMetadataKVP(void* object, u32 mod_id, void (*callback)(void* object, ModioResponse response, ModioMetadataKVP* metadata_kvp_array, u32 metadata_kvp_array_size));
Wrapped by: Metadata-KVP#getallmetadatakvp
API endpoint used: Get All Mod KVP Metadata
Returns an array containing all corresponding mod's ModioMetadataKVP objects.
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
mod_id | u32 |
Mod's unique identifier. |
callback | void (*callback)(void* object, ModioResponse response, ModioMetadataKVP* metadata_kvp_array, u32 metadata_kvp_array_size) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
metadata_kvp_array | ModioMetadataKVP* |
Array containing the ModioMetadataKVP objects returned. |
metadata_kvp_array_size | u32 |
Tags array size. |
void onGetAllMetadataKVP(void *object, ModioResponse response, ModioMetadataKVP *metadata_kvp_array, u32 metadata_kvp_array_size)
{
if(response.code == 200)
{
//Metadata KVP retrieved successfully
}
}
[...]
modioGetAllMetadataKVP(NULL, mod_id, &onGetAllMetadataKVP);
void modioAddMetadataKVP(void* object, u32 mod_id, char** metadata_kvp_array, u32 metadata_kvp_array_size, void (*callback)(void* object, ModioResponse response));
Wrapped by: Metadata-KVP#addmetadatakvp
API endpoint used: Add Mod KVP Metadata
Adds the metadata key value pairs provided to the corresponding mod.
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
mod_id | u32 |
Mod's unique identifier. |
metadata_kvp_array | char** |
Array containing the metadata key value pairs to be added. |
metadata_kvp_array_size | u32 |
Metadata key value pairs array size. |
callback | (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
void onAddMetadataKVP(void *object, ModioResponse response)
{
if(response.code == 201)
{
//Metadata KVP added successfully
}
}
[...]
char **metadata_kvp_array = (char **)malloc(1);
metadata_kvp_array[0] = (char *)malloc(100);
strcpy(metadata_kvp_array[0], "pistol-dmg:800\0");
modioAddMetadataKVP(NULL, mod_id, (char **)metadata_kvp_array, 1, &onAddMetadataKVP);
void modioDeleteMetadataKVP(void* object, u32 mod_id, char** metadata_kvp_array, u32 metadata_kvp_array_size, void (*callback)(void* object, ModioResponse response));
Wrapped by: Metadata-KVP#deletemetadatakvp
API endpoint used: Delete Mod KVP Metadata
Deletes the metadata key value pairs provided from the corresponding mod.
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
mod_id | u32 |
Mod's unique identifier. |
metadata_kvp_array | char** |
Array containing the metadata key value pairs to be deleted. |
metadata_kvp_array_size | u32 |
Metadata key value pairs array size. |
callback | (*callback)(void* object, ModioResponse response) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
object | void* |
Context paramter. |
response | ModioResponse |
ModioResponse object that contains the mod.io response status. |
void onDeleteMetadataKVP(void *object, ModioResponse response)
{
if(response.code == 204)
{
//Metadata KVP deleted successfully
}
}
[...]
char **metadata_kvp_array = (char **)malloc(1);
metadata_kvp_array[0] = (char *)malloc(100);
strcpy(metadata_kvp_array[0], "pistol-dmg:800\0");
modioDeleteMetadataKVP(NULL, mod_id, (char **)metadata_kvp_array, 1, &onAddMetadataKVP);
- 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