aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r--linden/indra/newview/llstartup.cpp1032
1 files changed, 248 insertions, 784 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index d747bd2..4d35242 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -120,6 +121,7 @@
120#include "llinventorymodel.h" 121#include "llinventorymodel.h"
121#include "llinventoryview.h" 122#include "llinventoryview.h"
122#include "llkeyboard.h" 123#include "llkeyboard.h"
124#include "llloginhandler.h" // gLoginHandler, SLURL support
123#include "llpanellogin.h" 125#include "llpanellogin.h"
124#include "llmutelist.h" 126#include "llmutelist.h"
125#include "llnotify.h" 127#include "llnotify.h"
@@ -134,12 +136,14 @@
134#include "llpanelgroupnotices.h" 136#include "llpanelgroupnotices.h"
135#include "llpreview.h" 137#include "llpreview.h"
136#include "llpreviewscript.h" 138#include "llpreviewscript.h"
139#include "llproductinforequest.h"
137#include "llsecondlifeurls.h" 140#include "llsecondlifeurls.h"
138#include "llselectmgr.h" 141#include "llselectmgr.h"
139#include "llsky.h" 142#include "llsky.h"
140#include "llsrv.h" 143#include "llsrv.h"
141#include "llstatview.h" 144#include "llstatview.h"
142#include "lltrans.h" 145#include "lltrans.h"
146#include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance
143#include "llsurface.h" 147#include "llsurface.h"
144#include "lltexturecache.h" 148#include "lltexturecache.h"
145#include "lltexturefetch.h" 149#include "lltexturefetch.h"
@@ -240,22 +244,19 @@ bool LLStartUp::mShouldAutoLogin = false;
240 244
241void login_show(); 245void login_show();
242void login_callback(S32 option, void* userdata); 246void login_callback(S32 option, void* userdata);
243std::string load_password_from_disk();
244void save_password_to_disk(const char* hashed_password);
245bool is_hex_string(U8* str, S32 len); 247bool is_hex_string(U8* str, S32 len);
246void show_first_run_dialog(); 248void show_first_run_dialog();
247void first_run_dialog_callback(S32 option, void* userdata); 249bool first_run_dialog_callback(const LLSD& notification, const LLSD& response);
248void set_startup_status(const F32 frac, const std::string& string, const std::string& msg); 250void set_startup_status(const F32 frac, const std::string& string, const std::string& msg);
249void login_alert_status(S32 option, void* user_data); 251bool login_alert_status(const LLSD& notification, const LLSD& response);
250void update_app(BOOL mandatory, const std::string& message); 252void update_app(BOOL mandatory, const std::string& message);
251void update_dialog_callback(S32 option, void *userdata); 253bool update_dialog_callback(const LLSD& notification, const LLSD& response);
252void login_packet_failed(void**, S32 result); 254void login_packet_failed(void**, S32 result);
253void use_circuit_callback(void**, S32 result); 255void use_circuit_callback(void**, S32 result);
254void register_viewer_callbacks(LLMessageSystem* msg); 256void register_viewer_callbacks(LLMessageSystem* msg);
255void init_stat_view(); 257void init_stat_view();
256void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32); 258void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32);
257void dialog_choose_gender_first_start(); 259bool callback_choose_gender(const LLSD& notification, const LLSD& response);
258void callback_choose_gender(S32 option, void* userdata);
259void init_start_screen(S32 location_id); 260void init_start_screen(S32 location_id);
260void release_start_screen(); 261void release_start_screen();
261void apply_udp_blacklist(const std::string& csv); 262void apply_udp_blacklist(const std::string& csv);
@@ -360,7 +361,6 @@ bool idle_startup()
360 static S32 location_which = START_LOCATION_ID_LAST; 361 static S32 location_which = START_LOCATION_ID_LAST;
361 362
362 static bool show_connect_box = true; 363 static bool show_connect_box = true;
363 static BOOL remember_password = TRUE;
364 364
365 static bool stipend_since_login = false; 365 static bool stipend_since_login = false;
366 366
@@ -401,16 +401,16 @@ bool idle_startup()
401 401
402 if (LLFeatureManager::getInstance()->isSafe()) 402 if (LLFeatureManager::getInstance()->isSafe())
403 { 403 {
404 gViewerWindow->alertXml("DisplaySetToSafe"); 404 LLNotifications::instance().add("DisplaySetToSafe");
405 } 405 }
406 else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && 406 else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) &&
407 (gSavedSettings.getS32("LastFeatureVersion") != 0)) 407 (gSavedSettings.getS32("LastFeatureVersion") != 0))
408 { 408 {
409 gViewerWindow->alertXml("DisplaySetToRecommended"); 409 LLNotifications::instance().add("DisplaySetToRecommended");
410 } 410 }
411 else if (!gViewerWindow->getInitAlert().empty()) 411 else if (!gViewerWindow->getInitAlert().empty())
412 { 412 {
413 gViewerWindow->alertXml(gViewerWindow->getInitAlert()); 413 LLNotifications::instance().add(gViewerWindow->getInitAlert());
414 } 414 }
415 415
416 gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion()); 416 gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion());
@@ -433,10 +433,11 @@ bool idle_startup()
433 } 433 }
434 if (!xml_ok) 434 if (!xml_ok)
435 { 435 {
436 // *TODO:translate (maybe - very unlikely error message) 436 // If XML is bad, there's a good possibility that notifications.xml is ALSO bad.
437 // Note: alerts.xml may be invalid - if this gets translated it will need to be in the code 437 // If that's so, then we'll get a fatal error on attempting to load it,
438 std::string bad_xui_msg = "An error occured while updating Second Life. Please download the latest version from www.secondlife.com."; 438 // which will display a nontranslatable error message that says so.
439 LLAppViewer::instance()->earlyExit(bad_xui_msg); 439 // Otherwise, we'll display a reasonable error message that IS translatable.
440 LLAppViewer::instance()->earlyExit("BadInstallation");
440 } 441 }
441 // 442 //
442 // Statistics stuff 443 // Statistics stuff
@@ -454,9 +455,9 @@ bool idle_startup()
454 455
455 if (ll_init_ares() == NULL || !gAres->isInitialized()) 456 if (ll_init_ares() == NULL || !gAres->isInitialized())
456 { 457 {
457 LL_WARNS("AppInit") << "Could not start address resolution system" << LL_ENDL; 458 std::string diagnostic = "Could not start address resolution system";
458 std::string msg = LLTrans::getString("LoginFailedNoNetwork"); 459 LL_WARNS("AppInit") << diagnostic << LL_ENDL;
459 LLAppViewer::instance()->earlyExit(msg); 460 LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic));
460 } 461 }
461 462
462 // 463 //
@@ -493,6 +494,14 @@ bool idle_startup()
493 } 494 }
494 495
495 LLHTTPSender::setDefaultSender(new LLNullHTTPSender()); 496 LLHTTPSender::setDefaultSender(new LLNullHTTPSender());
497
498 // TODO parameterize
499 const F32 circuit_heartbeat_interval = 5;
500 const F32 circuit_timeout = 100;
501
502 const LLUseCircuitCodeResponder* responder = NULL;
503 bool failure_is_fatal = true;
504
496 if(!start_messaging_system( 505 if(!start_messaging_system(
497 message_template_path, 506 message_template_path,
498 port, 507 port,
@@ -500,11 +509,15 @@ bool idle_startup()
500 LL_VERSION_MINOR, 509 LL_VERSION_MINOR,
501 LL_VERSION_PATCH, 510 LL_VERSION_PATCH,
502 FALSE, 511 FALSE,
503 std::string())) 512 std::string(),
513 responder,
514 failure_is_fatal,
515 circuit_heartbeat_interval,
516 circuit_timeout))
504 { 517 {
505 std::string msg = LLTrans::getString("LoginFailedNoNetwork"); 518 std::string diagnostic = llformat(" Error: %d", gMessageSystem->getErrorCode());
506 msg.append(llformat(" Error: %d", gMessageSystem->getErrorCode())); 519 LL_WARNS("AppInit") << diagnostic << LL_ENDL;
507 LLAppViewer::instance()->earlyExit(msg); 520 LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic));
508 } 521 }
509 522
510 #if LL_WINDOWS 523 #if LL_WINDOWS
@@ -527,7 +540,7 @@ bool idle_startup()
527 } 540 }
528 else 541 else
529 { 542 {
530 LLAppViewer::instance()->earlyExit("Message Template " + message_template_path + " not found."); 543 LLAppViewer::instance()->earlyExit("MessageTemplateNotFound", LLSD().insert("PATH", message_template_path));
531 } 544 }
532 545
533 if(gMessageSystem && gMessageSystem->isOK()) 546 if(gMessageSystem && gMessageSystem->isOK())
@@ -658,16 +671,23 @@ bool idle_startup()
658 // 671 //
659 // Log on to system 672 // Log on to system
660 // 673 //
661 if ((!gLoginHandler.mFirstName.empty() && 674 if (!LLStartUp::sSLURLCommand.empty())
662 !gLoginHandler.mLastName.empty() &&
663 !gLoginHandler.mWebLoginKey.isNull())
664 || gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand) )
665 { 675 {
666 firstname = gLoginHandler.mFirstName; 676 // this might be a secondlife:///app/login URL
667 lastname = gLoginHandler.mLastName; 677 gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand);
668 web_login_key = gLoginHandler.mWebLoginKey; 678 }
679 if (!gLoginHandler.getFirstName().empty()
680 || !gLoginHandler.getLastName().empty()
681 || !gLoginHandler.getWebLoginKey().isNull() )
682 {
683 // We have at least some login information on a SLURL
684 firstname = gLoginHandler.getFirstName();
685 lastname = gLoginHandler.getLastName();
686 web_login_key = gLoginHandler.getWebLoginKey();
669 687
670 show_connect_box = false; 688 // Show the login screen if we don't have everything
689 show_connect_box =
690 firstname.empty() || lastname.empty() || web_login_key.isNull();
671 } 691 }
672 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin()) 692 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin())
673 { 693 {
@@ -679,7 +699,6 @@ bool idle_startup()
679 char md5pass[33]; /* Flawfinder: ignore */ 699 char md5pass[33]; /* Flawfinder: ignore */
680 pass.hex_digest(md5pass); 700 pass.hex_digest(md5pass);
681 password = md5pass; 701 password = md5pass;
682 remember_password = gSavedSettings.getBOOL("RememberPassword");
683 702
684#ifdef USE_VIEWER_AUTH 703#ifdef USE_VIEWER_AUTH
685 show_connect_box = true; 704 show_connect_box = true;
@@ -692,9 +711,8 @@ bool idle_startup()
692 { 711 {
693 firstname = gSavedSettings.getString("FirstName"); 712 firstname = gSavedSettings.getString("FirstName");
694 lastname = gSavedSettings.getString("LastName"); 713 lastname = gSavedSettings.getString("LastName");
695 password = load_password_from_disk(); 714 password = LLStartUp::loadPasswordFromDisk();
696 gSavedSettings.setBOOL("RememberPassword", TRUE); 715 gSavedSettings.setBOOL("RememberPassword", TRUE);
697 remember_password = TRUE;
698 716
699#ifdef USE_VIEWER_AUTH 717#ifdef USE_VIEWER_AUTH
700 show_connect_box = true; 718 show_connect_box = true;
@@ -707,9 +725,7 @@ bool idle_startup()
707 // if not automatically logging in, display login dialog 725 // if not automatically logging in, display login dialog
708 firstname = gSavedSettings.getString("FirstName"); 726 firstname = gSavedSettings.getString("FirstName");
709 lastname = gSavedSettings.getString("LastName"); 727 lastname = gSavedSettings.getString("LastName");
710 password = load_password_from_disk(); 728 password = LLStartUp::loadPasswordFromDisk();
711
712 remember_password = gSavedSettings.getBOOL("RememberPassword");
713 show_connect_box = true; 729 show_connect_box = true;
714 } 730 }
715 731
@@ -740,8 +756,6 @@ bool idle_startup()
740 sAuthUriNum = -1; 756 sAuthUriNum = -1;
741 757
742 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 758 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
743 // Push our window frontmost
744 gViewerWindow->getWindow()->show();
745 759
746 timeout_count = 0; 760 timeout_count = 0;
747 761
@@ -755,7 +769,7 @@ bool idle_startup()
755 // Load all the name information out of the login view 769 // Load all the name information out of the login view
756 // NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't 770 // NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
757 // show the login view until login_show() is called below. 771 // show the login view until login_show() is called below.
758 // LLPanelLogin::getFields(firstname, lastname, password, remember_password); 772 // LLPanelLogin::getFields(firstname, lastname, password);
759 773
760 if (gNoRender) 774 if (gNoRender)
761 { 775 {
@@ -767,7 +781,7 @@ bool idle_startup()
767 // Show the login dialog 781 // Show the login dialog
768 login_show(); 782 login_show();
769 // connect dialog is already shown, so fill in the names 783 // connect dialog is already shown, so fill in the names
770 LLPanelLogin::setFields( firstname, lastname, password, remember_password ); 784 LLPanelLogin::setFields( firstname, lastname, password);
771 785
772 LLPanelLogin::giveFocus(); 786 LLPanelLogin::giveFocus();
773 787
@@ -802,6 +816,10 @@ bool idle_startup()
802 gLoginMenuBarView->setVisible( TRUE ); 816 gLoginMenuBarView->setVisible( TRUE );
803 gLoginMenuBarView->setEnabled( TRUE ); 817 gLoginMenuBarView->setEnabled( TRUE );
804 818
819 // Push our window frontmost
820 gViewerWindow->getWindow()->show();
821 display_startup();
822
805 // DEV-16927. The following code removes errant keystrokes that happen while the window is being 823 // DEV-16927. The following code removes errant keystrokes that happen while the window is being
806 // first made visible. 824 // first made visible.
807#ifdef _WIN32 825#ifdef _WIN32
@@ -825,13 +843,14 @@ bool idle_startup()
825 if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) 843 if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState())
826 { 844 {
827 //reset the values that could have come in from a slurl 845 //reset the values that could have come in from a slurl
828 if (!gLoginHandler.mWebLoginKey.isNull()) 846 if (!gLoginHandler.getWebLoginKey().isNull())
829 { 847 {
830 firstname = gLoginHandler.mFirstName; 848 firstname = gLoginHandler.getFirstName();
831 lastname = gLoginHandler.mLastName; 849 lastname = gLoginHandler.getLastName();
832 web_login_key = gLoginHandler.mWebLoginKey; 850 web_login_key = gLoginHandler.getWebLoginKey();
833 } 851 }
834 852
853 /* Jacek - Grid manager stuff that's changed with 1.23
835 if(!gLoginHandler.mPassword.empty()) 854 if(!gLoginHandler.mPassword.empty())
836 { 855 {
837 firstname = gLoginHandler.mFirstName; 856 firstname = gLoginHandler.mFirstName;
@@ -842,13 +861,13 @@ bool idle_startup()
842 gLoginHandler.mLastName = ""; 861 gLoginHandler.mLastName = "";
843 gLoginHandler.mPassword = ""; 862 gLoginHandler.mPassword = "";
844 LLStartUp::setShouldAutoLogin(false); 863 LLStartUp::setShouldAutoLogin(false);
845 } 864 }*/
846 865
847 if (show_connect_box) 866 if (show_connect_box)
848 { 867 {
849 // TODO if not use viewer auth 868 // TODO if not use viewer auth
850 // Load all the name information out of the login view 869 // Load all the name information out of the login view
851 LLPanelLogin::getFields(firstname, lastname, password, remember_password); 870 LLPanelLogin::getFields(&firstname, &lastname, &password);
852 // end TODO 871 // end TODO
853 872
854 // HACK: Try to make not jump on login 873 // HACK: Try to make not jump on login
@@ -860,16 +879,6 @@ bool idle_startup()
860 gSavedSettings.setString("FirstName", firstname); 879 gSavedSettings.setString("FirstName", firstname);
861 gSavedSettings.setString("LastName", lastname); 880 gSavedSettings.setString("LastName", lastname);
862 881
863 if (remember_password)
864 {
865 save_password_to_disk(password.c_str());
866 }
867 else
868 {
869 save_password_to_disk(NULL);
870 }
871 gSavedSettings.setBOOL("RememberPassword", remember_password);
872
873 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL; 882 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
874 gDebugInfo["LoginName"] = firstname + " " + lastname; 883 gDebugInfo["LoginName"] = firstname + " " + lastname;
875 } 884 }
@@ -883,12 +892,12 @@ bool idle_startup()
883 // Set PerAccountSettingsFile to the default value. 892 // Set PerAccountSettingsFile to the default value.
884 gSavedSettings.setString("PerAccountSettingsFile", 893 gSavedSettings.setString("PerAccountSettingsFile",
885 gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, 894 gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,
886 LLAppViewer::instance()->getSettingsFileName("PerAccount") 895 LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount")
887 ) 896 )
888 ); 897 );
889 898
890 // Overwrite default user settings with user settings 899 // Overwrite default user settings with user settings
891 LLAppViewer::instance()->loadSettingsFromDirectory(LL_PATH_PER_SL_ACCOUNT); 900 LLAppViewer::instance()->loadSettingsFromDirectory("Account");
892 901
893 // Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation 902 // Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation
894 // and startup time is close enough if we don't have a real value. 903 // and startup time is close enough if we don't have a real value.
@@ -1262,11 +1271,7 @@ bool idle_startup()
1262 reason_response = LLUserAuth::getInstance()->getResponse("reason"); 1271 reason_response = LLUserAuth::getInstance()->getResponse("reason");
1263 message_response = LLUserAuth::getInstance()->getResponse("message"); 1272 message_response = LLUserAuth::getInstance()->getResponse("message");
1264 1273
1265 if (gHideLinks && reason_response == "disabled") 1274 if (!message_response.empty())
1266 {
1267 emsg << gDisabledMessage;
1268 }
1269 else if (!message_response.empty())
1270 { 1275 {
1271 // XUI: fix translation for strings returned during login 1276 // XUI: fix translation for strings returned during login
1272 // We need a generic table for translations 1277 // We need a generic table for translations
@@ -1414,24 +1419,24 @@ bool idle_startup()
1414 gSavedSettings.setString("FirstName", firstname); 1419 gSavedSettings.setString("FirstName", firstname);
1415 gSavedSettings.setString("LastName", lastname); 1420 gSavedSettings.setString("LastName", lastname);
1416 1421
1417 if (remember_password) 1422 if (gSavedSettings.getBOOL("RememberPassword"))
1418 { 1423 {
1419 save_password_to_disk(password.c_str()); 1424 // Successful login means the password is valid, so save it.
1425 LLStartUp::savePasswordToDisk(password);
1420 } 1426 }
1421 else 1427 else
1422 { 1428 {
1423 save_password_to_disk(NULL); 1429 // Don't leave password from previous session sitting around
1430 // during this login session.
1431 LLStartUp::deletePasswordFromDisk();
1424 } 1432 }
1425 gSavedSettings.setBOOL("RememberPassword", remember_password);
1426 1433
1427 // This fixes Imprudence 1.2 thinking it's a teen.
1428 // Will need fixing for the 1.23 merge.
1429 // this is their actual ability to access content 1434 // this is their actual ability to access content
1430 text = LLUserAuth::getInstance()->getResponse("agent_access_max"); 1435 text = LLUserAuth::getInstance()->getResponse("agent_access_max");
1431 if (!text.empty()) 1436 if (!text.empty())
1432 { 1437 {
1433 // agent_access can be 'A', 'M', and 'PG'. 1438 // agent_access can be 'A', 'M', and 'PG'.
1434 gAgent.convertTextToMaturity(text[0]); 1439 gAgent.setMaturity(text[0]);
1435 } 1440 }
1436 else // we're on an older sim version (prolly an opensim) 1441 else // we're on an older sim version (prolly an opensim)
1437 { 1442 {
@@ -1445,6 +1450,26 @@ bool idle_startup()
1445 gAgent.setTeen(true); 1450 gAgent.setTeen(true);
1446 } 1451 }
1447 } 1452 }
1453
1454 // this is the value of their preference setting for that content
1455 // which will always be <= agent_access_max
1456 text = LLUserAuth::getInstance()->getResponse("agent_region_access");
1457 if (!text.empty())
1458 {
1459 int preferredMaturity = LLAgent::convertTextToMaturity(text[0]);
1460 gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
1461 }
1462 // During the AO transition, this flag will be true. Then the flag will
1463 // go away. After the AO transition, this code and all the code that
1464 // uses it can be deleted.
1465 text = LLUserAuth::getInstance()->getResponse("ao_transition");
1466 if (!text.empty())
1467 {
1468 if (text == "1")
1469 {
1470 gAgent.setAOTransition();
1471 }
1472 }
1448 1473
1449 text = LLUserAuth::getInstance()->getResponse("start_location"); 1474 text = LLUserAuth::getInstance()->getResponse("start_location");
1450 if(!text.empty()) agent_start_location.assign(text); 1475 if(!text.empty()) agent_start_location.assign(text);
@@ -1652,9 +1677,9 @@ bool idle_startup()
1652 exit(0); 1677 exit(0);
1653 } 1678 }
1654 // Bounce back to the login screen. 1679 // Bounce back to the login screen.
1655 LLStringUtil::format_map_t args; 1680 LLSD args;
1656 args["[ERROR_MESSAGE]"] = emsg.str(); 1681 args["ERROR_MESSAGE"] = emsg.str();
1657 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1682 LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
1658 LLStartUp::resetLogin(); 1683 LLStartUp::resetLogin();
1659 gSavedSettings.setBOOL("AutoLogin", FALSE); 1684 gSavedSettings.setBOOL("AutoLogin", FALSE);
1660 //this might be redundant 1685 //this might be redundant
@@ -1665,7 +1690,7 @@ bool idle_startup()
1665 // Pass the user information to the voice chat server interface. 1690 // Pass the user information to the voice chat server interface.
1666 gVoiceClient->userAuthorized(firstname, lastname, gAgentID); 1691 gVoiceClient->userAuthorized(firstname, lastname, gAgentID);
1667 } 1692 }
1668 else 1693 else // if(successful_login)
1669 { 1694 {
1670 if (gNoRender) 1695 if (gNoRender)
1671 { 1696 {
@@ -1674,16 +1699,14 @@ bool idle_startup()
1674 exit(0); 1699 exit(0);
1675 } 1700 }
1676 // Bounce back to the login screen. 1701 // Bounce back to the login screen.
1677 LLStringUtil::format_map_t args; 1702 LLSD args;
1678 args["[ERROR_MESSAGE]"] = emsg.str(); 1703 args["ERROR_MESSAGE"] = emsg.str();
1679 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1704 LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
1680 LLStartUp::resetLogin(); 1705 LLStartUp::resetLogin();
1681 gSavedSettings.setBOOL("AutoLogin", FALSE); 1706 gSavedSettings.setBOOL("AutoLogin", FALSE);
1682 //this might be redundant 1707 //this might be redundant
1683 LLStartUp::setShouldAutoLogin(false); 1708 LLStartUp::setShouldAutoLogin(false);
1684 show_connect_box = true; 1709 show_connect_box = true;
1685 // Don't save an incorrect password to disk.
1686 save_password_to_disk(NULL);
1687 } 1710 }
1688 return FALSE; 1711 return FALSE;
1689 } 1712 }
@@ -1831,7 +1854,10 @@ bool idle_startup()
1831 LLError::logToFixedBuffer(gDebugView->mDebugConsolep); 1854 LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
1832 // set initial visibility of debug console 1855 // set initial visibility of debug console
1833 gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole")); 1856 gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
1834 gDebugView->mFloaterStatsp->setVisible(gSavedSettings.getBOOL("ShowDebugStats")); 1857 if (gSavedSettings.getBOOL("ShowDebugStats"))
1858 {
1859 LLFloaterStats::showInstance();
1860 }
1835 } 1861 }
1836 1862
1837 // 1863 //
@@ -1898,6 +1924,7 @@ bool idle_startup()
1898 } 1924 }
1899 1925
1900 // Make sure agent knows correct aspect ratio 1926 // Make sure agent knows correct aspect ratio
1927 // FOV limits depend upon aspect ratio so this needs to happen before initializing the FOV below
1901 LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); 1928 LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight());
1902 if (gViewerWindow->mWindow->getFullscreen()) 1929 if (gViewerWindow->mWindow->getFullscreen())
1903 { 1930 {
@@ -1907,6 +1934,8 @@ bool idle_startup()
1907 { 1934 {
1908 LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); 1935 LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight());
1909 } 1936 }
1937 // Initialize FOV
1938 LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle"));
1910 1939
1911 // Move agent to starting location. The position handed to us by 1940 // Move agent to starting location. The position handed to us by
1912 // the space server is in global coordinates, but the agent frame 1941 // the space server is in global coordinates, but the agent frame
@@ -1923,7 +1952,13 @@ bool idle_startup()
1923 { 1952 {
1924 LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL; 1953 LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
1925 // Initialize all of the viewer object classes for the first time (doing things like texture fetches. 1954 // Initialize all of the viewer object classes for the first time (doing things like texture fetches.
1955 LLGLState::checkStates();
1956 LLGLState::checkTextureChannels();
1957
1926 gSky.init(initial_sun_direction); 1958 gSky.init(initial_sun_direction);
1959
1960 LLGLState::checkStates();
1961 LLGLState::checkTextureChannels();
1927 } 1962 }
1928 1963
1929 LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL; 1964 LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
@@ -2231,13 +2266,7 @@ bool idle_startup()
2231 2266
2232 // Get L$ and ownership credit information 2267 // Get L$ and ownership credit information
2233 llinfos << "Requesting Money Balance" << llendl; 2268 llinfos << "Requesting Money Balance" << llendl;
2234 msg->newMessageFast(_PREHASH_MoneyBalanceRequest); 2269 LLStatusBar::sendMoneyBalanceRequest();
2235 msg->nextBlockFast(_PREHASH_AgentData);
2236 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
2237 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
2238 msg->nextBlockFast(_PREHASH_MoneyData);
2239 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null );
2240 gAgent.sendReliableMessage();
2241 2270
2242 // request all group information 2271 // request all group information
2243 llinfos << "Requesting Agent Data" << llendl; 2272 llinfos << "Requesting Agent Data" << llendl;
@@ -2410,23 +2439,23 @@ bool idle_startup()
2410 // location is not your expected location. So, if this is 2439 // location is not your expected location. So, if this is
2411 // your first login, then you do not have an expectation, 2440 // your first login, then you do not have an expectation,
2412 // thus, do not show this alert. 2441 // thus, do not show this alert.
2413 LLStringUtil::format_map_t args; 2442 LLSD args;
2414 if (url_ok) 2443 if (url_ok)
2415 { 2444 {
2416 args["[TYPE]"] = "desired"; 2445 args["TYPE"] = "desired";
2417 args["[HELP]"] = ""; 2446 args["HELP"] = "";
2418 } 2447 }
2419 else if (gSavedSettings.getBOOL("LoginLastLocation")) 2448 else if (gSavedSettings.getBOOL("LoginLastLocation"))
2420 { 2449 {
2421 args["[TYPE]"] = "last"; 2450 args["TYPE"] = "last";
2422 args["[HELP]"] = ""; 2451 args["HELP"] = "";
2423 } 2452 }
2424 else 2453 else
2425 { 2454 {
2426 args["[TYPE]"] = "home"; 2455 args["TYPE"] = "home";
2427 args["[HELP]"] = "You may want to set a new home location."; 2456 args["HELP"] = "You may want to set a new home location.";
2428 } 2457 }
2429 gViewerWindow->alertXml("AvatarMoved", args); 2458 LLNotifications::instance().add("AvatarMoved", args);
2430 } 2459 }
2431 else 2460 else
2432 { 2461 {
@@ -2483,8 +2512,14 @@ bool idle_startup()
2483 { 2512 {
2484 update_texture_fetch(); 2513 update_texture_fetch();
2485 set_startup_status(0.60f + 0.30f * timeout_frac, 2514 set_startup_status(0.60f + 0.30f * timeout_frac,
2486 "Loading world...", 2515 LLTrans::getString("LoginPrecaching"),
2487 gAgent.mMOTD); 2516 gAgent.mMOTD);
2517 display_startup();
2518 if (!LLViewerShaderMgr::sInitialized)
2519 {
2520 LLViewerShaderMgr::sInitialized = TRUE;
2521 LLViewerShaderMgr::instance()->setShaders();
2522 }
2488 } 2523 }
2489 2524
2490 return TRUE; 2525 return TRUE;
@@ -2506,16 +2541,15 @@ bool idle_startup()
2506 // initial outfit, but if the load hasn't started 2541 // initial outfit, but if the load hasn't started
2507 // already then something is wrong so fall back 2542 // already then something is wrong so fall back
2508 // to generic outfits. JC 2543 // to generic outfits. JC
2509 gViewerWindow->alertXml("WelcomeChooseSex", 2544 LLNotifications::instance().add("WelcomeChooseSex", LLSD(), LLSD(),
2510 callback_choose_gender, NULL); 2545 callback_choose_gender);
2511 LLStartUp::setStartupState( STATE_CLEANUP ); 2546 LLStartUp::setStartupState( STATE_CLEANUP );
2512 return TRUE; 2547 return TRUE;
2513 } 2548 }
2514 2549
2515 if (wearables_time > MAX_WEARABLES_TIME) 2550 if (wearables_time > MAX_WEARABLES_TIME)
2516 { 2551 {
2517 // It's taken too long to load, show the world 2552 LLNotifications::instance().add("ClothingLoading");
2518 gViewerWindow->alertXml("ClothingLoading");
2519 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); 2553 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG);
2520 LLStartUp::setStartupState( STATE_CLEANUP ); 2554 LLStartUp::setStartupState( STATE_CLEANUP );
2521 return TRUE; 2555 return TRUE;
@@ -2535,7 +2569,7 @@ bool idle_startup()
2535 else 2569 else
2536 { 2570 {
2537 // OK to just get the wearables 2571 // OK to just get the wearables
2538 if ( gAgent.getWearablesLoaded() ) 2572 if ( gAgent.areWearablesLoaded() )
2539 { 2573 {
2540 // We have our clothing, proceed. 2574 // We have our clothing, proceed.
2541 //llinfos << "wearables loaded" << llendl; 2575 //llinfos << "wearables loaded" << llendl;
@@ -2595,6 +2629,11 @@ bool idle_startup()
2595 // If we've got a startup URL, dispatch it 2629 // If we've got a startup URL, dispatch it
2596 LLStartUp::dispatchURL(); 2630 LLStartUp::dispatchURL();
2597 2631
2632 // Retrieve information about the land data
2633 // (just accessing this the first time will fetch it,
2634 // then the data is cached for the viewer's lifetime)
2635 LLProductInfoRequestManager::instance();
2636
2598 // Clean up the userauth stuff. 2637 // Clean up the userauth stuff.
2599 LLUserAuth::getInstance()->reset(); 2638 LLUserAuth::getInstance()->reset();
2600 2639
@@ -2616,36 +2655,6 @@ bool idle_startup()
2616 gDebugView->mFastTimerView->setVisible(TRUE); 2655 gDebugView->mFastTimerView->setVisible(TRUE);
2617#endif 2656#endif
2618 2657
2619 // HACK: remove this when based on 1.23
2620 // Send our preferred maturity.
2621 // Update agent access preference on the server
2622 std::string url = gAgent.getRegion()->getCapability("UpdateAgentInformation");
2623 if (!url.empty())
2624 {
2625 U32 preferredMaturity = gSavedSettings.getU32("PreferredMaturity");
2626 // Set new access preference
2627 LLSD access_prefs = LLSD::emptyMap();
2628 if (preferredMaturity == SIM_ACCESS_PG)
2629 {
2630 access_prefs["max"] = "PG";
2631 }
2632 else if (preferredMaturity == SIM_ACCESS_MATURE)
2633 {
2634 access_prefs["max"] = "M";
2635 }
2636 if (preferredMaturity == SIM_ACCESS_ADULT)
2637 {
2638 access_prefs["max"] = "A";
2639 }
2640
2641 LLSD body = LLSD::emptyMap();
2642 body["access_prefs"] = access_prefs;
2643 llinfos << "Sending access prefs update to " << (access_prefs["max"].asString()) << " via capability to: "
2644 << url << llendl;
2645 LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); // Ignore response
2646 }
2647
2648 LLAppViewer::instance()->initMainloopTimeout("Mainloop Init");
2649 2658
2650// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e 2659// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e
2651 // RELEASE-RLVa: this should go in LLAppViewer::handleLoginComplete() but Imprudence doesn't call that function 2660 // RELEASE-RLVa: this should go in LLAppViewer::handleLoginComplete() but Imprudence doesn't call that function
@@ -2718,16 +2727,11 @@ void login_callback(S32 option, void *userdata)
2718 { 2727 {
2719 // Make sure we don't save the password if the user is trying to clear it. 2728 // Make sure we don't save the password if the user is trying to clear it.
2720 std::string first, last, password; 2729 std::string first, last, password;
2721 BOOL remember = TRUE; 2730 LLPanelLogin::getFields(&first, &last, &password);
2722 LLPanelLogin::getFields(first, last, password, remember); 2731 if (!gSavedSettings.getBOOL("RememberPassword"))
2723 if (!remember)
2724 { 2732 {
2725 // turn off the setting and write out to disk 2733 // turn off the setting and write out to disk
2726 gSavedSettings.setBOOL("RememberPassword", FALSE);
2727 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); 2734 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
2728
2729 // stomp the saved password on disk
2730 save_password_to_disk(NULL);
2731 } 2735 }
2732 2736
2733 // Next iteration through main loop should shut down the app cleanly. 2737 // Next iteration through main loop should shut down the app cleanly.
@@ -2745,8 +2749,18 @@ void login_callback(S32 option, void *userdata)
2745 } 2749 }
2746} 2750}
2747 2751
2748std::string load_password_from_disk() 2752
2753// static
2754std::string LLStartUp::loadPasswordFromDisk()
2749{ 2755{
2756 // Only load password if we also intend to save it (otherwise the user
2757 // wonders what we're doing behind his back). JC
2758 BOOL remember_password = gSavedSettings.getBOOL("RememberPassword");
2759 if (!remember_password)
2760 {
2761 return std::string("");
2762 }
2763
2750 std::string hashed_password(""); 2764 std::string hashed_password("");
2751 2765
2752 // Look for legacy "marker" password from settings.ini 2766 // Look for legacy "marker" password from settings.ini
@@ -2798,41 +2812,45 @@ std::string load_password_from_disk()
2798 return hashed_password; 2812 return hashed_password;
2799} 2813}
2800 2814
2801void save_password_to_disk(const char* hashed_password) 2815
2816// static
2817void LLStartUp::savePasswordToDisk(const std::string& hashed_password)
2802{ 2818{
2803 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, 2819 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
2804 "password.dat"); 2820 "password.dat");
2805 if (!hashed_password) 2821 LLFILE* fp = LLFile::fopen(filepath, "wb"); /* Flawfinder: ignore */
2822 if (!fp)
2806 { 2823 {
2807 // No password, remove the file. 2824 return;
2808 LLFile::remove(filepath);
2809 } 2825 }
2810 else
2811 {
2812 LLFILE* fp = LLFile::fopen(filepath, "wb"); /* Flawfinder: ignore */
2813 if (!fp)
2814 {
2815 return;
2816 }
2817
2818 // Encipher with MAC address
2819 const S32 HASHED_LENGTH = 32;
2820 U8 buffer[HASHED_LENGTH+1];
2821 2826
2822 LLStringUtil::copy((char*)buffer, hashed_password, HASHED_LENGTH+1); 2827 // Encipher with MAC address
2828 const S32 HASHED_LENGTH = 32;
2829 U8 buffer[HASHED_LENGTH+1];
2823 2830
2824 LLXORCipher cipher(gMACAddress, 6); 2831 LLStringUtil::copy((char*)buffer, hashed_password.c_str(), HASHED_LENGTH+1);
2825 cipher.encrypt(buffer, HASHED_LENGTH);
2826 2832
2827 if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1) 2833 LLXORCipher cipher(gMACAddress, 6);
2828 { 2834 cipher.encrypt(buffer, HASHED_LENGTH);
2829 LL_WARNS("AppInit") << "Short write" << LL_ENDL;
2830 }
2831 2835
2832 fclose(fp); 2836 if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1)
2837 {
2838 LL_WARNS("AppInit") << "Short write" << LL_ENDL;
2833 } 2839 }
2840
2841 fclose(fp);
2834} 2842}
2835 2843
2844
2845// static
2846void LLStartUp::deletePasswordFromDisk()
2847{
2848 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
2849 "password.dat");
2850 LLFile::remove(filepath);
2851}
2852
2853
2836bool is_hex_string(U8* str, S32 len) 2854bool is_hex_string(U8* str, S32 len)
2837{ 2855{
2838 bool rv = true; 2856 bool rv = true;
@@ -2869,11 +2887,12 @@ bool is_hex_string(U8* str, S32 len)
2869 2887
2870void show_first_run_dialog() 2888void show_first_run_dialog()
2871{ 2889{
2872 gViewerWindow->alertXml("FirstRun", first_run_dialog_callback, NULL); 2890 LLNotifications::instance().add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback);
2873} 2891}
2874 2892
2875void first_run_dialog_callback(S32 option, void* userdata) 2893bool first_run_dialog_callback(const LLSD& notification, const LLSD& response)
2876{ 2894{
2895 S32 option = LLNotification::getSelectedOption(notification, response);
2877 if (0 == option) 2896 if (0 == option)
2878 { 2897 {
2879 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; 2898 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL;
@@ -2881,6 +2900,7 @@ void first_run_dialog_callback(S32 option, void* userdata)
2881 } 2900 }
2882 2901
2883 LLPanelLogin::giveFocus(); 2902 LLPanelLogin::giveFocus();
2903 return false;
2884} 2904}
2885 2905
2886 2906
@@ -2893,8 +2913,9 @@ void set_startup_status(const F32 frac, const std::string& string, const std::st
2893 gViewerWindow->setProgressMessage(msg); 2913 gViewerWindow->setProgressMessage(msg);
2894} 2914}
2895 2915
2896void login_alert_status(S32 option, void* user_data) 2916bool login_alert_status(const LLSD& notification, const LLSD& response)
2897{ 2917{
2918 S32 option = LLNotification::getSelectedOption(notification, response);
2898 // Buttons 2919 // Buttons
2899 switch( option ) 2920 switch( option )
2900 { 2921 {
@@ -2913,6 +2934,7 @@ void login_alert_status(S32 option, void* user_data)
2913 } 2934 }
2914 2935
2915 LLPanelLogin::giveFocus(); 2936 LLPanelLogin::giveFocus();
2937 return false;
2916} 2938}
2917 2939
2918void update_app(BOOL mandatory, const std::string& auth_msg) 2940void update_app(BOOL mandatory, const std::string& auth_msg)
@@ -2928,68 +2950,66 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
2928 { 2950 {
2929 msg = "(" + auth_msg + ") \n"; 2951 msg = "(" + auth_msg + ") \n";
2930 } 2952 }
2931 LLStringUtil::format_map_t args; 2953
2932 args["[MESSAGE]"] = msg; 2954 LLSD args;
2955 args["MESSAGE"] = msg;
2933 2956
2934 // represent a bool as a null/non-null pointer 2957 LLSD payload;
2935 void *mandatoryp = mandatory ? &mandatory : NULL; 2958 payload["mandatory"] = mandatory;
2936 2959
2960/*
2961 We're constructing one of the following 6 strings here:
2962 "DownloadWindowsMandatory"
2963 "DownloadWindowsReleaseForDownload"
2964 "DownloadWindows"
2965 "DownloadMacMandatory"
2966 "DownloadMacReleaseForDownload"
2967 "DownloadMac"
2968
2969 I've called them out explicitly in this comment so that they can be grepped for.
2970
2971 Also, we assume that if we're not Windows we're Mac. If we ever intend to support
2972 Linux with autoupdate, this should be an explicit #elif LL_DARWIN, but
2973 we'd rather deliver the wrong message than no message, so until Linux is supported
2974 we'll leave it alone.
2975 */
2976 std::string notification_name = "Download";
2977
2937#if LL_WINDOWS 2978#if LL_WINDOWS
2938 if (mandatory) 2979 notification_name += "Windows";
2939 {
2940 gViewerWindow->alertXml("DownloadWindowsMandatory", args,
2941 update_dialog_callback,
2942 mandatoryp);
2943 }
2944 else
2945 {
2946#if LL_RELEASE_FOR_DOWNLOAD
2947 gViewerWindow->alertXml("DownloadWindowsReleaseForDownload", args,
2948 update_dialog_callback,
2949 mandatoryp);
2950#else 2980#else
2951 gViewerWindow->alertXml("DownloadWindows", args, 2981 notification_name += "Mac";
2952 update_dialog_callback,
2953 mandatoryp);
2954#endif 2982#endif
2955 } 2983
2956#else
2957 if (mandatory) 2984 if (mandatory)
2958 { 2985 {
2959 gViewerWindow->alertXml("DownloadMacMandatory", args, 2986 notification_name += "Mandatory";
2960 update_dialog_callback,
2961 mandatoryp);
2962 } 2987 }
2963 else 2988 else
2964 { 2989 {
2965#if LL_RELEASE_FOR_DOWNLOAD 2990#if LL_RELEASE_FOR_DOWNLOAD
2966 gViewerWindow->alertXml("DownloadMacReleaseForDownload", args, 2991 notification_name += "ReleaseForDownload";
2967 update_dialog_callback,
2968 mandatoryp);
2969#else
2970 gViewerWindow->alertXml("DownloadMac", args,
2971 update_dialog_callback,
2972 mandatoryp);
2973#endif 2992#endif
2974 } 2993 }
2975#endif 2994
2976 2995 LLNotifications::instance().add(notification_name, args, payload, update_dialog_callback);
2996
2977} 2997}
2978 2998
2979 2999bool update_dialog_callback(const LLSD& notification, const LLSD& response)
2980void update_dialog_callback(S32 option, void *userdata)
2981{ 3000{
3001 S32 option = LLNotification::getSelectedOption(notification, response);
2982 std::string update_exe_path; 3002 std::string update_exe_path;
2983 bool mandatory = userdata != NULL; 3003 bool mandatory = notification["payload"]["mandatory"].asBoolean();
2984 3004
2985#if !LL_RELEASE_FOR_DOWNLOAD 3005#if !LL_RELEASE_FOR_DOWNLOAD
2986 if (option == 2) 3006 if (option == 2)
2987 { 3007 {
2988 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); 3008 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
2989 return; 3009 return false;
2990 } 3010 }
2991#endif 3011#endif
2992 3012
2993 if (option == 1) 3013 if (option == 1)
2994 { 3014 {
2995 // ...user doesn't want to do it 3015 // ...user doesn't want to do it
@@ -3001,7 +3021,7 @@ void update_dialog_callback(S32 option, void *userdata)
3001 { 3021 {
3002 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); 3022 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
3003 } 3023 }
3004 return; 3024 return false;
3005 } 3025 }
3006 3026
3007 LLSD query_map = LLSD::emptyMap(); 3027 LLSD query_map = LLSD::emptyMap();
@@ -3012,12 +3032,15 @@ void update_dialog_callback(S32 option, void *userdata)
3012 query_map["os"] = "mac"; 3032 query_map["os"] = "mac";
3013#elif LL_LINUX 3033#elif LL_LINUX
3014 query_map["os"] = "lnx"; 3034 query_map["os"] = "lnx";
3035#elif LL_SOLARIS
3036 query_map["os"] = "sol";
3015#endif 3037#endif
3016 // *TODO change userserver to be grid on both viewer and sim, since 3038 // *TODO change userserver to be grid on both viewer and sim, since
3017 // userserver no longer exists. 3039 // userserver no longer exists.
3018 query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel(); 3040 query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
3019 query_map["channel"] = gSavedSettings.getString("VersionChannelName"); 3041 query_map["channel"] = gSavedSettings.getString("VersionChannelName");
3020 // *TODO constantize this guy 3042 // *TODO constantize this guy
3043 // *NOTE: This URL is also used in win_setup/lldownloader.cpp
3021 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 3044 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
3022 3045
3023/* if(LLAppViewer::sUpdaterInfo) 3046/* if(LLAppViewer::sUpdaterInfo)
@@ -3036,7 +3059,7 @@ void update_dialog_callback(S32 option, void *userdata)
3036 // We're hosed, bail 3059 // We're hosed, bail
3037 LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; 3060 LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL;
3038 LLAppViewer::instance()->forceQuit(); 3061 LLAppViewer::instance()->forceQuit();
3039 return; 3062 return false;
3040 } 3063 }
3041 3064
3042 LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; 3065 LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe";
@@ -3057,7 +3080,7 @@ void update_dialog_callback(S32 option, void *userdata)
3057 3080
3058 LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; 3081 LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL;
3059 LLAppViewer::instance()->forceQuit(); 3082 LLAppViewer::instance()->forceQuit();
3060 return; 3083 return false;
3061 } 3084 }
3062 3085
3063 // if a sim name was passed in via command line parameter (typically through a SLURL) 3086 // if a sim name was passed in via command line parameter (typically through a SLURL)
@@ -3096,13 +3119,14 @@ void update_dialog_callback(S32 option, void *userdata)
3096*/ 3119*/
3097 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ 3120 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
3098/* 3121/*
3099#elif LL_LINUX 3122#elif LL_LINUX || LL_SOLARIS
3100 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 3123 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
3101 "Please download the latest version from www.secondlife.com.", 3124 "Please download the latest version from www.secondlife.com.",
3102 LLStringUtil::null, OSMB_OK); 3125 LLStringUtil::null, OSMB_OK);
3103#endif 3126#endif
3104 LLAppViewer::instance()->forceQuit(); 3127 LLAppViewer::instance()->forceQuit();
3105 */ 3128 */
3129 return false;
3106} 3130}
3107 3131
3108void use_circuit_callback(void**, S32 result) 3132void use_circuit_callback(void**, S32 result)
@@ -3116,8 +3140,7 @@ void use_circuit_callback(void**, S32 result)
3116 { 3140 {
3117 // Make sure user knows something bad happened. JC 3141 // Make sure user knows something bad happened. JC
3118 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; 3142 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
3119 gViewerWindow->alertXml("LoginPacketNeverReceived", 3143 LLNotifications::instance().add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
3120 login_alert_status, NULL);
3121 LLStartUp::resetLogin(); 3144 LLStartUp::resetLogin();
3122 } 3145 }
3123 else 3146 else
@@ -3320,570 +3343,6 @@ void init_stat_view()
3320 LLFrameStatView *frameviewp = gDebugView->mFrameStatView; 3343 LLFrameStatView *frameviewp = gDebugView->mFrameStatView;
3321 frameviewp->setup(gFrameStats); 3344 frameviewp->setup(gFrameStats);
3322 frameviewp->mShowPercent = FALSE; 3345 frameviewp->mShowPercent = FALSE;
3323
3324 LLRect rect;
3325 LLStatBar *stat_barp;
3326 rect = gDebugView->mFloaterStatsp->getRect();
3327
3328 //
3329 // Viewer advanced stats
3330 //
3331 LLStatView *stat_viewp = NULL;
3332
3333 //
3334 // Viewer Basic
3335 //
3336 stat_viewp = new LLStatView("basic stat view", "Basic", "OpenDebugStatBasic", rect);
3337 gDebugView->mFloaterStatsp->addStatView(stat_viewp);
3338
3339 stat_barp = stat_viewp->addStat("FPS", &(LLViewerStats::getInstance()->mFPSStat));
3340 stat_barp->setUnitLabel(" fps");
3341 stat_barp->mMinBar = 0.f;
3342 stat_barp->mMaxBar = 45.f;
3343 stat_barp->mTickSpacing = 7.5f;
3344 stat_barp->mLabelSpacing = 15.f;
3345 stat_barp->mPrecision = 1;
3346 stat_barp->mDisplayBar = TRUE;
3347 stat_barp->mDisplayHistory = TRUE;
3348
3349 stat_barp = stat_viewp->addStat("Bandwidth", &(LLViewerStats::getInstance()->mKBitStat));
3350 stat_barp->setUnitLabel(" kbps");
3351 stat_barp->mMinBar = 0.f;
3352 stat_barp->mMaxBar = 900.f;
3353 stat_barp->mTickSpacing = 100.f;
3354 stat_barp->mLabelSpacing = 300.f;
3355 stat_barp->mDisplayBar = TRUE;
3356 stat_barp->mDisplayHistory = FALSE;
3357
3358 stat_barp = stat_viewp->addStat("Packet Loss", &(LLViewerStats::getInstance()->mPacketsLostPercentStat));
3359 stat_barp->setUnitLabel(" %");
3360 stat_barp->mMinBar = 0.f;
3361 stat_barp->mMaxBar = 5.f;
3362 stat_barp->mTickSpacing = 1.f;
3363 stat_barp->mLabelSpacing = 1.f;
3364 stat_barp->mDisplayBar = FALSE;
3365 stat_barp->mPerSec = FALSE;
3366 stat_barp->mDisplayMean = TRUE;
3367 stat_barp->mPrecision = 1;
3368
3369 stat_barp = stat_viewp->addStat("Ping Sim", &(LLViewerStats::getInstance()->mSimPingStat));
3370 stat_barp->setUnitLabel(" msec");
3371 stat_barp->mMinBar = 0.f;
3372 stat_barp->mMaxBar = 1000.f;
3373 stat_barp->mTickSpacing = 100.f;
3374 stat_barp->mLabelSpacing = 200.f;
3375 stat_barp->mDisplayBar = FALSE;
3376 stat_barp->mPerSec = FALSE;
3377 stat_barp->mDisplayMean = FALSE;
3378
3379
3380 stat_viewp = new LLStatView("advanced stat view", "Advanced", "OpenDebugStatAdvanced", rect);
3381 gDebugView->mFloaterStatsp->addStatView(stat_viewp);
3382
3383
3384 LLStatView *render_statviewp;
3385 render_statviewp = new LLStatView("render stat view", "Render", "OpenDebugStatRender", rect);
3386 stat_viewp->addChildAtEnd(render_statviewp);
3387
3388 stat_barp = render_statviewp->addStat("KTris Drawn", &(gPipeline.mTrianglesDrawnStat));
3389 stat_barp->setUnitLabel("/fr");
3390 stat_barp->mMinBar = 0.f;
3391 stat_barp->mMaxBar = 500.f;
3392 stat_barp->mTickSpacing = 100.f;
3393 stat_barp->mLabelSpacing = 500.f;
3394 stat_barp->mPrecision = 1;
3395 stat_barp->mPerSec = FALSE;
3396
3397 stat_barp = render_statviewp->addStat("KTris Drawn", &(gPipeline.mTrianglesDrawnStat));
3398 stat_barp->setUnitLabel("/sec");
3399 stat_barp->mMinBar = 0.f;
3400 stat_barp->mMaxBar = 3000.f;
3401 stat_barp->mTickSpacing = 250.f;
3402 stat_barp->mLabelSpacing = 1000.f;
3403 stat_barp->mPrecision = 1;
3404
3405 stat_barp = render_statviewp->addStat("Total Objs", &(gObjectList.mNumObjectsStat));
3406 stat_barp->mMinBar = 0.f;
3407 stat_barp->mMaxBar = 10000.f;
3408 stat_barp->mTickSpacing = 2500.f;
3409 stat_barp->mLabelSpacing = 5000.f;
3410 stat_barp->mPerSec = FALSE;
3411 stat_barp->mDisplayBar = FALSE;
3412
3413 stat_barp = render_statviewp->addStat("New Objs", &(gObjectList.mNumNewObjectsStat));
3414 stat_barp->setLabel("New Objs");
3415 stat_barp->setUnitLabel("/sec");
3416 stat_barp->mMinBar = 0.f;
3417 stat_barp->mMaxBar = 1000.f;
3418 stat_barp->mTickSpacing = 100.f;
3419 stat_barp->mLabelSpacing = 500.f;
3420 stat_barp->mPerSec = TRUE;
3421 stat_barp->mDisplayBar = FALSE;
3422
3423
3424 // Texture statistics
3425 LLStatView *texture_statviewp;
3426 texture_statviewp = new LLStatView("texture stat view", "Texture", "", rect);
3427 render_statviewp->addChildAtEnd(texture_statviewp);
3428
3429 stat_barp = texture_statviewp->addStat("Count", &(gImageList.sNumImagesStat));
3430 stat_barp->setUnitLabel("");
3431 stat_barp->mMinBar = 0.f;
3432 stat_barp->mMaxBar = 8000.f;
3433 stat_barp->mTickSpacing = 2000.f;
3434 stat_barp->mLabelSpacing = 4000.f;
3435 stat_barp->mPerSec = FALSE;
3436 stat_barp->mDisplayBar = FALSE;
3437
3438 stat_barp = texture_statviewp->addStat("Raw Count", &(gImageList.sNumRawImagesStat));
3439 stat_barp->setUnitLabel("");
3440 stat_barp->mMinBar = 0.f;
3441 stat_barp->mMaxBar = 8000.f;
3442 stat_barp->mTickSpacing = 2000.f;
3443 stat_barp->mLabelSpacing = 4000.f;
3444 stat_barp->mPerSec = FALSE;
3445 stat_barp->mDisplayBar = FALSE;
3446
3447 stat_barp = texture_statviewp->addStat("GL Mem", &(gImageList.sGLTexMemStat));
3448 stat_barp->setUnitLabel("");
3449 stat_barp->mMinBar = 0.f;
3450 stat_barp->mMaxBar = 400.f;
3451 stat_barp->mTickSpacing = 100.f;
3452 stat_barp->mLabelSpacing = 200.f;
3453 stat_barp->mPrecision = 1;
3454 stat_barp->mPerSec = FALSE;
3455
3456 stat_barp = texture_statviewp->addStat("Formatted Mem", &(gImageList.sFormattedMemStat));
3457 stat_barp->setUnitLabel("");
3458 stat_barp->mMinBar = 0.f;
3459 stat_barp->mMaxBar = 400.f;
3460 stat_barp->mTickSpacing = 100.f;
3461 stat_barp->mLabelSpacing = 200.f;
3462 stat_barp->mPrecision = 1;
3463 stat_barp->mPerSec = FALSE;
3464
3465 stat_barp = texture_statviewp->addStat("Raw Mem", &(gImageList.sRawMemStat));
3466 stat_barp->setUnitLabel("");
3467 stat_barp->mMinBar = 0.f;
3468 stat_barp->mMaxBar = 400.f;
3469 stat_barp->mTickSpacing = 100.f;
3470 stat_barp->mLabelSpacing = 200.f;
3471 stat_barp->mPrecision = 1;
3472 stat_barp->mPerSec = FALSE;
3473
3474 stat_barp = texture_statviewp->addStat("Bound Mem", &(gImageList.sGLBoundMemStat));
3475 stat_barp->setUnitLabel("");
3476 stat_barp->mMinBar = 0.f;
3477 stat_barp->mMaxBar = 400.f;
3478 stat_barp->mTickSpacing = 100.f;
3479 stat_barp->mLabelSpacing = 200.f;
3480 stat_barp->mPrecision = 1;
3481 stat_barp->mPerSec = FALSE;
3482
3483
3484 // Network statistics
3485 LLStatView *net_statviewp;
3486 net_statviewp = new LLStatView("network stat view", "Network", "OpenDebugStatNet", rect);
3487 stat_viewp->addChildAtEnd(net_statviewp);
3488
3489 stat_barp = net_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mPacketsInStat));
3490 stat_barp->setUnitLabel("/sec");
3491 stat_barp->mDisplayBar = FALSE;
3492
3493 stat_barp = net_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mPacketsOutStat));
3494 stat_barp->setUnitLabel("/sec");
3495 stat_barp->mDisplayBar = FALSE;
3496
3497 stat_barp = net_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mObjectKBitStat));
3498 stat_barp->setUnitLabel(" kbps");
3499 stat_barp->mDisplayBar = FALSE;
3500
3501 stat_barp = net_statviewp->addStat("Texture", &(LLViewerStats::getInstance()->mTextureKBitStat));
3502 stat_barp->setUnitLabel(" kbps");
3503 stat_barp->mDisplayBar = FALSE;
3504
3505 stat_barp = net_statviewp->addStat("Asset", &(LLViewerStats::getInstance()->mAssetKBitStat));
3506 stat_barp->setUnitLabel(" kbps");
3507 stat_barp->mDisplayBar = FALSE;
3508
3509 stat_barp = net_statviewp->addStat("Layers", &(LLViewerStats::getInstance()->mLayersKBitStat));
3510 stat_barp->setUnitLabel(" kbps");
3511 stat_barp->mDisplayBar = FALSE;
3512
3513 stat_barp = net_statviewp->addStat("Actual In", &(LLViewerStats::getInstance()->mActualInKBitStat));
3514 stat_barp->setUnitLabel(" kbps");
3515 stat_barp->mMinBar = 0.f;
3516 stat_barp->mMaxBar = 1024.f;
3517 stat_barp->mTickSpacing = 128.f;
3518 stat_barp->mLabelSpacing = 256.f;
3519 stat_barp->mDisplayBar = TRUE;
3520 stat_barp->mDisplayHistory = FALSE;
3521
3522 stat_barp = net_statviewp->addStat("Actual Out", &(LLViewerStats::getInstance()->mActualOutKBitStat));
3523 stat_barp->setUnitLabel(" kbps");
3524 stat_barp->mMinBar = 0.f;
3525 stat_barp->mMaxBar = 512.f;
3526 stat_barp->mTickSpacing = 128.f;
3527 stat_barp->mLabelSpacing = 256.f;
3528 stat_barp->mDisplayBar = TRUE;
3529 stat_barp->mDisplayHistory = FALSE;
3530
3531 stat_barp = net_statviewp->addStat("VFS Pending Ops", &(LLViewerStats::getInstance()->mVFSPendingOperations));
3532 stat_barp->setUnitLabel(" ");
3533 stat_barp->mPerSec = FALSE;
3534 stat_barp->mDisplayBar = FALSE;
3535
3536
3537 // Simulator stats
3538 LLStatView *sim_statviewp = new LLStatView("sim stat view", "Simulator", "OpenDebugStatSim", rect);
3539 gDebugView->mFloaterStatsp->addStatView(sim_statviewp);
3540
3541 stat_barp = sim_statviewp->addStat("Time Dilation", &(LLViewerStats::getInstance()->mSimTimeDilation));
3542 stat_barp->mPrecision = 2;
3543 stat_barp->mMinBar = 0.f;
3544 stat_barp->mMaxBar = 1.f;
3545 stat_barp->mTickSpacing = 0.25f;
3546 stat_barp->mLabelSpacing = 0.5f;
3547 stat_barp->mPerSec = FALSE;
3548 stat_barp->mDisplayBar = FALSE;
3549 stat_barp->mDisplayMean = FALSE;
3550
3551 stat_barp = sim_statviewp->addStat("Sim FPS", &(LLViewerStats::getInstance()->mSimFPS));
3552 stat_barp->mMinBar = 0.f;
3553 stat_barp->mMaxBar = 200.f;
3554 stat_barp->mTickSpacing = 20.f;
3555 stat_barp->mLabelSpacing = 100.f;
3556 stat_barp->mPerSec = FALSE;
3557 stat_barp->mDisplayBar = FALSE;
3558 stat_barp->mDisplayMean = FALSE;
3559
3560 stat_barp = sim_statviewp->addStat("Physics FPS", &(LLViewerStats::getInstance()->mSimPhysicsFPS));
3561 stat_barp->mPrecision = 1;
3562 stat_barp->mMinBar = 0.f;
3563 stat_barp->mMaxBar = 66.f;
3564 stat_barp->mTickSpacing = 33.f;
3565 stat_barp->mLabelSpacing = 33.f;
3566 stat_barp->mPerSec = FALSE;
3567 stat_barp->mDisplayBar = FALSE;
3568 stat_barp->mDisplayMean = FALSE;
3569
3570 LLStatView *phys_details_viewp;
3571 phys_details_viewp = new LLStatView("phys detail view", "Physics Details", "", rect);
3572 sim_statviewp->addChildAtEnd(phys_details_viewp);
3573
3574 stat_barp = phys_details_viewp->addStat("Pinned Objects", &(LLViewerStats::getInstance()->mPhysicsPinnedTasks));
3575 stat_barp->mPrecision = 0;
3576 stat_barp->mMinBar = 0.f;
3577 stat_barp->mMaxBar = 500.f;
3578 stat_barp->mTickSpacing = 10.f;
3579 stat_barp->mLabelSpacing = 40.f;
3580 stat_barp->mPerSec = FALSE;
3581 stat_barp->mDisplayBar = FALSE;
3582 stat_barp->mDisplayMean = FALSE;
3583
3584 stat_barp = phys_details_viewp->addStat("Low LOD Objects", &(LLViewerStats::getInstance()->mPhysicsLODTasks));
3585 stat_barp->mPrecision = 0;
3586 stat_barp->mMinBar = 0.f;
3587 stat_barp->mMaxBar = 500.f;
3588 stat_barp->mTickSpacing = 10.f;
3589 stat_barp->mLabelSpacing = 40.f;
3590 stat_barp->mPerSec = FALSE;
3591 stat_barp->mDisplayBar = FALSE;
3592 stat_barp->mDisplayMean = FALSE;
3593
3594 stat_barp = phys_details_viewp->addStat("Memory Allocated", &(LLViewerStats::getInstance()->mPhysicsMemoryAllocated));
3595 stat_barp->setUnitLabel(" MB");
3596 stat_barp->mPrecision = 0;
3597 stat_barp->mMinBar = 0.f;
3598 stat_barp->mMaxBar = 1024.f;
3599 stat_barp->mTickSpacing = 128.f;
3600 stat_barp->mLabelSpacing = 256.f;
3601 stat_barp->mPerSec = FALSE;
3602 stat_barp->mDisplayBar = FALSE;
3603 stat_barp->mDisplayMean = FALSE;
3604
3605 stat_barp = sim_statviewp->addStat("Agent Updates/Sec", &(LLViewerStats::getInstance()->mSimAgentUPS));
3606 stat_barp->mPrecision = 1;
3607 stat_barp->mMinBar = 0.f;
3608 stat_barp->mMaxBar = 100.f;
3609 stat_barp->mTickSpacing = 25.f;
3610 stat_barp->mLabelSpacing = 50.f;
3611 stat_barp->mPerSec = FALSE;
3612 stat_barp->mDisplayBar = FALSE;
3613 stat_barp->mDisplayMean = FALSE;
3614
3615 stat_barp = sim_statviewp->addStat("Main Agents", &(LLViewerStats::getInstance()->mSimMainAgents));
3616 stat_barp->mPrecision = 0;
3617 stat_barp->mMinBar = 0.f;
3618 stat_barp->mMaxBar = 80.f;
3619 stat_barp->mTickSpacing = 10.f;
3620 stat_barp->mLabelSpacing = 40.f;
3621 stat_barp->mPerSec = FALSE;
3622 stat_barp->mDisplayBar = FALSE;
3623 stat_barp->mDisplayMean = FALSE;
3624
3625 stat_barp = sim_statviewp->addStat("Child Agents", &(LLViewerStats::getInstance()->mSimChildAgents));
3626 stat_barp->mPrecision = 0;
3627 stat_barp->mMinBar = 0.f;
3628 stat_barp->mMaxBar = 40.f;
3629 stat_barp->mTickSpacing = 5.f;
3630 stat_barp->mLabelSpacing = 10.f;
3631 stat_barp->mPerSec = FALSE;
3632 stat_barp->mDisplayBar = FALSE;
3633 stat_barp->mDisplayMean = FALSE;
3634
3635 stat_barp = sim_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mSimObjects));
3636 stat_barp->mPrecision = 0;
3637 stat_barp->mMinBar = 0.f;
3638 stat_barp->mMaxBar = 30000.f;
3639 stat_barp->mTickSpacing = 5000.f;
3640 stat_barp->mLabelSpacing = 10000.f;
3641 stat_barp->mPerSec = FALSE;
3642 stat_barp->mDisplayBar = FALSE;
3643 stat_barp->mDisplayMean = FALSE;
3644
3645 stat_barp = sim_statviewp->addStat("Active Objects", &(LLViewerStats::getInstance()->mSimActiveObjects));
3646 stat_barp->mPrecision = 0;
3647 stat_barp->mMinBar = 0.f;
3648 stat_barp->mMaxBar = 800.f;
3649 stat_barp->mTickSpacing = 100.f;
3650 stat_barp->mLabelSpacing = 200.f;
3651 stat_barp->mPerSec = FALSE;
3652 stat_barp->mDisplayBar = FALSE;
3653 stat_barp->mDisplayMean = FALSE;
3654
3655 stat_barp = sim_statviewp->addStat("Active Scripts", &(LLViewerStats::getInstance()->mSimActiveScripts));
3656 stat_barp->mPrecision = 0;
3657 stat_barp->mMinBar = 0.f;
3658 stat_barp->mMaxBar = 800.f;
3659 stat_barp->mTickSpacing = 100.f;
3660 stat_barp->mLabelSpacing = 200.f;
3661 stat_barp->mPerSec = FALSE;
3662 stat_barp->mDisplayBar = FALSE;
3663 stat_barp->mDisplayMean = FALSE;
3664
3665 stat_barp = sim_statviewp->addStat("Script Events", &(LLViewerStats::getInstance()->mSimScriptEPS));
3666 stat_barp->setUnitLabel(" eps");
3667 stat_barp->mPrecision = 0;
3668 stat_barp->mMinBar = 0.f;
3669 stat_barp->mMaxBar = 20000.f;
3670 stat_barp->mTickSpacing = 2500.f;
3671 stat_barp->mLabelSpacing = 5000.f;
3672 stat_barp->mPerSec = FALSE;
3673 stat_barp->mDisplayBar = FALSE;
3674 stat_barp->mDisplayMean = FALSE;
3675
3676 stat_barp = sim_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mSimInPPS));
3677 stat_barp->setUnitLabel(" pps");
3678 stat_barp->mPrecision = 0;
3679 stat_barp->mMinBar = 0.f;
3680 stat_barp->mMaxBar = 2000.f;
3681 stat_barp->mTickSpacing = 250.f;
3682 stat_barp->mLabelSpacing = 1000.f;
3683 stat_barp->mPerSec = FALSE;
3684 stat_barp->mDisplayBar = FALSE;
3685 stat_barp->mDisplayMean = FALSE;
3686
3687 stat_barp = sim_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mSimOutPPS));
3688 stat_barp->setUnitLabel(" pps");
3689 stat_barp->mPrecision = 0;
3690 stat_barp->mMinBar = 0.f;
3691 stat_barp->mMaxBar = 2000.f;
3692 stat_barp->mTickSpacing = 250.f;
3693 stat_barp->mLabelSpacing = 1000.f;
3694 stat_barp->mPerSec = FALSE;
3695 stat_barp->mDisplayBar = FALSE;
3696 stat_barp->mDisplayMean = FALSE;
3697
3698 stat_barp = sim_statviewp->addStat("Pending Downloads", &(LLViewerStats::getInstance()->mSimPendingDownloads));
3699 stat_barp->mPrecision = 0;
3700 stat_barp->mMinBar = 0.f;
3701 stat_barp->mMaxBar = 800.f;
3702 stat_barp->mTickSpacing = 100.f;
3703 stat_barp->mLabelSpacing = 200.f;
3704 stat_barp->mPerSec = FALSE;
3705 stat_barp->mDisplayBar = FALSE;
3706 stat_barp->mDisplayMean = FALSE;
3707
3708 stat_barp = sim_statviewp->addStat("Pending Uploads", &(LLViewerStats::getInstance()->mSimPendingUploads));
3709 stat_barp->mPrecision = 0;
3710 stat_barp->mMinBar = 0.f;
3711 stat_barp->mMaxBar = 100.f;
3712 stat_barp->mTickSpacing = 25.f;
3713 stat_barp->mLabelSpacing = 50.f;
3714 stat_barp->mPerSec = FALSE;
3715 stat_barp->mDisplayBar = FALSE;
3716 stat_barp->mDisplayMean = FALSE;
3717
3718 stat_barp = sim_statviewp->addStat("Total Unacked Bytes", &(LLViewerStats::getInstance()->mSimTotalUnackedBytes));
3719 stat_barp->setUnitLabel(" kb");
3720 stat_barp->mPrecision = 0;
3721 stat_barp->mMinBar = 0.f;
3722 stat_barp->mMaxBar = 100000.f;
3723 stat_barp->mTickSpacing = 25000.f;
3724 stat_barp->mLabelSpacing = 50000.f;
3725 stat_barp->mPerSec = FALSE;
3726 stat_barp->mDisplayBar = FALSE;
3727 stat_barp->mDisplayMean = FALSE;
3728
3729 LLStatView *sim_time_viewp;
3730 sim_time_viewp = new LLStatView("sim perf view", "Time (ms)", "", rect);
3731 sim_statviewp->addChildAtEnd(sim_time_viewp);
3732
3733 stat_barp = sim_time_viewp->addStat("Total Frame Time", &(LLViewerStats::getInstance()->mSimFrameMsec));
3734 stat_barp->setUnitLabel("ms");
3735 stat_barp->mPrecision = 1;
3736 stat_barp->mMinBar = 0.f;
3737 stat_barp->mMaxBar = 40.f;
3738 stat_barp->mTickSpacing = 10.f;
3739 stat_barp->mLabelSpacing = 20.f;
3740 stat_barp->mPerSec = FALSE;
3741 stat_barp->mDisplayBar = FALSE;
3742 stat_barp->mDisplayMean = FALSE;
3743
3744 stat_barp = sim_time_viewp->addStat("Net Time", &(LLViewerStats::getInstance()->mSimNetMsec));
3745 stat_barp->setUnitLabel("ms");
3746 stat_barp->mPrecision = 1;
3747 stat_barp->mMinBar = 0.f;
3748 stat_barp->mMaxBar = 40.f;
3749 stat_barp->mTickSpacing = 10.f;
3750 stat_barp->mLabelSpacing = 20.f;
3751 stat_barp->mPerSec = FALSE;
3752 stat_barp->mDisplayBar = FALSE;
3753 stat_barp->mDisplayMean = FALSE;
3754
3755 stat_barp = sim_time_viewp->addStat("Physics Time", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec));
3756 stat_barp->setUnitLabel("ms");
3757 stat_barp->mPrecision = 1;
3758 stat_barp->mMinBar = 0.f;
3759 stat_barp->mMaxBar = 40.f;
3760 stat_barp->mTickSpacing = 10.f;
3761 stat_barp->mLabelSpacing = 20.f;
3762 stat_barp->mPerSec = FALSE;
3763 stat_barp->mDisplayBar = FALSE;
3764 stat_barp->mDisplayMean = FALSE;
3765
3766 stat_barp = sim_time_viewp->addStat("Simulation Time", &(LLViewerStats::getInstance()->mSimSimOtherMsec));
3767 stat_barp->setUnitLabel("ms");
3768 stat_barp->mPrecision = 1;
3769 stat_barp->mMinBar = 0.f;
3770 stat_barp->mMaxBar = 40.f;
3771 stat_barp->mTickSpacing = 10.f;
3772 stat_barp->mLabelSpacing = 20.f;
3773 stat_barp->mPerSec = FALSE;
3774 stat_barp->mDisplayBar = FALSE;
3775 stat_barp->mDisplayMean = FALSE;
3776
3777 stat_barp = sim_time_viewp->addStat("Agent Time", &(LLViewerStats::getInstance()->mSimAgentMsec));
3778 stat_barp->setUnitLabel("ms");
3779 stat_barp->mPrecision = 1;
3780 stat_barp->mMinBar = 0.f;
3781 stat_barp->mMaxBar = 40.f;
3782 stat_barp->mTickSpacing = 10.f;
3783 stat_barp->mLabelSpacing = 20.f;
3784 stat_barp->mPerSec = FALSE;
3785 stat_barp->mDisplayBar = FALSE;
3786 stat_barp->mDisplayMean = FALSE;
3787
3788 stat_barp = sim_time_viewp->addStat("Images Time", &(LLViewerStats::getInstance()->mSimImagesMsec));
3789 stat_barp->setUnitLabel("ms");
3790 stat_barp->mPrecision = 1;
3791 stat_barp->mMinBar = 0.f;
3792 stat_barp->mMaxBar = 40.f;
3793 stat_barp->mTickSpacing = 10.f;
3794 stat_barp->mLabelSpacing = 20.f;
3795 stat_barp->mPerSec = FALSE;
3796 stat_barp->mDisplayBar = FALSE;
3797 stat_barp->mDisplayMean = FALSE;
3798
3799 stat_barp = sim_time_viewp->addStat("Script Time", &(LLViewerStats::getInstance()->mSimScriptMsec));
3800 stat_barp->setUnitLabel("ms");
3801 stat_barp->mPrecision = 1;
3802 stat_barp->mMinBar = 0.f;
3803 stat_barp->mMaxBar = 40.f;
3804 stat_barp->mTickSpacing = 10.f;
3805 stat_barp->mLabelSpacing = 20.f;
3806 stat_barp->mPerSec = FALSE;
3807 stat_barp->mDisplayBar = FALSE;
3808 stat_barp->mDisplayMean = FALSE;
3809
3810 stat_barp = sim_time_viewp->addStat("Spare Time", &(LLViewerStats::getInstance()->mSimSpareMsec));
3811 stat_barp->setUnitLabel("ms");
3812 stat_barp->mPrecision = 1;
3813 stat_barp->mMinBar = 0.f;
3814 stat_barp->mMaxBar = 40.f;
3815 stat_barp->mTickSpacing = 10.f;
3816 stat_barp->mLabelSpacing = 20.f;
3817 stat_barp->mPerSec = FALSE;
3818 stat_barp->mDisplayBar = FALSE;
3819 stat_barp->mDisplayMean = FALSE;
3820
3821
3822 // 2nd level time blocks under 'Details' second
3823 LLStatView *detailed_time_viewp;
3824 detailed_time_viewp = new LLStatView("sim perf view", "Time Details (ms)", "", rect);
3825 sim_time_viewp->addChildAtEnd(detailed_time_viewp);
3826 {
3827 stat_barp = detailed_time_viewp->addStat(" Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec));
3828 stat_barp->setUnitLabel("ms");
3829 stat_barp->mPrecision = 1;
3830 stat_barp->mMinBar = 0.f;
3831 stat_barp->mMaxBar = 40.f;
3832 stat_barp->mTickSpacing = 10.f;
3833 stat_barp->mLabelSpacing = 20.f;
3834 stat_barp->mPerSec = FALSE;
3835 stat_barp->mDisplayBar = FALSE;
3836 stat_barp->mDisplayMean = FALSE;
3837
3838 stat_barp = detailed_time_viewp->addStat(" Update Physics Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec));
3839 stat_barp->setUnitLabel("ms");
3840 stat_barp->mPrecision = 1;
3841 stat_barp->mMinBar = 0.f;
3842 stat_barp->mMaxBar = 40.f;
3843 stat_barp->mTickSpacing = 10.f;
3844 stat_barp->mLabelSpacing = 20.f;
3845 stat_barp->mPerSec = FALSE;
3846 stat_barp->mDisplayBar = FALSE;
3847 stat_barp->mDisplayMean = FALSE;
3848
3849 stat_barp = detailed_time_viewp->addStat(" Physics Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec));
3850 stat_barp->setUnitLabel("ms");
3851 stat_barp->mPrecision = 1;
3852 stat_barp->mMinBar = 0.f;
3853 stat_barp->mMaxBar = 40.f;
3854 stat_barp->mTickSpacing = 10.f;
3855 stat_barp->mLabelSpacing = 20.f;
3856 stat_barp->mPerSec = FALSE;
3857 stat_barp->mDisplayBar = FALSE;
3858 stat_barp->mDisplayMean = FALSE;
3859
3860 stat_barp = detailed_time_viewp->addStat(" Sleep Time", &(LLViewerStats::getInstance()->mSimSleepMsec));
3861 stat_barp->setUnitLabel("ms");
3862 stat_barp->mPrecision = 1;
3863 stat_barp->mMinBar = 0.f;
3864 stat_barp->mMaxBar = 40.f;
3865 stat_barp->mTickSpacing = 10.f;
3866 stat_barp->mLabelSpacing = 20.f;
3867 stat_barp->mPerSec = FALSE;
3868 stat_barp->mDisplayBar = FALSE;
3869 stat_barp->mDisplayMean = FALSE;
3870
3871 stat_barp = detailed_time_viewp->addStat(" Pump IO", &(LLViewerStats::getInstance()->mSimPumpIOMsec));
3872 stat_barp->setUnitLabel("ms");
3873 stat_barp->mPrecision = 1;
3874 stat_barp->mMinBar = 0.f;
3875 stat_barp->mMaxBar = 40.f;
3876 stat_barp->mTickSpacing = 10.f;
3877 stat_barp->mLabelSpacing = 20.f;
3878 stat_barp->mPerSec = FALSE;
3879 stat_barp->mDisplayBar = FALSE;
3880 stat_barp->mDisplayMean = FALSE;
3881 }
3882
3883 LLRect r = gDebugView->mFloaterStatsp->getRect();
3884
3885 // Reshape based on the parameters we set.
3886 gDebugView->mFloaterStatsp->reshape(r.getWidth(), r.getHeight());
3887} 3346}
3888 3347
3889void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32) 3348void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32)
@@ -3901,8 +3360,9 @@ const S32 OPT_CLOSED_WINDOW = -1;
3901const S32 OPT_MALE = 0; 3360const S32 OPT_MALE = 0;
3902const S32 OPT_FEMALE = 1; 3361const S32 OPT_FEMALE = 1;
3903 3362
3904void callback_choose_gender(S32 option, void* userdata) 3363bool callback_choose_gender(const LLSD& notification, const LLSD& response)
3905{ 3364{
3365 S32 option = LLNotification::getSelectedOption(notification, response);
3906 switch(option) 3366 switch(option)
3907 { 3367 {
3908 case OPT_MALE: 3368 case OPT_MALE:
@@ -3915,6 +3375,7 @@ void callback_choose_gender(S32 option, void* userdata)
3915 LLStartUp::loadInitialOutfit( FEMALE_OUTFIT_FOLDER, "female" ); 3375 LLStartUp::loadInitialOutfit( FEMALE_OUTFIT_FOLDER, "female" );
3916 break; 3376 break;
3917 } 3377 }
3378 return false;
3918} 3379}
3919 3380
3920void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, 3381void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
@@ -3957,8 +3418,8 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
3957 // This is really misnamed -- it means we have started loading 3418 // This is really misnamed -- it means we have started loading
3958 // an outfit/shape that will give the avatar a gender eventually. JC 3419 // an outfit/shape that will give the avatar a gender eventually. JC
3959 gAgent.setGenderChosen(TRUE); 3420 gAgent.setGenderChosen(TRUE);
3421
3960} 3422}
3961
3962 3423
3963// Loads a bitmap to display during load 3424// Loads a bitmap to display during load
3964// location_id = 0 => last position 3425// location_id = 0 => last position
@@ -4107,7 +3568,7 @@ void LLStartUp::multimediaInit()
4107{ 3568{
4108 LL_DEBUGS("AppInit") << "Initializing Multimedia...." << LL_ENDL; 3569 LL_DEBUGS("AppInit") << "Initializing Multimedia...." << LL_ENDL;
4109 std::string msg = LLTrans::getString("LoginInitializingMultimedia"); 3570 std::string msg = LLTrans::getString("LoginInitializingMultimedia");
4110 set_startup_status(0.50f, msg.c_str(), gAgent.mMOTD.c_str()); 3571 set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str());
4111 display_startup(); 3572 display_startup();
4112 3573
4113 LLViewerMedia::initClass(); 3574 LLViewerMedia::initClass();
@@ -4119,8 +3580,9 @@ bool LLStartUp::dispatchURL()
4119 // ok, if we've gotten this far and have a startup URL 3580 // ok, if we've gotten this far and have a startup URL
4120 if (!sSLURLCommand.empty()) 3581 if (!sSLURLCommand.empty())
4121 { 3582 {
4122 const bool from_external_browser = true; 3583 LLWebBrowserCtrl* web = NULL;
4123 LLURLDispatcher::dispatch(sSLURLCommand, from_external_browser); 3584 const bool trusted_browser = false;
3585 LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser);
4124 } 3586 }
4125 else if (LLURLSimString::parse()) 3587 else if (LLURLSimString::parse())
4126 { 3588 {
@@ -4136,17 +3598,19 @@ bool LLStartUp::dispatchURL()
4136 || (dy*dy > SLOP*SLOP) ) 3598 || (dy*dy > SLOP*SLOP) )
4137 { 3599 {
4138 std::string url = LLURLSimString::getURL(); 3600 std::string url = LLURLSimString::getURL();
4139 const bool from_external_browser = true; 3601 LLWebBrowserCtrl* web = NULL;
4140 LLURLDispatcher::dispatch(url, from_external_browser); 3602 const bool trusted_browser = false;
3603 LLURLDispatcher::dispatch(url, web, trusted_browser);
4141 } 3604 }
4142 return true; 3605 return true;
4143 } 3606 }
4144 return false; 3607 return false;
4145} 3608}
4146 3609
4147void login_alert_done(S32 option, void* user_data) 3610bool login_alert_done(const LLSD& notification, const LLSD& response)
4148{ 3611{
4149 LLPanelLogin::giveFocus(); 3612 LLPanelLogin::giveFocus();
3613 return false;
4150} 3614}
4151 3615
4152 3616