Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
Ahmed Castro edited this page Sep 3, 2018 · 8 revisions

addModLogo

void Instance::addModLogo(u32 mod_id, std::string logo_path, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Uploads a new logo image to a corresponding mod.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
logo_path const std::string& Image's local path to be uploaded.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

modio_instance.addModLogo(mod_id, "ModExample/logo.png", [&](const modio::Response& response)
{
  if(response.code == 201)
  {
    //Mod logo added successfully
  }
});

addModImages

void Instance::addModImages(u32 mod_id, std::vector<std::string> image_paths, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Uploads a list of images to the corresponding mod's gallery.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
image_paths std::vector<std::string> Image's local paths to be uploaded.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

std::vector<std::string> images;
images.push_back("ModExample/Screenshot1.png");
images.push_back("ModExample/Screenshot2.png");

modio_instance.addModImages(mod_id, images, [&](const modio::Response& response)
{
  if(response.code == 201)
  {
    //Images added successfully
  }
});

addModYoutubeLinks

void Instance::addModYoutubeLinks(u32 mod_id, std::vector<std::string> youtube_links, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Adds a list of youtube links to the corresponding mod's profile.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
youtube_links std::vector<std::string> Youtube links to be added.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

std::vector<std::string> youtube_links;
youtube_links.push_back("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
youtube_links.push_back("https://www.youtube.com/watch?v=JM5v_cR-tCI");

modio_instance.addModYoutubeLinks(mod_id, youtube_links, [&](const modio::Response& response)
{
  if(response.code == 201)
  {
    //Youtube links added successfully
  }
});

addModSketchfabLinks

void Instance::addModSketchfabLinks(u32 mod_id, std::vector<std::string> sketchfab_links, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Adds a list of sketchfab links to the corresponding mod's profile.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
sketchfab_links std::vector<std::string> Sketchfab links to be added.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

std::vector<std::string> sketchfab_links;
sketchfab_links.push_back("https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74");
sketchfab_links.push_back("https://sketchfab.com/models/d66fee8c6cb747509a9bc09c494a726d");

modio_instance.addModSketchfabLinks(mod_id, sketchfab_links, [&](const modio::Response& response)
{
  if(response.code == 201)
  {
    //Sketchfab links added successfully
  }
});

deleteModImages

void Instance::deleteModImages(u32 mod_id, std::vector<std::string> image_paths, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Deletes a list of images from the corresponding mod's gallery.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
image_paths std::vector<std::string> Images to be deleted.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

std::vector<std::string> image_paths;
image_paths.push_back("Screenshot1.png");
image_paths.push_back("Screenshot2.png");

modio_instance.deleteModImages(mod_id, image_paths, [&](const modio::Response& response)
{
  if(response.code == 204)
  {
    //Images deleted successfully
  }
});

deleteModYoutubeLinks

void Instance::deleteModYoutubeLinks(u32 mod_id, std::vector<std::string> youtube_links, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Deletes a list of youtube links from the corresponding mod.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
youtube_links std::vector<std::string> Youtube links to be deleted.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

std::vector<std::string> youtube_links;
youtube_links.push_back("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
youtube_links.push_back("https://www.youtube.com/watch?v=JM5v_cR-tCI");

modio_instance.deleteModYoutubeLinks(mod_id, youtube_links, [&](const modio::Response& response)
{
  if(response.code == 204)
  {
    //Images deleted successfully
  }
});

deleteModSketchfabLinks

void deleteModSketchfabLinks(u32 mod_id, std::vector<std::string> sketchfab_links, const std::function<void(const modio::Response &response)> &callback);

API endpoint used: Add Mod Media

Deletes a list of sketchfab links from the corresponding mod.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
sketchfab_links std::vector<std::string> Sketchfab links to be deleted.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

std::vector<std::string> sketchfab_links;
sketchfab_links.push_back("https://sketchfab.com/models/7793b895f27841f4930e6b71f75a8d74");
sketchfab_links.push_back("https://sketchfab.com/models/d66fee8c6cb747509a9bc09c494a726d");

modio_instance.deleteModSketchfabLinks(mod_id, sketchfab_links, [&](const modio::Response& response)
{
  if(response.code == 204)
  {
    //Images deleted successfully
  }
});

downloadImage

void Instance::downloadImage(const std::string& image_url, const std::string& path, const std::function<void(const modio::Response&)>& callback);

Downloads an image to a desired path given the image url.

Function parameters

Name Type Description
image_url const std::string& Image url.
path const std::string& Path where the image will be downloaded.
callback const std::function<void(const modio::Response&)>& Function called once the process finished.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

modio_instance.downloadImage(mod.logo.original, "mods_dir/original.png", [&](const modio::Response& response)
{
  if(response.code == 200)
  {
    //Image downloaded successfully
  }
});

Contents

Clone this wiki locally