Skip to content
Permalink
Browse files

renamed oculus user id param

  • Loading branch information
Turupawn committed Sep 10, 2019
1 parent f2f622d commit 6e6b067a46d99e8164296e34e19c740e736dfe81
@@ -91,7 +91,7 @@ modio_instance.galaxyAuth(appdata, [&](const modio::Response &response)
#### Oculus Auth

```c++
modio_instance.oculusAuth(nonce, user_id, access_token, email, date_expires, [&](const modio::Response &response)
modio_instance.oculusAuth(nonce, oculus_user_id, access_token, email, date_expires, [&](const modio::Response &response)
{
if (response.code == 200)
{
@@ -21,11 +21,11 @@ int main()
// Auth works by providing the Appdata param given by the Oculus SDK
std::string appdata = "";
std::string nonce = "GALAXY NONCE PROOF HERE";
std::string user_id = "123123";
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, user_id, access_token, email, date_expires, [&](const modio::Response &response) {
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)
@@ -24,11 +24,11 @@ int main(void)

// Auth works by providing the data given by the Oculus SDK
char *nonce = "GALAXY NONCE PROOF HERE";
char *user_id = "123123";
char *oculus_user_id = "123123";
char *access_token = "GALAXY AUTH TOKEN HERE";
char *email = NULL; // Optional email param
u32 date_expires = 0; // Optional expiration date param, 0 will be ignored
modioOculusAuth(&wait, nonce, user_id, access_token, email, date_expires, &onOculusAuth);
modioOculusAuth(&wait, nonce, oculus_user_id, access_token, email, date_expires, &onOculusAuth);

while (wait)
{
@@ -79,7 +79,7 @@ class MODIO_DLL Instance

//External Authentication Methods
void galaxyAuth(const std::string &appdata, const std::function<void(const modio::Response &)> &callback);
void oculusAuth(const std::string &nonce, const std::string &user_id, const std::string &access_token, const std::string &email, u32 date_expires, const std::function<void(const modio::Response &)> &callback);
void oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, u32 date_expires, const std::function<void(const modio::Response &)> &callback);
void steamAuth(const unsigned char* rgubTicket, u32 cubTicket, const std::function<void(const modio::Response &)> &callback);
void steamAuthEncoded(const std::string &base64_token, const std::function<void(const modio::Response &)> &callback);
void linkExternalAccount(u32 service, const std::string &service_id, const std::string &email, const std::function<void(const modio::Response &)> &callback);
@@ -529,7 +529,7 @@ extern "C"

//External Authentication Methods
void MODIO_DLL modioGalaxyAuth(void* object, char const* appdata, void (*callback)(void* object, ModioResponse response));
void MODIO_DLL modioOculusAuth(void* object, char const* nonce, char const* user_id, char const* access_token, char const* email, u32 date_expires, void (*callback)(void* object, ModioResponse response));
void MODIO_DLL modioOculusAuth(void* object, char const* nonce, char const* oculus_user_id, char const* access_token, char const* email, u32 date_expires, void (*callback)(void* object, ModioResponse response));
void MODIO_DLL modioSteamAuth(void* object, unsigned char const* rgubTicket, u32 cubTicket, void (*callback)(void* object, ModioResponse response));
void MODIO_DLL modioSteamAuthEncoded(void* object, char const* base64_ticket, void (*callback)(void* object, ModioResponse response));
void MODIO_DLL modioLinkExternalAccount(void* object, u32 service, char const* service_id, char const* email, void (*callback)(void* object, ModioResponse response));
@@ -13,7 +13,7 @@ void Instance::galaxyAuth(const std::string &appdata, const std::function<void(c
current_call_id++;
}

void Instance::oculusAuth(const std::string &nonce, const std::string &user_id, const std::string &access_token, const std::string &email, u32 date_expires, const std::function<void(const modio::Response &)> &callback)
void Instance::oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, u32 date_expires, const std::function<void(const modio::Response &)> &callback)
{
struct GenericCall *oculus_auth_call = new GenericCall{callback};
oculus_auth_calls[current_call_id] = oculus_auth_call;
@@ -22,7 +22,7 @@ void Instance::oculusAuth(const std::string &nonce, const std::string &user_id,
if(email != "")
email_c = (char*)email.c_str();

modioOculusAuth((void*)((uintptr_t)current_call_id), nonce.c_str(), user_id.c_str(), access_token.c_str(), email_c, date_expires, &onOculusAuth);
modioOculusAuth((void*)((uintptr_t)current_call_id), nonce.c_str(), oculus_user_id.c_str(), access_token.c_str(), email_c, date_expires, &onOculusAuth);

current_call_id++;
}
@@ -19,7 +19,7 @@ extern "C"
modio::curlwrapper::post(call_number, url, std::vector<std::string>(), data, &modioOnGalaxyAuth);
}

void modioOculusAuth(void* object, char const* nonce, char const* user_id, char const* access_token, char const* email, u32 date_expires, void (*callback)(void* object, ModioResponse response))
void modioOculusAuth(void* object, char const* nonce, char const* oculus_user_id, char const* access_token, char const* email, u32 date_expires, void (*callback)(void* object, ModioResponse response))
{
u32 call_number = modio::curlwrapper::getCallNumber();

@@ -32,7 +32,7 @@ extern "C"

std::map<std::string, std::string> data;
data["nonce"] = modio::curlwrapper::dataURLEncode(std::string(nonce));
data["user_id"] = modio::curlwrapper::dataURLEncode(std::string(user_id));
data["user_id"] = modio::curlwrapper::dataURLEncode(std::string(oculus_user_id));
data["access_token"] = modio::curlwrapper::dataURLEncode(std::string(access_token));
if(email)
data["email"] = modio::curlwrapper::dataURLEncode(std::string(email));

0 comments on commit 6e6b067

Please sign in to comment.
You can’t perform that action at this time.