-
Notifications
You must be signed in to change notification settings - Fork 27
Initialization, Process and Shutdown (C compatible)
void modioInit(u32 environment, u32 game_id, bool retrieve_mods_from_other_games, char const *api_key, char const *root_path);
Name | Type | Description |
---|---|---|
environment | u32 |
Server Environment. |
game_id | u32 |
Your game unique identifier. |
retrieve_mods_from_other_games | bool |
If set to true, mods from other games will also be retrieved in the User's functions |
api_key | char* |
Your game unique API key, grab this from the mod.io website. |
game_id | char* |
Optional parameter: You can change the root path where the .modio directory will reside. The ./modio directory contains the installed mods as well as all the files the mod.io handles behind the scene. The root path will be the working directory if not explicitly defined. |
Initializes mod.io SDK on your project to access API functionality. This will setup a .modio/
directory as mod.io working directory in your project path. This must be called before any other mod.io function.
Example:
modioInit(MODIO_ENVIRONMENT_TEST, 7, (char*)"e91c01b8882f4affeddd56c96111977b");
void modioProcess();
This function handles transfers and callbacks in an non-blocking way. We recommend calling it regularly when performance is not critical, for example in menus or modding tools. Be mindful this function may impact the frame rate and online latency, we recommend not calling it in-game or better yet you could let your players decide. Additionally does the following work behinds the scenes:
- Installs mods when the logged user subscribed.
- Uninstalls mods when the logged user unsubscribed.
- Reinstalls modfiles when a new version is available regardless if the user is logged in.
- Redownloads installed mods cache regardless if the user is logged in. Mod cache information is accessible through the getInstalledMods function.
This functionality is achieved by polling the API events endpoints. Polling occur every 15s by default so it should take about that amount of time to reflect the changes.
Example:
modioProcess();
void modioShutdown()
Call this to close and release mod.io SDK resources. No further SDK calls should be made after this.
- 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