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
Modfiles
Ahmed Castro edited this page Nov 7, 2017
·
31 revisions
void modioAddModfile(int mod_id, ModioModfileHandler* modfile_handler, void (*callback)(ModioResponse* response, ModioModfile* modfile))
API endpoint used: Add Mod File
Uploads a file to a corresponding mod.
Name | Type | Description |
---|---|---|
mod_id | int |
Mod's unique identifier |
modfile_handler | ModioModfileHandler* |
ModioModfileHandler object containing the data that will be added |
callback | void (*callback)(ModioResponse* response, ModioModfile* modfile) |
Function called once the process finished |
Name | Type | Description |
---|---|---|
response | ModioResponse* |
ModioResponse object that contains the mod.io response status |
modfile | ModioModfile* |
Resulting ModioModfile object |
void onModfileAdded(ModioResponse* response, ModioModfile* modfile)
{
cout<<"Add Modfile Response: "<<response->code<<endl;
if(response->code == 201)
{
//Modfile successfully added
}
}
[...]
ModioModfileHandler* modfile_handler = new ModioModfileHandler();
modioInitModfileHandler(modfile_handler);
//Required
modioSetModfilePath(modfile_handler, (char*)"ModExample/modfile/");
modioSetModfileVersion(modfile_handler, (char*)"v1.0.0");
modioSetModfileChangelog(modfile_handler, (char*)"This is a change log, this is a changelog , this is a changelog , this is a changelog , this is a changelog , this is a changelog, this is a changelog , this is a changelog , this is a changelog");
//Optional
modioSetModfileActive(modfile_handler, true);
modioAddModfile(mod_id, modfile_handler, &onModfileAdded);
void modioEditModfile(int mod_id, int modfile_id, ModioModfileHandler* modfile_handler, void (*callback)(ModioResponse* response, int modfile_id))
API endpoint used: Edit Mod File
Updates the details of a corresponding modfile. Only the changelog
and active
fields are editable. If you want to update another field, you should add a new modfile instead.
Name | Type | Description |
---|---|---|
mod_id | int |
Mod's uinique identifier |
modfile_id | int |
Modfile's unique identifier |
modfile_handler | ModioModfileHandler* |
ModioModfileHandler object containing the data that will be edited |
callback | void (*callback)(ModioResponse* response, int modfile_id) |
Function called once the process finished |
Name | Type | Description |
---|---|---|
response | ModioResponse* |
ModioResponse object that contains the mod.io response status |
modfile_id | int |
Resulting ModioModfile object |
void onModfileEdited(ModioResponse* response, int modfile_id)
{
if(response->code == 200)
{
//Modfile successfully edited
}
}
[...]
ModioModfileHandler* modfile_handler = new ModioModfileHandler;
modioInitModfileHandler(modfile_handler);
modioSetModfileActive(modfile_handler,false);
modioSetModfileChangelog(modfile_handler,(char*)"Stuff was changed on this mod via the examples.");
modioEditModfile(mod_id, modfile_id, modfile_handler, &onModfileEdited);
void modioInstallModfile(ModioModfile *modfile, char* destination_path, void (*callback)(ModioResponse* response, char* path))
Downloads and decompress a mod file into a provided directory.
Name | Type | Description |
---|---|---|
modfile | ModioModfile* |
ModioModfile* to be downloaded |
destination_path | char* |
Directory where the modfile will be installed |
callback | void (*callback)(ModioResponse* response, char* path) |
Function called once the process finished |
Name | Type | Description |
---|---|---|
response | ModioResponse* |
ModioResponse object that contains the mod.io response status |
path | char* |
Path where the modfile was installed |
void onModfileInstalled(ModioResponse* response, char* path)
{
if(response->code == 200)
{
//Modfile successfully installed
}
}
[...]
modioInstallModfile(modfile, "mods_directory/example_mod/", &onModfileInstalled);
- 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