Permalink
Please sign in to comment.
Browse files
Merge pull request #78 from Turupawn/devel
Storing current user on cache functionality
- Loading branch information...
Showing
with
105 additions
and 11 deletions.
- +26 −0 examples/code-samples/c++/53_GetCurrentUser.cpp
- +22 −0 examples/code-samples/c/53_GetAuthenticatedUser.c
- +1 −0 examples/code-samples/c/modio_c.h
- +1 −0 include/Globals.h
- +2 −0 include/ModioUtility.h
- +1 −0 include/c++/ModIOInstance.h
- +1 −0 include/c/ModioC.h
- +1 −0 src/Globals.cpp
- +15 −4 src/ModioUtility.cpp
- +8 −0 src/c++/methods/AuthenticationInstanceMethods.cpp
- +5 −0 src/c/methods/AuthenticationMethods.cpp
- +4 −3 src/c/methods/callbacks/AuthenticationCallbacks.cpp
- +9 −4 src/c/methods/callbacks/MeCallbacks.cpp
- +9 −0 src/modio.cpp
@@ -0,0 +1,26 @@ | |||
#include "modio.h" | |||
|
|||
int main(void) | |||
{ | |||
modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b"); | |||
|
|||
volatile static bool finished = false; | |||
|
|||
auto finish = [&]() { | |||
finished = true; | |||
}; | |||
|
|||
// Use getCurrentUser in conjuction with the isLoggedIn to check the current user cache | |||
if(modio_instance.isLoggedIn()) | |||
{ | |||
std::cout << "Logged in as " << modio_instance.getCurrentUser().username << std::endl; | |||
}else | |||
{ | |||
std::cout << "You are not logged in." << std::endl; | |||
} | |||
|
|||
|
|||
std::cout << "Process finished" << std::endl; | |||
|
|||
return 0; | |||
} |
@@ -0,0 +1,22 @@ | |||
#include "modio_c.h" | |||
|
|||
int main(void) | |||
{ | |||
modioInit(MODIO_ENVIRONMENT_TEST, 7, (char *)"e91c01b8882f4affeddd56c96111977b", NULL); | |||
|
|||
// Use modioGetCurrentUser in conjuction with the modioIsLoggedIn to check the current user cache | |||
if(modioIsLoggedIn()) | |||
{ | |||
printf("Logged in as %s\n", modioGetCurrentUser().username); | |||
}else | |||
{ | |||
printf("You are not logged in.\n"); | |||
} | |||
|
|||
|
|||
modioShutdown(); | |||
|
|||
printf("Process finished\n"); | |||
|
|||
return 0; | |||
} |
0 comments on commit
4b6859e