diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--[-rwxr-xr-x] | indra/newview/llstartup.cpp | 83 |
1 files changed, 27 insertions, 56 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 965aad517d..a2c8e7772e 100755..100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -46,7 +46,6 @@ #include "llaudioengine_openal.h" #endif -#include "llares.h" #include "llavatarnamecache.h" #include "llexperiencecache.h" #include "lllandmark.h" @@ -56,7 +55,6 @@ #include "llerrorcontrol.h" #include "llfloaterreg.h" #include "llfocusmgr.h" -#include "llhttpsender.h" #include "llfloaterimsession.h" #include "lllocationhistory.h" #include "llimageworker.h" @@ -113,7 +111,6 @@ #include "llgroupmgr.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llhttpclient.h" #include "llimagebmp.h" #include "llinventorybridge.h" #include "llinventorymodel.h" @@ -292,20 +289,6 @@ void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is // local classes // -namespace -{ - class LLNullHTTPSender : public LLHTTPSender - { - virtual void send(const LLHost& host, - const std::string& message, const LLSD& body, - LLHTTPClient::ResponderPtr response) const - { - LL_WARNS("AppInit") << " attemped to send " << message << " to " << host - << " with null sender" << LL_ENDL; - } - }; -} - void update_texture_fetch() { LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread @@ -458,13 +441,6 @@ bool idle_startup() // Load the throttle settings gViewerThrottle.load(); - if (ll_init_ares() == NULL || !gAres->isInitialized()) - { - std::string diagnostic = "Could not start address resolution system"; - LL_WARNS("AppInit") << diagnostic << LL_ENDL; - LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().with("DIAGNOSTIC", diagnostic)); - } - // // Initialize messaging system // @@ -509,8 +485,6 @@ bool idle_startup() port = gSavedSettings.getU32("ConnectionPort"); } - LLHTTPSender::setDefaultSender(new LLNullHTTPSender()); - // TODO parameterize const F32 circuit_heartbeat_interval = 5; const F32 circuit_timeout = 100; @@ -713,6 +687,11 @@ bool idle_startup() gRememberPassword = gSavedSettings.getBOOL("RememberPassword"); show_connect_box = TRUE; } + + //setup map of datetime strings to codes and slt & local time offset from utc + // *TODO: Does this need to be here? + LLStringOps::setupDatetimeInfo(false); + // Go to the next startup state LLStartUp::setStartupState( STATE_BROWSER_INIT ); return FALSE; @@ -752,12 +731,9 @@ bool idle_startup() if (gLoginMenuBarView == NULL) { LL_DEBUGS("AppInit") << "initializing menu bar" << LL_ENDL; - display_startup(); initialize_edit_menu(); initialize_spellcheck_menu(); - display_startup(); init_menus(); - display_startup(); } if (show_connect_box) @@ -769,23 +745,17 @@ bool idle_startup() if (gUserCredential.isNull()) { LL_DEBUGS("AppInit") << "loading credentials from gLoginHandler" << LL_ENDL; - display_startup(); gUserCredential = gLoginHandler.initializeLoginInfo(); - display_startup(); } // Make sure the process dialog doesn't hide things - display_startup(); gViewerWindow->setShowProgress(FALSE); - display_startup(); // Show the login dialog login_show(); - display_startup(); // connect dialog is already shown, so fill in the names if (gUserCredential.notNull()) { LLPanelLogin::setFields( gUserCredential, gRememberPassword); } - display_startup(); LLPanelLogin::giveFocus(); // MAINT-3231 Show first run dialog only for Desura viewer @@ -811,22 +781,15 @@ bool idle_startup() LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } - display_startup(); gViewerWindow->setNormalControlsVisible( FALSE ); - display_startup(); gLoginMenuBarView->setVisible( TRUE ); - display_startup(); gLoginMenuBarView->setEnabled( TRUE ); - display_startup(); show_debug_menus(); - display_startup(); // Hide the splash screen LLSplashScreen::hide(); - display_startup(); // Push our window frontmost gViewerWindow->getWindow()->show(); - display_startup(); // DEV-16927. The following code removes errant keystrokes that happen while the window is being // first made visible. @@ -834,9 +797,9 @@ bool idle_startup() MSG msg; while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ) { } - display_startup(); #endif - timeout.reset(); + display_startup(); + timeout.reset(); return FALSE; } @@ -1181,9 +1144,6 @@ bool idle_startup() LLNotificationsUtil::add("ErrorMessage", args, LLSD(), login_alert_done); } } - //setup map of datetime strings to codes and slt & local time offset from utc - // *TODO: Does this need to be here? - LLStringOps::setupDatetimeInfo (false); transition_back_to_login_panel(emsg.str()); show_connect_box = true; } @@ -2775,8 +2735,6 @@ void reset_login() gAgent.cleanup(); LLWorld::getInstance()->destroyClass(); - LLStartUp::setStartupState( STATE_LOGIN_SHOW ); - if ( gViewerWindow ) { // Hide menus and normal buttons gViewerWindow->setNormalControlsVisible( FALSE ); @@ -2786,6 +2744,7 @@ void reset_login() // Hide any other stuff LLFloaterReg::hideVisibleInstances(); + LLStartUp::setStartupState( STATE_BROWSER_INIT ); } //--------------------------------------------------------------------------- @@ -2835,9 +2794,11 @@ void LLStartUp::initNameCache() void LLStartUp::initExperiences() -{ - LLAppViewer::instance()->loadExperienceCache(); - LLExperienceCache::initClass(); +{ + // Should trigger loading the cache. + LLExperienceCache::instance().setCapabilityQuery( + boost::bind(&LLAgent::getRegionCapability, &gAgent, _1)); + LLExperienceLog::instance().initialize(); } @@ -3245,12 +3206,15 @@ bool process_login_success_response() gAgentUsername = first_name; } - if(response.has("last_name") && !gAgentUsername.empty() && (gAgentUsername != "Resident")) + if(response.has("last_name") && !gAgentUsername.empty()) { std::string last_name = response["last_name"].asString(); - LLStringUtil::replaceChar(last_name, '"', ' '); - LLStringUtil::trim(last_name); - gAgentUsername = gAgentUsername + " " + last_name; + if (last_name != "Resident") + { + LLStringUtil::replaceChar(last_name, '"', ' '); + LLStringUtil::trim(last_name); + gAgentUsername = gAgentUsername + " " + last_name; + } } if(gDisplayName.empty()) @@ -3348,6 +3312,13 @@ bool process_login_success_response() { time_t now = time(NULL); gUTCOffset = (server_utc_time - now); + + // Print server timestamp + LLSD substitution; + substitution["datetime"] = (S32)server_utc_time; + std::string timeStr = "[month, datetime, slt] [day, datetime, slt] [year, datetime, slt] [hour, datetime, slt]:[min, datetime, slt]:[second, datetime, slt]"; + LLStringUtil::format(timeStr, substitution); + LL_INFOS("AppInit") << "Server SLT timestamp: " << timeStr << ". Server-viewer time offset before correction: " << gUTCOffset << "s" << LL_ENDL; } } |