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

Events (C compatible)

Ahmed Castro edited this page May 10, 2019 · 9 revisions

modioGetAllModEvents

void modioGetAllModEvents(void* object, ModioFilterCreator filter, void (*callback)(void* object, ModioResponse response, ModioModEvent* mod_events_array, u32 mod_events_array_size));

Wrapped by: Events#getallmodevents

API endpoint used: Get All Mod Events

Get all mods events for the corresponding game sorted by latest event first. The result can be filtered using the ModioFilterCreator.

Function parameters

Name Type Description
object void* Context paramter.
filter ModioFilterCreator* ModioFilterCreator object to be customized.
callback void (*callback)(void* object, ModioResponse response, ModioModEvent* mod_events_array, u32 mod_events_array_size) Function called once the process finished.

Callback parameters

Name Type Description
object void* Context paramter.
response ModioResponse ModioResponse object that contains the mod.io response status.
mod_events_array ModioModEvent* Array containing the ModioModEvent objects returned.
mod_events_array_size u32 Mod events array size.

Example

void onGetAllModEvents(void* object, ModioResponse response, ModioModEvent* mod_events_array, u32 mod_events_array_size)
{
  if(response.code == 200)
  {
    //Mod events retrieved successfully
  }
}

[...]

ModioFilterCreator filter_creator;
modioInitFilter(&filter_creator);
modioSetFilterLimit(&filter_creator,3);

modioGetAllModEvents(NULL, filter, &onGetAllModEvents);

modioGetModEvents

void modioGetModEvents(void* object, u32 mod_id, ModioFilterCreator filter, void (*callback)(void* object, ModioResponse response, ModioModEvent* mod_events_array, u32 mod_events_array_size));

Wrapped by: Events#getmodevents

API endpoint used: Get All Mod Events

Get the event log for a mod, showing changes made sorted by latest event first. The result can be filtered using the ModioFilterCreator.

Function parameters

Name Type Description
object void* Context paramter.
mod_id u32 Mod's unique identifier.
filter ModioFilterCreator* ModioFilterCreator object to be customized.
callback void (*callback)(void* object, ModioResponse response, ModioModEvent* mod_events_array, u32 mod_events_array_size) Function called once the process finished.

Callback parameters

Name Type Description
object void* Context paramter.
response ModioResponse ModioResponse object that contains the mod.io response status.
mod_events_array ModioModEvent* Array containing the ModioModEvent objects returned.
mod_events_array_size u32 Mod events array size.

Example

void onGetModEvents(void* object, ModioResponse response, ModioModEvent* mod_events_array, u32 mod_events_array_size)
{
  if(response.code == 200)
  {
    //Mod events retrieved successfully
  }
}

[...]

ModioFilterCreator filter_creator;
modioInitFilter(&filter_creator);
modioSetFilterLimit(&filter_creator,3);

modioGetModEvents(NULL, mod_id, filter, &onGetModEvents);

Contents

Clone this wiki locally