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
Subscriptions
Ahmed Castro edited this page Oct 21, 2019
·
10 revisions
void Instance::subscribeToMod(u32 mod_id, const std::function<void(const modio::Response& response, const modio::Mod& mod)>& callback);
API endpoint used: Subscribe to Mod
Subscribe the authenticated user to a corresponding mod. This will automatically download the mod locally.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
callback | const std::function<void(const modio::Response& response, const modio::Mod& mod)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
mod | const modio::Mod& |
modio::Mod object the user just subscribed to. |
modio_instance.subscribeToMod(mod_id, [&](const modio::Response& response, const modio::Mod& mod)
{
if(response.code == 201)
{
//Subscribed to mod successfully
}
});
void Instance::unsubscribeFromMod(u32 mod_id, const std::function<void(const modio::Response& response)>& callback);
API endpoint used: Unsubscribe from Mod
Unsubscribe the authenticated user from the corresponding mod. This will automatically uninstall the mod locally.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod'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. |
modio_instance.unsubscribeFromMod(mod_id, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Unsubscribed from mod successfully
}
});
bool Instance::isCurrentUserSubscribed(u32 mod_id)
Returns true if the authenticated user is subscribed to the corresponding mod.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Id of the corresponding mod |
bool is_subscribed = isCurrentUserSubscribed(mod_id);
const std::vector<u32> getCurrentUserSubscriptions();
Returns a std::vector
of the mod ids that the current user has subscribed.
std::vector<modio::InstalledMod> installed_mods = mod_instance.getCurrentUserSubscriptions();
- 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