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.cpp1041
1 files changed, 249 insertions, 792 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index d747bd2..c5bf2c7 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,
@@ -29,14 +30,7 @@
29 * $/LicenseInfo$ 30 * $/LicenseInfo$
30 */ 31 */
31 32
32// #include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
33
34
35#if LL_WINDOWS
36 #define WIN32_LEAN_AND_MEAN
37 #include <winsock2.h>
38 #include <windows.h>
39#endif
40 34
41#include "llstartup.h" 35#include "llstartup.h"
42 36
@@ -120,6 +114,7 @@
120#include "llinventorymodel.h" 114#include "llinventorymodel.h"
121#include "llinventoryview.h" 115#include "llinventoryview.h"
122#include "llkeyboard.h" 116#include "llkeyboard.h"
117#include "llloginhandler.h" // gLoginHandler, SLURL support
123#include "llpanellogin.h" 118#include "llpanellogin.h"
124#include "llmutelist.h" 119#include "llmutelist.h"
125#include "llnotify.h" 120#include "llnotify.h"
@@ -134,12 +129,14 @@
134#include "llpanelgroupnotices.h" 129#include "llpanelgroupnotices.h"
135#include "llpreview.h" 130#include "llpreview.h"
136#include "llpreviewscript.h" 131#include "llpreviewscript.h"
132#include "llproductinforequest.h"
137#include "llsecondlifeurls.h" 133#include "llsecondlifeurls.h"
138#include "llselectmgr.h" 134#include "llselectmgr.h"
139#include "llsky.h" 135#include "llsky.h"
140#include "llsrv.h" 136#include "llsrv.h"
141#include "llstatview.h" 137#include "llstatview.h"
142#include "lltrans.h" 138#include "lltrans.h"
139#include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance
143#include "llsurface.h" 140#include "llsurface.h"
144#include "lltexturecache.h" 141#include "lltexturecache.h"
145#include "lltexturefetch.h" 142#include "lltexturefetch.h"
@@ -240,22 +237,19 @@ bool LLStartUp::mShouldAutoLogin = false;
240 237
241void login_show(); 238void login_show();
242void login_callback(S32 option, void* userdata); 239void 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); 240bool is_hex_string(U8* str, S32 len);
246void show_first_run_dialog(); 241void show_first_run_dialog();
247void first_run_dialog_callback(S32 option, void* userdata); 242bool 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); 243void set_startup_status(const F32 frac, const std::string& string, const std::string& msg);
249void login_alert_status(S32 option, void* user_data); 244bool login_alert_status(const LLSD& notification, const LLSD& response);
250void update_app(BOOL mandatory, const std::string& message); 245void update_app(BOOL mandatory, const std::string& message);
251void update_dialog_callback(S32 option, void *userdata); 246bool update_dialog_callback(const LLSD& notification, const LLSD& response);
252void login_packet_failed(void**, S32 result); 247void login_packet_failed(void**, S32 result);
253void use_circuit_callback(void**, S32 result); 248void use_circuit_callback(void**, S32 result);
254void register_viewer_callbacks(LLMessageSystem* msg); 249void register_viewer_callbacks(LLMessageSystem* msg);
255void init_stat_view(); 250void init_stat_view();
256void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32); 251void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32);
257void dialog_choose_gender_first_start(); 252bool callback_choose_gender(const LLSD& notification, const LLSD& response);
258void callback_choose_gender(S32 option, void* userdata);
259void init_start_screen(S32 location_id); 253void init_start_screen(S32 location_id);
260void release_start_screen(); 254void release_start_screen();
261void apply_udp_blacklist(const std::string& csv); 255void apply_udp_blacklist(const std::string& csv);
@@ -360,7 +354,6 @@ bool idle_startup()
360 static S32 location_which = START_LOCATION_ID_LAST; 354 static S32 location_which = START_LOCATION_ID_LAST;
361 355
362 static bool show_connect_box = true; 356 static bool show_connect_box = true;
363 static BOOL remember_password = TRUE;
364 357
365 static bool stipend_since_login = false; 358 static bool stipend_since_login = false;
366 359
@@ -401,16 +394,16 @@ bool idle_startup()
401 394
402 if (LLFeatureManager::getInstance()->isSafe()) 395 if (LLFeatureManager::getInstance()->isSafe())
403 { 396 {
404 gViewerWindow->alertXml("DisplaySetToSafe"); 397 LLNotifications::instance().add("DisplaySetToSafe");
405 } 398 }
406 else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && 399 else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) &&
407 (gSavedSettings.getS32("LastFeatureVersion") != 0)) 400 (gSavedSettings.getS32("LastFeatureVersion") != 0))
408 { 401 {
409 gViewerWindow->alertXml("DisplaySetToRecommended"); 402 LLNotifications::instance().add("DisplaySetToRecommended");
410 } 403 }
411 else if (!gViewerWindow->getInitAlert().empty()) 404 else if (!gViewerWindow->getInitAlert().empty())
412 { 405 {
413 gViewerWindow->alertXml(gViewerWindow->getInitAlert()); 406 LLNotifications::instance().add(gViewerWindow->getInitAlert());
414 } 407 }
415 408
416 gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion()); 409 gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion());
@@ -433,10 +426,11 @@ bool idle_startup()
433 } 426 }
434 if (!xml_ok) 427 if (!xml_ok)
435 { 428 {
436 // *TODO:translate (maybe - very unlikely error message) 429 // 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 430 // 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."; 431 // which will display a nontranslatable error message that says so.
439 LLAppViewer::instance()->earlyExit(bad_xui_msg); 432 // Otherwise, we'll display a reasonable error message that IS translatable.
433 LLAppViewer::instance()->earlyExit("BadInstallation");
440 } 434 }
441 // 435 //
442 // Statistics stuff 436 // Statistics stuff
@@ -454,9 +448,9 @@ bool idle_startup()
454 448
455 if (ll_init_ares() == NULL || !gAres->isInitialized()) 449 if (ll_init_ares() == NULL || !gAres->isInitialized())
456 { 450 {
457 LL_WARNS("AppInit") << "Could not start address resolution system" << LL_ENDL; 451 std::string diagnostic = "Could not start address resolution system";
458 std::string msg = LLTrans::getString("LoginFailedNoNetwork"); 452 LL_WARNS("AppInit") << diagnostic << LL_ENDL;
459 LLAppViewer::instance()->earlyExit(msg); 453 LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic));
460 } 454 }
461 455
462 // 456 //
@@ -493,6 +487,14 @@ bool idle_startup()
493 } 487 }
494 488
495 LLHTTPSender::setDefaultSender(new LLNullHTTPSender()); 489 LLHTTPSender::setDefaultSender(new LLNullHTTPSender());
490
491 // TODO parameterize
492 const F32 circuit_heartbeat_interval = 5;
493 const F32 circuit_timeout = 100;
494
495 const LLUseCircuitCodeResponder* responder = NULL;
496 bool failure_is_fatal = true;
497
496 if(!start_messaging_system( 498 if(!start_messaging_system(
497 message_template_path, 499 message_template_path,
498 port, 500 port,
@@ -500,11 +502,15 @@ bool idle_startup()
500 LL_VERSION_MINOR, 502 LL_VERSION_MINOR,
501 LL_VERSION_PATCH, 503 LL_VERSION_PATCH,
502 FALSE, 504 FALSE,
503 std::string())) 505 std::string(),
506 responder,
507 failure_is_fatal,
508 circuit_heartbeat_interval,
509 circuit_timeout))
504 { 510 {
505 std::string msg = LLTrans::getString("LoginFailedNoNetwork"); 511 std::string diagnostic = llformat(" Error: %d", gMessageSystem->getErrorCode());
506 msg.append(llformat(" Error: %d", gMessageSystem->getErrorCode())); 512 LL_WARNS("AppInit") << diagnostic << LL_ENDL;
507 LLAppViewer::instance()->earlyExit(msg); 513 LLAppViewer::instance()->earlyExit("LoginFailedNoNetwork", LLSD().insert("DIAGNOSTIC", diagnostic));
508 } 514 }
509 515
510 #if LL_WINDOWS 516 #if LL_WINDOWS
@@ -527,7 +533,7 @@ bool idle_startup()
527 } 533 }
528 else 534 else
529 { 535 {
530 LLAppViewer::instance()->earlyExit("Message Template " + message_template_path + " not found."); 536 LLAppViewer::instance()->earlyExit("MessageTemplateNotFound", LLSD().insert("PATH", message_template_path));
531 } 537 }
532 538
533 if(gMessageSystem && gMessageSystem->isOK()) 539 if(gMessageSystem && gMessageSystem->isOK())
@@ -658,16 +664,23 @@ bool idle_startup()
658 // 664 //
659 // Log on to system 665 // Log on to system
660 // 666 //
661 if ((!gLoginHandler.mFirstName.empty() && 667 if (!LLStartUp::sSLURLCommand.empty())
662 !gLoginHandler.mLastName.empty() &&
663 !gLoginHandler.mWebLoginKey.isNull())
664 || gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand) )
665 { 668 {
666 firstname = gLoginHandler.mFirstName; 669 // this might be a secondlife:///app/login URL
667 lastname = gLoginHandler.mLastName; 670 gLoginHandler.parseDirectLogin(LLStartUp::sSLURLCommand);
668 web_login_key = gLoginHandler.mWebLoginKey; 671 }
672 if (!gLoginHandler.getFirstName().empty()
673 || !gLoginHandler.getLastName().empty()
674 || !gLoginHandler.getWebLoginKey().isNull() )
675 {
676 // We have at least some login information on a SLURL
677 firstname = gLoginHandler.getFirstName();
678 lastname = gLoginHandler.getLastName();
679 web_login_key = gLoginHandler.getWebLoginKey();
669 680
670 show_connect_box = false; 681 // Show the login screen if we don't have everything
682 show_connect_box =
683 firstname.empty() || lastname.empty() || web_login_key.isNull();
671 } 684 }
672 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin()) 685 else if((gSavedSettings.getLLSD("UserLoginInfo").size() == 3) && !LLStartUp::shouldAutoLogin())
673 { 686 {
@@ -679,7 +692,6 @@ bool idle_startup()
679 char md5pass[33]; /* Flawfinder: ignore */ 692 char md5pass[33]; /* Flawfinder: ignore */
680 pass.hex_digest(md5pass); 693 pass.hex_digest(md5pass);
681 password = md5pass; 694 password = md5pass;
682 remember_password = gSavedSettings.getBOOL("RememberPassword");
683 695
684#ifdef USE_VIEWER_AUTH 696#ifdef USE_VIEWER_AUTH
685 show_connect_box = true; 697 show_connect_box = true;
@@ -692,9 +704,8 @@ bool idle_startup()
692 { 704 {
693 firstname = gSavedSettings.getString("FirstName"); 705 firstname = gSavedSettings.getString("FirstName");
694 lastname = gSavedSettings.getString("LastName"); 706 lastname = gSavedSettings.getString("LastName");
695 password = load_password_from_disk(); 707 password = LLStartUp::loadPasswordFromDisk();
696 gSavedSettings.setBOOL("RememberPassword", TRUE); 708 gSavedSettings.setBOOL("RememberPassword", TRUE);
697 remember_password = TRUE;
698 709
699#ifdef USE_VIEWER_AUTH 710#ifdef USE_VIEWER_AUTH
700 show_connect_box = true; 711 show_connect_box = true;
@@ -707,9 +718,7 @@ bool idle_startup()
707 // if not automatically logging in, display login dialog 718 // if not automatically logging in, display login dialog
708 firstname = gSavedSettings.getString("FirstName"); 719 firstname = gSavedSettings.getString("FirstName");
709 lastname = gSavedSettings.getString("LastName"); 720 lastname = gSavedSettings.getString("LastName");
710 password = load_password_from_disk(); 721 password = LLStartUp::loadPasswordFromDisk();
711
712 remember_password = gSavedSettings.getBOOL("RememberPassword");
713 show_connect_box = true; 722 show_connect_box = true;
714 } 723 }
715 724
@@ -740,8 +749,6 @@ bool idle_startup()
740 sAuthUriNum = -1; 749 sAuthUriNum = -1;
741 750
742 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 751 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
743 // Push our window frontmost
744 gViewerWindow->getWindow()->show();
745 752
746 timeout_count = 0; 753 timeout_count = 0;
747 754
@@ -755,7 +762,7 @@ bool idle_startup()
755 // Load all the name information out of the login view 762 // 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 763 // 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. 764 // show the login view until login_show() is called below.
758 // LLPanelLogin::getFields(firstname, lastname, password, remember_password); 765 // LLPanelLogin::getFields(firstname, lastname, password);
759 766
760 if (gNoRender) 767 if (gNoRender)
761 { 768 {
@@ -767,7 +774,7 @@ bool idle_startup()
767 // Show the login dialog 774 // Show the login dialog
768 login_show(); 775 login_show();
769 // connect dialog is already shown, so fill in the names 776 // connect dialog is already shown, so fill in the names
770 LLPanelLogin::setFields( firstname, lastname, password, remember_password ); 777 LLPanelLogin::setFields( firstname, lastname, password);
771 778
772 LLPanelLogin::giveFocus(); 779 LLPanelLogin::giveFocus();
773 780
@@ -802,6 +809,10 @@ bool idle_startup()
802 gLoginMenuBarView->setVisible( TRUE ); 809 gLoginMenuBarView->setVisible( TRUE );
803 gLoginMenuBarView->setEnabled( TRUE ); 810 gLoginMenuBarView->setEnabled( TRUE );
804 811
812 // Push our window frontmost
813 gViewerWindow->getWindow()->show();
814 display_startup();
815
805 // DEV-16927. The following code removes errant keystrokes that happen while the window is being 816 // DEV-16927. The following code removes errant keystrokes that happen while the window is being
806 // first made visible. 817 // first made visible.
807#ifdef _WIN32 818#ifdef _WIN32
@@ -825,13 +836,14 @@ bool idle_startup()
825 if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) 836 if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState())
826 { 837 {
827 //reset the values that could have come in from a slurl 838 //reset the values that could have come in from a slurl
828 if (!gLoginHandler.mWebLoginKey.isNull()) 839 if (!gLoginHandler.getWebLoginKey().isNull())
829 { 840 {
830 firstname = gLoginHandler.mFirstName; 841 firstname = gLoginHandler.getFirstName();
831 lastname = gLoginHandler.mLastName; 842 lastname = gLoginHandler.getLastName();
832 web_login_key = gLoginHandler.mWebLoginKey; 843 web_login_key = gLoginHandler.getWebLoginKey();
833 } 844 }
834 845
846 /* Jacek - Grid manager stuff that's changed with 1.23
835 if(!gLoginHandler.mPassword.empty()) 847 if(!gLoginHandler.mPassword.empty())
836 { 848 {
837 firstname = gLoginHandler.mFirstName; 849 firstname = gLoginHandler.mFirstName;
@@ -842,13 +854,13 @@ bool idle_startup()
842 gLoginHandler.mLastName = ""; 854 gLoginHandler.mLastName = "";
843 gLoginHandler.mPassword = ""; 855 gLoginHandler.mPassword = "";
844 LLStartUp::setShouldAutoLogin(false); 856 LLStartUp::setShouldAutoLogin(false);
845 } 857 }*/
846 858
847 if (show_connect_box) 859 if (show_connect_box)
848 { 860 {
849 // TODO if not use viewer auth 861 // TODO if not use viewer auth
850 // Load all the name information out of the login view 862 // Load all the name information out of the login view
851 LLPanelLogin::getFields(firstname, lastname, password, remember_password); 863 LLPanelLogin::getFields(&firstname, &lastname, &password);
852 // end TODO 864 // end TODO
853 865
854 // HACK: Try to make not jump on login 866 // HACK: Try to make not jump on login
@@ -860,16 +872,6 @@ bool idle_startup()
860 gSavedSettings.setString("FirstName", firstname); 872 gSavedSettings.setString("FirstName", firstname);
861 gSavedSettings.setString("LastName", lastname); 873 gSavedSettings.setString("LastName", lastname);
862 874
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; 875 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
874 gDebugInfo["LoginName"] = firstname + " " + lastname; 876 gDebugInfo["LoginName"] = firstname + " " + lastname;
875 } 877 }
@@ -883,12 +885,12 @@ bool idle_startup()
883 // Set PerAccountSettingsFile to the default value. 885 // Set PerAccountSettingsFile to the default value.
884 gSavedSettings.setString("PerAccountSettingsFile", 886 gSavedSettings.setString("PerAccountSettingsFile",
885 gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, 887 gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,
886 LLAppViewer::instance()->getSettingsFileName("PerAccount") 888 LLAppViewer::instance()->getSettingsFilename("Default", "PerAccount")
887 ) 889 )
888 ); 890 );
889 891
890 // Overwrite default user settings with user settings 892 // Overwrite default user settings with user settings
891 LLAppViewer::instance()->loadSettingsFromDirectory(LL_PATH_PER_SL_ACCOUNT); 893 LLAppViewer::instance()->loadSettingsFromDirectory("Account");
892 894
893 // Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation 895 // 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. 896 // and startup time is close enough if we don't have a real value.
@@ -1262,11 +1264,7 @@ bool idle_startup()
1262 reason_response = LLUserAuth::getInstance()->getResponse("reason"); 1264 reason_response = LLUserAuth::getInstance()->getResponse("reason");
1263 message_response = LLUserAuth::getInstance()->getResponse("message"); 1265 message_response = LLUserAuth::getInstance()->getResponse("message");
1264 1266
1265 if (gHideLinks && reason_response == "disabled") 1267 if (!message_response.empty())
1266 {
1267 emsg << gDisabledMessage;
1268 }
1269 else if (!message_response.empty())
1270 { 1268 {
1271 // XUI: fix translation for strings returned during login 1269 // XUI: fix translation for strings returned during login
1272 // We need a generic table for translations 1270 // We need a generic table for translations
@@ -1414,24 +1412,24 @@ bool idle_startup()
1414 gSavedSettings.setString("FirstName", firstname); 1412 gSavedSettings.setString("FirstName", firstname);
1415 gSavedSettings.setString("LastName", lastname); 1413 gSavedSettings.setString("LastName", lastname);
1416 1414
1417 if (remember_password) 1415 if (gSavedSettings.getBOOL("RememberPassword"))
1418 { 1416 {
1419 save_password_to_disk(password.c_str()); 1417 // Successful login means the password is valid, so save it.
1418 LLStartUp::savePasswordToDisk(password);
1420 } 1419 }
1421 else 1420 else
1422 { 1421 {
1423 save_password_to_disk(NULL); 1422 // Don't leave password from previous session sitting around
1423 // during this login session.
1424 LLStartUp::deletePasswordFromDisk();
1424 } 1425 }
1425 gSavedSettings.setBOOL("RememberPassword", remember_password);
1426 1426
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 1427 // this is their actual ability to access content
1430 text = LLUserAuth::getInstance()->getResponse("agent_access_max"); 1428 text = LLUserAuth::getInstance()->getResponse("agent_access_max");
1431 if (!text.empty()) 1429 if (!text.empty())
1432 { 1430 {
1433 // agent_access can be 'A', 'M', and 'PG'. 1431 // agent_access can be 'A', 'M', and 'PG'.
1434 gAgent.convertTextToMaturity(text[0]); 1432 gAgent.setMaturity(text[0]);
1435 } 1433 }
1436 else // we're on an older sim version (prolly an opensim) 1434 else // we're on an older sim version (prolly an opensim)
1437 { 1435 {
@@ -1445,6 +1443,26 @@ bool idle_startup()
1445 gAgent.setTeen(true); 1443 gAgent.setTeen(true);
1446 } 1444 }
1447 } 1445 }
1446
1447 // this is the value of their preference setting for that content
1448 // which will always be <= agent_access_max
1449 text = LLUserAuth::getInstance()->getResponse("agent_region_access");
1450 if (!text.empty())
1451 {
1452 int preferredMaturity = LLAgent::convertTextToMaturity(text[0]);
1453 gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
1454 }
1455 // During the AO transition, this flag will be true. Then the flag will
1456 // go away. After the AO transition, this code and all the code that
1457 // uses it can be deleted.
1458 text = LLUserAuth::getInstance()->getResponse("ao_transition");
1459 if (!text.empty())
1460 {
1461 if (text == "1")
1462 {
1463 gAgent.setAOTransition();
1464 }
1465 }
1448 1466
1449 text = LLUserAuth::getInstance()->getResponse("start_location"); 1467 text = LLUserAuth::getInstance()->getResponse("start_location");
1450 if(!text.empty()) agent_start_location.assign(text); 1468 if(!text.empty()) agent_start_location.assign(text);
@@ -1652,9 +1670,9 @@ bool idle_startup()
1652 exit(0); 1670 exit(0);
1653 } 1671 }
1654 // Bounce back to the login screen. 1672 // Bounce back to the login screen.
1655 LLStringUtil::format_map_t args; 1673 LLSD args;
1656 args["[ERROR_MESSAGE]"] = emsg.str(); 1674 args["ERROR_MESSAGE"] = emsg.str();
1657 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1675 LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
1658 LLStartUp::resetLogin(); 1676 LLStartUp::resetLogin();
1659 gSavedSettings.setBOOL("AutoLogin", FALSE); 1677 gSavedSettings.setBOOL("AutoLogin", FALSE);
1660 //this might be redundant 1678 //this might be redundant
@@ -1665,7 +1683,7 @@ bool idle_startup()
1665 // Pass the user information to the voice chat server interface. 1683 // Pass the user information to the voice chat server interface.
1666 gVoiceClient->userAuthorized(firstname, lastname, gAgentID); 1684 gVoiceClient->userAuthorized(firstname, lastname, gAgentID);
1667 } 1685 }
1668 else 1686 else // if(successful_login)
1669 { 1687 {
1670 if (gNoRender) 1688 if (gNoRender)
1671 { 1689 {
@@ -1674,16 +1692,14 @@ bool idle_startup()
1674 exit(0); 1692 exit(0);
1675 } 1693 }
1676 // Bounce back to the login screen. 1694 // Bounce back to the login screen.
1677 LLStringUtil::format_map_t args; 1695 LLSD args;
1678 args["[ERROR_MESSAGE]"] = emsg.str(); 1696 args["ERROR_MESSAGE"] = emsg.str();
1679 gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); 1697 LLNotifications::instance().add("ErrorMessage", args, LLSD(), login_alert_done);
1680 LLStartUp::resetLogin(); 1698 LLStartUp::resetLogin();
1681 gSavedSettings.setBOOL("AutoLogin", FALSE); 1699 gSavedSettings.setBOOL("AutoLogin", FALSE);
1682 //this might be redundant 1700 //this might be redundant
1683 LLStartUp::setShouldAutoLogin(false); 1701 LLStartUp::setShouldAutoLogin(false);
1684 show_connect_box = true; 1702 show_connect_box = true;
1685 // Don't save an incorrect password to disk.
1686 save_password_to_disk(NULL);
1687 } 1703 }
1688 return FALSE; 1704 return FALSE;
1689 } 1705 }
@@ -1831,7 +1847,10 @@ bool idle_startup()
1831 LLError::logToFixedBuffer(gDebugView->mDebugConsolep); 1847 LLError::logToFixedBuffer(gDebugView->mDebugConsolep);
1832 // set initial visibility of debug console 1848 // set initial visibility of debug console
1833 gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole")); 1849 gDebugView->mDebugConsolep->setVisible(gSavedSettings.getBOOL("ShowDebugConsole"));
1834 gDebugView->mFloaterStatsp->setVisible(gSavedSettings.getBOOL("ShowDebugStats")); 1850 if (gSavedSettings.getBOOL("ShowDebugStats"))
1851 {
1852 LLFloaterStats::showInstance();
1853 }
1835 } 1854 }
1836 1855
1837 // 1856 //
@@ -1898,6 +1917,7 @@ bool idle_startup()
1898 } 1917 }
1899 1918
1900 // Make sure agent knows correct aspect ratio 1919 // Make sure agent knows correct aspect ratio
1920 // FOV limits depend upon aspect ratio so this needs to happen before initializing the FOV below
1901 LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); 1921 LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight());
1902 if (gViewerWindow->mWindow->getFullscreen()) 1922 if (gViewerWindow->mWindow->getFullscreen())
1903 { 1923 {
@@ -1907,6 +1927,8 @@ bool idle_startup()
1907 { 1927 {
1908 LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); 1928 LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight());
1909 } 1929 }
1930 // Initialize FOV
1931 LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle"));
1910 1932
1911 // Move agent to starting location. The position handed to us by 1933 // Move agent to starting location. The position handed to us by
1912 // the space server is in global coordinates, but the agent frame 1934 // the space server is in global coordinates, but the agent frame
@@ -1923,7 +1945,13 @@ bool idle_startup()
1923 { 1945 {
1924 LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL; 1946 LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
1925 // Initialize all of the viewer object classes for the first time (doing things like texture fetches. 1947 // Initialize all of the viewer object classes for the first time (doing things like texture fetches.
1948 LLGLState::checkStates();
1949 LLGLState::checkTextureChannels();
1950
1926 gSky.init(initial_sun_direction); 1951 gSky.init(initial_sun_direction);
1952
1953 LLGLState::checkStates();
1954 LLGLState::checkTextureChannels();
1927 } 1955 }
1928 1956
1929 LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL; 1957 LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
@@ -2231,13 +2259,7 @@ bool idle_startup()
2231 2259
2232 // Get L$ and ownership credit information 2260 // Get L$ and ownership credit information
2233 llinfos << "Requesting Money Balance" << llendl; 2261 llinfos << "Requesting Money Balance" << llendl;
2234 msg->newMessageFast(_PREHASH_MoneyBalanceRequest); 2262 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 2263
2242 // request all group information 2264 // request all group information
2243 llinfos << "Requesting Agent Data" << llendl; 2265 llinfos << "Requesting Agent Data" << llendl;
@@ -2410,23 +2432,23 @@ bool idle_startup()
2410 // location is not your expected location. So, if this is 2432 // location is not your expected location. So, if this is
2411 // your first login, then you do not have an expectation, 2433 // your first login, then you do not have an expectation,
2412 // thus, do not show this alert. 2434 // thus, do not show this alert.
2413 LLStringUtil::format_map_t args; 2435 LLSD args;
2414 if (url_ok) 2436 if (url_ok)
2415 { 2437 {
2416 args["[TYPE]"] = "desired"; 2438 args["TYPE"] = "desired";
2417 args["[HELP]"] = ""; 2439 args["HELP"] = "";
2418 } 2440 }
2419 else if (gSavedSettings.getBOOL("LoginLastLocation")) 2441 else if (gSavedSettings.getBOOL("LoginLastLocation"))
2420 { 2442 {
2421 args["[TYPE]"] = "last"; 2443 args["TYPE"] = "last";
2422 args["[HELP]"] = ""; 2444 args["HELP"] = "";
2423 } 2445 }
2424 else 2446 else
2425 { 2447 {
2426 args["[TYPE]"] = "home"; 2448 args["TYPE"] = "home";
2427 args["[HELP]"] = "You may want to set a new home location."; 2449 args["HELP"] = "You may want to set a new home location.";
2428 } 2450 }
2429 gViewerWindow->alertXml("AvatarMoved", args); 2451 LLNotifications::instance().add("AvatarMoved", args);
2430 } 2452 }
2431 else 2453 else
2432 { 2454 {
@@ -2483,8 +2505,14 @@ bool idle_startup()
2483 { 2505 {
2484 update_texture_fetch(); 2506 update_texture_fetch();
2485 set_startup_status(0.60f + 0.30f * timeout_frac, 2507 set_startup_status(0.60f + 0.30f * timeout_frac,
2486 "Loading world...", 2508 LLTrans::getString("LoginPrecaching"),
2487 gAgent.mMOTD); 2509 gAgent.mMOTD);
2510 display_startup();
2511 if (!LLViewerShaderMgr::sInitialized)
2512 {
2513 LLViewerShaderMgr::sInitialized = TRUE;
2514 LLViewerShaderMgr::instance()->setShaders();
2515 }
2488 } 2516 }
2489 2517
2490 return TRUE; 2518 return TRUE;
@@ -2506,16 +2534,15 @@ bool idle_startup()
2506 // initial outfit, but if the load hasn't started 2534 // initial outfit, but if the load hasn't started
2507 // already then something is wrong so fall back 2535 // already then something is wrong so fall back
2508 // to generic outfits. JC 2536 // to generic outfits. JC
2509 gViewerWindow->alertXml("WelcomeChooseSex", 2537 LLNotifications::instance().add("WelcomeChooseSex", LLSD(), LLSD(),
2510 callback_choose_gender, NULL); 2538 callback_choose_gender);
2511 LLStartUp::setStartupState( STATE_CLEANUP ); 2539 LLStartUp::setStartupState( STATE_CLEANUP );
2512 return TRUE; 2540 return TRUE;
2513 } 2541 }
2514 2542
2515 if (wearables_time > MAX_WEARABLES_TIME) 2543 if (wearables_time > MAX_WEARABLES_TIME)
2516 { 2544 {
2517 // It's taken too long to load, show the world 2545 LLNotifications::instance().add("ClothingLoading");
2518 gViewerWindow->alertXml("ClothingLoading");
2519 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); 2546 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG);
2520 LLStartUp::setStartupState( STATE_CLEANUP ); 2547 LLStartUp::setStartupState( STATE_CLEANUP );
2521 return TRUE; 2548 return TRUE;
@@ -2535,7 +2562,7 @@ bool idle_startup()
2535 else 2562 else
2536 { 2563 {
2537 // OK to just get the wearables 2564 // OK to just get the wearables
2538 if ( gAgent.getWearablesLoaded() ) 2565 if ( gAgent.areWearablesLoaded() )
2539 { 2566 {
2540 // We have our clothing, proceed. 2567 // We have our clothing, proceed.
2541 //llinfos << "wearables loaded" << llendl; 2568 //llinfos << "wearables loaded" << llendl;
@@ -2595,6 +2622,11 @@ bool idle_startup()
2595 // If we've got a startup URL, dispatch it 2622 // If we've got a startup URL, dispatch it
2596 LLStartUp::dispatchURL(); 2623 LLStartUp::dispatchURL();
2597 2624
2625 // Retrieve information about the land data
2626 // (just accessing this the first time will fetch it,
2627 // then the data is cached for the viewer's lifetime)
2628 LLProductInfoRequestManager::instance();
2629
2598 // Clean up the userauth stuff. 2630 // Clean up the userauth stuff.
2599 LLUserAuth::getInstance()->reset(); 2631 LLUserAuth::getInstance()->reset();
2600 2632
@@ -2616,36 +2648,6 @@ bool idle_startup()
2616 gDebugView->mFastTimerView->setVisible(TRUE); 2648 gDebugView->mFastTimerView->setVisible(TRUE);
2617#endif 2649#endif
2618 2650
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 2651
2650// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e 2652// [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 2653 // RELEASE-RLVa: this should go in LLAppViewer::handleLoginComplete() but Imprudence doesn't call that function
@@ -2718,16 +2720,11 @@ void login_callback(S32 option, void *userdata)
2718 { 2720 {
2719 // Make sure we don't save the password if the user is trying to clear it. 2721 // Make sure we don't save the password if the user is trying to clear it.
2720 std::string first, last, password; 2722 std::string first, last, password;
2721 BOOL remember = TRUE; 2723 LLPanelLogin::getFields(&first, &last, &password);
2722 LLPanelLogin::getFields(first, last, password, remember); 2724 if (!gSavedSettings.getBOOL("RememberPassword"))
2723 if (!remember)
2724 { 2725 {
2725 // turn off the setting and write out to disk 2726 // turn off the setting and write out to disk
2726 gSavedSettings.setBOOL("RememberPassword", FALSE);
2727 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); 2727 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
2728
2729 // stomp the saved password on disk
2730 save_password_to_disk(NULL);
2731 } 2728 }
2732 2729
2733 // Next iteration through main loop should shut down the app cleanly. 2730 // Next iteration through main loop should shut down the app cleanly.
@@ -2745,8 +2742,18 @@ void login_callback(S32 option, void *userdata)
2745 } 2742 }
2746} 2743}
2747 2744
2748std::string load_password_from_disk() 2745
2746// static
2747std::string LLStartUp::loadPasswordFromDisk()
2749{ 2748{
2749 // Only load password if we also intend to save it (otherwise the user
2750 // wonders what we're doing behind his back). JC
2751 BOOL remember_password = gSavedSettings.getBOOL("RememberPassword");
2752 if (!remember_password)
2753 {
2754 return std::string("");
2755 }
2756
2750 std::string hashed_password(""); 2757 std::string hashed_password("");
2751 2758
2752 // Look for legacy "marker" password from settings.ini 2759 // Look for legacy "marker" password from settings.ini
@@ -2798,41 +2805,45 @@ std::string load_password_from_disk()
2798 return hashed_password; 2805 return hashed_password;
2799} 2806}
2800 2807
2801void save_password_to_disk(const char* hashed_password) 2808
2809// static
2810void LLStartUp::savePasswordToDisk(const std::string& hashed_password)
2802{ 2811{
2803 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, 2812 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
2804 "password.dat"); 2813 "password.dat");
2805 if (!hashed_password) 2814 LLFILE* fp = LLFile::fopen(filepath, "wb"); /* Flawfinder: ignore */
2815 if (!fp)
2806 { 2816 {
2807 // No password, remove the file. 2817 return;
2808 LLFile::remove(filepath);
2809 } 2818 }
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 2819
2822 LLStringUtil::copy((char*)buffer, hashed_password, HASHED_LENGTH+1); 2820 // Encipher with MAC address
2821 const S32 HASHED_LENGTH = 32;
2822 U8 buffer[HASHED_LENGTH+1];
2823 2823
2824 LLXORCipher cipher(gMACAddress, 6); 2824 LLStringUtil::copy((char*)buffer, hashed_password.c_str(), HASHED_LENGTH+1);
2825 cipher.encrypt(buffer, HASHED_LENGTH);
2826 2825
2827 if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1) 2826 LLXORCipher cipher(gMACAddress, 6);
2828 { 2827 cipher.encrypt(buffer, HASHED_LENGTH);
2829 LL_WARNS("AppInit") << "Short write" << LL_ENDL;
2830 }
2831 2828
2832 fclose(fp); 2829 if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1)
2830 {
2831 LL_WARNS("AppInit") << "Short write" << LL_ENDL;
2833 } 2832 }
2833
2834 fclose(fp);
2834} 2835}
2835 2836
2837
2838// static
2839void LLStartUp::deletePasswordFromDisk()
2840{
2841 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
2842 "password.dat");
2843 LLFile::remove(filepath);
2844}
2845
2846
2836bool is_hex_string(U8* str, S32 len) 2847bool is_hex_string(U8* str, S32 len)
2837{ 2848{
2838 bool rv = true; 2849 bool rv = true;
@@ -2869,11 +2880,12 @@ bool is_hex_string(U8* str, S32 len)
2869 2880
2870void show_first_run_dialog() 2881void show_first_run_dialog()
2871{ 2882{
2872 gViewerWindow->alertXml("FirstRun", first_run_dialog_callback, NULL); 2883 LLNotifications::instance().add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback);
2873} 2884}
2874 2885
2875void first_run_dialog_callback(S32 option, void* userdata) 2886bool first_run_dialog_callback(const LLSD& notification, const LLSD& response)
2876{ 2887{
2888 S32 option = LLNotification::getSelectedOption(notification, response);
2877 if (0 == option) 2889 if (0 == option)
2878 { 2890 {
2879 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; 2891 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL;
@@ -2881,6 +2893,7 @@ void first_run_dialog_callback(S32 option, void* userdata)
2881 } 2893 }
2882 2894
2883 LLPanelLogin::giveFocus(); 2895 LLPanelLogin::giveFocus();
2896 return false;
2884} 2897}
2885 2898
2886 2899
@@ -2893,8 +2906,9 @@ void set_startup_status(const F32 frac, const std::string& string, const std::st
2893 gViewerWindow->setProgressMessage(msg); 2906 gViewerWindow->setProgressMessage(msg);
2894} 2907}
2895 2908
2896void login_alert_status(S32 option, void* user_data) 2909bool login_alert_status(const LLSD& notification, const LLSD& response)
2897{ 2910{
2911 S32 option = LLNotification::getSelectedOption(notification, response);
2898 // Buttons 2912 // Buttons
2899 switch( option ) 2913 switch( option )
2900 { 2914 {
@@ -2913,6 +2927,7 @@ void login_alert_status(S32 option, void* user_data)
2913 } 2927 }
2914 2928
2915 LLPanelLogin::giveFocus(); 2929 LLPanelLogin::giveFocus();
2930 return false;
2916} 2931}
2917 2932
2918void update_app(BOOL mandatory, const std::string& auth_msg) 2933void update_app(BOOL mandatory, const std::string& auth_msg)
@@ -2928,68 +2943,66 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
2928 { 2943 {
2929 msg = "(" + auth_msg + ") \n"; 2944 msg = "(" + auth_msg + ") \n";
2930 } 2945 }
2931 LLStringUtil::format_map_t args; 2946
2932 args["[MESSAGE]"] = msg; 2947 LLSD args;
2948 args["MESSAGE"] = msg;
2933 2949
2934 // represent a bool as a null/non-null pointer 2950 LLSD payload;
2935 void *mandatoryp = mandatory ? &mandatory : NULL; 2951 payload["mandatory"] = mandatory;
2936 2952
2953/*
2954 We're constructing one of the following 6 strings here:
2955 "DownloadWindowsMandatory"
2956 "DownloadWindowsReleaseForDownload"
2957 "DownloadWindows"
2958 "DownloadMacMandatory"
2959 "DownloadMacReleaseForDownload"
2960 "DownloadMac"
2961
2962 I've called them out explicitly in this comment so that they can be grepped for.
2963
2964 Also, we assume that if we're not Windows we're Mac. If we ever intend to support
2965 Linux with autoupdate, this should be an explicit #elif LL_DARWIN, but
2966 we'd rather deliver the wrong message than no message, so until Linux is supported
2967 we'll leave it alone.
2968 */
2969 std::string notification_name = "Download";
2970
2937#if LL_WINDOWS 2971#if LL_WINDOWS
2938 if (mandatory) 2972 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 2973#else
2951 gViewerWindow->alertXml("DownloadWindows", args, 2974 notification_name += "Mac";
2952 update_dialog_callback,
2953 mandatoryp);
2954#endif 2975#endif
2955 } 2976
2956#else
2957 if (mandatory) 2977 if (mandatory)
2958 { 2978 {
2959 gViewerWindow->alertXml("DownloadMacMandatory", args, 2979 notification_name += "Mandatory";
2960 update_dialog_callback,
2961 mandatoryp);
2962 } 2980 }
2963 else 2981 else
2964 { 2982 {
2965#if LL_RELEASE_FOR_DOWNLOAD 2983#if LL_RELEASE_FOR_DOWNLOAD
2966 gViewerWindow->alertXml("DownloadMacReleaseForDownload", args, 2984 notification_name += "ReleaseForDownload";
2967 update_dialog_callback,
2968 mandatoryp);
2969#else
2970 gViewerWindow->alertXml("DownloadMac", args,
2971 update_dialog_callback,
2972 mandatoryp);
2973#endif 2985#endif
2974 } 2986 }
2975#endif 2987
2976 2988 LLNotifications::instance().add(notification_name, args, payload, update_dialog_callback);
2989
2977} 2990}
2978 2991
2979 2992bool update_dialog_callback(const LLSD& notification, const LLSD& response)
2980void update_dialog_callback(S32 option, void *userdata)
2981{ 2993{
2994 S32 option = LLNotification::getSelectedOption(notification, response);
2982 std::string update_exe_path; 2995 std::string update_exe_path;
2983 bool mandatory = userdata != NULL; 2996 bool mandatory = notification["payload"]["mandatory"].asBoolean();
2984 2997
2985#if !LL_RELEASE_FOR_DOWNLOAD 2998#if !LL_RELEASE_FOR_DOWNLOAD
2986 if (option == 2) 2999 if (option == 2)
2987 { 3000 {
2988 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); 3001 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
2989 return; 3002 return false;
2990 } 3003 }
2991#endif 3004#endif
2992 3005
2993 if (option == 1) 3006 if (option == 1)
2994 { 3007 {
2995 // ...user doesn't want to do it 3008 // ...user doesn't want to do it
@@ -3001,7 +3014,7 @@ void update_dialog_callback(S32 option, void *userdata)
3001 { 3014 {
3002 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); 3015 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT );
3003 } 3016 }
3004 return; 3017 return false;
3005 } 3018 }
3006 3019
3007 LLSD query_map = LLSD::emptyMap(); 3020 LLSD query_map = LLSD::emptyMap();
@@ -3012,12 +3025,15 @@ void update_dialog_callback(S32 option, void *userdata)
3012 query_map["os"] = "mac"; 3025 query_map["os"] = "mac";
3013#elif LL_LINUX 3026#elif LL_LINUX
3014 query_map["os"] = "lnx"; 3027 query_map["os"] = "lnx";
3028#elif LL_SOLARIS
3029 query_map["os"] = "sol";
3015#endif 3030#endif
3016 // *TODO change userserver to be grid on both viewer and sim, since 3031 // *TODO change userserver to be grid on both viewer and sim, since
3017 // userserver no longer exists. 3032 // userserver no longer exists.
3018 query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel(); 3033 query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
3019 query_map["channel"] = gSavedSettings.getString("VersionChannelName"); 3034 query_map["channel"] = gSavedSettings.getString("VersionChannelName");
3020 // *TODO constantize this guy 3035 // *TODO constantize this guy
3036 // *NOTE: This URL is also used in win_setup/lldownloader.cpp
3021 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 3037 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
3022 3038
3023/* if(LLAppViewer::sUpdaterInfo) 3039/* if(LLAppViewer::sUpdaterInfo)
@@ -3036,7 +3052,7 @@ void update_dialog_callback(S32 option, void *userdata)
3036 // We're hosed, bail 3052 // We're hosed, bail
3037 LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; 3053 LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL;
3038 LLAppViewer::instance()->forceQuit(); 3054 LLAppViewer::instance()->forceQuit();
3039 return; 3055 return false;
3040 } 3056 }
3041 3057
3042 LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; 3058 LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe";
@@ -3057,7 +3073,7 @@ void update_dialog_callback(S32 option, void *userdata)
3057 3073
3058 LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; 3074 LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL;
3059 LLAppViewer::instance()->forceQuit(); 3075 LLAppViewer::instance()->forceQuit();
3060 return; 3076 return false;
3061 } 3077 }
3062 3078
3063 // if a sim name was passed in via command line parameter (typically through a SLURL) 3079 // if a sim name was passed in via command line parameter (typically through a SLURL)
@@ -3096,13 +3112,14 @@ void update_dialog_callback(S32 option, void *userdata)
3096*/ 3112*/
3097 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ 3113 //system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */
3098/* 3114/*
3099#elif LL_LINUX 3115#elif LL_LINUX || LL_SOLARIS
3100 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 3116 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
3101 "Please download the latest version from www.secondlife.com.", 3117 "Please download the latest version from www.secondlife.com.",
3102 LLStringUtil::null, OSMB_OK); 3118 LLStringUtil::null, OSMB_OK);
3103#endif 3119#endif
3104 LLAppViewer::instance()->forceQuit(); 3120 LLAppViewer::instance()->forceQuit();
3105 */ 3121 */
3122 return false;
3106} 3123}
3107 3124
3108void use_circuit_callback(void**, S32 result) 3125void use_circuit_callback(void**, S32 result)
@@ -3116,8 +3133,7 @@ void use_circuit_callback(void**, S32 result)
3116 { 3133 {
3117 // Make sure user knows something bad happened. JC 3134 // Make sure user knows something bad happened. JC
3118 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; 3135 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
3119 gViewerWindow->alertXml("LoginPacketNeverReceived", 3136 LLNotifications::instance().add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
3120 login_alert_status, NULL);
3121 LLStartUp::resetLogin(); 3137 LLStartUp::resetLogin();
3122 } 3138 }
3123 else 3139 else
@@ -3320,570 +3336,6 @@ void init_stat_view()
3320 LLFrameStatView *frameviewp = gDebugView->mFrameStatView; 3336 LLFrameStatView *frameviewp = gDebugView->mFrameStatView;
3321 frameviewp->setup(gFrameStats); 3337 frameviewp->setup(gFrameStats);
3322 frameviewp->mShowPercent = FALSE; 3338 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} 3339}
3888 3340
3889void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32) 3341void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S32)
@@ -3901,8 +3353,9 @@ const S32 OPT_CLOSED_WINDOW = -1;
3901const S32 OPT_MALE = 0; 3353const S32 OPT_MALE = 0;
3902const S32 OPT_FEMALE = 1; 3354const S32 OPT_FEMALE = 1;
3903 3355
3904void callback_choose_gender(S32 option, void* userdata) 3356bool callback_choose_gender(const LLSD& notification, const LLSD& response)
3905{ 3357{
3358 S32 option = LLNotification::getSelectedOption(notification, response);
3906 switch(option) 3359 switch(option)
3907 { 3360 {
3908 case OPT_MALE: 3361 case OPT_MALE:
@@ -3915,6 +3368,7 @@ void callback_choose_gender(S32 option, void* userdata)
3915 LLStartUp::loadInitialOutfit( FEMALE_OUTFIT_FOLDER, "female" ); 3368 LLStartUp::loadInitialOutfit( FEMALE_OUTFIT_FOLDER, "female" );
3916 break; 3369 break;
3917 } 3370 }
3371 return false;
3918} 3372}
3919 3373
3920void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, 3374void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
@@ -3957,8 +3411,8 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
3957 // This is really misnamed -- it means we have started loading 3411 // This is really misnamed -- it means we have started loading
3958 // an outfit/shape that will give the avatar a gender eventually. JC 3412 // an outfit/shape that will give the avatar a gender eventually. JC
3959 gAgent.setGenderChosen(TRUE); 3413 gAgent.setGenderChosen(TRUE);
3414
3960} 3415}
3961
3962 3416
3963// Loads a bitmap to display during load 3417// Loads a bitmap to display during load
3964// location_id = 0 => last position 3418// location_id = 0 => last position
@@ -4107,7 +3561,7 @@ void LLStartUp::multimediaInit()
4107{ 3561{
4108 LL_DEBUGS("AppInit") << "Initializing Multimedia...." << LL_ENDL; 3562 LL_DEBUGS("AppInit") << "Initializing Multimedia...." << LL_ENDL;
4109 std::string msg = LLTrans::getString("LoginInitializingMultimedia"); 3563 std::string msg = LLTrans::getString("LoginInitializingMultimedia");
4110 set_startup_status(0.50f, msg.c_str(), gAgent.mMOTD.c_str()); 3564 set_startup_status(0.42f, msg.c_str(), gAgent.mMOTD.c_str());
4111 display_startup(); 3565 display_startup();
4112 3566
4113 LLViewerMedia::initClass(); 3567 LLViewerMedia::initClass();
@@ -4119,8 +3573,9 @@ bool LLStartUp::dispatchURL()
4119 // ok, if we've gotten this far and have a startup URL 3573 // ok, if we've gotten this far and have a startup URL
4120 if (!sSLURLCommand.empty()) 3574 if (!sSLURLCommand.empty())
4121 { 3575 {
4122 const bool from_external_browser = true; 3576 LLWebBrowserCtrl* web = NULL;
4123 LLURLDispatcher::dispatch(sSLURLCommand, from_external_browser); 3577 const bool trusted_browser = false;
3578 LLURLDispatcher::dispatch(sSLURLCommand, web, trusted_browser);
4124 } 3579 }
4125 else if (LLURLSimString::parse()) 3580 else if (LLURLSimString::parse())
4126 { 3581 {
@@ -4136,17 +3591,19 @@ bool LLStartUp::dispatchURL()
4136 || (dy*dy > SLOP*SLOP) ) 3591 || (dy*dy > SLOP*SLOP) )
4137 { 3592 {
4138 std::string url = LLURLSimString::getURL(); 3593 std::string url = LLURLSimString::getURL();
4139 const bool from_external_browser = true; 3594 LLWebBrowserCtrl* web = NULL;
4140 LLURLDispatcher::dispatch(url, from_external_browser); 3595 const bool trusted_browser = false;
3596 LLURLDispatcher::dispatch(url, web, trusted_browser);
4141 } 3597 }
4142 return true; 3598 return true;
4143 } 3599 }
4144 return false; 3600 return false;
4145} 3601}
4146 3602
4147void login_alert_done(S32 option, void* user_data) 3603bool login_alert_done(const LLSD& notification, const LLSD& response)
4148{ 3604{
4149 LLPanelLogin::giveFocus(); 3605 LLPanelLogin::giveFocus();
3606 return false;
4150} 3607}
4151 3608
4152 3609