-
Notifications
You must be signed in to change notification settings - Fork 27
Downloads (C compatible)
void modioDownloadMod(u32 mod_id);
C++ wrapper: Downloads#downloadmod
Adds the corresponding mod to download queue to be downloaded locally. Once downloaded it will trigger the download listener that can be set by calling the modioSetDownloadListener function, mods will be installed automatically on startup when calling modioInit()
or by manually calling modioInstallDownloadedMods.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modioDownloadMod(mod_id);
void modioInstallDownloadedMods();
C++ wrapper: Downloads#installdownloadedmods
Extracts and installs all mods downloaded either by automatic installs or by calling modioDownloadMod.
modioInstallDownloadedMods();
void modioUninstallMod(u32 mod_id);
C++ wrapper: Downloads#uninstallmod
Removes the corresponding mod from the local storage.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modioUninstallMod(mod_id);
void modioPauseDownloads();
C++ wrapper: Downloads#pausedownloads
Pauses the current downloads. The state of the download queue is stored to it can be continued even after the mod.io SDK is shutdown.
modioPauseDownloads();
void modioResumeDownloads();
C++ wrapper: Downloads#resumedownloads
Resumes the downloads after a pause.
modioResumeDownloads();
void modioPrioritizeModDownload(u32 mod_id);
C++ wrapper: Downloads#prioritizemoddownload
Puts the corresponding mod download to the front of the download queue.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modioPrioritizeModDownload(mod_id);
void modioSetDownloadListener(void (*callback)(u32 response_code, u32 mod_id));
C++ wrapper: Downloads#setdownloadlistener
Registers a function to be called every time a mod is installed.
Name | Type | Description |
---|---|---|
callback | void (*callback)(u32 response_code, u32 mod_id) |
Function to be called every time a mod is installed. |
Name | Type | Description |
---|---|---|
response_code | u32 |
Response code from mod.io backend. See Response Codes. |
mod_id | u32 |
Id of the mod that was just installed. |
void onModInstalled(u32 response_code, u32 mod_id)
{
if (response_code == 200)
{
//Mod installed successfully
}
}
[...]
modioSetDownloadListener(&onModInstalled);
u32 modioGetModDownloadQueueCount();
C++ wrapper: n/a
Returns the size of the download queue.
u32 queue_size = modioGetModDownloadQueueCount();
void modioGetModDownloadQueue(ModioQueuedModDownload* download_queue);
C++ wrapper: Downloads#getmoddownloadqueue
Returns an array of ModioQueuedModDownload objects which represents the mods that are currently queued to be installed.
Name | Type | Description |
---|---|---|
download_queue | ModioQueuedModDownload* |
Array where the contents of the queue will be copied. |
u32 queue_size = modioGetModDownloadQueueCount();
ModioQueuedModDownload *download_queue = malloc(queue_size * sizeof(*download_queue));
modioGetModDownloadQueue(download_queue);
[...]
free(download_queue);
void modioGetInstalledMod(u32 mod_id, ModioInstalledMod *installed_mod);
C++ wrapper: Downloads#getinstalledmod
Returns a ModioInstalledMod object which represents a mod installed locally.
ModioInstalledMod installed_mod;
modioGetInstalledMod(mod_id, &installed_mod);
u32 modioGetAllInstalledModsCount();
C++ wrapper: Downloads#getallinstalledmodssize
Returns the amounts of mods installed locally.
u32 installed_mods_size = modioGetAllInstalledModsCount();
void modioGetAllInstalledMods(ModioInstalledMod* installed_mods);
C++ wrapper: Downloads#getallinstalledmods
Returns an array of ModioInstalledMod objects which represents the mods that are locally installed.
Name | Type | Description |
---|---|---|
installed_mods | ModioInstalledMod* |
Array where the contents of the installed mods data will be copied. |
u32 installed_mods_size = modioGetallInstalledModsCount();
ModioInstalledMod* installed_mods = malloc(installed_mods_size * sizeof(*installed_mods));
modioGetallInstalledMods(installed_mods);
[...]
free(installed_mods);
u32 modioGetAllDownloadedModsCount();
C++ wrapper: Downloads#getalldownloadedmodssize
Returns the amount of mods that are downloaded locally but are still not extracted and installed. To install them use modioInstallDownloadedMods.
u32 downloaded_mods_count = modioGetAllDownloadedModsCount();
void modioGetAllDownloadedMods(u32* downloaded_mods);
C++ wrapper: Downloads#getalldownloadedmods
Returns an array of ids of mods that are downloaded locally but are still not extracted and installed. To install them use modioInstallDownloadedMods.
Name | Type | Description |
---|---|---|
installed_mods | ModioInstalledMod* |
Array where the contents of the installed mods data will be copied. |
u32 installed_mods_size = modioGetallInstalledModsCount();
ModioInstalledMod* installed_mods = malloc(installed_mods_size * sizeof(*installed_mods));
modioGetallInstalledMods(installed_mods);
[...]
free(installed_mods);
u32 modioGetModState(u32 mod_id);
C++ wrapper: Downloads#getmodstate
Returns the state of the corresponding mod, see Mod states.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
u32 mod_state = modioGetModState(mod_id);
void modioFreeInstalledMod(ModioInstalledMod* installed_mod);
C++ wrapper: n/a
Frees the privided ModioInstalledMod, use this to free the returned queue from modioGetAllInstalledMods.
Name | Type | Description |
---|---|---|
installed_mod | ModioInstalledMod |
ModioInstalledMod object to be freed. |
void modioFreeQueuedModDownload(ModioQueuedModDownload* queued_mod_download);
C++ wrapper: n/a
Frees the privided ModioQueuedModDownload, use this to free the returned queue from modioGetModDownloadQueue.
Name | Type | Description |
---|---|---|
queued_mod_download | ModioQueuedModDownload |
ModioQueuedModDownload object to be freed. |
- 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