-
Notifications
You must be signed in to change notification settings - Fork 27
Downloads
void Instance::downloadMod(u32 mod_id)
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 setDownloadListener function, mods will be installed automatically on startup when calling modio_instance.init()
or by manually calling installDownloadedMods.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modio_instance.downloadMod(mod_id);
void Instance::installDownloadedMods()
Extracts and installs all mods downloaded either by automatic installs or by calling downloadMod.
modio_instance.installDownloadedMods();
void Instance::uninstallMod(u32 mod_id)
Removes the corresponding mod from the local storage.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modio_instance.uninstallMod(mod_id);
void Instance::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.
modio_instance.pauseDownloads();
void Instance::resumeDownloads()
Resumes the downloads after a pause.
modio_instance.resumeDownloads();
void Instance::prioritizeModDownload(u32 mod_id)
Puts the corresponding mod download to the front of the download queue.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
modio_instance.prioritizeModDownload(mod_id);
void Instance::setDownloadListener(const std::function<void(u32 response_code, u32 mod_id)> &callback);
Registers a function to be called every time a mod finished downloading.
Name | Type | Description |
---|---|---|
callback | const std::function<void(u32 response_code, u32 mod_id)>& | Function to be called every time a mod finished downloading. |
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 downloaded. |
modio_instance.setDownloadListener([&](u32 response_code, u32 mod_id) {
if (response_code == 200)
{
//Mod successfully downloaded
}
});
std::list<QueuedModDownload*> Instance::getModDownloadQueue();
Returns a std::list
of modio::QueuedModDownload objects which represents the mods that are currently queued to be downloaded.
std::list<modio::QueuedModDownload *> mod_download_queue = modio_instance.getModDownloadQueue();
modio::InstalledMod Instance::getInstalledMod(u32 mod_id);
Returns a modio::InstalledMod object which represents a mod installed locally.
modio::InstalledMod installed_mod = modio_instance.getInstalledMod(mod_id);
std::vector<modio::InstalledMod> Instance::getAllInstalledMods();
Returns a std::vector
of modio::InstalledMod objects which represents the mods that are locally installed.
std::vector<modio::InstalledMod> installed_mods = modio_instance.getAllInstalledMods();
std::vector<u32> Instance::getAllDownloadedMods();
Returns a std::vector
of ids of mods that are downloaded locally but are still not extracted and installed. To install them use the installDownloadedMods.
std::vector<int> downloaded_mods = modio_instance.getAllDownloadedMods();
u32 Instance::getModState(u32 mod_id);
Returns the state of the corresponding mod, see Mod states.
u32 mod_state = modio_instance.getModState(mod_id);
- 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