diff --git a/include/Utility.h b/include/Utility.h index 32ea659f..383ca8d1 100644 --- a/include/Utility.h +++ b/include/Utility.h @@ -36,6 +36,7 @@ namespace modio std::string MODIO_DLL toString(i32 number); std::string MODIO_DLL toString(u32 number); std::string MODIO_DLL toString(double number); +std::string MODIO_DLL toString(bool boolean); std::string replaceSubstrings(const std::string &str, const std::string &from, const std::string &to); std::string addSlashIfNeeded(const std::string &directory_path); std::string getFilename(std::string file_path); diff --git a/include/c++/ModIOInstance.h b/include/c++/ModIOInstance.h index 9eb16300..082f3d2b 100644 --- a/include/c++/ModIOInstance.h +++ b/include/c++/ModIOInstance.h @@ -67,10 +67,10 @@ class MODIO_DLL Instance modio::User getCurrentUser(); //External Authentication Methods - void galaxyAuth(const std::string &appdata, const std::function &callback); - void oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, const std::string &device, u32 date_expires, const std::function &callback); - void steamAuth(const unsigned char* rgubTicket, u32 cubTicket, const std::function &callback); - void steamAuthEncoded(const std::string &base64_token, const std::function &callback); + void galaxyAuth(const std::string &appdata, bool terms_agreed, const std::function &callback); + void oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, const std::string &device, u32 date_expires, bool terms_agreed, const std::function &callback); + void steamAuth(const unsigned char* rgubTicket, u32 cubTicket, bool terms_agreed, const std::function &callback); + void steamAuthEncoded(const std::string &base64_token, bool terms_agreed, const std::function &callback); void linkExternalAccount(u32 service, const std::string &service_id, const std::string &email, const std::function &callback); void getTerms(u32 service, const std::function& callback); diff --git a/src/Utility.cpp b/src/Utility.cpp index 977508bc..c824e7dd 100644 --- a/src/Utility.cpp +++ b/src/Utility.cpp @@ -118,6 +118,11 @@ std::string toString(double number) return std::to_string(number); } +std::string toString(bool boolean) +{ + return boolean ? "true" : "false"; +} + std::string replaceSubstrings(const std::string &str, const std::string &from, const std::string &to) { std::string return_value = str; diff --git a/src/c++/methods/ExternalAuthenticationInstanceMethods.cpp b/src/c++/methods/ExternalAuthenticationInstanceMethods.cpp index 82f5424c..7f6ea05d 100644 --- a/src/c++/methods/ExternalAuthenticationInstanceMethods.cpp +++ b/src/c++/methods/ExternalAuthenticationInstanceMethods.cpp @@ -5,18 +5,18 @@ namespace modio { -void Instance::galaxyAuth(const std::string &appdata, const std::function &callback) +void Instance::galaxyAuth(const std::string &appdata, bool terms_agreed, const std::function &callback) { struct GenericCall *galaxy_auth_call = new GenericCall{callback}; galaxy_auth_calls[current_call_id] = galaxy_auth_call; // @todonow: Update c++ interface - modioGalaxyAuth((void*)((uintptr_t)current_call_id), appdata.c_str(), false, &onGalaxyAuth); + modioGalaxyAuth((void*)((uintptr_t)current_call_id), appdata.c_str(), terms_agreed, &onGalaxyAuth); current_call_id++; } -void Instance::oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, const std::string &device, u32 date_expires, const std::function &callback) +void Instance::oculusAuth(const std::string &nonce, const std::string &oculus_user_id, const std::string &access_token, const std::string &email, const std::string &device, u32 date_expires, bool terms_agreed, const std::function &callback) { struct GenericCall *oculus_auth_call = new GenericCall{callback}; oculus_auth_calls[current_call_id] = oculus_auth_call; @@ -26,29 +26,29 @@ void Instance::oculusAuth(const std::string &nonce, const std::string &oculus_us email_c = (char*)email.c_str(); // @todonow: Update c++ interface - modioOculusAuth((void*)((uintptr_t)current_call_id), nonce.c_str(), oculus_user_id.c_str(), access_token.c_str(), email_c, device.c_str(), date_expires, false, &onOculusAuth); + modioOculusAuth((void*)((uintptr_t)current_call_id), nonce.c_str(), oculus_user_id.c_str(), access_token.c_str(), email_c, device.c_str(), date_expires, terms_agreed, &onOculusAuth); current_call_id++; } -void Instance::steamAuth(const unsigned char* rgubTicket, u32 cubTicket, const std::function &callback) +void Instance::steamAuth(const unsigned char* rgubTicket, u32 cubTicket, bool terms_agreed, const std::function &callback) { struct GenericCall *steam_auth_call = new GenericCall{callback}; steam_auth_calls[current_call_id] = steam_auth_call; // @todonow: Update c++ interface - modioSteamAuth((void*)((uintptr_t)current_call_id), rgubTicket, cubTicket, true, &onSteamAuth); + modioSteamAuth((void*)((uintptr_t)current_call_id), rgubTicket, cubTicket, terms_agreed, &onSteamAuth); current_call_id++; } -void Instance::steamAuthEncoded(const std::string &base64_ticket, const std::function &callback) +void Instance::steamAuthEncoded(const std::string &base64_ticket, bool terms_agreed, const std::function &callback) { struct GenericCall *steam_auth_encoded_call = new GenericCall{callback}; steam_auth_encoded_calls[current_call_id] = steam_auth_encoded_call; // @todonow: Update c++ interface - modioSteamAuthEncoded((void*)((uintptr_t)current_call_id), base64_ticket.c_str(), false, &onSteamAuthEncoded); + modioSteamAuthEncoded((void*)((uintptr_t)current_call_id), base64_ticket.c_str(), terms_agreed, &onSteamAuthEncoded); current_call_id++; }