diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 338 |
1 files changed, 142 insertions, 196 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index dad8046..6c37341 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -134,6 +134,7 @@ | |||
134 | #include "llurlsimstring.h" | 134 | #include "llurlsimstring.h" |
135 | #include "llurlwhitelist.h" | 135 | #include "llurlwhitelist.h" |
136 | #include "lluserauth.h" | 136 | #include "lluserauth.h" |
137 | #include "llvieweraudio.h" | ||
137 | #include "llviewerassetstorage.h" | 138 | #include "llviewerassetstorage.h" |
138 | #include "llviewercamera.h" | 139 | #include "llviewercamera.h" |
139 | #include "llviewerdisplay.h" | 140 | #include "llviewerdisplay.h" |
@@ -155,12 +156,16 @@ | |||
155 | #include "llworldmap.h" | 156 | #include "llworldmap.h" |
156 | #include "llxfermanager.h" | 157 | #include "llxfermanager.h" |
157 | #include "pipeline.h" | 158 | #include "pipeline.h" |
158 | #include "viewer.h" | 159 | #include "llappviewer.h" |
159 | #include "llmediaengine.h" | 160 | #include "llmediaengine.h" |
160 | #include "llfasttimerview.h" | 161 | #include "llfasttimerview.h" |
161 | #include "llfloatermap.h" | 162 | #include "llfloatermap.h" |
162 | #include "llweb.h" | 163 | #include "llweb.h" |
163 | #include "llvoiceclient.h" | 164 | #include "llvoiceclient.h" |
165 | #include "llnamelistctrl.h" | ||
166 | #include "llnamebox.h" | ||
167 | #include "llnameeditor.h" | ||
168 | #include "llurlsimstring.h" | ||
164 | 169 | ||
165 | #if LL_LIBXUL_ENABLED | 170 | #if LL_LIBXUL_ENABLED |
166 | #include "llmozlib.h" | 171 | #include "llmozlib.h" |
@@ -186,13 +191,7 @@ | |||
186 | // | 191 | // |
187 | // exported globals | 192 | // exported globals |
188 | // | 193 | // |
189 | 194 | BOOL gAgentMovementCompleted = FALSE; | |
190 | // HACK: Allow server to change sun and moon IDs. | ||
191 | // I can't figure out how to pass the appropriate | ||
192 | // information into the LLVOSky constructor. JC | ||
193 | LLUUID gSunTextureID = IMG_SUN; | ||
194 | LLUUID gMoonTextureID = IMG_MOON; | ||
195 | LLUUID gCloudTextureID = IMG_CLOUD_POOF; | ||
196 | 195 | ||
197 | const char* SCREEN_HOME_FILENAME = "screen_home.bmp"; | 196 | const char* SCREEN_HOME_FILENAME = "screen_home.bmp"; |
198 | const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; | 197 | const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; |
@@ -202,7 +201,6 @@ const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; | |||
202 | // | 201 | // |
203 | extern S32 gStartImageWidth; | 202 | extern S32 gStartImageWidth; |
204 | extern S32 gStartImageHeight; | 203 | extern S32 gStartImageHeight; |
205 | extern std::string gSerialNumber; | ||
206 | 204 | ||
207 | // | 205 | // |
208 | // local globals | 206 | // local globals |
@@ -250,6 +248,17 @@ void init_start_screen(S32 location_id); | |||
250 | void release_start_screen(); | 248 | void release_start_screen(); |
251 | void reset_login(); | 249 | void reset_login(); |
252 | 250 | ||
251 | void callback_cache_name(const LLUUID& id, const char* firstname, const char* lastname, BOOL is_group, void* data) | ||
252 | { | ||
253 | LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); | ||
254 | LLNameBox::refreshAll(id, firstname, lastname, is_group); | ||
255 | LLNameEditor::refreshAll(id, firstname, lastname, is_group); | ||
256 | |||
257 | // TODO: Actually be intelligent about the refresh. | ||
258 | // For now, just brute force refresh the dialogs. | ||
259 | dialog_refresh_all(); | ||
260 | } | ||
261 | |||
253 | // | 262 | // |
254 | // exported functionality | 263 | // exported functionality |
255 | // | 264 | // |
@@ -288,9 +297,9 @@ public: | |||
288 | 297 | ||
289 | void update_texture_fetch() | 298 | void update_texture_fetch() |
290 | { | 299 | { |
291 | gTextureCache->update(1); // unpauses the texture cache thread | 300 | LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread |
292 | gImageDecodeThread->update(1); // unpauses the image thread | 301 | LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread |
293 | gTextureFetch->update(1); // unpauses the texture fetch thread | 302 | LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread |
294 | gImageList.updateImages(0.10f); | 303 | gImageList.updateImages(0.10f); |
295 | } | 304 | } |
296 | 305 | ||
@@ -320,6 +329,7 @@ BOOL idle_startup() | |||
320 | static std::string auth_message; | 329 | static std::string auth_message; |
321 | static LLString firstname; | 330 | static LLString firstname; |
322 | static LLString lastname; | 331 | static LLString lastname; |
332 | static LLUUID web_login_key; | ||
323 | static LLString password; | 333 | static LLString password; |
324 | static std::vector<const char*> requested_options; | 334 | static std::vector<const char*> requested_options; |
325 | 335 | ||
@@ -339,7 +349,6 @@ BOOL idle_startup() | |||
339 | static S32 location_which = START_LOCATION_ID_LAST; | 349 | static S32 location_which = START_LOCATION_ID_LAST; |
340 | 350 | ||
341 | static BOOL show_connect_box = TRUE; | 351 | static BOOL show_connect_box = TRUE; |
342 | static BOOL remember_password = TRUE; | ||
343 | 352 | ||
344 | static BOOL stipend_since_login = FALSE; | 353 | static BOOL stipend_since_login = FALSE; |
345 | 354 | ||
@@ -372,7 +381,7 @@ BOOL idle_startup() | |||
372 | 381 | ||
373 | ///////////////////////////////////////////////// | 382 | ///////////////////////////////////////////////// |
374 | // | 383 | // |
375 | // Initialize stuff that doesn't need data from userserver/simulators | 384 | // Initialize stuff that doesn't need data from simulators |
376 | // | 385 | // |
377 | 386 | ||
378 | if (gFeatureManagerp->isSafe()) | 387 | if (gFeatureManagerp->isSafe()) |
@@ -412,7 +421,7 @@ BOOL idle_startup() | |||
412 | // *TODO:translate (maybe - very unlikely error message) | 421 | // *TODO:translate (maybe - very unlikely error message) |
413 | // Note: alerts.xml may be invalid - if this gets translated it will need to be in the code | 422 | // Note: alerts.xml may be invalid - if this gets translated it will need to be in the code |
414 | LLString bad_xui_msg = "An error occured while updating Second Life. Please download the latest version from www.secondlife.com."; | 423 | LLString bad_xui_msg = "An error occured while updating Second Life. Please download the latest version from www.secondlife.com."; |
415 | app_early_exit(bad_xui_msg); | 424 | LLAppViewer::instance()->earlyExit(bad_xui_msg); |
416 | } | 425 | } |
417 | // | 426 | // |
418 | // Statistics stuff | 427 | // Statistics stuff |
@@ -465,13 +474,13 @@ BOOL idle_startup() | |||
465 | std::string())) | 474 | std::string())) |
466 | { | 475 | { |
467 | std::string msg = llformat("Unable to start networking, error %d", gMessageSystem->getErrorCode()); | 476 | std::string msg = llformat("Unable to start networking, error %d", gMessageSystem->getErrorCode()); |
468 | app_early_exit(msg); | 477 | LLAppViewer::instance()->earlyExit(msg); |
469 | } | 478 | } |
470 | LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); | 479 | LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); |
471 | } | 480 | } |
472 | else | 481 | else |
473 | { | 482 | { |
474 | app_early_exit("Unable to initialize communications."); | 483 | LLAppViewer::instance()->earlyExit("Unable to initialize communications."); |
475 | } | 484 | } |
476 | 485 | ||
477 | if(gMessageSystem && gMessageSystem->isOK()) | 486 | if(gMessageSystem && gMessageSystem->isOK()) |
@@ -625,37 +634,42 @@ BOOL idle_startup() | |||
625 | // | 634 | // |
626 | // Log on to system | 635 | // Log on to system |
627 | // | 636 | // |
628 | if( !gCmdLineFirstName.empty() | 637 | if ((!gLoginHandler.mFirstName.empty() && |
638 | !gLoginHandler.mLastName.empty() && | ||
639 | !gLoginHandler.mWebLoginKey.isNull()) | ||
640 | || gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand) ) | ||
641 | { | ||
642 | firstname = gLoginHandler.mFirstName; | ||
643 | lastname = gLoginHandler.mLastName; | ||
644 | web_login_key = gLoginHandler.mWebLoginKey; | ||
645 | |||
646 | show_connect_box = FALSE; | ||
647 | } | ||
648 | else if( !gCmdLineFirstName.empty() | ||
629 | && !gCmdLineLastName.empty() | 649 | && !gCmdLineLastName.empty() |
630 | && !gCmdLinePassword.empty()) | 650 | && !gCmdLinePassword.empty()) |
631 | { | 651 | { |
632 | firstname = gCmdLineFirstName; | 652 | firstname = gCmdLineFirstName; |
633 | lastname = gCmdLineLastName; | 653 | lastname = gCmdLineLastName; |
634 | 654 | ||
635 | LLMD5 pass((unsigned char*)gCmdLinePassword.c_str()); | 655 | show_connect_box = TRUE; |
636 | char md5pass[33]; /* Flawfinder: ignore */ | 656 | gAutoLogin = TRUE; |
637 | pass.hex_digest(md5pass); | ||
638 | password = md5pass; | ||
639 | |||
640 | remember_password = gSavedSettings.getBOOL("RememberPassword"); | ||
641 | show_connect_box = FALSE; | ||
642 | } | 657 | } |
643 | else if (gAutoLogin || gSavedSettings.getBOOL("AutoLogin")) | 658 | else if (gAutoLogin || gSavedSettings.getBOOL("AutoLogin")) |
644 | { | 659 | { |
645 | firstname = gSavedSettings.getString("FirstName"); | 660 | firstname = gSavedSettings.getString("FirstName"); |
646 | lastname = gSavedSettings.getString("LastName"); | 661 | lastname = gSavedSettings.getString("LastName"); |
647 | password = load_password_from_disk(); | 662 | password = load_password_from_disk(); |
648 | remember_password = TRUE; | 663 | gSavedSettings.setBOOL("RememberPassword", TRUE); |
649 | show_connect_box = FALSE; | 664 | show_connect_box = TRUE; |
650 | } | 665 | } |
651 | else | 666 | else |
652 | { | 667 | { |
653 | // if not automatically logging in, display login dialog | 668 | // if not automatically logging in, display login dialog |
654 | // until a valid userserver is selected | 669 | // a valid grid is selected |
655 | firstname = gSavedSettings.getString("FirstName"); | 670 | firstname = gSavedSettings.getString("FirstName"); |
656 | lastname = gSavedSettings.getString("LastName"); | 671 | lastname = gSavedSettings.getString("LastName"); |
657 | password = load_password_from_disk(); | 672 | password = load_password_from_disk(); |
658 | remember_password = gSavedSettings.getBOOL("RememberPassword"); | ||
659 | show_connect_box = TRUE; | 673 | show_connect_box = TRUE; |
660 | } | 674 | } |
661 | 675 | ||
@@ -665,7 +679,8 @@ BOOL idle_startup() | |||
665 | } | 679 | } |
666 | 680 | ||
667 | if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) | 681 | if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) |
668 | { | 682 | { |
683 | |||
669 | llinfos << "Initializing Window" << llendl; | 684 | llinfos << "Initializing Window" << llendl; |
670 | 685 | ||
671 | gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); | 686 | gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); |
@@ -686,8 +701,6 @@ BOOL idle_startup() | |||
686 | // Show the login dialog | 701 | // Show the login dialog |
687 | login_show(); | 702 | login_show(); |
688 | 703 | ||
689 | // connect dialog is already shown, so fill in the names | ||
690 | LLPanelLogin::setFields( firstname, lastname, password, remember_password ); | ||
691 | LLPanelLogin::giveFocus(); | 704 | LLPanelLogin::giveFocus(); |
692 | 705 | ||
693 | gSavedSettings.setBOOL("FirstRunThisInstall", FALSE); | 706 | gSavedSettings.setBOOL("FirstRunThisInstall", FALSE); |
@@ -699,6 +712,32 @@ BOOL idle_startup() | |||
699 | // skip directly to message template verification | 712 | // skip directly to message template verification |
700 | LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); | 713 | LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); |
701 | } | 714 | } |
715 | |||
716 | // Create selection manager | ||
717 | // Must be done before menus created, because many enabled callbacks | ||
718 | // require its existance. | ||
719 | gSelectMgr = new LLSelectMgr(); | ||
720 | gParcelMgr = new LLViewerParcelMgr(); | ||
721 | gHUDManager = new LLHUDManager(); | ||
722 | gMuteListp = new LLMuteList(); | ||
723 | |||
724 | // Initialize UI | ||
725 | if (!gNoRender) | ||
726 | { | ||
727 | // Initialize all our tools. Must be done after saved settings loaded. | ||
728 | if ( gToolMgr == NULL ) | ||
729 | { | ||
730 | gToolMgr = new LLToolMgr(); | ||
731 | gToolMgr->initTools(); | ||
732 | } | ||
733 | |||
734 | // Quickly get something onscreen to look at. | ||
735 | gViewerWindow->initWorldUI(); | ||
736 | } | ||
737 | |||
738 | gViewerWindow->setNormalControlsVisible( FALSE ); | ||
739 | gLoginMenuBarView->setVisible( TRUE ); | ||
740 | gLoginMenuBarView->setEnabled( TRUE ); | ||
702 | 741 | ||
703 | timeout.reset(); | 742 | timeout.reset(); |
704 | return do_normal_idle; | 743 | return do_normal_idle; |
@@ -716,11 +755,16 @@ BOOL idle_startup() | |||
716 | 755 | ||
717 | if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) | 756 | if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) |
718 | { | 757 | { |
758 | //reset the values that could have come in from a slurl | ||
759 | if (!gLoginHandler.mWebLoginKey.isNull()) | ||
760 | { | ||
761 | firstname = gLoginHandler.mFirstName; | ||
762 | lastname = gLoginHandler.mLastName; | ||
763 | web_login_key = gLoginHandler.mWebLoginKey; | ||
764 | } | ||
765 | |||
719 | if (show_connect_box) | 766 | if (show_connect_box) |
720 | { | 767 | { |
721 | // Load all the name information out of the login view | ||
722 | LLPanelLogin::getFields(firstname, lastname, password, remember_password); | ||
723 | |||
724 | // HACK: Try to make not jump on login | 768 | // HACK: Try to make not jump on login |
725 | gKeyboard->resetKeys(); | 769 | gKeyboard->resetKeys(); |
726 | } | 770 | } |
@@ -730,12 +774,11 @@ BOOL idle_startup() | |||
730 | gSavedSettings.setString("FirstName", firstname); | 774 | gSavedSettings.setString("FirstName", firstname); |
731 | gSavedSettings.setString("LastName", lastname); | 775 | gSavedSettings.setString("LastName", lastname); |
732 | 776 | ||
777 | |||
778 | |||
779 | |||
733 | llinfos << "Attempting login as: " << firstname << " " << lastname << llendl; | 780 | llinfos << "Attempting login as: " << firstname << " " << lastname << llendl; |
734 | write_debug("Attempting login as: "); | 781 | gDebugInfo["LoginName"] = firstname + " " + lastname; |
735 | write_debug(firstname); | ||
736 | write_debug(" "); | ||
737 | write_debug(lastname); | ||
738 | write_debug("\n"); | ||
739 | } | 782 | } |
740 | 783 | ||
741 | // create necessary directories | 784 | // create necessary directories |
@@ -780,28 +823,10 @@ BOOL idle_startup() | |||
780 | 823 | ||
781 | if (show_connect_box) | 824 | if (show_connect_box) |
782 | { | 825 | { |
783 | LLString server_label; | ||
784 | S32 domain_name_index; | ||
785 | BOOL user_picked_server = LLPanelLogin::getServer( server_label, domain_name_index ); | ||
786 | gUserServerChoice = (EUserServerDomain) domain_name_index; | ||
787 | gSavedSettings.setS32("ServerChoice", gUserServerChoice); | ||
788 | if (gUserServerChoice == USERSERVER_OTHER) | ||
789 | { | ||
790 | snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ | ||
791 | } | ||
792 | |||
793 | if ( user_picked_server ) | ||
794 | { // User picked a grid from the popup, so clear the stored urls and they will be re-generated from gUserServerChoice | ||
795 | sAuthUris.clear(); | ||
796 | resetURIs(); | ||
797 | } | ||
798 | |||
799 | LLString location; | ||
800 | LLPanelLogin::getLocation( location ); | ||
801 | LLURLSimString::setString( location ); | ||
802 | LLPanelLogin::close(); | 826 | LLPanelLogin::close(); |
803 | } | 827 | } |
804 | 828 | ||
829 | |||
805 | //For HTML parsing in text boxes. | 830 | //For HTML parsing in text boxes. |
806 | LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); | 831 | LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); |
807 | LLTextEditor::setURLCallbacks ( &LLWeb::loadURL, &LLURLDispatcher::dispatch, &LLURLDispatcher::dispatch ); | 832 | LLTextEditor::setURLCallbacks ( &LLWeb::loadURL, &LLURLDispatcher::dispatch, &LLURLDispatcher::dispatch ); |
@@ -871,6 +896,8 @@ BOOL idle_startup() | |||
871 | if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState()) | 896 | if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState()) |
872 | { | 897 | { |
873 | //#define LL_MINIMIAL_REQUESTED_OPTIONS | 898 | //#define LL_MINIMIAL_REQUESTED_OPTIONS |
899 | gDebugInfo["GridUtilHost"] = gGridInfo[gGridChoice].mName; | ||
900 | |||
874 | lldebugs << "STATE_LOGIN_AUTH_INIT" << llendl; | 901 | lldebugs << "STATE_LOGIN_AUTH_INIT" << llendl; |
875 | if (!gUserAuthp) | 902 | if (!gUserAuthp) |
876 | { | 903 | { |
@@ -906,14 +933,13 @@ BOOL idle_startup() | |||
906 | gSavedSettings.setBOOL("UseDebugMenus", TRUE); | 933 | gSavedSettings.setBOOL("UseDebugMenus", TRUE); |
907 | requested_options.push_back("god-connect"); | 934 | requested_options.push_back("god-connect"); |
908 | } | 935 | } |
909 | if (sAuthUris.empty()) | 936 | LLAppViewer::instance()->getLoginURIs(); |
910 | { | 937 | sAuthUris = LLAppViewer::instance()->getLoginURIs(); |
911 | sAuthUris = getLoginURIs(); | 938 | |
912 | } | ||
913 | sAuthUriNum = 0; | 939 | sAuthUriNum = 0; |
914 | auth_method = "login_to_simulator"; | 940 | auth_method = "login_to_simulator"; |
915 | auth_desc = "Logging in. "; | 941 | auth_desc = "Logging in. "; |
916 | auth_desc += gSecondLife; | 942 | auth_desc += LLAppViewer::instance()->getSecondLifeTitle(); |
917 | auth_desc += " may appear frozen. Please wait."; | 943 | auth_desc += " may appear frozen. Please wait."; |
918 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); | 944 | LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); |
919 | } | 945 | } |
@@ -931,11 +957,12 @@ BOOL idle_startup() | |||
931 | // a startup URL was specified | 957 | // a startup URL was specified |
932 | std::stringstream unescaped_start; | 958 | std::stringstream unescaped_start; |
933 | unescaped_start << "uri:" | 959 | unescaped_start << "uri:" |
934 | << LLURLSimString::sInstance.mSimName << "&" | 960 | << LLURLSimString::sInstance.mSimName << "&" |
935 | << LLURLSimString::sInstance.mX << "&" | 961 | << LLURLSimString::sInstance.mX << "&" |
936 | << LLURLSimString::sInstance.mY << "&" | 962 | << LLURLSimString::sInstance.mY << "&" |
937 | << LLURLSimString::sInstance.mZ; | 963 | << LLURLSimString::sInstance.mZ; |
938 | start << xml_escape_string(unescaped_start.str().c_str()); | 964 | start << xml_escape_string(unescaped_start.str().c_str()); |
965 | |||
939 | } | 966 | } |
940 | else if (gSavedSettings.getBOOL("LoginLastLocation")) | 967 | else if (gSavedSettings.getBOOL("LoginLastLocation")) |
941 | { | 968 | { |
@@ -951,13 +978,13 @@ BOOL idle_startup() | |||
951 | hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES ); | 978 | hashed_mac.update( gMACAddress, MAC_ADDRESS_BYTES ); |
952 | hashed_mac.finalize(); | 979 | hashed_mac.finalize(); |
953 | hashed_mac.hex_digest(hashed_mac_string); | 980 | hashed_mac.hex_digest(hashed_mac_string); |
954 | 981 | ||
955 | gUserAuthp->authenticate( | 982 | gUserAuthp->authenticate( |
956 | sAuthUris[sAuthUriNum].c_str(), | 983 | sAuthUris[sAuthUriNum].c_str(), |
957 | auth_method.c_str(), | 984 | auth_method.c_str(), |
958 | firstname.c_str(), | 985 | firstname.c_str(), |
959 | lastname.c_str(), | 986 | lastname.c_str(), |
960 | password.c_str(), | 987 | web_login_key, |
961 | start.str().c_str(), | 988 | start.str().c_str(), |
962 | gSkipOptionalUpdate, | 989 | gSkipOptionalUpdate, |
963 | gAcceptTOS, | 990 | gAcceptTOS, |
@@ -966,7 +993,8 @@ BOOL idle_startup() | |||
966 | gLastExecFroze, | 993 | gLastExecFroze, |
967 | requested_options, | 994 | requested_options, |
968 | hashed_mac_string, | 995 | hashed_mac_string, |
969 | gSerialNumber); | 996 | LLAppViewer::instance()->getSerialNumber()); |
997 | |||
970 | // reset globals | 998 | // reset globals |
971 | gAcceptTOS = FALSE; | 999 | gAcceptTOS = FALSE; |
972 | gAcceptCriticalMessage = FALSE; | 1000 | gAcceptCriticalMessage = FALSE; |
@@ -977,6 +1005,10 @@ BOOL idle_startup() | |||
977 | if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState()) | 1005 | if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState()) |
978 | { | 1006 | { |
979 | //lldebugs << "STATE_LOGIN_NO_DATA_YET" << llendl; | 1007 | //lldebugs << "STATE_LOGIN_NO_DATA_YET" << llendl; |
1008 | // If we get here we have gotten past the potential stall | ||
1009 | // in curl, so take "may appear frozen" out of progress bar. JC | ||
1010 | auth_desc = "Logging in..."; | ||
1011 | set_startup_status(progress, auth_desc.c_str(), auth_message.c_str()); | ||
980 | if (!gUserAuthp) | 1012 | if (!gUserAuthp) |
981 | { | 1013 | { |
982 | llerrs << "No userauth in STATE_LOGIN_NO_DATA_YET!" << llendl; | 1014 | llerrs << "No userauth in STATE_LOGIN_NO_DATA_YET!" << llendl; |
@@ -1167,7 +1199,7 @@ BOOL idle_startup() | |||
1167 | default: | 1199 | default: |
1168 | if (sAuthUriNum >= (int) sAuthUris.size() - 1) | 1200 | if (sAuthUriNum >= (int) sAuthUris.size() - 1) |
1169 | { | 1201 | { |
1170 | emsg << "Unable to connect to " << gSecondLife << ".\n"; | 1202 | emsg << "Unable to connect to " << LLAppViewer::instance()->getSecondLifeTitle() << ".\n"; |
1171 | emsg << gUserAuthp->errorMessage(); | 1203 | emsg << gUserAuthp->errorMessage(); |
1172 | } else { | 1204 | } else { |
1173 | sAuthUriNum++; | 1205 | sAuthUriNum++; |
@@ -1187,7 +1219,7 @@ BOOL idle_startup() | |||
1187 | { | 1219 | { |
1188 | delete gUserAuthp; | 1220 | delete gUserAuthp; |
1189 | gUserAuthp = NULL; | 1221 | gUserAuthp = NULL; |
1190 | app_force_quit(NULL); | 1222 | LLAppViewer::instance()->forceQuit(); |
1191 | return FALSE; | 1223 | return FALSE; |
1192 | } | 1224 | } |
1193 | 1225 | ||
@@ -1202,15 +1234,11 @@ BOOL idle_startup() | |||
1202 | const char* text; | 1234 | const char* text; |
1203 | text = gUserAuthp->getResponse("agent_id"); | 1235 | text = gUserAuthp->getResponse("agent_id"); |
1204 | if(text) gAgentID.set(text); | 1236 | if(text) gAgentID.set(text); |
1205 | write_debug("AgentID: "); | 1237 | gDebugInfo["AgentID"] = text; |
1206 | write_debug(text); | ||
1207 | write_debug("\n"); | ||
1208 | 1238 | ||
1209 | text = gUserAuthp->getResponse("session_id"); | 1239 | text = gUserAuthp->getResponse("session_id"); |
1210 | if(text) gAgentSessionID.set(text); | 1240 | if(text) gAgentSessionID.set(text); |
1211 | write_debug("SessionID: "); | 1241 | gDebugInfo["SessionID"] = text; |
1212 | write_debug(text); | ||
1213 | write_debug("\n"); | ||
1214 | 1242 | ||
1215 | text = gUserAuthp->getResponse("secure_session_id"); | 1243 | text = gUserAuthp->getResponse("secure_session_id"); |
1216 | if(text) gAgent.mSecureSessionID.set(text); | 1244 | if(text) gAgent.mSecureSessionID.set(text); |
@@ -1228,17 +1256,8 @@ BOOL idle_startup() | |||
1228 | if(text) lastname.assign(text); | 1256 | if(text) lastname.assign(text); |
1229 | gSavedSettings.setString("FirstName", firstname); | 1257 | gSavedSettings.setString("FirstName", firstname); |
1230 | gSavedSettings.setString("LastName", lastname); | 1258 | gSavedSettings.setString("LastName", lastname); |
1231 | if (remember_password) | 1259 | |
1232 | { | ||
1233 | save_password_to_disk(password.c_str()); | ||
1234 | } | ||
1235 | else | ||
1236 | { | ||
1237 | save_password_to_disk(NULL); | ||
1238 | } | ||
1239 | gSavedSettings.setBOOL("RememberPassword", remember_password); | ||
1240 | gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); | 1260 | gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); |
1241 | gSavedSettings.setBOOL("LoggedIn", TRUE); | ||
1242 | 1261 | ||
1243 | text = gUserAuthp->getResponse("agent_access"); | 1262 | text = gUserAuthp->getResponse("agent_access"); |
1244 | if(text && (text[0] == 'M')) | 1263 | if(text && (text[0] == 'M')) |
@@ -1463,14 +1482,6 @@ BOOL idle_startup() | |||
1463 | // type the name/password again if we crash. | 1482 | // type the name/password again if we crash. |
1464 | gSavedSettings.saveToFile(gSettingsFileName, TRUE); | 1483 | gSavedSettings.saveToFile(gSettingsFileName, TRUE); |
1465 | 1484 | ||
1466 | // Create selection manager | ||
1467 | // Must be done before menus created, because many enabled callbacks | ||
1468 | // require its existance. | ||
1469 | gSelectMgr = new LLSelectMgr(); | ||
1470 | gParcelMgr = new LLViewerParcelMgr(); | ||
1471 | gHUDManager = new LLHUDManager(); | ||
1472 | gMuteListp = new LLMuteList(); | ||
1473 | |||
1474 | // | 1485 | // |
1475 | // Initialize classes w/graphics stuff. | 1486 | // Initialize classes w/graphics stuff. |
1476 | // | 1487 | // |
@@ -1539,21 +1550,14 @@ BOOL idle_startup() | |||
1539 | if ( gViewerWindow != NULL && gToolMgr != NULL ) | 1550 | if ( gViewerWindow != NULL && gToolMgr != NULL ) |
1540 | { // This isn't the first logon attempt, so show the UI | 1551 | { // This isn't the first logon attempt, so show the UI |
1541 | gViewerWindow->setNormalControlsVisible( TRUE ); | 1552 | gViewerWindow->setNormalControlsVisible( TRUE ); |
1542 | } | 1553 | } |
1554 | gLoginMenuBarView->setVisible( FALSE ); | ||
1555 | gLoginMenuBarView->setEnabled( FALSE ); | ||
1556 | |||
1557 | gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); | ||
1543 | 1558 | ||
1544 | // Initialize UI | ||
1545 | if (!gNoRender) | 1559 | if (!gNoRender) |
1546 | { | 1560 | { |
1547 | // Initialize all our tools. Must be done after saved settings loaded. | ||
1548 | if ( gToolMgr == NULL ) | ||
1549 | { | ||
1550 | gToolMgr = new LLToolMgr(); | ||
1551 | gToolMgr->initTools(); | ||
1552 | } | ||
1553 | |||
1554 | // Quickly get something onscreen to look at. | ||
1555 | gViewerWindow->initWorldUI(); | ||
1556 | |||
1557 | // Move the progress view in front of the UI | 1561 | // Move the progress view in front of the UI |
1558 | gViewerWindow->moveProgressViewToFront(); | 1562 | gViewerWindow->moveProgressViewToFront(); |
1559 | 1563 | ||
@@ -1587,7 +1591,7 @@ BOOL idle_startup() | |||
1587 | gCacheName->addObserver(callback_cache_name); | 1591 | gCacheName->addObserver(callback_cache_name); |
1588 | 1592 | ||
1589 | // Load stored cache if possible | 1593 | // Load stored cache if possible |
1590 | load_name_cache(); | 1594 | LLAppViewer::instance()->loadNameCache(); |
1591 | } | 1595 | } |
1592 | 1596 | ||
1593 | // Data storage for map of world. | 1597 | // Data storage for map of world. |
@@ -1985,22 +1989,8 @@ BOOL idle_startup() | |||
1985 | gAgent.sendReliableMessage(); | 1989 | gAgent.sendReliableMessage(); |
1986 | 1990 | ||
1987 | // request all group information | 1991 | // request all group information |
1988 | // *FIX: This will not do the right thing if the message | ||
1989 | // gets there before the requestuserserverconnection | ||
1990 | // circuit is completed. | ||
1991 | gAgent.sendAgentDataUpdateRequest(); | 1992 | gAgent.sendAgentDataUpdateRequest(); |
1992 | 1993 | ||
1993 | |||
1994 | // NOTE: removed as part of user-privacy | ||
1995 | // enhancements. this information should be available from | ||
1996 | // login. 2006-10-16 Phoenix. | ||
1997 | // get the users that have been granted modify powers | ||
1998 | //msg->newMessageFast(_PREHASH_RequestGrantedProxies); | ||
1999 | //msg->nextBlockFast(_PREHASH_AgentData); | ||
2000 | //msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
2001 | //msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
2002 | //gAgent.sendReliableMessage(); | ||
2003 | |||
2004 | BOOL shown_at_exit = gSavedSettings.getBOOL("ShowInventory"); | 1994 | BOOL shown_at_exit = gSavedSettings.getBOOL("ShowInventory"); |
2005 | 1995 | ||
2006 | // Create the inventory views | 1996 | // Create the inventory views |
@@ -2136,7 +2126,6 @@ BOOL idle_startup() | |||
2136 | //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius); | 2126 | //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius); |
2137 | 2127 | ||
2138 | llinfos << "Initialization complete" << llendl; | 2128 | llinfos << "Initialization complete" << llendl; |
2139 | gInitializationComplete = TRUE; | ||
2140 | 2129 | ||
2141 | gRenderStartTime.reset(); | 2130 | gRenderStartTime.reset(); |
2142 | gForegroundTime.reset(); | 2131 | gForegroundTime.reset(); |
@@ -2169,17 +2158,17 @@ BOOL idle_startup() | |||
2169 | if (url_ok) | 2158 | if (url_ok) |
2170 | { | 2159 | { |
2171 | args["[TYPE]"] = "desired"; | 2160 | args["[TYPE]"] = "desired"; |
2172 | args["[HELP]"] = " "; | 2161 | args["[HELP]"] = ""; |
2173 | } | 2162 | } |
2174 | else if (gSavedSettings.getBOOL("LoginLastLocation")) | 2163 | else if (gSavedSettings.getBOOL("LoginLastLocation")) |
2175 | { | 2164 | { |
2176 | args["[TYPE]"] = "last"; | 2165 | args["[TYPE]"] = "last"; |
2177 | args["[HELP]"] = " \n "; | 2166 | args["[HELP]"] = ""; |
2178 | } | 2167 | } |
2179 | else | 2168 | else |
2180 | { | 2169 | { |
2181 | args["[TYPE]"] = "home"; | 2170 | args["[TYPE]"] = "home"; |
2182 | args["[HELP]"] = " \nYou may want to set a new home location.\n "; | 2171 | args["[HELP]"] = "\nYou may want to set a new home location."; |
2183 | } | 2172 | } |
2184 | gViewerWindow->alertXml("AvatarMoved", args); | 2173 | gViewerWindow->alertXml("AvatarMoved", args); |
2185 | } | 2174 | } |
@@ -2351,68 +2340,12 @@ void login_show() | |||
2351 | // UI textures have been previously loaded in doPreloadImages() | 2340 | // UI textures have been previously loaded in doPreloadImages() |
2352 | 2341 | ||
2353 | llinfos << "Setting Servers" << llendl; | 2342 | llinfos << "Setting Servers" << llendl; |
2354 | |||
2355 | if( USERSERVER_OTHER == gUserServerChoice ) | ||
2356 | { | ||
2357 | LLPanelLogin::addServer( gUserServerName, USERSERVER_OTHER ); | ||
2358 | } | ||
2359 | else | ||
2360 | { | ||
2361 | LLPanelLogin::addServer( gUserServerDomainName[gUserServerChoice].mLabel, gUserServerChoice ); | ||
2362 | } | ||
2363 | |||
2364 | // Arg! We hate loops! | ||
2365 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_DMZ].mLabel, USERSERVER_DMZ ); | ||
2366 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_LOCAL].mLabel, USERSERVER_LOCAL ); | ||
2367 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_AGNI].mLabel, USERSERVER_AGNI ); | ||
2368 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_ADITI].mLabel, USERSERVER_ADITI ); | ||
2369 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SIVA].mLabel, USERSERVER_SIVA ); | ||
2370 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_DURGA].mLabel, USERSERVER_DURGA ); | ||
2371 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SHAKTI].mLabel, USERSERVER_SHAKTI ); | ||
2372 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_GANGA].mLabel, USERSERVER_GANGA ); | ||
2373 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_UMA].mLabel, USERSERVER_UMA ); | ||
2374 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SOMA].mLabel, USERSERVER_SOMA ); | ||
2375 | LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_VAAK].mLabel, USERSERVER_VAAK ); | ||
2376 | } | 2343 | } |
2377 | 2344 | ||
2378 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. | 2345 | // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. |
2379 | void login_callback(S32 option, void *userdata) | 2346 | void login_callback(S32 option, void *userdata) |
2380 | { | 2347 | { |
2381 | const S32 CONNECT_OPTION = 0; | ||
2382 | const S32 QUIT_OPTION = 1; | ||
2383 | |||
2384 | if (CONNECT_OPTION == option) | ||
2385 | { | ||
2386 | LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); | ||
2387 | return; | ||
2388 | } | ||
2389 | else if (QUIT_OPTION == option) | ||
2390 | { | ||
2391 | // Make sure we don't save the password if the user is trying to clear it. | ||
2392 | LLString first, last, password; | ||
2393 | BOOL remember = TRUE; | ||
2394 | LLPanelLogin::getFields(first, last, password, remember); | ||
2395 | if (!remember) | ||
2396 | { | ||
2397 | // turn off the setting and write out to disk | ||
2398 | gSavedSettings.setBOOL("RememberPassword", FALSE); | ||
2399 | gSavedSettings.saveToFile(gSettingsFileName, TRUE); | ||
2400 | |||
2401 | // stomp the saved password on disk | ||
2402 | save_password_to_disk(NULL); | ||
2403 | } | ||
2404 | 2348 | ||
2405 | LLPanelLogin::close(); | ||
2406 | |||
2407 | // Next iteration through main loop should shut down the app cleanly. | ||
2408 | gQuit = TRUE; | ||
2409 | |||
2410 | return; | ||
2411 | } | ||
2412 | else | ||
2413 | { | ||
2414 | llwarns << "Unknown login button clicked" << llendl; | ||
2415 | } | ||
2416 | } | 2349 | } |
2417 | 2350 | ||
2418 | LLString load_password_from_disk() | 2351 | LLString load_password_from_disk() |
@@ -2660,7 +2593,7 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2660 | // ...user doesn't want to do it | 2593 | // ...user doesn't want to do it |
2661 | if (mandatory) | 2594 | if (mandatory) |
2662 | { | 2595 | { |
2663 | app_force_quit(); | 2596 | LLAppViewer::instance()->forceQuit(); |
2664 | // Bump them back to the login screen. | 2597 | // Bump them back to the login screen. |
2665 | //reset_login(); | 2598 | //reset_login(); |
2666 | } | 2599 | } |
@@ -2680,7 +2613,9 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2680 | #elif LL_LINUX | 2613 | #elif LL_LINUX |
2681 | query_map["os"] = "lnx"; | 2614 | query_map["os"] = "lnx"; |
2682 | #endif | 2615 | #endif |
2683 | query_map["userserver"] = gUserServerName; | 2616 | // *TODO change userserver to be grid on both viewer and sim, since |
2617 | // userserver no longer exists. | ||
2618 | query_map["userserver"] = gGridName; | ||
2684 | query_map["channel"] = gChannelName; | 2619 | query_map["channel"] = gChannelName; |
2685 | // *TODO constantize this guy | 2620 | // *TODO constantize this guy |
2686 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2621 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
@@ -2691,7 +2626,7 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2691 | { | 2626 | { |
2692 | // We're hosed, bail | 2627 | // We're hosed, bail |
2693 | llwarns << "LLDir::getTempFilename() failed" << llendl; | 2628 | llwarns << "LLDir::getTempFilename() failed" << llendl; |
2694 | app_force_quit(NULL); | 2629 | LLAppViewer::instance()->forceQuit(); |
2695 | return; | 2630 | return; |
2696 | } | 2631 | } |
2697 | 2632 | ||
@@ -2709,7 +2644,7 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2709 | if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) | 2644 | if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) |
2710 | { | 2645 | { |
2711 | llinfos << "Unable to copy the updater!" << llendl; | 2646 | llinfos << "Unable to copy the updater!" << llendl; |
2712 | app_force_quit(NULL); | 2647 | LLAppViewer::instance()->forceQuit(); |
2713 | return; | 2648 | return; |
2714 | } | 2649 | } |
2715 | 2650 | ||
@@ -2742,13 +2677,14 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2742 | program_name = "SecondLife"; | 2677 | program_name = "SecondLife"; |
2743 | } | 2678 | } |
2744 | 2679 | ||
2745 | params << " -silent -name \"" << gSecondLife << "\""; | 2680 | params << " -silent -name \"" << LLAppViewer::instance()->getSecondLifeTitle() << "\""; |
2746 | params << " -program \"" << program_name << "\""; | 2681 | params << " -program \"" << program_name << "\""; |
2747 | } | 2682 | } |
2748 | 2683 | ||
2749 | llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; | 2684 | llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; |
2750 | 2685 | ||
2751 | remove_marker_file(); // In case updater fails | 2686 | // *REMOVE:Mani The following call is handled through ~LLAppViewer. |
2687 | // remove_marker_file(); // In case updater fails | ||
2752 | 2688 | ||
2753 | // Use spawn() to run asynchronously | 2689 | // Use spawn() to run asynchronously |
2754 | int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); | 2690 | int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); |
@@ -2767,13 +2703,14 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2767 | update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -url \""; | 2703 | update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -url \""; |
2768 | update_exe_path += update_url.asString(); | 2704 | update_exe_path += update_url.asString(); |
2769 | update_exe_path += "\" -name \""; | 2705 | update_exe_path += "\" -name \""; |
2770 | update_exe_path += gSecondLife; | 2706 | update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); |
2771 | update_exe_path += "\" &"; | 2707 | update_exe_path += "\" &"; |
2772 | 2708 | ||
2773 | llinfos << "Calling updater: " << update_exe_path << llendl; | 2709 | llinfos << "Calling updater: " << update_exe_path << llendl; |
2774 | |||
2775 | remove_marker_file(); // In case updater fails | ||
2776 | 2710 | ||
2711 | // *REMOVE:Mani The following call is handled through ~LLAppViewer. | ||
2712 | // remove_marker_file(); // In case updater fails | ||
2713 | |||
2777 | // Run the auto-updater. | 2714 | // Run the auto-updater. |
2778 | system(update_exe_path.c_str()); /* Flawfinder: ignore */ | 2715 | system(update_exe_path.c_str()); /* Flawfinder: ignore */ |
2779 | 2716 | ||
@@ -2781,16 +2718,18 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2781 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 2718 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
2782 | "Please download the latest version from www.secondlife.com.", | 2719 | "Please download the latest version from www.secondlife.com.", |
2783 | NULL, OSMB_OK); | 2720 | NULL, OSMB_OK); |
2784 | remove_marker_file(); | 2721 | |
2722 | // *REMOVE:Mani The following call is handled through ~LLAppViewer. | ||
2723 | // remove_marker_file(); | ||
2785 | 2724 | ||
2786 | #endif | 2725 | #endif |
2787 | app_force_quit(NULL); | 2726 | LLAppViewer::instance()->forceQuit(); |
2788 | } | 2727 | } |
2789 | 2728 | ||
2790 | void use_circuit_callback(void**, S32 result) | 2729 | void use_circuit_callback(void**, S32 result) |
2791 | { | 2730 | { |
2792 | // bail if we're quitting. | 2731 | // bail if we're quitting. |
2793 | if(gQuit) return; | 2732 | if(LLApp::isExiting()) return; |
2794 | if( !gUseCircuitCallbackCalled ) | 2733 | if( !gUseCircuitCallbackCalled ) |
2795 | { | 2734 | { |
2796 | gUseCircuitCallbackCalled = true; | 2735 | gUseCircuitCallbackCalled = true; |
@@ -3646,6 +3585,8 @@ void reset_login() | |||
3646 | if ( gViewerWindow ) | 3585 | if ( gViewerWindow ) |
3647 | { // Hide menus and normal buttons | 3586 | { // Hide menus and normal buttons |
3648 | gViewerWindow->setNormalControlsVisible( FALSE ); | 3587 | gViewerWindow->setNormalControlsVisible( FALSE ); |
3588 | gLoginMenuBarView->setVisible( TRUE ); | ||
3589 | gLoginMenuBarView->setEnabled( TRUE ); | ||
3649 | } | 3590 | } |
3650 | 3591 | ||
3651 | // Hide any other stuff | 3592 | // Hide any other stuff |
@@ -3689,3 +3630,8 @@ bool LLStartUp::dispatchURL() | |||
3689 | } | 3630 | } |
3690 | return false; | 3631 | return false; |
3691 | } | 3632 | } |
3633 | |||
3634 | void login_alert_done(S32 option, void* user_data) | ||
3635 | { | ||
3636 | LLPanelLogin::giveFocus(); | ||
3637 | } | ||