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

Commit

Permalink
Merge pull request #104 from Turupawn/devel
Browse files Browse the repository at this point in the history
Road to v0.12.0
  • Loading branch information
Turupawn committed Oct 22, 2019
2 parents caa0195 + 542ac09 commit 2c313d2
Show file tree
Hide file tree
Showing 118 changed files with 5,911 additions and 272 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -11,10 +11,9 @@ script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cmake -D test=on . ;
else
CXX=/usr/bin/g++-5 CC=/usr/bin/gcc-5 cmake -Dtest=on . ;
CXX=/usr/bin/g++-5 CC=/usr/bin/gcc-5 cmake . ;
fi
- make -j2
- make test
- if [[ "$TRAVIS_TAG" ]]; then
cmake -D BUILD_SHARED_LIBS=OFF . ;
make -j2 ;
Expand Down Expand Up @@ -43,4 +42,4 @@ deploy:
skip_cleanup: true
on:
tags: true
condition: $TRAVIS_OS_NAME == "osx"
condition: $TRAVIS_OS_NAME == "osx"
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -35,6 +35,8 @@ ENDIF()

IF (UNIX AND NOT APPLE)
add_definitions(-D_LARGEFILE64_SOURCE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
target_link_libraries (modio curl)
ENDIF ()

Expand Down
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -88,6 +88,18 @@ modio_instance.galaxyAuth(appdata, [&](const modio::Response &response)
});
```

#### Oculus Auth

```c++
modio_instance.oculusAuth(nonce, oculus_user_id, access_token, email, date_expires, [&](const modio::Response &response)
{
if (response.code == 200)
{
// Successful Oculus authentication
}
});
```

#### Steam Auth

```c++
Expand Down
28 changes: 28 additions & 0 deletions examples/code-samples/c++/57_GetInstalledMod.cpp
@@ -0,0 +1,28 @@
#include "modio.h"

int main(void)
{
modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b");

u32 mod_id;
std::cout << "Enter the mod id: " << std::endl;
std::cin >> mod_id;

modio::InstalledMod installed_mod = modio_instance.getInstalledMod(mod_id);

// First, let's check if there is at least one modfile installed
if (installed_mod.mod_id != 0)
{
// Now we delete the local modfile folder by providing the modfile id
std::cout << "Mod name: " << installed_mod.mod.name << std::endl;
std::cout << "Mod path: " << installed_mod.path << std::endl;
}
else
{
std::cout << "That mod is not installed." << std::endl;
}

std::cout << "Process finished" << std::endl;

return 0;
}
42 changes: 42 additions & 0 deletions examples/code-samples/c++/58_OculusAuth.cpp
@@ -0,0 +1,42 @@
#include "modio.h"

