aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r--linden/indra/newview/llstartup.cpp211
1 files changed, 151 insertions, 60 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index ea08298..9b46054 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -29,7 +29,14 @@
29 * $/LicenseInfo$ 29 * $/LicenseInfo$
30 */ 30 */
31 31
32#include "llviewerprecompiledheaders.h" 32// #include "llviewerprecompiledheaders.h"
33
34
35#if LL_WINDOWS
36 #define WIN32_LEAN_AND_MEAN
37 #include <winsock2.h>
38 #include <windows.h>
39#endif
33 40
34#include "llstartup.h" 41#include "llstartup.h"
35 42
@@ -190,6 +197,8 @@
190#include "lldxhardware.h" 197#include "lldxhardware.h"
191#endif 198#endif
192 199
200#include "hippoGridManager.h"
201#include "hippoLimits.h"
193// 202//
194// exported globals 203// exported globals
195// 204//
@@ -222,7 +231,8 @@ static std::string sInitialOutfitGender; // "male" or "female"
222static bool gUseCircuitCallbackCalled = false; 231static bool gUseCircuitCallbackCalled = false;
223 232
224EStartupState LLStartUp::gStartupState = STATE_FIRST; 233EStartupState LLStartUp::gStartupState = STATE_FIRST;
225 234bool LLStartUp::mStartedOnce = false;
235bool LLStartUp::mShouldAutoLogin = false;
226 236
227// 237//
228// local function declaration 238// local function declaration
@@ -248,7 +258,6 @@ void dialog_choose_gender_first_start();
248void callback_choose_gender(S32 option, void* userdata); 258void callback_choose_gender(S32 option, void* userdata);
249void init_start_screen(S32 location_id); 259void init_start_screen(S32 location_id);
250void release_start_screen(); 260void release_start_screen();
251void reset_login();
252void apply_udp_blacklist(const std::string& csv); 261void apply_udp_blacklist(const std::string& csv);
253 262
254void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) 263void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data)
@@ -322,6 +331,7 @@ bool idle_startup()
322 static S32 timeout_count = 0; 331 static S32 timeout_count = 0;
323 332
324 static LLTimer login_time; 333 static LLTimer login_time;
334 static LLFrameTimer wearables_timer;
325 335
326 // until this is encapsulated, this little hack for the 336 // until this is encapsulated, this little hack for the
327 // auth/transform loop will do. 337 // auth/transform loop will do.
@@ -659,7 +669,7 @@ bool idle_startup()
659 669
660 show_connect_box = false; 670 show_connect_box = false;
661 } 671 }
662 else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) 672 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin())
663 { 673 {
664 LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); 674 LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo");
665 firstname = cmd_line_login[0].asString(); 675 firstname = cmd_line_login[0].asString();
@@ -695,10 +705,10 @@ bool idle_startup()
695 else 705 else
696 { 706 {
697 // if not automatically logging in, display login dialog 707 // if not automatically logging in, display login dialog
698 // a valid grid is selected
699 firstname = gSavedSettings.getString("FirstName"); 708 firstname = gSavedSettings.getString("FirstName");
700 lastname = gSavedSettings.getString("LastName"); 709 lastname = gSavedSettings.getString("LastName");
701 password = load_password_from_disk(); 710 password = load_password_from_disk();
711
702 remember_password = gSavedSettings.getBOOL("RememberPassword"); 712 remember_password = gSavedSettings.getBOOL("RememberPassword");
703 show_connect_box = true; 713 show_connect_box = true;
704 } 714 }
@@ -726,12 +736,19 @@ bool idle_startup()
726 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) 736 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState())
727 { 737 {
728 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; 738 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL;
739 sAuthUris.clear();
740 sAuthUriNum = -1;
729 741
730 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 742 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
731 // Push our window frontmost 743 // Push our window frontmost
732 gViewerWindow->getWindow()->show(); 744 gViewerWindow->getWindow()->show();
733 745
734 timeout_count = 0; 746 timeout_count = 0;
747
748 if(LLStartUp::shouldAutoLogin())
749 {
750 show_connect_box = false;
751 }
735 752
736 if (show_connect_box) 753 if (show_connect_box)
737 { 754 {
@@ -814,6 +831,18 @@ bool idle_startup()
814 lastname = gLoginHandler.mLastName; 831 lastname = gLoginHandler.mLastName;
815 web_login_key = gLoginHandler.mWebLoginKey; 832 web_login_key = gLoginHandler.mWebLoginKey;
816 } 833 }
834
835 if(!gLoginHandler.mPassword.empty())
836 {
837 firstname = gLoginHandler.mFirstName;
838 lastname = gLoginHandler.mLastName;
839 password = gLoginHandler.mPassword;
840
841 gLoginHandler.mFirstName = "";
842 gLoginHandler.mLastName = "";
843 gLoginHandler.mPassword = "";
844 LLStartUp::setShouldAutoLogin(false);
845 }
817 846
818 if (show_connect_box) 847 if (show_connect_box)
819 { 848 {
@@ -841,13 +870,14 @@ bool idle_startup()
841 } 870 }
842 gSavedSettings.setBOOL("RememberPassword", remember_password); 871 gSavedSettings.setBOOL("RememberPassword", remember_password);
843 872
844 LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL; 873 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
845 gDebugInfo["LoginName"] = firstname + " " + lastname; 874 gDebugInfo["LoginName"] = firstname + " " + lastname;
846 } 875 }
847 876
877 gHippoGridManager->setCurrentGridAsConnected();
848 // create necessary directories 878 // create necessary directories
849 // *FIX: these mkdir's should error check 879 // *FIX: these mkdir's should error check
850 gDirUtilp->setLindenUserDir(firstname, lastname); 880 gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
851 LLFile::mkdir(gDirUtilp->getLindenUserDir()); 881 LLFile::mkdir(gDirUtilp->getLindenUserDir());
852 882
853 // Set PerAccountSettingsFile to the default value. 883 // Set PerAccountSettingsFile to the default value.
@@ -878,7 +908,7 @@ bool idle_startup()
878 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 908 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
879 } 909 }
880 910
881 gDirUtilp->setPerAccountChatLogsDir(firstname, lastname); 911 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
882 912
883 LLFile::mkdir(gDirUtilp->getChatLogsDir()); 913 LLFile::mkdir(gDirUtilp->getChatLogsDir());
884 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 914 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
@@ -1054,6 +1084,10 @@ bool idle_startup()
1054 LLStringUtil::format_map_t args; 1084 LLStringUtil::format_map_t args;
1055 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); 1085 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle();
1056 auth_desc = LLTrans::getString("LoginInProgress", args); 1086 auth_desc = LLTrans::getString("LoginInProgress", args);
1087
1088 //Since we are about to login, we don't want the client to attempt auto login
1089 //again until the user does a grid2grid teleport.
1090 LLStartUp::setShouldAutoLogin(false);
1057 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); 1091 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
1058 } 1092 }
1059 1093
@@ -1093,13 +1127,15 @@ bool idle_startup()
1093 hashed_mac.hex_digest(hashed_mac_string); 1127 hashed_mac.hex_digest(hashed_mac_string);
1094 1128
1095 // TODO if statement here to use web_login_key 1129 // TODO if statement here to use web_login_key
1130 if(web_login_key.isNull()){
1096 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); 1131 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
1097 LLUserAuth::getInstance()->authenticate( 1132 LLUserAuth::getInstance()->authenticate(
1098 sAuthUris[sAuthUriNum], 1133 sAuthUris[sAuthUriNum],
1099 auth_method, 1134 auth_method,
1100 firstname, 1135 firstname,
1101 lastname, 1136 lastname,
1102 password, // web_login_key, 1137 password,
1138 //web_login_key,
1103 start.str(), 1139 start.str(),
1104 gSkipOptionalUpdate, 1140 gSkipOptionalUpdate,
1105 gAcceptTOS, 1141 gAcceptTOS,
@@ -1108,6 +1144,22 @@ bool idle_startup()
1108 requested_options, 1144 requested_options,
1109 hashed_mac_string, 1145 hashed_mac_string,
1110 LLAppViewer::instance()->getSerialNumber()); 1146 LLAppViewer::instance()->getSerialNumber());
1147 } else {
1148 LLUserAuth::getInstance()->authenticate(
1149 sAuthUris[sAuthUriNum],
1150 auth_method,
1151 firstname,
1152 lastname,
1153 web_login_key,
1154 start.str(),
1155 gSkipOptionalUpdate,
1156 gAcceptTOS,
1157 gAcceptCriticalMessage,
1158 gLastExecEvent,
1159 requested_options,
1160 hashed_mac_string,
1161 LLAppViewer::instance()->getSerialNumber());
1162 }
1111 1163
1112 // reset globals 1164 // reset globals
1113 gAcceptTOS = FALSE; 1165 gAcceptTOS = FALSE;
@@ -1167,7 +1219,6 @@ bool idle_startup()
1167 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; 1219 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
1168 std::ostringstream emsg; 1220 std::ostringstream emsg;
1169 bool quit = false; 1221 bool quit = false;
1170 bool update = false;
1171 std::string login_response; 1222 std::string login_response;
1172 std::string reason_response; 1223 std::string reason_response;
1173 std::string message_response; 1224 std::string message_response;
@@ -1211,7 +1262,11 @@ bool idle_startup()
1211 reason_response = LLUserAuth::getInstance()->getResponse("reason"); 1262 reason_response = LLUserAuth::getInstance()->getResponse("reason");
1212 message_response = LLUserAuth::getInstance()->getResponse("message"); 1263 message_response = LLUserAuth::getInstance()->getResponse("message");
1213 1264
1214 if (!message_response.empty()) 1265 if (gHideLinks && reason_response == "disabled")
1266 {
1267 emsg << gDisabledMessage;
1268 }
1269 else if (!message_response.empty())
1215 { 1270 {
1216 // XUI: fix translation for strings returned during login 1271 // XUI: fix translation for strings returned during login
1217 // We need a generic table for translations 1272 // We need a generic table for translations
@@ -1269,7 +1324,16 @@ bool idle_startup()
1269 if(reason_response == "update") 1324 if(reason_response == "update")
1270 { 1325 {
1271 auth_message = LLUserAuth::getInstance()->getResponse("message"); 1326 auth_message = LLUserAuth::getInstance()->getResponse("message");
1272 update = true; 1327 if (show_connect_box)
1328 {
1329 update_app(TRUE, auth_message);
1330 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1331 return false;
1332 }
1333 else
1334 {
1335 quit = true;
1336 }
1273 } 1337 }
1274 if(reason_response == "optional") 1338 if(reason_response == "optional")
1275 { 1339 {
@@ -1307,21 +1371,6 @@ bool idle_startup()
1307 break; 1371 break;
1308 } 1372 }
1309 1373
1310 if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
1311 {
1312 gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
1313 if (show_connect_box)
1314 {
1315 update_app(TRUE, auth_message);
1316 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1317 return false;
1318 }
1319 else
1320 {
1321 quit = true;
1322 }
1323 }
1324
1325 // Version update and we're not showing the dialog 1374 // Version update and we're not showing the dialog
1326 if(quit) 1375 if(quit)
1327 { 1376 {
@@ -1534,6 +1583,42 @@ bool idle_startup()
1534 } 1583 }
1535 } 1584 }
1536 1585
1586 // Override grid info with anything sent in the login response
1587 std::string tmp = LLUserAuth::getInstance()->getResponse("gridname");
1588 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
1589 tmp = LLUserAuth::getInstance()->getResponse("loginuri");
1590 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
1591 tmp = LLUserAuth::getInstance()->getResponse("welcome");
1592 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1593 tmp = LLUserAuth::getInstance()->getResponse("loginpage");
1594 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1595 tmp = LLUserAuth::getInstance()->getResponse("economy");
1596 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1597 tmp = LLUserAuth::getInstance()->getResponse("helperuri");
1598 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
1599 tmp = LLUserAuth::getInstance()->getResponse("about");
1600 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1601 tmp = LLUserAuth::getInstance()->getResponse("website");
1602 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1603 tmp = LLUserAuth::getInstance()->getResponse("help");
1604 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1605 tmp = LLUserAuth::getInstance()->getResponse("support");
1606 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
1607 tmp = LLUserAuth::getInstance()->getResponse("register");
1608 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1609 tmp = LLUserAuth::getInstance()->getResponse("account");
1610 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
1611 tmp = LLUserAuth::getInstance()->getResponse("password");
1612 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
1613 tmp = LLUserAuth::getInstance()->getResponse("search");
1614 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
1615 tmp = LLUserAuth::getInstance()->getResponse("currency");
1616 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
1617 tmp = LLUserAuth::getInstance()->getResponse("real_currency");
1618 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
1619 tmp = LLUserAuth::getInstance()->getResponse("directory_fee");
1620 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
1621 gHippoGridManager->saveFile();
1537 1622
1538 // JC: gesture loading done below, when we have an asset system 1623 // JC: gesture loading done below, when we have an asset system
1539 // in place. Don't delete/clear user_credentials until then. 1624 // in place. Don't delete/clear user_credentials until then.
@@ -1558,8 +1643,10 @@ bool idle_startup()
1558 LLStringUtil::format_map_t args; 1643 LLStringUtil::format_map_t args;
1559 args["[ERROR_MESSAGE]"] = emsg.str(); 1644 args["[ERROR_MESSAGE]"] = emsg.str();
1560 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1645 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1561 reset_login(); 1646 LLStartUp::resetLogin();
1562 gSavedSettings.setBOOL("AutoLogin", FALSE); 1647 gSavedSettings.setBOOL("AutoLogin", FALSE);
1648 //this might be redundant
1649 LLStartUp::setShouldAutoLogin(false);
1563 show_connect_box = true; 1650 show_connect_box = true;
1564 } 1651 }
1565 1652
@@ -1578,8 +1665,10 @@ bool idle_startup()
1578 LLStringUtil::format_map_t args; 1665 LLStringUtil::format_map_t args;
1579 args["[ERROR_MESSAGE]"] = emsg.str(); 1666 args["[ERROR_MESSAGE]"] = emsg.str();
1580 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1667 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done);
1581 reset_login(); 1668 LLStartUp::resetLogin();
1582 gSavedSettings.setBOOL("AutoLogin", FALSE); 1669 gSavedSettings.setBOOL("AutoLogin", FALSE);
1670 //this might be redundant
1671 LLStartUp::setShouldAutoLogin(false);
1583 show_connect_box = true; 1672 show_connect_box = true;
1584 // Don't save an incorrect password to disk. 1673 // Don't save an incorrect password to disk.
1585 save_password_to_disk(NULL); 1674 save_password_to_disk(NULL);
@@ -1593,6 +1682,7 @@ bool idle_startup()
1593 if (STATE_WORLD_INIT == LLStartUp::getStartupState()) 1682 if (STATE_WORLD_INIT == LLStartUp::getStartupState())
1594 { 1683 {
1595 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); 1684 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD);
1685 gDisconnected=FALSE;
1596 display_startup(); 1686 display_startup();
1597 // We should have an agent id by this point. 1687 // We should have an agent id by this point.
1598 llassert(!(gAgentID == LLUUID::null)); 1688 llassert(!(gAgentID == LLUUID::null));
@@ -1621,10 +1711,11 @@ bool idle_startup()
1621 LLWaterParamManager::initClass(); 1711 LLWaterParamManager::initClass();
1622 1712
1623 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering 1713 // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering
1714
1715 if (!LLStartUp::getStartedOnce())
1624 LLViewerObject::initVOClasses(); 1716 LLViewerObject::initVOClasses();
1625 1717
1626 display_startup(); 1718 display_startup();
1627
1628 // This is where we used to initialize gWorldp. Original comment said: 1719 // This is where we used to initialize gWorldp. Original comment said:
1629 // World initialization must be done after above window init 1720 // World initialization must be done after above window init
1630 1721
@@ -1767,7 +1858,7 @@ bool idle_startup()
1767 //reset statistics 1858 //reset statistics
1768 LLViewerStats::getInstance()->resetStats(); 1859 LLViewerStats::getInstance()->resetStats();
1769 1860
1770 if (!gNoRender) 1861 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
1771 { 1862 {
1772 // 1863 //
1773 // Set up all of our statistics UI stuff. 1864 // Set up all of our statistics UI stuff.
@@ -2039,6 +2130,7 @@ bool idle_startup()
2039 LLAvatarTracker::instance().addBuddyList(list); 2130 LLAvatarTracker::instance().addBuddyList(list);
2040 } 2131 }
2041 2132
2133 /*
2042 options.clear(); 2134 options.clear();
2043 if(LLUserAuth::getInstance()->getOptions("ui-config", options)) 2135 if(LLUserAuth::getInstance()->getOptions("ui-config", options))
2044 { 2136 {
@@ -2057,6 +2149,7 @@ bool idle_startup()
2057 } 2149 }
2058 } 2150 }
2059 } 2151 }
2152 */
2060 options.clear(); 2153 options.clear();
2061 bool show_hud = false; 2154 bool show_hud = false;
2062 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) 2155 if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options))
@@ -2144,6 +2237,7 @@ bool idle_startup()
2144 // Create the inventory views 2237 // Create the inventory views
2145 llinfos << "Creating Inventory Views" << llendl; 2238 llinfos << "Creating Inventory Views" << llendl;
2146 LLInventoryView::showAgentInventory(); 2239 LLInventoryView::showAgentInventory();
2240 llinfos << "Inventory Views Created" << llendl;
2147 2241
2148 // Hide the inventory if it wasn't shown at exit 2242 // Hide the inventory if it wasn't shown at exit
2149 if(!shown_at_exit) 2243 if(!shown_at_exit)
@@ -2207,7 +2301,7 @@ bool idle_startup()
2207 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); 2301 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
2208 }; 2302 };
2209 2303
2210 if (!gNoRender) 2304 if ((!gNoRender)&&(!LLStartUp::getStartedOnce()))
2211 { 2305 {
2212 // JC: Initializing audio requests many sounds for download. 2306 // JC: Initializing audio requests many sounds for download.
2213 init_audio(); 2307 init_audio();
@@ -2367,25 +2461,11 @@ bool idle_startup()
2367 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); 2461 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2368 } 2462 }
2369 2463
2370
2371 // We now have an inventory skeleton, so if this is a user's first
2372 // login, we can start setting up their clothing and avatar
2373 // appearance. This helps to avoid the generic "Ruth" avatar in
2374 // the orientation island tutorial experience. JC
2375 if (gAgent.isFirstLogin()
2376 && !sInitialOutfit.empty() // registration set up an outfit
2377 && !sInitialOutfitGender.empty() // and a gender
2378 && gAgent.getAvatarObject() // can't wear clothes without object
2379 && !gAgent.isGenderChosen() ) // nothing already loading
2380 {
2381 // Start loading the wearables, textures, gestures
2382 LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
2383 }
2384
2385 // wait precache-delay and for agent's avatar or a lot longer. 2464 // wait precache-delay and for agent's avatar or a lot longer.
2386 if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) 2465 if(((timeout_frac > 1.f) && gAgent.getAvatarObject())
2387 || (timeout_frac > 3.f)) 2466 || (timeout_frac > 3.f))
2388 { 2467 {
2468 wearables_timer.reset();
2389 LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); 2469 LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
2390 } 2470 }
2391 else 2471 else
@@ -2401,7 +2481,6 @@ bool idle_startup()
2401 2481
2402 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) 2482 if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState())
2403 { 2483 {
2404 static LLFrameTimer wearables_timer;
2405 2484
2406 const F32 wearables_time = wearables_timer.getElapsedTimeF32(); 2485 const F32 wearables_time = wearables_timer.getElapsedTimeF32();
2407 const F32 MAX_WEARABLES_TIME = 10.f; 2486 const F32 MAX_WEARABLES_TIME = 10.f;
@@ -2509,6 +2588,7 @@ bool idle_startup()
2509 LLUserAuth::getInstance()->reset(); 2588 LLUserAuth::getInstance()->reset();
2510 2589
2511 LLStartUp::setStartupState( STATE_STARTED ); 2590 LLStartUp::setStartupState( STATE_STARTED );
2591 LLStartUp::setStartedOnce(true);
2512 2592
2513 // Unmute audio if desired and setup volumes. 2593 // Unmute audio if desired and setup volumes.
2514 // Unmute audio if desired and setup volumes. 2594 // Unmute audio if desired and setup volumes.
@@ -2525,7 +2605,7 @@ bool idle_startup()
2525 gDebugView->mFastTimerView->setVisible(TRUE); 2605 gDebugView->mFastTimerView->setVisible(TRUE);
2526#endif 2606#endif
2527 2607
2528 LLAppViewer::instance()->handleLoginComplete(); 2608 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init");
2529 2609
2530 return TRUE; 2610 return TRUE;
2531 } 2611 }
@@ -2555,14 +2635,15 @@ void login_show()
2555 // UI textures have been previously loaded in doPreloadImages() 2635 // UI textures have been previously loaded in doPreloadImages()
2556 2636
2557 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; 2637 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL;
2558 LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL;
2559 2638
2639 //KOW
2640/*
2560 LLViewerLogin* vl = LLViewerLogin::getInstance(); 2641 LLViewerLogin* vl = LLViewerLogin::getInstance();
2561 for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) 2642 for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index)
2562 { 2643 {
2563 LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); 2644 LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index);
2564 } 2645 }
2565 LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); 2646*/
2566} 2647}
2567 2648
2568// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2649// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
@@ -2841,6 +2922,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
2841 2922
2842void update_dialog_callback(S32 option, void *userdata) 2923void update_dialog_callback(S32 option, void *userdata)
2843{ 2924{
2925 std::string update_exe_path;
2844 bool mandatory = userdata != NULL; 2926 bool mandatory = userdata != NULL;
2845 2927
2846#if !LL_RELEASE_FOR_DOWNLOAD 2928#if !LL_RELEASE_FOR_DOWNLOAD
@@ -2857,8 +2939,6 @@ void update_dialog_callback(S32 option, void *userdata)
2857 if (mandatory) 2939 if (mandatory)
2858 { 2940 {
2859 LLAppViewer::instance()->forceQuit(); 2941 LLAppViewer::instance()->forceQuit();
2860 // Bump them back to the login screen.
2861 //reset_login();
2862 } 2942 }
2863 else 2943 else
2864 { 2944 {
@@ -2883,7 +2963,7 @@ void update_dialog_callback(S32 option, void *userdata)
2883 // *TODO constantize this guy 2963 // *TODO constantize this guy
2884 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 2964 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
2885 2965
2886 if(LLAppViewer::sUpdaterInfo) 2966/* if(LLAppViewer::sUpdaterInfo)
2887 { 2967 {
2888 delete LLAppViewer::sUpdaterInfo ; 2968 delete LLAppViewer::sUpdaterInfo ;
2889 } 2969 }
@@ -2956,14 +3036,16 @@ void update_dialog_callback(S32 option, void *userdata)
2956 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; 3036 LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL;
2957 3037
2958 // Run the auto-updater. 3038 // Run the auto-updater.
2959 system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ 3039*/
2960 3040 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
3041/*
2961#elif LL_LINUX 3042#elif LL_LINUX
2962 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 3043 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
2963 "Please download the latest version from www.secondlife.com.", 3044 "Please download the latest version from www.secondlife.com.",
2964 LLStringUtil::null, OSMB_OK); 3045 LLStringUtil::null, OSMB_OK);
2965#endif 3046#endif
2966 LLAppViewer::instance()->forceQuit(); 3047 LLAppViewer::instance()->forceQuit();
3048 */
2967} 3049}
2968 3050
2969void use_circuit_callback(void**, S32 result) 3051void use_circuit_callback(void**, S32 result)
@@ -2979,7 +3061,7 @@ void use_circuit_callback(void**, S32 result)
2979 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; 3061 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
2980 gViewerWindow->alertXml("LoginPacketNeverReceived", 3062 gViewerWindow->alertXml("LoginPacketNeverReceived",
2981 login_alert_status, NULL); 3063 login_alert_status, NULL);
2982 reset_login(); 3064 LLStartUp::resetLogin();
2983 } 3065 }
2984 else 3066 else
2985 { 3067 {
@@ -3929,7 +4011,16 @@ void LLStartUp::setStartupState( EStartupState state )
3929} 4011}
3930 4012
3931 4013
3932void reset_login() 4014//static
4015void LLStartUp::setStartedOnce(bool started)
4016{
4017 mStartedOnce=started;
4018}
4019
4020
4021//displays the screen and cleans up UI
4022// static
4023void LLStartUp::resetLogin()
3933{ 4024{
3934 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 4025 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
3935 4026