Last active
January 16, 2018 01:46
-
-
Save Turupawn/8c8455c124a2718b5027bf40f1789281 to your computer and use it in GitHub Desktop.
Modio Delete Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "modio.h" | |
int main(void) | |
{ | |
modio::Instance modio_instance(7, "e91c01b8882f4affeddd56c96111977b"); | |
volatile static bool finished = false; | |
auto wait = [&]() | |
{ | |
while (!finished) | |
{ | |
modio_instance.sleep(10); | |
modioProcess(); | |
} | |
}; | |
auto finish = [&]() | |
{ | |
finished = true; | |
}; | |
if(modio_instance.isLoggedIn()) | |
{ | |
u32 mod_id; | |
std::cout << "Enter the mod id: " << std::endl; | |
std::cin >> mod_id; | |
// We delete a mod providing the Mod id | |
std::cout << "Deleting mod..." << response.code << std::endl; | |
modio_instance.deleteMod(mod_id, [&](const modio::Response& response, u32 mod_id) | |
{ | |
std::cout << "Mod Delete response: " << response.code << std::endl; | |
if(response.code == 204) | |
{ | |
std::cout << "Mod delete successfully" << std::endl; | |
} | |
finish(); | |
}); | |
wait(); | |
} | |
std::cout << "Process finished" << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment