diff options
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 205 |
1 files changed, 148 insertions, 57 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index aca3cac..8f9b728 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" | |||
222 | static bool gUseCircuitCallbackCalled = false; | 231 | static bool gUseCircuitCallbackCalled = false; |
223 | 232 | ||
224 | EStartupState LLStartUp::gStartupState = STATE_FIRST; | 233 | EStartupState LLStartUp::gStartupState = STATE_FIRST; |
225 | 234 | bool LLStartUp::mStartedOnce = false; | |
235 | bool 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(); | |||
248 | void callback_choose_gender(S32 option, void* userdata); | 258 | void callback_choose_gender(S32 option, void* userdata); |
249 | void init_start_screen(S32 location_id); | 259 | void init_start_screen(S32 location_id); |
250 | void release_start_screen(); | 260 | void release_start_screen(); |
251 | void reset_login(); | ||
252 | void apply_udp_blacklist(const std::string& csv); | 261 | void apply_udp_blacklist(const std::string& csv); |
253 | 262 | ||
254 | void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) | 263 | void 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. |
@@ -654,7 +664,7 @@ bool idle_startup() | |||
654 | 664 | ||
655 | show_connect_box = false; | 665 | show_connect_box = false; |
656 | } | 666 | } |
657 | else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) | 667 | else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin()) |
658 | { | 668 | { |
659 | LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); | 669 | LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); |
660 | firstname = cmd_line_login[0].asString(); | 670 | firstname = cmd_line_login[0].asString(); |
@@ -721,12 +731,19 @@ bool idle_startup() | |||
721 | if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) | 731 | if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) |
722 | { | 732 | { |
723 | LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; | 733 | LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL; |
734 | sAuthUris.clear(); | ||
735 | sAuthUriNum = -1; | ||
724 | 736 | ||
725 | gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); | 737 | gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); |
726 | // Push our window frontmost | 738 | // Push our window frontmost |
727 | gViewerWindow->getWindow()->show(); | 739 | gViewerWindow->getWindow()->show(); |
728 | 740 | ||
729 | timeout_count = 0; | 741 | timeout_count = 0; |
742 | |||
743 | if(LLStartUp::shouldAutoLogin()) | ||
744 | { | ||
745 | show_connect_box = false; | ||
746 | } | ||
730 | 747 | ||
731 | if (show_connect_box) | 748 | if (show_connect_box) |
732 | { | 749 | { |
@@ -809,6 +826,18 @@ bool idle_startup() | |||
809 | lastname = gLoginHandler.mLastName; | 826 | lastname = gLoginHandler.mLastName; |
810 | web_login_key = gLoginHandler.mWebLoginKey; | 827 | web_login_key = gLoginHandler.mWebLoginKey; |
811 | } | 828 | } |
829 | |||
830 | if(!gLoginHandler.mPassword.empty()) | ||
831 | { | ||
832 | firstname = gLoginHandler.mFirstName; | ||
833 | lastname = gLoginHandler.mLastName; | ||
834 | password = gLoginHandler.mPassword; | ||
835 | |||
836 | gLoginHandler.mFirstName = ""; | ||
837 | gLoginHandler.mLastName = ""; | ||
838 | gLoginHandler.mPassword = ""; | ||
839 | LLStartUp::setShouldAutoLogin(false); | ||
840 | } | ||
812 | 841 | ||
813 | if (show_connect_box) | 842 | if (show_connect_box) |
814 | { | 843 | { |
@@ -836,10 +865,11 @@ bool idle_startup() | |||
836 | } | 865 | } |
837 | gSavedSettings.setBOOL("RememberPassword", remember_password); | 866 | gSavedSettings.setBOOL("RememberPassword", remember_password); |
838 | 867 | ||
839 | LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL; | 868 | LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL; |
840 | gDebugInfo["LoginName"] = firstname + " " + lastname; | 869 | gDebugInfo["LoginName"] = firstname + " " + lastname; |
841 | } | 870 | } |
842 | 871 | ||
872 | gHippoGridManager->setCurrentGridAsConnected(); | ||
843 | // create necessary directories | 873 | // create necessary directories |
844 | // *FIX: these mkdir's should error check | 874 | // *FIX: these mkdir's should error check |
845 | gDirUtilp->setLindenUserDir(firstname, lastname); | 875 | gDirUtilp->setLindenUserDir(firstname, lastname); |
@@ -1031,6 +1061,10 @@ bool idle_startup() | |||
1031 | LLStringUtil::format_map_t args; | 1061 | LLStringUtil::format_map_t args; |
1032 | args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); | 1062 | args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); |
1033 | auth_desc = LLTrans::getString("LoginInProgress", args); | 1063 | auth_desc = LLTrans::getString("LoginInProgress", args); |
1064 | |||
1065 | //Since we are about to login, we don't want the client to attempt auto login | ||
1066 | //again until the user does a grid2grid teleport. | ||
1067 | LLStartUp::setShouldAutoLogin(false); | ||
1034 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); | 1068 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); |
1035 | } | 1069 | } |
1036 | 1070 | ||
@@ -1070,13 +1104,15 @@ bool idle_startup() | |||
1070 | hashed_mac.hex_digest(hashed_mac_string); | 1104 | hashed_mac.hex_digest(hashed_mac_string); |
1071 | 1105 | ||
1072 | // TODO if statement here to use web_login_key | 1106 | // TODO if statement here to use web_login_key |
1107 | if(web_login_key.isNull()){ | ||
1073 | sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); | 1108 | sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); |
1074 | LLUserAuth::getInstance()->authenticate( | 1109 | LLUserAuth::getInstance()->authenticate( |
1075 | sAuthUris[sAuthUriNum], | 1110 | sAuthUris[sAuthUriNum], |
1076 | auth_method, | 1111 | auth_method, |
1077 | firstname, | 1112 | firstname, |
1078 | lastname, | 1113 | lastname, |
1079 | password, // web_login_key, | 1114 | password, |
1115 | //web_login_key, | ||
1080 | start.str(), | 1116 | start.str(), |
1081 | gSkipOptionalUpdate, | 1117 | gSkipOptionalUpdate, |
1082 | gAcceptTOS, | 1118 | gAcceptTOS, |
@@ -1085,6 +1121,22 @@ bool idle_startup() | |||
1085 | requested_options, | 1121 | requested_options, |
1086 | hashed_mac_string, | 1122 | hashed_mac_string, |
1087 | LLAppViewer::instance()->getSerialNumber()); | 1123 | LLAppViewer::instance()->getSerialNumber()); |
1124 | } else { | ||
1125 | LLUserAuth::getInstance()->authenticate( | ||
1126 | sAuthUris[sAuthUriNum], | ||
1127 | auth_method, | ||
1128 | firstname, | ||
1129 | lastname, | ||
1130 | web_login_key, | ||
1131 | start.str(), | ||
1132 | gSkipOptionalUpdate, | ||
1133 | gAcceptTOS, | ||
1134 | gAcceptCriticalMessage, | ||
1135 | gLastExecEvent, | ||
1136 | requested_options, | ||
1137 | hashed_mac_string, | ||
1138 | LLAppViewer::instance()->getSerialNumber()); | ||
1139 | } | ||
1088 | 1140 | ||
1089 | // reset globals | 1141 | // reset globals |
1090 | gAcceptTOS = FALSE; | 1142 | gAcceptTOS = FALSE; |
@@ -1144,7 +1196,6 @@ bool idle_startup() | |||
1144 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; | 1196 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; |
1145 | std::ostringstream emsg; | 1197 | std::ostringstream emsg; |
1146 | bool quit = false; | 1198 | bool quit = false; |
1147 | bool update = false; | ||
1148 | std::string login_response; | 1199 | std::string login_response; |
1149 | std::string reason_response; | 1200 | std::string reason_response; |
1150 | std::string message_response; | 1201 | std::string message_response; |
@@ -1188,7 +1239,11 @@ bool idle_startup() | |||
1188 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); | 1239 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); |
1189 | message_response = LLUserAuth::getInstance()->getResponse("message"); | 1240 | message_response = LLUserAuth::getInstance()->getResponse("message"); |
1190 | 1241 | ||
1191 | if (!message_response.empty()) | 1242 | if (gHideLinks && reason_response == "disabled") |
1243 | { | ||
1244 | emsg << gDisabledMessage; | ||
1245 | } | ||
1246 | else if (!message_response.empty()) | ||
1192 | { | 1247 | { |
1193 | // XUI: fix translation for strings returned during login | 1248 | // XUI: fix translation for strings returned during login |
1194 | // We need a generic table for translations | 1249 | // We need a generic table for translations |
@@ -1246,7 +1301,16 @@ bool idle_startup() | |||
1246 | if(reason_response == "update") | 1301 | if(reason_response == "update") |
1247 | { | 1302 | { |
1248 | auth_message = LLUserAuth::getInstance()->getResponse("message"); | 1303 | auth_message = LLUserAuth::getInstance()->getResponse("message"); |
1249 | update = true; | 1304 | if (show_connect_box) |
1305 | { | ||
1306 | update_app(TRUE, auth_message); | ||
1307 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1308 | return false; | ||
1309 | } | ||
1310 | else | ||
1311 | { | ||
1312 | quit = true; | ||
1313 | } | ||
1250 | } | 1314 | } |
1251 | if(reason_response == "optional") | 1315 | if(reason_response == "optional") |
1252 | { | 1316 | { |
@@ -1284,21 +1348,6 @@ bool idle_startup() | |||
1284 | break; | 1348 | break; |
1285 | } | 1349 | } |
1286 | 1350 | ||
1287 | if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate")) | ||
1288 | { | ||
1289 | gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); | ||
1290 | if (show_connect_box) | ||
1291 | { | ||
1292 | update_app(TRUE, auth_message); | ||
1293 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1294 | return false; | ||
1295 | } | ||
1296 | else | ||
1297 | { | ||
1298 | quit = true; | ||
1299 | } | ||
1300 | } | ||
1301 | |||
1302 | // Version update and we're not showing the dialog | 1351 | // Version update and we're not showing the dialog |
1303 | if(quit) | 1352 | if(quit) |
1304 | { | 1353 | { |
@@ -1511,6 +1560,42 @@ bool idle_startup() | |||
1511 | } | 1560 | } |
1512 | } | 1561 | } |
1513 | 1562 | ||
1563 | // Override grid info with anything sent in the login response | ||
1564 | std::string tmp = LLUserAuth::getInstance()->getResponse("gridname"); | ||
1565 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp); | ||
1566 | tmp = LLUserAuth::getInstance()->getResponse("loginuri"); | ||
1567 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp); | ||
1568 | tmp = LLUserAuth::getInstance()->getResponse("welcome"); | ||
1569 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); | ||
1570 | tmp = LLUserAuth::getInstance()->getResponse("loginpage"); | ||
1571 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); | ||
1572 | tmp = LLUserAuth::getInstance()->getResponse("economy"); | ||
1573 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); | ||
1574 | tmp = LLUserAuth::getInstance()->getResponse("helperuri"); | ||
1575 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); | ||
1576 | tmp = LLUserAuth::getInstance()->getResponse("about"); | ||
1577 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); | ||
1578 | tmp = LLUserAuth::getInstance()->getResponse("website"); | ||
1579 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); | ||
1580 | tmp = LLUserAuth::getInstance()->getResponse("help"); | ||
1581 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); | ||
1582 | tmp = LLUserAuth::getInstance()->getResponse("support"); | ||
1583 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); | ||
1584 | tmp = LLUserAuth::getInstance()->getResponse("register"); | ||
1585 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); | ||
1586 | tmp = LLUserAuth::getInstance()->getResponse("account"); | ||
1587 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); | ||
1588 | tmp = LLUserAuth::getInstance()->getResponse("password"); | ||
1589 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); | ||
1590 | tmp = LLUserAuth::getInstance()->getResponse("search"); | ||
1591 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); | ||
1592 | tmp = LLUserAuth::getInstance()->getResponse("currency"); | ||
1593 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); | ||
1594 | tmp = LLUserAuth::getInstance()->getResponse("real_currency"); | ||
1595 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp); | ||
1596 | tmp = LLUserAuth::getInstance()->getResponse("directory_fee"); | ||
1597 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str())); | ||
1598 | gHippoGridManager->saveFile(); | ||
1514 | 1599 | ||
1515 | // JC: gesture loading done below, when we have an asset system | 1600 | // JC: gesture loading done below, when we have an asset system |
1516 | // in place. Don't delete/clear user_credentials until then. | 1601 | // in place. Don't delete/clear user_credentials until then. |
@@ -1535,8 +1620,10 @@ bool idle_startup() | |||
1535 | LLStringUtil::format_map_t args; | 1620 | LLStringUtil::format_map_t args; |
1536 | args["[ERROR_MESSAGE]"] = emsg.str(); | 1621 | args["[ERROR_MESSAGE]"] = emsg.str(); |
1537 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); | 1622 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); |
1538 | reset_login(); | 1623 | LLStartUp::resetLogin(); |
1539 | gSavedSettings.setBOOL("AutoLogin", FALSE); | 1624 | gSavedSettings.setBOOL("AutoLogin", FALSE); |
1625 | //this might be redundant | ||
1626 | LLStartUp::setShouldAutoLogin(false); | ||
1540 | show_connect_box = true; | 1627 | show_connect_box = true; |
1541 | } | 1628 | } |
1542 | 1629 | ||
@@ -1555,8 +1642,10 @@ bool idle_startup() | |||
1555 | LLStringUtil::format_map_t args; | 1642 | LLStringUtil::format_map_t args; |
1556 | args["[ERROR_MESSAGE]"] = emsg.str(); | 1643 | args["[ERROR_MESSAGE]"] = emsg.str(); |
1557 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); | 1644 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); |
1558 | reset_login(); | 1645 | LLStartUp::resetLogin(); |
1559 | gSavedSettings.setBOOL("AutoLogin", FALSE); | 1646 | gSavedSettings.setBOOL("AutoLogin", FALSE); |
1647 | //this might be redundant | ||
1648 | LLStartUp::setShouldAutoLogin(false); | ||
1560 | show_connect_box = true; | 1649 | show_connect_box = true; |
1561 | // Don't save an incorrect password to disk. | 1650 | // Don't save an incorrect password to disk. |
1562 | save_password_to_disk(NULL); | 1651 | save_password_to_disk(NULL); |
@@ -1570,6 +1659,7 @@ bool idle_startup() | |||
1570 | if (STATE_WORLD_INIT == LLStartUp::getStartupState()) | 1659 | if (STATE_WORLD_INIT == LLStartUp::getStartupState()) |
1571 | { | 1660 | { |
1572 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); | 1661 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); |
1662 | gDisconnected=FALSE; | ||
1573 | display_startup(); | 1663 | display_startup(); |
1574 | // We should have an agent id by this point. | 1664 | // We should have an agent id by this point. |
1575 | llassert(!(gAgentID == LLUUID::null)); | 1665 | llassert(!(gAgentID == LLUUID::null)); |
@@ -1598,10 +1688,11 @@ bool idle_startup() | |||
1598 | LLWaterParamManager::initClass(); | 1688 | LLWaterParamManager::initClass(); |
1599 | 1689 | ||
1600 | // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering | 1690 | // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering |
1691 | |||
1692 | if (!LLStartUp::getStartedOnce()) | ||
1601 | LLViewerObject::initVOClasses(); | 1693 | LLViewerObject::initVOClasses(); |
1602 | 1694 | ||
1603 | display_startup(); | 1695 | display_startup(); |
1604 | |||
1605 | // This is where we used to initialize gWorldp. Original comment said: | 1696 | // This is where we used to initialize gWorldp. Original comment said: |
1606 | // World initialization must be done after above window init | 1697 | // World initialization must be done after above window init |
1607 | 1698 | ||
@@ -1744,7 +1835,7 @@ bool idle_startup() | |||
1744 | //reset statistics | 1835 | //reset statistics |
1745 | LLViewerStats::getInstance()->resetStats(); | 1836 | LLViewerStats::getInstance()->resetStats(); |
1746 | 1837 | ||
1747 | if (!gNoRender) | 1838 | if ((!gNoRender)&&(!LLStartUp::getStartedOnce())) |
1748 | { | 1839 | { |
1749 | // | 1840 | // |
1750 | // Set up all of our statistics UI stuff. | 1841 | // Set up all of our statistics UI stuff. |
@@ -2016,6 +2107,7 @@ bool idle_startup() | |||
2016 | LLAvatarTracker::instance().addBuddyList(list); | 2107 | LLAvatarTracker::instance().addBuddyList(list); |
2017 | } | 2108 | } |
2018 | 2109 | ||
2110 | /* | ||
2019 | options.clear(); | 2111 | options.clear(); |
2020 | if(LLUserAuth::getInstance()->getOptions("ui-config", options)) | 2112 | if(LLUserAuth::getInstance()->getOptions("ui-config", options)) |
2021 | { | 2113 | { |
@@ -2034,6 +2126,7 @@ bool idle_startup() | |||
2034 | } | 2126 | } |
2035 | } | 2127 | } |
2036 | } | 2128 | } |
2129 | */ | ||
2037 | options.clear(); | 2130 | options.clear(); |
2038 | bool show_hud = false; | 2131 | bool show_hud = false; |
2039 | if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) | 2132 | if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) |
@@ -2121,6 +2214,7 @@ bool idle_startup() | |||
2121 | // Create the inventory views | 2214 | // Create the inventory views |
2122 | llinfos << "Creating Inventory Views" << llendl; | 2215 | llinfos << "Creating Inventory Views" << llendl; |
2123 | LLInventoryView::showAgentInventory(); | 2216 | LLInventoryView::showAgentInventory(); |
2217 | llinfos << "Inventory Views Created" << llendl; | ||
2124 | 2218 | ||
2125 | // Hide the inventory if it wasn't shown at exit | 2219 | // Hide the inventory if it wasn't shown at exit |
2126 | if(!shown_at_exit) | 2220 | if(!shown_at_exit) |
@@ -2184,7 +2278,7 @@ bool idle_startup() | |||
2184 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); | 2278 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); |
2185 | }; | 2279 | }; |
2186 | 2280 | ||
2187 | if (!gNoRender) | 2281 | if ((!gNoRender)&&(!LLStartUp::getStartedOnce())) |
2188 | { | 2282 | { |
2189 | // JC: Initializing audio requests many sounds for download. | 2283 | // JC: Initializing audio requests many sounds for download. |
2190 | init_audio(); | 2284 | init_audio(); |
@@ -2344,25 +2438,11 @@ bool idle_startup() | |||
2344 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); | 2438 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); |
2345 | } | 2439 | } |
2346 | 2440 | ||
2347 | |||
2348 | // We now have an inventory skeleton, so if this is a user's first | ||
2349 | // login, we can start setting up their clothing and avatar | ||
2350 | // appearance. This helps to avoid the generic "Ruth" avatar in | ||
2351 | // the orientation island tutorial experience. JC | ||
2352 | if (gAgent.isFirstLogin() | ||
2353 | && !sInitialOutfit.empty() // registration set up an outfit | ||
2354 | && !sInitialOutfitGender.empty() // and a gender | ||
2355 | && gAgent.getAvatarObject() // can't wear clothes without object | ||
2356 | && !gAgent.isGenderChosen() ) // nothing already loading | ||
2357 | { | ||
2358 | // Start loading the wearables, textures, gestures | ||
2359 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); | ||
2360 | } | ||
2361 | |||
2362 | // wait precache-delay and for agent's avatar or a lot longer. | 2441 | // wait precache-delay and for agent's avatar or a lot longer. |
2363 | if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) | 2442 | if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) |
2364 | || (timeout_frac > 3.f)) | 2443 | || (timeout_frac > 3.f)) |
2365 | { | 2444 | { |
2445 | wearables_timer.reset(); | ||
2366 | LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); | 2446 | LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); |
2367 | } | 2447 | } |
2368 | else | 2448 | else |
@@ -2378,7 +2458,6 @@ bool idle_startup() | |||
2378 | 2458 | ||
2379 | if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) | 2459 | if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) |
2380 | { | 2460 | { |
2381 | static LLFrameTimer wearables_timer; | ||
2382 | 2461 | ||
2383 | const F32 wearables_time = wearables_timer.getElapsedTimeF32(); | 2462 | const F32 wearables_time = wearables_timer.getElapsedTimeF32(); |
2384 | const F32 MAX_WEARABLES_TIME = 10.f; | 2463 | const F32 MAX_WEARABLES_TIME = 10.f; |
@@ -2482,6 +2561,7 @@ bool idle_startup() | |||
2482 | LLUserAuth::getInstance()->reset(); | 2561 | LLUserAuth::getInstance()->reset(); |
2483 | 2562 | ||
2484 | LLStartUp::setStartupState( STATE_STARTED ); | 2563 | LLStartUp::setStartupState( STATE_STARTED ); |
2564 | LLStartUp::setStartedOnce(true); | ||
2485 | 2565 | ||
2486 | // Unmute audio if desired and setup volumes. | 2566 | // Unmute audio if desired and setup volumes. |
2487 | // Unmute audio if desired and setup volumes. | 2567 | // Unmute audio if desired and setup volumes. |
@@ -2498,7 +2578,7 @@ bool idle_startup() | |||
2498 | gDebugView->mFastTimerView->setVisible(TRUE); | 2578 | gDebugView->mFastTimerView->setVisible(TRUE); |
2499 | #endif | 2579 | #endif |
2500 | 2580 | ||
2501 | LLAppViewer::instance()->handleLoginComplete(); | 2581 | LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); |
2502 | 2582 | ||
2503 | return TRUE; | 2583 | return TRUE; |
2504 | } | 2584 | } |
@@ -2528,14 +2608,15 @@ void login_show() | |||
2528 | // UI textures have been previously loaded in doPreloadImages() | 2608 | // UI textures have been previously loaded in doPreloadImages() |
2529 | 2609 | ||
2530 | LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; | 2610 | LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; |
2531 | LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL; | ||
2532 | 2611 | ||
2612 | //KOW | ||
2613 | /* | ||
2533 | LLViewerLogin* vl = LLViewerLogin::getInstance(); | 2614 | LLViewerLogin* vl = LLViewerLogin::getInstance(); |
2534 | for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) | 2615 | for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index) |
2535 | { | 2616 | { |
2536 | LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); | 2617 | LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index); |
2537 | } | 2618 | } |
2538 | LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); | 2619 | */ |
2539 | } | 2620 | } |
2540 | 2621 | ||
2541 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. | 2622 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. |
@@ -2814,6 +2895,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg) | |||
2814 | 2895 | ||
2815 | void update_dialog_callback(S32 option, void *userdata) | 2896 | void update_dialog_callback(S32 option, void *userdata) |
2816 | { | 2897 | { |
2898 | std::string update_exe_path; | ||
2817 | bool mandatory = userdata != NULL; | 2899 | bool mandatory = userdata != NULL; |
2818 | 2900 | ||
2819 | #if !LL_RELEASE_FOR_DOWNLOAD | 2901 | #if !LL_RELEASE_FOR_DOWNLOAD |
@@ -2830,8 +2912,6 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2830 | if (mandatory) | 2912 | if (mandatory) |
2831 | { | 2913 | { |
2832 | LLAppViewer::instance()->forceQuit(); | 2914 | LLAppViewer::instance()->forceQuit(); |
2833 | // Bump them back to the login screen. | ||
2834 | //reset_login(); | ||
2835 | } | 2915 | } |
2836 | else | 2916 | else |
2837 | { | 2917 | { |
@@ -2856,7 +2936,7 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2856 | // *TODO constantize this guy | 2936 | // *TODO constantize this guy |
2857 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2937 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2858 | 2938 | ||
2859 | if(LLAppViewer::sUpdaterInfo) | 2939 | /* if(LLAppViewer::sUpdaterInfo) |
2860 | { | 2940 | { |
2861 | delete LLAppViewer::sUpdaterInfo ; | 2941 | delete LLAppViewer::sUpdaterInfo ; |
2862 | } | 2942 | } |
@@ -2929,14 +3009,16 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2929 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; | 3009 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; |
2930 | 3010 | ||
2931 | // Run the auto-updater. | 3011 | // Run the auto-updater. |
2932 | system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ | 3012 | */ |
2933 | 3013 | //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ | |
3014 | /* | ||
2934 | #elif LL_LINUX | 3015 | #elif LL_LINUX |
2935 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 3016 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
2936 | "Please download the latest version from www.secondlife.com.", | 3017 | "Please download the latest version from www.secondlife.com.", |
2937 | LLStringUtil::null, OSMB_OK); | 3018 | LLStringUtil::null, OSMB_OK); |
2938 | #endif | 3019 | #endif |
2939 | LLAppViewer::instance()->forceQuit(); | 3020 | LLAppViewer::instance()->forceQuit(); |
3021 | */ | ||
2940 | } | 3022 | } |
2941 | 3023 | ||
2942 | void use_circuit_callback(void**, S32 result) | 3024 | void use_circuit_callback(void**, S32 result) |
@@ -2952,7 +3034,7 @@ void use_circuit_callback(void**, S32 result) | |||
2952 | LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; | 3034 | LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; |
2953 | gViewerWindow->alertXml("LoginPacketNeverReceived", | 3035 | gViewerWindow->alertXml("LoginPacketNeverReceived", |
2954 | login_alert_status, NULL); | 3036 | login_alert_status, NULL); |
2955 | reset_login(); | 3037 | LLStartUp::resetLogin(); |
2956 | } | 3038 | } |
2957 | else | 3039 | else |
2958 | { | 3040 | { |
@@ -3902,7 +3984,16 @@ void LLStartUp::setStartupState( EStartupState state ) | |||
3902 | } | 3984 | } |
3903 | 3985 | ||
3904 | 3986 | ||
3905 | void reset_login() | 3987 | //static |
3988 | void LLStartUp::setStartedOnce(bool started) | ||
3989 | { | ||
3990 | mStartedOnce=started; | ||
3991 | } | ||
3992 | |||
3993 | |||
3994 | //displays the screen and cleans up UI | ||
3995 | // static | ||
3996 | void LLStartUp::resetLogin() | ||
3906 | { | 3997 | { |
3907 | LLStartUp::setStartupState( STATE_LOGIN_SHOW ); | 3998 | LLStartUp::setStartupState( STATE_LOGIN_SHOW ); |
3908 | 3999 | ||