diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-08-28 14:05:00 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-08-28 14:05:00 +0100 |
commit | 218584593a7815f7494be58a7b36774c47fd047f (patch) | |
tree | 0a230b602538349a1954e4456f7af6ce58dce08e /indra/newview | |
parent | a254ca8b442e0a17e7048b792fbba48c8db592ee (diff) | |
parent | b3ceeb6d9cf92613a06337b5985e225c612e53d5 (diff) |
merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lllogininstance.cpp | 29 | ||||
-rw-r--r-- | indra/newview/lllogininstance.h | 3 | ||||
-rw-r--r-- | indra/newview/tests/lllogininstance_test.cpp | 107 |
4 files changed, 29 insertions, 112 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4ab19b714f..f43612d1c8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -735,7 +735,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString(), getOSInfo().getOSStringSimple()); } LLAppViewer::~LLAppViewer() diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index b4d0bb6823..bacd88e0e0 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -59,10 +59,16 @@ #include "llupdaterservice.h" #include "llevents.h" #include "llappviewer.h" +#include "llsdserialize.h" #include <boost/scoped_ptr.hpp> #include <sstream> +// this can be removed once it is defined by the build for all forks +#ifndef ADDRESS_SIZE +# define ADDRESS_SIZE 32 +#endif + class LLLoginInstance::Disposable { public: virtual ~Disposable() {} @@ -493,10 +499,12 @@ LLLoginInstance::LLLoginInstance() : } void LLLoginInstance::setPlatformInfo(const std::string platform, - const std::string platform_version) + const std::string platform_version, + const std::string platform_name) { mPlatform = platform; mPlatformVersion = platform_version; + mPlatformVersionName = platform_name; } LLLoginInstance::~LLLoginInstance() @@ -565,7 +573,6 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia requested_options.append("event_notifications"); requested_options.append("classified_categories"); requested_options.append("adult_compliant"); - //requested_options.append("inventory-targets"); requested_options.append("buddy-list"); requested_options.append("newuser-config"); requested_options.append("ui-config"); @@ -587,8 +594,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia requested_options.append("god-connect"); } - // (re)initialize the request params with creds. - LLSD request_params = user_credential->getLoginParams(); + LLSD request_params; unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; if ( ! llHashedUniqueID(hashed_unique_id_string) ) @@ -605,11 +611,26 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia request_params["version"] = LLVersionInfo::getVersion(); request_params["channel"] = LLVersionInfo::getChannel(); request_params["platform"] = mPlatform; + request_params["address_size"] = ADDRESS_SIZE; request_params["platform_version"] = mPlatformVersion; + request_params["platform_string"] = mPlatformVersionName; request_params["id0"] = mSerialNumber; request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args + // log request_params _before_ adding the credentials + LL_DEBUGS("LLLogin") << "Login parameters: " << LLSDOStreamer<LLSDNotationFormatter>(request_params) << LL_ENDL; + + // Copy the credentials into the request after logging the rest + LLSD credentials(user_credential->getLoginParams()); + for (LLSD::map_const_iterator it = credentials.beginMap(); + it != credentials.endMap(); + it++ + ) + { + request_params[it->first] = it->second; + } + mRequestData.clear(); mRequestData["method"] = "login_to_simulator"; mRequestData["params"] = request_params; diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 282ddc1cea..1adea67189 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -67,7 +67,7 @@ public: void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } - void setPlatformInfo(const std::string platform, const std::string platform_version); + void setPlatformInfo(const std::string platform, const std::string platform_version, const std::string platform_name); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } @@ -105,6 +105,7 @@ private: S32 mLastExecDuration; std::string mPlatform; std::string mPlatformVersion; + std::string mPlatformVersionName; UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; LLUpdaterService * mUpdaterService; diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b603157ca7..978678a09c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -362,7 +362,7 @@ namespace tut accountCredential->setCredentialData(identifier, authenticator); logininstance->setNotificationsInterface(¬ifications); - logininstance->setPlatformInfo("win", "1.3.5"); + logininstance->setPlatformInfo("win", "1.3.5", "Windows Bogus Version 100.6.6.6"); } LLLoginInstance* logininstance; @@ -478,109 +478,4 @@ namespace tut ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false); } - template<> template<> - void lllogininstance_object::test<3>() - { - set_test_name("Test Mandatory Update User Accepts"); - - // Part 1 - Mandatory Update, with User accepts response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<4>() - { - set_test_name("Test Mandatory Update User Decline"); - - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<6>() - { - set_test_name("Test Optional Update User Accept"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<7>() - { - set_test_name("Test Optional Update User Denies"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - // User skips, should be reconnecting. - ensure_equals("reconnect uri", gLoginURI, VIEWERLOGIN_URI); - ensure_equals("skipping optional update", gLoginCreds["params"]["skipoptional"].asBoolean(), true); - } } |