diff options
author | Jacek Antonelli | 2009-09-09 12:27:11 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-09-10 02:26:28 -0500 |
commit | e944c5086e47e92e7952e5a43c68f01108899656 (patch) | |
tree | c47ff63c4dcae473cd07a0dbcbc9d52636e6061e /linden/indra/newview/llstartup.cpp | |
parent | Commented out Linux tarball building. (diff) | |
parent | looks like working now (diff) | |
download | meta-impy-e944c5086e47e92e7952e5a43c68f01108899656.zip meta-impy-e944c5086e47e92e7952e5a43c68f01108899656.tar.gz meta-impy-e944c5086e47e92e7952e5a43c68f01108899656.tar.bz2 meta-impy-e944c5086e47e92e7952e5a43c68f01108899656.tar.xz |
Merged 'armin/grid-manager5' into login-manager
Conflicts:
linden/indra/newview/CMakeLists.txt
linden/indra/newview/llpanellogin.cpp
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 8d5aa9e..ffd7f3d 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. |
@@ -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(); |
@@ -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,10 +870,11 @@ 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(firstname, lastname); |
@@ -1053,6 +1083,10 @@ bool idle_startup() | |||
1053 | LLStringUtil::format_map_t args; | 1083 | LLStringUtil::format_map_t args; |
1054 | args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); | 1084 | args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle(); |
1055 | auth_desc = LLTrans::getString("LoginInProgress", args); | 1085 | auth_desc = LLTrans::getString("LoginInProgress", args); |
1086 | |||
1087 | //Since we are about to login, we don't want the client to attempt auto login | ||
1088 | //again until the user does a grid2grid teleport. | ||
1089 | LLStartUp::setShouldAutoLogin(false); | ||
1056 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); | 1090 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); |
1057 | } | 1091 | } |
1058 | 1092 | ||
@@ -1092,13 +1126,15 @@ bool idle_startup() | |||
1092 | hashed_mac.hex_digest(hashed_mac_string); | 1126 | hashed_mac.hex_digest(hashed_mac_string); |
1093 | 1127 | ||
1094 | // TODO if statement here to use web_login_key | 1128 | // TODO if statement here to use web_login_key |
1129 | if(web_login_key.isNull()){ | ||
1095 | sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); | 1130 | sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); |
1096 | LLUserAuth::getInstance()->authenticate( | 1131 | LLUserAuth::getInstance()->authenticate( |
1097 | sAuthUris[sAuthUriNum], | 1132 | sAuthUris[sAuthUriNum], |
1098 | auth_method, | 1133 | auth_method, |
1099 | firstname, | 1134 | firstname, |
1100 | lastname, | 1135 | lastname, |
1101 | password, // web_login_key, | 1136 | password, |
1137 | //web_login_key, | ||
1102 | start.str(), | 1138 | start.str(), |
1103 | gSkipOptionalUpdate, | 1139 | gSkipOptionalUpdate, |
1104 | gAcceptTOS, | 1140 | gAcceptTOS, |
@@ -1107,6 +1143,22 @@ bool idle_startup() | |||
1107 | requested_options, | 1143 | requested_options, |
1108 | hashed_mac_string, | 1144 | hashed_mac_string, |
1109 | LLAppViewer::instance()->getSerialNumber()); | 1145 | LLAppViewer::instance()->getSerialNumber()); |
1146 | } else { | ||
1147 | LLUserAuth::getInstance()->authenticate( | ||
1148 | sAuthUris[sAuthUriNum], | ||
1149 | auth_method, | ||
1150 | firstname, | ||
1151 | lastname, | ||
1152 | web_login_key, | ||
1153 | start.str(), | ||
1154 | gSkipOptionalUpdate, | ||
1155 | gAcceptTOS, | ||
1156 | gAcceptCriticalMessage, | ||
1157 | gLastExecEvent, | ||
1158 | requested_options, | ||
1159 | hashed_mac_string, | ||
1160 | LLAppViewer::instance()->getSerialNumber()); | ||
1161 | } | ||
1110 | 1162 | ||
1111 | // reset globals | 1163 | // reset globals |
1112 | gAcceptTOS = FALSE; | 1164 | gAcceptTOS = FALSE; |
@@ -1166,7 +1218,6 @@ bool idle_startup() | |||
1166 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; | 1218 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; |
1167 | std::ostringstream emsg; | 1219 | std::ostringstream emsg; |
1168 | bool quit = false; | 1220 | bool quit = false; |
1169 | bool update = false; | ||
1170 | std::string login_response; | 1221 | std::string login_response; |
1171 | std::string reason_response; | 1222 | std::string reason_response; |
1172 | std::string message_response; | 1223 | std::string message_response; |
@@ -1210,7 +1261,11 @@ bool idle_startup() | |||
1210 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); | 1261 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); |
1211 | message_response = LLUserAuth::getInstance()->getResponse("message"); | 1262 | message_response = LLUserAuth::getInstance()->getResponse("message"); |
1212 | 1263 | ||
1213 | if (!message_response.empty()) | 1264 | if (gHideLinks && reason_response == "disabled") |
1265 | { | ||
1266 | emsg << gDisabledMessage; | ||
1267 | } | ||
1268 | else if (!message_response.empty()) | ||
1214 | { | 1269 | { |
1215 | // XUI: fix translation for strings returned during login | 1270 | // XUI: fix translation for strings returned during login |
1216 | // We need a generic table for translations | 1271 | // We need a generic table for translations |
@@ -1268,7 +1323,16 @@ bool idle_startup() | |||
1268 | if(reason_response == "update") | 1323 | if(reason_response == "update") |
1269 | { | 1324 | { |
1270 | auth_message = LLUserAuth::getInstance()->getResponse("message"); | 1325 | auth_message = LLUserAuth::getInstance()->getResponse("message"); |
1271 | update = true; | 1326 | if (show_connect_box) |
1327 | { | ||
1328 | update_app(TRUE, auth_message); | ||
1329 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1330 | return false; | ||
1331 | } | ||
1332 | else | ||
1333 | { | ||
1334 | quit = true; | ||
1335 | } | ||
1272 | } | 1336 | } |
1273 | if(reason_response == "optional") | 1337 | if(reason_response == "optional") |
1274 | { | 1338 | { |
@@ -1306,21 +1370,6 @@ bool idle_startup() | |||
1306 | break; | 1370 | break; |
1307 | } | 1371 | } |
1308 | 1372 | ||
1309 | if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate")) | ||
1310 | { | ||
1311 | gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); | ||
1312 | if (show_connect_box) | ||
1313 | { | ||
1314 | update_app(TRUE, auth_message); | ||
1315 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1316 | return false; | ||
1317 | } | ||
1318 | else | ||
1319 | { | ||
1320 | quit = true; | ||
1321 | } | ||
1322 | } | ||
1323 | |||
1324 | // Version update and we're not showing the dialog | 1373 | // Version update and we're not showing the dialog |
1325 | if(quit) | 1374 | if(quit) |
1326 | { | 1375 | { |
@@ -1533,6 +1582,42 @@ bool idle_startup() | |||
1533 | } | 1582 | } |
1534 | } | 1583 | } |
1535 | 1584 | ||
1585 | // Override grid info with anything sent in the login response | ||
1586 | std::string tmp = LLUserAuth::getInstance()->getResponse("gridname"); | ||
1587 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp); | ||
1588 | tmp = LLUserAuth::getInstance()->getResponse("loginuri"); | ||
1589 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp); | ||
1590 | tmp = LLUserAuth::getInstance()->getResponse("welcome"); | ||
1591 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); | ||
1592 | tmp = LLUserAuth::getInstance()->getResponse("loginpage"); | ||
1593 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); | ||
1594 | tmp = LLUserAuth::getInstance()->getResponse("economy"); | ||
1595 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); | ||
1596 | tmp = LLUserAuth::getInstance()->getResponse("helperuri"); | ||
1597 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); | ||
1598 | tmp = LLUserAuth::getInstance()->getResponse("about"); | ||
1599 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); | ||
1600 | tmp = LLUserAuth::getInstance()->getResponse("website"); | ||
1601 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); | ||
1602 | tmp = LLUserAuth::getInstance()->getResponse("help"); | ||
1603 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); | ||
1604 | tmp = LLUserAuth::getInstance()->getResponse("support"); | ||
1605 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); | ||
1606 | tmp = LLUserAuth::getInstance()->getResponse("register"); | ||
1607 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); | ||
1608 | tmp = LLUserAuth::getInstance()->getResponse("account"); | ||
1609 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); | ||
1610 | tmp = LLUserAuth::getInstance()->getResponse("password"); | ||
1611 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); | ||
1612 | tmp = LLUserAuth::getInstance()->getResponse("search"); | ||
1613 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); | ||
1614 | tmp = LLUserAuth::getInstance()->getResponse("currency"); | ||
1615 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); | ||
1616 | tmp = LLUserAuth::getInstance()->getResponse("real_currency"); | ||
1617 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp); | ||
1618 | tmp = LLUserAuth::getInstance()->getResponse("directory_fee"); | ||
1619 | if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str())); | ||
1620 | gHippoGridManager->saveFile(); | ||
1536 | 1621 | ||
1537 | // JC: gesture loading done below, when we have an asset system | 1622 | // JC: gesture loading done below, when we have an asset system |
1538 | // in place. Don't delete/clear user_credentials until then. | 1623 | // in place. Don't delete/clear user_credentials until then. |
@@ -1557,8 +1642,10 @@ bool idle_startup() | |||
1557 | LLStringUtil::format_map_t args; | 1642 | LLStringUtil::format_map_t args; |
1558 | args["[ERROR_MESSAGE]"] = emsg.str(); | 1643 | args["[ERROR_MESSAGE]"] = emsg.str(); |
1559 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); | 1644 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); |
1560 | reset_login(); | 1645 | LLStartUp::resetLogin(); |
1561 | gSavedSettings.setBOOL("AutoLogin", FALSE); | 1646 | gSavedSettings.setBOOL("AutoLogin", FALSE); |
1647 | //this might be redundant | ||
1648 | LLStartUp::setShouldAutoLogin(false); | ||
1562 | show_connect_box = true; | 1649 | show_connect_box = true; |
1563 | } | 1650 | } |
1564 | 1651 | ||
@@ -1577,8 +1664,10 @@ bool idle_startup() | |||
1577 | LLStringUtil::format_map_t args; | 1664 | LLStringUtil::format_map_t args; |
1578 | args["[ERROR_MESSAGE]"] = emsg.str(); | 1665 | args["[ERROR_MESSAGE]"] = emsg.str(); |
1579 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); | 1666 | gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); |
1580 | reset_login(); | 1667 | LLStartUp::resetLogin(); |
1581 | gSavedSettings.setBOOL("AutoLogin", FALSE); | 1668 | gSavedSettings.setBOOL("AutoLogin", FALSE); |
1669 | //this might be redundant | ||
1670 | LLStartUp::setShouldAutoLogin(false); | ||
1582 | show_connect_box = true; | 1671 | show_connect_box = true; |
1583 | // Don't save an incorrect password to disk. | 1672 | // Don't save an incorrect password to disk. |
1584 | save_password_to_disk(NULL); | 1673 | save_password_to_disk(NULL); |
@@ -1592,6 +1681,7 @@ bool idle_startup() | |||
1592 | if (STATE_WORLD_INIT == LLStartUp::getStartupState()) | 1681 | if (STATE_WORLD_INIT == LLStartUp::getStartupState()) |
1593 | { | 1682 | { |
1594 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); | 1683 | set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); |
1684 | gDisconnected=FALSE; | ||
1595 | display_startup(); | 1685 | display_startup(); |
1596 | // We should have an agent id by this point. | 1686 | // We should have an agent id by this point. |
1597 | llassert(!(gAgentID == LLUUID::null)); | 1687 | llassert(!(gAgentID == LLUUID::null)); |
@@ -1620,10 +1710,11 @@ bool idle_startup() | |||
1620 | LLWaterParamManager::initClass(); | 1710 | LLWaterParamManager::initClass(); |
1621 | 1711 | ||
1622 | // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering | 1712 | // RN: don't initialize VO classes in drone mode, they are too closely tied to rendering |
1713 | |||
1714 | if (!LLStartUp::getStartedOnce()) | ||
1623 | LLViewerObject::initVOClasses(); | 1715 | LLViewerObject::initVOClasses(); |
1624 | 1716 | ||
1625 | display_startup(); | 1717 | display_startup(); |
1626 | |||
1627 | // This is where we used to initialize gWorldp. Original comment said: | 1718 | // This is where we used to initialize gWorldp. Original comment said: |
1628 | // World initialization must be done after above window init | 1719 | // World initialization must be done after above window init |
1629 | 1720 | ||
@@ -1766,7 +1857,7 @@ bool idle_startup() | |||
1766 | //reset statistics | 1857 | //reset statistics |
1767 | LLViewerStats::getInstance()->resetStats(); | 1858 | LLViewerStats::getInstance()->resetStats(); |
1768 | 1859 | ||
1769 | if (!gNoRender) | 1860 | if ((!gNoRender)&&(!LLStartUp::getStartedOnce())) |
1770 | { | 1861 | { |
1771 | // | 1862 | // |
1772 | // Set up all of our statistics UI stuff. | 1863 | // Set up all of our statistics UI stuff. |
@@ -2038,6 +2129,7 @@ bool idle_startup() | |||
2038 | LLAvatarTracker::instance().addBuddyList(list); | 2129 | LLAvatarTracker::instance().addBuddyList(list); |
2039 | } | 2130 | } |
2040 | 2131 | ||
2132 | /* | ||
2041 | options.clear(); | 2133 | options.clear(); |
2042 | if(LLUserAuth::getInstance()->getOptions("ui-config", options)) | 2134 | if(LLUserAuth::getInstance()->getOptions("ui-config", options)) |
2043 | { | 2135 | { |
@@ -2056,6 +2148,7 @@ bool idle_startup() | |||
2056 | } | 2148 | } |
2057 | } | 2149 | } |
2058 | } | 2150 | } |
2151 | */ | ||
2059 | options.clear(); | 2152 | options.clear(); |
2060 | bool show_hud = false; | 2153 | bool show_hud = false; |
2061 | if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) | 2154 | if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) |
@@ -2143,6 +2236,7 @@ bool idle_startup() | |||
2143 | // Create the inventory views | 2236 | // Create the inventory views |
2144 | llinfos << "Creating Inventory Views" << llendl; | 2237 | llinfos << "Creating Inventory Views" << llendl; |
2145 | LLInventoryView::showAgentInventory(); | 2238 | LLInventoryView::showAgentInventory(); |
2239 | llinfos << "Inventory Views Created" << llendl; | ||
2146 | 2240 | ||
2147 | // Hide the inventory if it wasn't shown at exit | 2241 | // Hide the inventory if it wasn't shown at exit |
2148 | if(!shown_at_exit) | 2242 | if(!shown_at_exit) |
@@ -2206,7 +2300,7 @@ bool idle_startup() | |||
2206 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); | 2300 | gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); |
2207 | }; | 2301 | }; |
2208 | 2302 | ||
2209 | if (!gNoRender) | 2303 | if ((!gNoRender)&&(!LLStartUp::getStartedOnce())) |
2210 | { | 2304 | { |
2211 | // JC: Initializing audio requests many sounds for download. | 2305 | // JC: Initializing audio requests many sounds for download. |
2212 | init_audio(); | 2306 | init_audio(); |
@@ -2366,25 +2460,11 @@ bool idle_startup() | |||
2366 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); | 2460 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); |
2367 | } | 2461 | } |
2368 | 2462 | ||
2369 | |||
2370 | // We now have an inventory skeleton, so if this is a user's first | ||
2371 | // login, we can start setting up their clothing and avatar | ||
2372 | // appearance. This helps to avoid the generic "Ruth" avatar in | ||
2373 | // the orientation island tutorial experience. JC | ||
2374 | if (gAgent.isFirstLogin() | ||
2375 | && !sInitialOutfit.empty() // registration set up an outfit | ||
2376 | && !sInitialOutfitGender.empty() // and a gender | ||
2377 | && gAgent.getAvatarObject() // can't wear clothes without object | ||
2378 | && !gAgent.isGenderChosen() ) // nothing already loading | ||
2379 | { | ||
2380 | // Start loading the wearables, textures, gestures | ||
2381 | LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender ); | ||
2382 | } | ||
2383 | |||
2384 | // wait precache-delay and for agent's avatar or a lot longer. | 2463 | // wait precache-delay and for agent's avatar or a lot longer. |
2385 | if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) | 2464 | if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) |
2386 | || (timeout_frac > 3.f)) | 2465 | || (timeout_frac > 3.f)) |
2387 | { | 2466 | { |
2467 | wearables_timer.reset(); | ||
2388 | LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); | 2468 | LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); |
2389 | } | 2469 | } |
2390 | else | 2470 | else |
@@ -2400,7 +2480,6 @@ bool idle_startup() | |||
2400 | 2480 | ||
2401 | if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) | 2481 | if (STATE_WEARABLES_WAIT == LLStartUp::getStartupState()) |
2402 | { | 2482 | { |
2403 | static LLFrameTimer wearables_timer; | ||
2404 | 2483 | ||
2405 | const F32 wearables_time = wearables_timer.getElapsedTimeF32(); | 2484 | const F32 wearables_time = wearables_timer.getElapsedTimeF32(); |
2406 | const F32 MAX_WEARABLES_TIME = 10.f; | 2485 | const F32 MAX_WEARABLES_TIME = 10.f; |
@@ -2508,6 +2587,7 @@ bool idle_startup() | |||
2508 | LLUserAuth::getInstance()->reset(); | 2587 | LLUserAuth::getInstance()->reset(); |
2509 | 2588 | ||
2510 | LLStartUp::setStartupState( STATE_STARTED ); | 2589 | LLStartUp::setStartupState( STATE_STARTED ); |
2590 | LLStartUp::setStartedOnce(true); | ||
2511 | 2591 | ||
2512 | // Unmute audio if desired and setup volumes. | 2592 | // Unmute audio if desired and setup volumes. |
2513 | // Unmute audio if desired and setup volumes. | 2593 | // Unmute audio if desired and setup volumes. |
@@ -2524,7 +2604,7 @@ bool idle_startup() | |||
2524 | gDebugView->mFastTimerView->setVisible(TRUE); | 2604 | gDebugView->mFastTimerView->setVisible(TRUE); |
2525 | #endif | 2605 | #endif |
2526 | 2606 | ||
2527 | LLAppViewer::instance()->handleLoginComplete(); | 2607 | LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); |
2528 | 2608 | ||
2529 | return TRUE; | 2609 | return TRUE; |
2530 | } | 2610 | } |
@@ -2554,14 +2634,15 @@ void login_show() | |||
2554 | // UI textures have been previously loaded in doPreloadImages() | 2634 | // UI textures have been previously loaded in doPreloadImages() |
2555 | 2635 | ||
2556 | LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; | 2636 | LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL; |
2557 | LL_INFOS("AppInit") << "getGridChoice is " << LLViewerLogin::getInstance()->getGridChoice() << LL_ENDL; | ||
2558 | 2637 | ||
2638 | //KOW | ||
2639 | /* | ||
2559 | LLViewerLogin* vl = LLViewerLogin::getInstance(); | 2640 | LLViewerLogin* vl = LLViewerLogin::getInstance(); |
2560 | for(int grid_index = GRID_INFO_NONE + 1; grid_index < GRID_INFO_OTHER; ++grid_index) | 2641 | for(int grid_index = 1; grid_index < GRID_INFO_OTHER; ++grid_index) |
2561 | { | 2642 | { |
2562 | LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index), grid_index); | 2643 | LLPanelLogin::addServer(vl->getKnownGridLabel(grid_index), grid_index); |
2563 | } | 2644 | } |
2564 | LLPanelLogin::setServer(LLViewerLogin::getInstance()->getGridChoice()-1); | 2645 | */ |
2565 | } | 2646 | } |
2566 | 2647 | ||
2567 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. | 2648 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. |
@@ -2840,6 +2921,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg) | |||
2840 | 2921 | ||
2841 | void update_dialog_callback(S32 option, void *userdata) | 2922 | void update_dialog_callback(S32 option, void *userdata) |
2842 | { | 2923 | { |
2924 | std::string update_exe_path; | ||
2843 | bool mandatory = userdata != NULL; | 2925 | bool mandatory = userdata != NULL; |
2844 | 2926 | ||
2845 | #if !LL_RELEASE_FOR_DOWNLOAD | 2927 | #if !LL_RELEASE_FOR_DOWNLOAD |
@@ -2856,8 +2938,6 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2856 | if (mandatory) | 2938 | if (mandatory) |
2857 | { | 2939 | { |
2858 | LLAppViewer::instance()->forceQuit(); | 2940 | LLAppViewer::instance()->forceQuit(); |
2859 | // Bump them back to the login screen. | ||
2860 | //reset_login(); | ||
2861 | } | 2941 | } |
2862 | else | 2942 | else |
2863 | { | 2943 | { |
@@ -2882,7 +2962,7 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2882 | // *TODO constantize this guy | 2962 | // *TODO constantize this guy |
2883 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2963 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2884 | 2964 | ||
2885 | if(LLAppViewer::sUpdaterInfo) | 2965 | /* if(LLAppViewer::sUpdaterInfo) |
2886 | { | 2966 | { |
2887 | delete LLAppViewer::sUpdaterInfo ; | 2967 | delete LLAppViewer::sUpdaterInfo ; |
2888 | } | 2968 | } |
@@ -2955,14 +3035,16 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2955 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; | 3035 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; |
2956 | 3036 | ||
2957 | // Run the auto-updater. | 3037 | // Run the auto-updater. |
2958 | system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ | 3038 | */ |
2959 | 3039 | //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ | |
3040 | /* | ||
2960 | #elif LL_LINUX | 3041 | #elif LL_LINUX |
2961 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 3042 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
2962 | "Please download the latest version from www.secondlife.com.", | 3043 | "Please download the latest version from www.secondlife.com.", |
2963 | LLStringUtil::null, OSMB_OK); | 3044 | LLStringUtil::null, OSMB_OK); |
2964 | #endif | 3045 | #endif |
2965 | LLAppViewer::instance()->forceQuit(); | 3046 | LLAppViewer::instance()->forceQuit(); |
3047 | */ | ||
2966 | } | 3048 | } |
2967 | 3049 | ||
2968 | void use_circuit_callback(void**, S32 result) | 3050 | void use_circuit_callback(void**, S32 result) |
@@ -2978,7 +3060,7 @@ void use_circuit_callback(void**, S32 result) | |||
2978 | LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; | 3060 | LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; |
2979 | gViewerWindow->alertXml("LoginPacketNeverReceived", | 3061 | gViewerWindow->alertXml("LoginPacketNeverReceived", |
2980 | login_alert_status, NULL); | 3062 | login_alert_status, NULL); |
2981 | reset_login(); | 3063 | LLStartUp::resetLogin(); |
2982 | } | 3064 | } |
2983 | else | 3065 | else |
2984 | { | 3066 | { |
@@ -3928,7 +4010,16 @@ void LLStartUp::setStartupState( EStartupState state ) | |||
3928 | } | 4010 | } |
3929 | 4011 | ||
3930 | 4012 | ||
3931 | void reset_login() | 4013 | //static |
4014 | void LLStartUp::setStartedOnce(bool started) | ||
4015 | { | ||
4016 | mStartedOnce=started; | ||
4017 | } | ||
4018 | |||
4019 | |||
4020 | //displays the screen and cleans up UI | ||
4021 | // static | ||
4022 | void LLStartUp::resetLogin() | ||
3932 | { | 4023 | { |
3933 | LLStartUp::setStartupState( STATE_LOGIN_SHOW ); | 4024 | LLStartUp::setStartupState( STATE_LOGIN_SHOW ); |
3934 | 4025 | ||