int main()
{
modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b");

volatile static bool finished = false;

auto wait = [&]() {
while (!finished)
{
modio_instance.sleep(10);
modio_instance.process();
}
};

auto finish = [&]() {
finished = true;
};

// Auth works by providing the Appdata param given by the Oculus SDK
std::string appdata = "";
std::string nonce = "GALAXY NONCE PROOF HERE";
std::string oculus_user_id = "123123";
std::string access_token = "GALAXY AUTH TOKEN HERE";
std::string email = ""; // Optional email param, "" will be ignored
u32 date_expires = 0; // Optional expiration date param, 0 will be ignored
modio_instance.oculusAuth(nonce, oculus_user_id, access_token, email, date_expires, [&](const modio::Response &response) {
std::cout << "Response code: " << response.code << std::endl;

if (response.code == 200)
std::cout << "Successful Oculus authentication";
else
std::cout << "Error while authenticating to Oculus" << std::endl;

finish();
});
wait();

std::cout << "Process finished" << std::endl;
return 0;
}
2 changes: 1 addition & 1 deletion examples/code-samples/c/01_Authentication.c
Expand Up @@ -42,7 +42,7 @@ void onEmailRequest(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/02_BrowseMods.c
Expand Up @@ -29,7 +29,7 @@ void onGetAllMods(void *object, ModioResponse response, ModioMod *mods, u32 mods

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/03_GetUserMods.c
Expand Up @@ -29,7 +29,7 @@ void onGetAllMods(void *object, ModioResponse response, ModioMod *mods, u32 mods

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/04_ErrorResponse.c
Expand Up @@ -30,7 +30,7 @@ void onGetAllMods(void *object, ModioResponse response, ModioMod *mods, u32 mods

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/05_DownloadModfile.c
Expand Up @@ -20,7 +20,7 @@ void onDownloadMod(u32 response_code, u32 mod_id)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

// Let's start by requesting a single mod
printf("Please enter the mod id: \n");
Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/06_DownloadImages.c
Expand Up @@ -36,7 +36,7 @@ void onGetMod(void *object, ModioResponse response, ModioMod mod)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/07_RemoveModfile.c
Expand Up @@ -4,7 +4,7 @@

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

// First, let's check if there is at least one mod installed
u32 installed_mods_count = modioGetAllInstalledModsCount();
Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/08_AddMod.c
Expand Up @@ -18,7 +18,7 @@ void onAddMod(void *object, ModioResponse response, ModioMod mod)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

if (!modioIsLoggedIn())
{
Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/09_GetMod.c
Expand Up @@ -28,7 +28,7 @@ void onGetMod(void *object, ModioResponse response, ModioMod mod)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/10_AddModfile.c
Expand Up @@ -18,7 +18,7 @@ void onAddModfile(u32 response_code, u32 mod_id)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

if (!modioIsLoggedIn())
{
Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/11_EditMod.c
Expand Up @@ -15,7 +15,7 @@ void onEditMod(void *object, ModioResponse response, ModioMod mod)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/12_EditModfile.c
Expand Up @@ -15,7 +15,7 @@ void onEditModfile(void *object, ModioResponse response, ModioModfile modfile)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/13_DeleteModfile.c
Expand Up @@ -15,7 +15,7 @@ void onDeleteModfile(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/14_AddModLogo.c
Expand Up @@ -15,7 +15,7 @@ void onAddModLogo(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/15_AddModImages.c
Expand Up @@ -15,7 +15,7 @@ void onAddModImages(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/16_AddModYoutubeLinks.c
Expand Up @@ -15,7 +15,7 @@ void onAddModYoutubeLinks(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/17_AddModSketchfabLinks.c
Expand Up @@ -15,7 +15,7 @@ void onAddModSketchfabLinks(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/18_DeleteModImages.c
Expand Up @@ -15,7 +15,7 @@ void onDeleteModImages(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/19_DeleteModYoutubeLinks.c
Expand Up @@ -15,7 +15,7 @@ void onDeleteModYoutubeLinks(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/20_DeleteModSketchfabLinks.c
Expand Up @@ -15,7 +15,7 @@ void onDeleteModSketchfabLinks(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/21_DeleteMod.c
Expand Up @@ -15,7 +15,7 @@ void onModDeleted(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/22_GetTags.c
Expand Up @@ -19,7 +19,7 @@ void onGetModTags(void *object, ModioResponse response, ModioTag *tags_array, u3

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/23_AddTags.c
Expand Up @@ -15,7 +15,7 @@ void onAddModTags(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/24_DeleteTags.c
Expand Up @@ -15,7 +15,7 @@ void onDeleteModTags(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/25_SubscribeToMod.c
Expand Up @@ -18,7 +18,7 @@ void onSubscribeToMod(void *object, ModioResponse response, ModioMod mod)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/26_UnsubscribeFromMod.c
Expand Up @@ -16,7 +16,7 @@ void onModUnsubscribed(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/27_Ratings.c
Expand Up @@ -16,7 +16,7 @@ void onAddModRating(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/28_GetMetadataKVP.c
Expand Up @@ -19,7 +19,7 @@ void onGetAllMetadataKVP(void *object, ModioResponse response, ModioMetadataKVP

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/29_AddMetadataKVP.c
Expand Up @@ -15,7 +15,7 @@ void onAddMetadataKVP(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/30_DeleteMetadataKVP.c
Expand Up @@ -15,7 +15,7 @@ void onDeleteMetadataKVP(void *object, ModioResponse response)

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down
2 changes: 1 addition & 1 deletion examples/code-samples/c/31_EventsListener.c
Expand Up @@ -41,7 +41,7 @@ void onEvent(ModioResponse response, ModioModEvent *events_array, u32 events_arr

int main(void)
{
modioInit(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b", NULL);
modioInit(MODIO_ENVIRONMENT_TEST, 7, false, "e91c01b8882f4affeddd56c96111977b", NULL);

bool wait = true;

Expand Down

0 comments on commit 2c313d2

Please sign in to comment.