Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Ratings

Ahmed Castro edited this page Oct 21, 2019 · 7 revisions

addModRating

void Instance::addModRating(u32 mod_id, bool vote_up, const std::function<void(const modio::Response& response)>& callback);

API endpoint used: Add Mod Rating

Submit a positive or negative rating for a mod.

Function parameters

Name Type Description
mod_id u32 Mod's unique identifier.
vote_up u32 true represents a positive vote and false a negative one.
callback const std::function<void(const modio::Response& 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.addModRating(mod_id, vote, [&](const modio::Response& response)
{
  if(response.code == 201)
  {
    //Rating submitted successfully
  }
});

getCurrentUserModRating

u32 Instance::getCurrentUserModRating(u32 mod_id);

API endpoint used: Get User Ratings

Get a mod rating submitted by the authenticated user by providing the mod id. It returns an u32: -1 means negative rating, 1 positive and 0 no rating.

Function parameters

Name Type Description
mod_id u32 Id of the corresponding mod

Example

int rating_result = getCurrentUserModRating(mod_id);

Contents

Clone this wiki locally