diff options
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 128 |
1 files changed, 73 insertions, 55 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 7dbb107..208bb7c 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -85,6 +85,8 @@ | |||
85 | #include "lleventnotifier.h" | 85 | #include "lleventnotifier.h" |
86 | #include "llface.h" | 86 | #include "llface.h" |
87 | #include "llfeaturemanager.h" | 87 | #include "llfeaturemanager.h" |
88 | #include "llfirstuse.h" | ||
89 | #include "llfloateractivespeakers.h" | ||
88 | #include "llfloaterchat.h" | 90 | #include "llfloaterchat.h" |
89 | #include "llfloatergesture.h" | 91 | #include "llfloatergesture.h" |
90 | #include "llfloaterland.h" | 92 | #include "llfloaterland.h" |
@@ -153,6 +155,7 @@ | |||
153 | #include "llfasttimerview.h" | 155 | #include "llfasttimerview.h" |
154 | #include "llfloatermap.h" | 156 | #include "llfloatermap.h" |
155 | #include "llweb.h" | 157 | #include "llweb.h" |
158 | #include "llvoiceclient.h" | ||
156 | 159 | ||
157 | #if LL_LIBXUL_ENABLED | 160 | #if LL_LIBXUL_ENABLED |
158 | #include "llmozlib.h" | 161 | #include "llmozlib.h" |
@@ -211,6 +214,7 @@ static bool gGotUseCircuitCodeAck = false; | |||
211 | LLString gInitialOutfit; | 214 | LLString gInitialOutfit; |
212 | LLString gInitialOutfitGender; // "male" or "female" | 215 | LLString gInitialOutfitGender; // "male" or "female" |
213 | 216 | ||
217 | static bool gUseCircuitCallbackCalled = false; | ||
214 | 218 | ||
215 | // | 219 | // |
216 | // local function declaration | 220 | // local function declaration |
@@ -783,12 +787,7 @@ BOOL idle_startup() | |||
783 | LLFile::mkdir(gDirUtilp->getChatLogsDir().c_str()); | 787 | LLFile::mkdir(gDirUtilp->getChatLogsDir().c_str()); |
784 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir().c_str()); | 788 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir().c_str()); |
785 | 789 | ||
786 | |||
787 | #if LL_WINDOWS | ||
788 | if (gSavedSettings.getBOOL("UseDebugLogin") && show_connect_box) | ||
789 | #else | ||
790 | if (show_connect_box) | 790 | if (show_connect_box) |
791 | #endif | ||
792 | { | 791 | { |
793 | LLString server_label; | 792 | LLString server_label; |
794 | S32 domain_name_index; | 793 | S32 domain_name_index; |
@@ -799,10 +798,16 @@ BOOL idle_startup() | |||
799 | { | 798 | { |
800 | snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ | 799 | snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ |
801 | } | 800 | } |
802 | } | ||
803 | 801 | ||
804 | if (show_connect_box) | 802 | // Dave S temp reversion of SL-49082 fix - this code breaks command line urls. I'll fix this with |
805 | { | 803 | // the control isDirty() functionality tomorrow. |
804 | |||
805 | //if ( userPickedServer ) | ||
806 | //{ // User picked a grid from the popup, so clear the stored urls so they will be re-generated from gUserServerChoice | ||
807 | // auth_uris.clear(); | ||
808 | // resetURIs(); | ||
809 | //} | ||
810 | |||
806 | LLString location; | 811 | LLString location; |
807 | LLPanelLogin::getLocation( location ); | 812 | LLPanelLogin::getLocation( location ); |
808 | LLURLSimString::setString( location ); | 813 | LLURLSimString::setString( location ); |
@@ -1159,29 +1164,18 @@ BOOL idle_startup() | |||
1159 | case LLUserAuth::E_COULDNT_RESOLVE_HOST: | 1164 | case LLUserAuth::E_COULDNT_RESOLVE_HOST: |
1160 | case LLUserAuth::E_SSL_PEER_CERTIFICATE: | 1165 | case LLUserAuth::E_SSL_PEER_CERTIFICATE: |
1161 | case LLUserAuth::E_UNHANDLED_ERROR: | 1166 | case LLUserAuth::E_UNHANDLED_ERROR: |
1167 | case LLUserAuth::E_SSL_CACERT: | ||
1168 | case LLUserAuth::E_SSL_CONNECT_ERROR: | ||
1162 | default: | 1169 | default: |
1163 | if (auth_uri_num >= (int) auth_uris.size()) | 1170 | if (auth_uri_num >= (int) auth_uris.size() - 1) |
1164 | { | 1171 | { |
1165 | emsg << "Unable to connect to " << gSecondLife << ".\n"; | 1172 | emsg << "Unable to connect to " << gSecondLife << ".\n"; |
1166 | emsg << gUserAuthp->errorMessage(); | 1173 | emsg << gUserAuthp->errorMessage(); |
1167 | } else { | 1174 | } else { |
1168 | std::ostringstream s; | ||
1169 | s << "Logging in (attempt " << (auth_uri_num + 1) << "). "; | ||
1170 | auth_desc = s.str(); | ||
1171 | gStartupState = STATE_LOGIN_AUTHENTICATE; | ||
1172 | auth_uri_num++; | 1175 | auth_uri_num++; |
1173 | return do_normal_idle; | ||
1174 | } | ||
1175 | break; | ||
1176 | case LLUserAuth::E_SSL_CACERT: | ||
1177 | case LLUserAuth::E_SSL_CONNECT_ERROR: | ||
1178 | if (auth_uri_num >= (int) auth_uris.size()) | ||
1179 | { | ||
1180 | emsg << "Unable to establish a secure connection to the login server.\n"; | ||
1181 | emsg << gUserAuthp->errorMessage(); | ||
1182 | } else { | ||
1183 | std::ostringstream s; | 1176 | std::ostringstream s; |
1184 | s << "Logging in (attempt " << (auth_uri_num + 1) << "). "; | 1177 | s << "Previous login attempt failed. Logging in, attempt " |
1178 | << (auth_uri_num + 1) << ". "; | ||
1185 | auth_desc = s.str(); | 1179 | auth_desc = s.str(); |
1186 | gStartupState = STATE_LOGIN_AUTHENTICATE; | 1180 | gStartupState = STATE_LOGIN_AUTHENTICATE; |
1187 | auth_uri_num++; | 1181 | auth_uri_num++; |
@@ -1431,6 +1425,9 @@ BOOL idle_startup() | |||
1431 | gAutoLogin = FALSE; | 1425 | gAutoLogin = FALSE; |
1432 | show_connect_box = TRUE; | 1426 | show_connect_box = TRUE; |
1433 | } | 1427 | } |
1428 | |||
1429 | // Pass the user information to the voice chat server interface. | ||
1430 | gVoiceClient->userAuthorized(firstname, lastname, gAgentID); | ||
1434 | } | 1431 | } |
1435 | else | 1432 | else |
1436 | { | 1433 | { |
@@ -1553,12 +1550,21 @@ BOOL idle_startup() | |||
1553 | { | 1550 | { |
1554 | update_texture_fetch(); | 1551 | update_texture_fetch(); |
1555 | 1552 | ||
1553 | if ( gViewerWindow != NULL && gToolMgr != NULL ) | ||
1554 | { // This isn't the first logon attempt, so show the UI | ||
1555 | gViewerWindow->setNormalControlsVisible( TRUE ); | ||
1556 | } | ||
1557 | |||
1556 | // Initialize UI | 1558 | // Initialize UI |
1557 | if (!gNoRender) | 1559 | if (!gNoRender) |
1558 | { | 1560 | { |
1559 | // Initialize all our tools. Must be done after saved settings loaded. | 1561 | // Initialize all our tools. Must be done after saved settings loaded. |
1560 | gToolMgr = new LLToolMgr(); | 1562 | if ( gToolMgr == NULL ) |
1561 | gToolMgr->initTools(); | 1563 | { |
1564 | gToolMgr = new LLToolMgr(); | ||
1565 | gToolMgr->initTools(); | ||
1566 | } | ||
1567 | |||
1562 | // Quickly get something onscreen to look at. | 1568 | // Quickly get something onscreen to look at. |
1563 | gViewerWindow->initWorldUI(); | 1569 | gViewerWindow->initWorldUI(); |
1564 | 1570 | ||
@@ -1589,14 +1595,20 @@ BOOL idle_startup() | |||
1589 | 1595 | ||
1590 | gXferManager->registerCallbacks(gMessageSystem); | 1596 | gXferManager->registerCallbacks(gMessageSystem); |
1591 | 1597 | ||
1592 | gCacheName = new LLCacheName(gMessageSystem); | 1598 | if ( gCacheName == NULL ) |
1593 | gCacheName->addObserver(callback_cache_name); | 1599 | { |
1594 | 1600 | gCacheName = new LLCacheName(gMessageSystem); | |
1595 | // Load stored cache if possible | 1601 | gCacheName->addObserver(callback_cache_name); |
1596 | load_name_cache(); | 1602 | |
1603 | // Load stored cache if possible | ||
1604 | load_name_cache(); | ||
1605 | } | ||
1597 | 1606 | ||
1598 | // Data storage for map of world. | 1607 | // Data storage for map of world. |
1599 | gWorldMap = new LLWorldMap(); | 1608 | if ( gWorldMap == NULL ) |
1609 | { | ||
1610 | gWorldMap = new LLWorldMap(); | ||
1611 | } | ||
1600 | 1612 | ||
1601 | // register null callbacks for audio until the audio system is initialized | 1613 | // register null callbacks for audio until the audio system is initialized |
1602 | gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); | 1614 | gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); |
@@ -1678,6 +1690,9 @@ BOOL idle_startup() | |||
1678 | { | 1690 | { |
1679 | llwarns << "Attempting to connect to simulator with a zero circuit code!" << llendl; | 1691 | llwarns << "Attempting to connect to simulator with a zero circuit code!" << llendl; |
1680 | } | 1692 | } |
1693 | |||
1694 | gUseCircuitCallbackCalled = FALSE; | ||
1695 | |||
1681 | msg->enableCircuit(first_sim, TRUE); | 1696 | msg->enableCircuit(first_sim, TRUE); |
1682 | // now, use the circuit info to tell simulator about us! | 1697 | // now, use the circuit info to tell simulator about us! |
1683 | llinfos << "viewer: UserLoginLocationReply() Enabling " << first_sim << " with code " << msg->mOurCircuitCode << llendl; | 1698 | llinfos << "viewer: UserLoginLocationReply() Enabling " << first_sim << " with code " << msg->mOurCircuitCode << llendl; |
@@ -1711,14 +1726,7 @@ BOOL idle_startup() | |||
1711 | { | 1726 | { |
1712 | if (gViewerWindow) | 1727 | if (gViewerWindow) |
1713 | { | 1728 | { |
1714 | if (gSavedSettings.getBOOL("MuteAudio")) | 1729 | audio_update_volume(true); |
1715 | { | ||
1716 | LLMediaEngine::updateClass( 0.0f ); | ||
1717 | } | ||
1718 | else | ||
1719 | { | ||
1720 | LLMediaEngine::updateClass( gSavedSettings.getF32( "MediaAudioVolume" ) ); | ||
1721 | } | ||
1722 | } | 1730 | } |
1723 | 1731 | ||
1724 | #if LL_QUICKTIME_ENABLED // windows only right now but will be ported to mac | 1732 | #if LL_QUICKTIME_ENABLED // windows only right now but will be ported to mac |
@@ -2298,6 +2306,9 @@ BOOL idle_startup() | |||
2298 | // On first start, ask user for gender | 2306 | // On first start, ask user for gender |
2299 | dialog_choose_gender_first_start(); | 2307 | dialog_choose_gender_first_start(); |
2300 | 2308 | ||
2309 | // setup voice | ||
2310 | LLFirstUse::useVoice(); | ||
2311 | |||
2301 | // Start automatic replay if the flag is set. | 2312 | // Start automatic replay if the flag is set. |
2302 | if (gSavedSettings.getBOOL("StatsAutoRun")) | 2313 | if (gSavedSettings.getBOOL("StatsAutoRun")) |
2303 | { | 2314 | { |
@@ -2325,7 +2336,7 @@ BOOL idle_startup() | |||
2325 | } | 2336 | } |
2326 | } | 2337 | } |
2327 | } | 2338 | } |
2328 | 2339 | ||
2329 | // Clean up the userauth stuff. | 2340 | // Clean up the userauth stuff. |
2330 | if (gUserAuthp) | 2341 | if (gUserAuthp) |
2331 | { | 2342 | { |
@@ -2334,13 +2345,9 @@ BOOL idle_startup() | |||
2334 | } | 2345 | } |
2335 | 2346 | ||
2336 | gStartupState++; | 2347 | gStartupState++; |
2337 | //RN: unmute audio now that we are entering world | 2348 | |
2338 | //JC: But only if the user wants audio working. | 2349 | // Unmute audio if desired and setup volumes |
2339 | if (gAudiop) | 2350 | audio_update_volume(); |
2340 | { | ||
2341 | BOOL mute = gSavedSettings.getBOOL("MuteAudio"); | ||
2342 | gAudiop->setMuted(mute); | ||
2343 | } | ||
2344 | 2351 | ||
2345 | // reset keyboard focus to sane state of pointing at world | 2352 | // reset keyboard focus to sane state of pointing at world |
2346 | gFocusMgr.setKeyboardFocus(NULL, NULL); | 2353 | gFocusMgr.setKeyboardFocus(NULL, NULL); |
@@ -2362,9 +2369,15 @@ BOOL idle_startup() | |||
2362 | void login_show() | 2369 | void login_show() |
2363 | { | 2370 | { |
2364 | llinfos << "Initializing Login Screen" << llendl; | 2371 | llinfos << "Initializing Login Screen" << llendl; |
2365 | 2372 | ||
2373 | #ifdef LL_RELEASE_FOR_DOWNLOAD | ||
2374 | BOOL bUseDebugLogin = gSavedSettings.getBOOL("UseDebugLogin"); | ||
2375 | #else | ||
2376 | BOOL bUseDebugLogin = TRUE; | ||
2377 | #endif | ||
2378 | |||
2366 | LLPanelLogin::show( gViewerWindow->getVirtualWindowRect(), | 2379 | LLPanelLogin::show( gViewerWindow->getVirtualWindowRect(), |
2367 | gSavedSettings.getBOOL("UseDebugLogin"), | 2380 | bUseDebugLogin, |
2368 | login_callback, NULL ); | 2381 | login_callback, NULL ); |
2369 | 2382 | ||
2370 | llinfos << "Decoding Images" << llendl; | 2383 | llinfos << "Decoding Images" << llendl; |
@@ -2516,7 +2529,10 @@ void save_password_to_disk(const char* hashed_password) | |||
2516 | LLXORCipher cipher(gMACAddress, 6); | 2529 | LLXORCipher cipher(gMACAddress, 6); |
2517 | cipher.encrypt(buffer, HASHED_LENGTH); | 2530 | cipher.encrypt(buffer, HASHED_LENGTH); |
2518 | 2531 | ||
2519 | fwrite(buffer, HASHED_LENGTH, 1, fp); | 2532 | if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1) |
2533 | { | ||
2534 | llwarns << "Short write" << llendl; | ||
2535 | } | ||
2520 | 2536 | ||
2521 | fclose(fp); | 2537 | fclose(fp); |
2522 | } | 2538 | } |
@@ -2810,10 +2826,9 @@ void use_circuit_callback(void**, S32 result) | |||
2810 | { | 2826 | { |
2811 | // bail if we're quitting. | 2827 | // bail if we're quitting. |
2812 | if(gQuit) return; | 2828 | if(gQuit) return; |
2813 | static bool called = false; | 2829 | if( !gUseCircuitCallbackCalled ) |
2814 | if(!called) | ||
2815 | { | 2830 | { |
2816 | called = true; | 2831 | gUseCircuitCallbackCalled = true; |
2817 | if (result) | 2832 | if (result) |
2818 | { | 2833 | { |
2819 | // Make sure user knows something bad happened. JC | 2834 | // Make sure user knows something bad happened. JC |
@@ -3731,5 +3746,8 @@ void reset_login() | |||
3731 | { | 3746 | { |
3732 | gStartupState = STATE_LOGIN_SHOW; | 3747 | gStartupState = STATE_LOGIN_SHOW; |
3733 | 3748 | ||
3734 | // do cleanup here of in-world UI? | 3749 | if ( gViewerWindow ) |
3750 | { // Hide menus and normal buttons | ||
3751 | gViewerWindow->setNormalControlsVisible( FALSE ); | ||
3752 | } | ||
3735 | } | 3753 | } |