aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llstartup.cpp258
1 files changed, 121 insertions, 137 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 914b993..52f4d1a 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -127,6 +127,7 @@
127#include "llsky.h" 127#include "llsky.h"
128#include "llsrv.h" 128#include "llsrv.h"
129#include "llstatview.h" 129#include "llstatview.h"
130#include "lltrans.h"
130#include "llsurface.h" 131#include "llsurface.h"
131#include "lltexturecache.h" 132#include "lltexturecache.h"
132#include "lltexturefetch.h" 133#include "lltexturefetch.h"
@@ -264,8 +265,8 @@ namespace
264 const char* message, const LLSD& body, 265 const char* message, const LLSD& body,
265 LLHTTPClient::ResponderPtr response) const 266 LLHTTPClient::ResponderPtr response) const
266 { 267 {
267 llwarns << " attemped to send " << message << " to " << host 268 LL_WARNS("AppInit") << " attemped to send " << message << " to " << host
268 << " with null sender" << llendl; 269 << " with null sender" << LL_ENDL;
269 } 270 }
270 }; 271 };
271} 272}
@@ -427,17 +428,17 @@ BOOL idle_startup()
427 428
428 if (ll_init_ares() == NULL) 429 if (ll_init_ares() == NULL)
429 { 430 {
430 llerrs << "Could not start address resolution system" << llendl; 431 LL_ERRS("AppInit") << "Could not start address resolution system" << LL_ENDL;
431 } 432 }
432 433
433 // 434 //
434 // Initialize messaging system 435 // Initialize messaging system
435 // 436 //
436 llinfos << "Initializing messaging system..." << llendl; 437 LL_DEBUGS("AppInit") << "Initializing messaging system..." << LL_ENDL;
437 438
438 std::string message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message_template.msg"); 439 std::string message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message_template.msg");
439 440
440 FILE* found_template = NULL; 441 LLFILE* found_template = NULL;
441 found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */ 442 found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */
442 if (found_template) 443 if (found_template)
443 { 444 {
@@ -495,7 +496,7 @@ BOOL idle_startup()
495 496
496 if (gSavedSettings.getBOOL("LogMessages")) 497 if (gSavedSettings.getBOOL("LogMessages"))
497 { 498 {
498 llinfos << "Message logging activated!" << llendl; 499 LL_DEBUGS("AppInit") << "Message logging activated!" << LL_ENDL;
499 msg->startLogging(); 500 msg->startLogging();
500 } 501 }
501 502
@@ -520,13 +521,13 @@ BOOL idle_startup()
520 F32 outBandwidth = gSavedSettings.getF32("OutBandwidth"); 521 F32 outBandwidth = gSavedSettings.getF32("OutBandwidth");
521 if (inBandwidth != 0.f) 522 if (inBandwidth != 0.f)
522 { 523 {
523 llinfos << "Setting packetring incoming bandwidth to " << inBandwidth << llendl; 524 LL_DEBUGS("AppInit") << "Setting packetring incoming bandwidth to " << inBandwidth << LL_ENDL;
524 msg->mPacketRing.setUseInThrottle(TRUE); 525 msg->mPacketRing.setUseInThrottle(TRUE);
525 msg->mPacketRing.setInBandwidth(inBandwidth); 526 msg->mPacketRing.setInBandwidth(inBandwidth);
526 } 527 }
527 if (outBandwidth != 0.f) 528 if (outBandwidth != 0.f)
528 { 529 {
529 llinfos << "Setting packetring outgoing bandwidth to " << outBandwidth << llendl; 530 LL_DEBUGS("AppInit") << "Setting packetring outgoing bandwidth to " << outBandwidth << LL_ENDL;
530 msg->mPacketRing.setUseOutThrottle(TRUE); 531 msg->mPacketRing.setUseOutThrottle(TRUE);
531 msg->mPacketRing.setOutBandwidth(outBandwidth); 532 msg->mPacketRing.setOutBandwidth(outBandwidth);
532 } 533 }
@@ -557,7 +558,7 @@ BOOL idle_startup()
557 BOOL init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle); 558 BOOL init = gAudiop->init(kAUDIO_NUM_SOURCES, window_handle);
558 if(!init) 559 if(!init)
559 { 560 {
560 llwarns << "Unable to initialize audio engine" << llendl; 561 LL_WARNS("AppInit") << "Unable to initialize audio engine" << LL_ENDL;
561 } 562 }
562 gAudiop->setMuted(TRUE); 563 gAudiop->setMuted(TRUE);
563 } 564 }
@@ -565,7 +566,7 @@ BOOL idle_startup()
565 566
566 if (LLTimer::knownBadTimer()) 567 if (LLTimer::knownBadTimer())
567 { 568 {
568 llwarns << "Unreliable timers detected (may be bad PCI chipset)!!" << llendl; 569 LL_WARNS("AppInit") << "Unreliable timers detected (may be bad PCI chipset)!!" << LL_ENDL;
569 } 570 }
570 571
571 // 572 //
@@ -638,7 +639,7 @@ BOOL idle_startup()
638 //--------------------------------------------------------------------- 639 //---------------------------------------------------------------------
639 if (STATE_MEDIA_INIT == LLStartUp::getStartupState()) 640 if (STATE_MEDIA_INIT == LLStartUp::getStartupState())
640 { 641 {
641 llinfos << "Initializing Multimedia...." << llendl; 642 LL_DEBUGS("AppInit") << "Initializing Multimedia...." << LL_ENDL;
642 set_startup_status(0.03f, "Initializing Multimedia...", gAgent.mMOTD.c_str()); 643 set_startup_status(0.03f, "Initializing Multimedia...", gAgent.mMOTD.c_str());
643 display_startup(); 644 display_startup();
644 LLViewerMedia::initClass(); 645 LLViewerMedia::initClass();
@@ -656,7 +657,7 @@ BOOL idle_startup()
656 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState()) 657 if (STATE_LOGIN_SHOW == LLStartUp::getStartupState())
657 { 658 {
658 659
659 llinfos << "Initializing Window" << llendl; 660 LL_DEBUGS("AppInit") << "Initializing Window" << LL_ENDL;
660 661
661 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 662 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
662 // Push our window frontmost 663 // Push our window frontmost
@@ -667,11 +668,13 @@ BOOL idle_startup()
667 if (show_connect_box) 668 if (show_connect_box)
668 { 669 {
669 // Load all the name information out of the login view 670 // Load all the name information out of the login view
670 LLPanelLogin::getFields(firstname, lastname, password, remember_password); 671 // NOTE: Hits "Attempted getFields with no login view shown" warning, since we don't
672 // show the login view until login_show() is called below.
673 // LLPanelLogin::getFields(firstname, lastname, password, remember_password);
671 674
672 if (gNoRender) 675 if (gNoRender)
673 { 676 {
674 llerrs << "Need to autologin or use command line with norender!" << llendl; 677 LL_ERRS("AppInit") << "Need to autologin or use command line with norender!" << LL_ENDL;
675 } 678 }
676 // Make sure the process dialog doesn't hide things 679 // Make sure the process dialog doesn't hide things
677 gViewerWindow->setShowProgress(FALSE); 680 gViewerWindow->setShowProgress(FALSE);
@@ -764,7 +767,7 @@ BOOL idle_startup()
764 } 767 }
765 gSavedSettings.setBOOL("RememberPassword", remember_password); 768 gSavedSettings.setBOOL("RememberPassword", remember_password);
766 769
767 llinfos << "Attempting login as: " << firstname << " " << lastname << llendl; 770 LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << LL_ENDL;
768 gDebugInfo["LoginName"] = firstname + " " + lastname; 771 gDebugInfo["LoginName"] = firstname + " " + lastname;
769 } 772 }
770 773
@@ -812,22 +815,28 @@ BOOL idle_startup()
812 LLString server_label; 815 LLString server_label;
813 S32 domain_name_index; 816 S32 domain_name_index;
814 BOOL user_picked_server = LLPanelLogin::getServer( server_label, domain_name_index ); 817 BOOL user_picked_server = LLPanelLogin::getServer( server_label, domain_name_index );
815 gGridChoice = (EGridInfo) domain_name_index; 818 if((EGridInfo)domain_name_index == GRID_INFO_OTHER)
816 gSavedSettings.setS32("ServerChoice", gGridChoice);
817 if (gGridChoice == GRID_INFO_OTHER)
818 { 819 {
819 gGridName = server_label;/* Flawfinder: ignore */ 820 // Since the grid chosen was an 'other', set the choice by string.
821 LLViewerLogin::getInstance()->setGridChoice(server_label);
822 }
823 else
824 {
825 // Set the choice according to index.
826 LLViewerLogin::getInstance()->setGridChoice((EGridInfo)domain_name_index);
820 } 827 }
821 828
822 if ( user_picked_server ) 829 if ( user_picked_server )
823 { // User picked a grid from the popup, so clear the stored urls and they will be re-generated from gGridChoice 830 { // User picked a grid from the popup, so clear the
831 // stored uris and they will be re-generated from the GridChoice
824 sAuthUris.clear(); 832 sAuthUris.clear();
825 LLAppViewer::instance()->resetURIs(); 833 LLViewerLogin::getInstance()->resetURIs();
826 } 834 }
827 835
828 LLString location; 836 LLString location;
829 LLPanelLogin::getLocation( location ); 837 LLPanelLogin::getLocation( location );
830 LLURLSimString::setString( location ); 838 LLURLSimString::setString( location );
839
831 // END TODO 840 // END TODO
832 LLPanelLogin::close(); 841 LLPanelLogin::close();
833 } 842 }
@@ -884,7 +893,7 @@ BOOL idle_startup()
884 893
885 // Poke the VFS, which could potentially block for a while if 894 // Poke the VFS, which could potentially block for a while if
886 // Windows XP is acting up 895 // Windows XP is acting up
887 set_startup_status(0.07f, "Verifying cache files (can take 60-90 seconds)...", NULL); 896 set_startup_status(0.07f, LLTrans::getString("LoginVerifyingCache").c_str(), NULL);
888 display_startup(); 897 display_startup();
889 898
890 gVFS->pokeFiles(); 899 gVFS->pokeFiles();
@@ -907,10 +916,9 @@ BOOL idle_startup()
907 if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState()) 916 if(STATE_LOGIN_AUTH_INIT == LLStartUp::getStartupState())
908 { 917 {
909//#define LL_MINIMIAL_REQUESTED_OPTIONS 918//#define LL_MINIMIAL_REQUESTED_OPTIONS
910 gDebugInfo["GridName"] = gGridInfo[gGridChoice].mLabel; 919 gDebugInfo["GridName"] = LLViewerLogin::getInstance()->getGridLabel();
911 920
912 // *Note: this is where gUserAuth used to be created. 921 // *Note: this is where gUserAuth used to be created.
913
914 requested_options.clear(); 922 requested_options.clear();
915 requested_options.push_back("inventory-root"); 923 requested_options.push_back("inventory-root");
916 requested_options.push_back("inventory-skeleton"); 924 requested_options.push_back("inventory-skeleton");
@@ -942,7 +950,8 @@ BOOL idle_startup()
942 gSavedSettings.setBOOL("UseDebugMenus", TRUE); 950 gSavedSettings.setBOOL("UseDebugMenus", TRUE);
943 requested_options.push_back("god-connect"); 951 requested_options.push_back("god-connect");
944 } 952 }
945 const std::vector<std::string>& uris = LLAppViewer::instance()->getLoginURIs(); 953 std::vector<std::string> uris;
954 LLViewerLogin::getInstance()->getLoginURIs(uris);
946 std::vector<std::string>::const_iterator iter, end; 955 std::vector<std::string>::const_iterator iter, end;
947 for (iter = uris.begin(), end = uris.end(); iter != end; ++iter) 956 for (iter = uris.begin(), end = uris.end(); iter != end; ++iter)
948 { 957 {
@@ -953,15 +962,16 @@ BOOL idle_startup()
953 } 962 }
954 sAuthUriNum = 0; 963 sAuthUriNum = 0;
955 auth_method = "login_to_simulator"; 964 auth_method = "login_to_simulator";
956 auth_desc = "Logging in. "; 965
957 auth_desc += LLAppViewer::instance()->getSecondLifeTitle(); 966 LLString::format_map_t args;
958 auth_desc += " may appear frozen. Please wait."; 967 args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle();
968 auth_desc = LLTrans::getString("LoginInProgress", args).c_str();
959 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); 969 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
960 } 970 }
961 971
962 if (STATE_LOGIN_AUTHENTICATE == LLStartUp::getStartupState()) 972 if (STATE_LOGIN_AUTHENTICATE == LLStartUp::getStartupState())
963 { 973 {
964 lldebugs << "STATE_LOGIN_AUTHENTICATE" << llendl; 974 LL_DEBUGS("AppInit") << "STATE_LOGIN_AUTHENTICATE" << LL_ENDL;
965 set_startup_status(progress, auth_desc.c_str(), auth_message.c_str()); 975 set_startup_status(progress, auth_desc.c_str(), auth_message.c_str());
966 progress += 0.02f; 976 progress += 0.02f;
967 display_startup(); 977 display_startup();
@@ -1021,7 +1031,7 @@ BOOL idle_startup()
1021 1031
1022 if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState()) 1032 if(STATE_LOGIN_NO_DATA_YET == LLStartUp::getStartupState())
1023 { 1033 {
1024 //lldebugs << "STATE_LOGIN_NO_DATA_YET" << llendl; 1034 LL_DEBUGS("AppInit") << "STATE_LOGIN_NO_DATA_YET" << LL_ENDL;
1025 // If we get here we have gotten past the potential stall 1035 // If we get here we have gotten past the potential stall
1026 // in curl, so take "may appear frozen" out of progress bar. JC 1036 // in curl, so take "may appear frozen" out of progress bar. JC
1027 auth_desc = "Logging in..."; 1037 auth_desc = "Logging in...";
@@ -1035,7 +1045,7 @@ BOOL idle_startup()
1035 LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); 1045 LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse();
1036 if(LLUserAuth::E_NO_RESPONSE_YET == error) 1046 if(LLUserAuth::E_NO_RESPONSE_YET == error)
1037 { 1047 {
1038 //llinfos << "waiting..." << llendl; 1048 LL_DEBUGS("AppInit") << "waiting..." << LL_ENDL;
1039 return do_normal_idle; 1049 return do_normal_idle;
1040 } 1050 }
1041 LLStartUp::setStartupState( STATE_LOGIN_DOWNLOADING ); 1051 LLStartUp::setStartupState( STATE_LOGIN_DOWNLOADING );
@@ -1046,7 +1056,7 @@ BOOL idle_startup()
1046 1056
1047 if(STATE_LOGIN_DOWNLOADING == LLStartUp::getStartupState()) 1057 if(STATE_LOGIN_DOWNLOADING == LLStartUp::getStartupState())
1048 { 1058 {
1049 lldebugs << "STATE_LOGIN_DOWNLOADING" << llendl; 1059 LL_DEBUGS("AppInit") << "STATE_LOGIN_DOWNLOADING" << LL_ENDL;
1050 // Process messages to keep from dropping circuit. 1060 // Process messages to keep from dropping circuit.
1051 LLMessageSystem* msg = gMessageSystem; 1061 LLMessageSystem* msg = gMessageSystem;
1052 while (msg->checkAllMessages(gFrameCount, gServicePump)) 1062 while (msg->checkAllMessages(gFrameCount, gServicePump))
@@ -1056,18 +1066,18 @@ BOOL idle_startup()
1056 LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); 1066 LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse();
1057 if(LLUserAuth::E_DOWNLOADING == error) 1067 if(LLUserAuth::E_DOWNLOADING == error)
1058 { 1068 {
1059 //llinfos << "downloading..." << llendl; 1069 LL_DEBUGS("AppInit") << "downloading..." << LL_ENDL;
1060 return do_normal_idle; 1070 return do_normal_idle;
1061 } 1071 }
1062 LLStartUp::setStartupState( STATE_LOGIN_PROCESS_RESPONSE ); 1072 LLStartUp::setStartupState( STATE_LOGIN_PROCESS_RESPONSE );
1063 progress += 0.01f; 1073 progress += 0.01f;
1064 set_startup_status(progress, "Processing Response...", auth_message.c_str()); 1074 set_startup_status(progress, LLTrans::getString("LoginProcessingResponse").c_str(), auth_message.c_str());
1065 return do_normal_idle; 1075 return do_normal_idle;
1066 } 1076 }
1067 1077
1068 if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState()) 1078 if(STATE_LOGIN_PROCESS_RESPONSE == LLStartUp::getStartupState())
1069 { 1079 {
1070 lldebugs << "STATE_LOGIN_PROCESS_RESPONSE" << llendl; 1080 LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL;
1071 std::ostringstream emsg; 1081 std::ostringstream emsg;
1072 BOOL quit = FALSE; 1082 BOOL quit = FALSE;
1073 const char* login_response = NULL; 1083 const char* login_response = NULL;
@@ -1089,18 +1099,18 @@ BOOL idle_startup()
1089 } 1099 }
1090 else if(login_response && (0 == strcmp(login_response, "indeterminate"))) 1100 else if(login_response && (0 == strcmp(login_response, "indeterminate")))
1091 { 1101 {
1092 llinfos << "Indeterminate login..." << llendl; 1102 LL_INFOS("AppInit") << "Indeterminate login..." << LL_ENDL;
1093 sAuthUris = LLSRV::rewriteURI(LLUserAuth::getInstance()->getResponse("next_url")); 1103 sAuthUris = LLSRV::rewriteURI(LLUserAuth::getInstance()->getResponse("next_url"));
1094 sAuthUriNum = 0; 1104 sAuthUriNum = 0;
1095 auth_method = LLUserAuth::getInstance()->getResponse("next_method"); 1105 auth_method = LLUserAuth::getInstance()->getResponse("next_method");
1096 auth_message = LLUserAuth::getInstance()->getResponse("message"); 1106 auth_message = LLUserAuth::getInstance()->getResponse("message");
1097 if(auth_method.substr(0, 5) == "login") 1107 if(auth_method.substr(0, 5) == "login")
1098 { 1108 {
1099 auth_desc.assign("Authenticating..."); 1109 auth_desc.assign(LLTrans::getString("LoginAuthenticating").c_str());
1100 } 1110 }
1101 else 1111 else
1102 { 1112 {
1103 auth_desc.assign("Performing account maintenance..."); 1113 auth_desc.assign(LLTrans::getString("LoginMaintenance").c_str());
1104 } 1114 }
1105 // ignoring the duration & options array for now. 1115 // ignoring the duration & options array for now.
1106 // Go back to authenticate. 1116 // Go back to authenticate.
@@ -1136,7 +1146,7 @@ BOOL idle_startup()
1136 { 1146 {
1137 if (show_connect_box) 1147 if (show_connect_box)
1138 { 1148 {
1139 llinfos << "Need tos agreement" << llendl; 1149 LL_DEBUGS("AppInit") << "Need tos agreement" << LL_ENDL;
1140 LLStartUp::setStartupState( STATE_UPDATE_CHECK ); 1150 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1141 LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS, 1151 LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,
1142 message_response); 1152 message_response);
@@ -1153,7 +1163,7 @@ BOOL idle_startup()
1153 { 1163 {
1154 if (show_connect_box) 1164 if (show_connect_box)
1155 { 1165 {
1156 llinfos << "Need critical message" << llendl; 1166 LL_DEBUGS("AppInit") << "Need critical message" << LL_ENDL;
1157 LLStartUp::setStartupState( STATE_UPDATE_CHECK ); 1167 LLStartUp::setStartupState( STATE_UPDATE_CHECK );
1158 LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_CRITICAL_MESSAGE, 1168 LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_CRITICAL_MESSAGE,
1159 message_response); 1169 message_response);
@@ -1188,7 +1198,7 @@ BOOL idle_startup()
1188 } 1198 }
1189 if(reason_response && (0 == strcmp(reason_response, "optional"))) 1199 if(reason_response && (0 == strcmp(reason_response, "optional")))
1190 { 1200 {
1191 llinfos << "Login got optional update" << llendl; 1201 LL_DEBUGS("AppInit") << "Login got optional update" << LL_ENDL;
1192 auth_message = LLUserAuth::getInstance()->getResponse("message"); 1202 auth_message = LLUserAuth::getInstance()->getResponse("message");
1193 if (show_connect_box) 1203 if (show_connect_box)
1194 { 1204 {
@@ -1213,9 +1223,9 @@ BOOL idle_startup()
1213 } else { 1223 } else {
1214 sAuthUriNum++; 1224 sAuthUriNum++;
1215 std::ostringstream s; 1225 std::ostringstream s;
1216 s << "Previous login attempt failed. Logging in, attempt " 1226 LLString::format_map_t args;
1217 << (sAuthUriNum + 1) << ". "; 1227 args["[NUMBER]"] = sAuthUriNum + 1;
1218 auth_desc = s.str(); 1228 auth_desc = LLTrans::getString("LoginAttempt", args).c_str();
1219 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); 1229 LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE );
1220 return do_normal_idle; 1230 return do_normal_idle;
1221 } 1231 }
@@ -1451,8 +1461,8 @@ BOOL idle_startup()
1451 { 1461 {
1452 if (gNoRender) 1462 if (gNoRender)
1453 { 1463 {
1454 llinfos << "Bad login - missing return values" << llendl; 1464 LL_WARNS("AppInit") << "Bad login - missing return values" << LL_ENDL;
1455 llinfos << emsg << llendl; 1465 LL_WARNS("AppInit") << emsg << LL_ENDL;
1456 exit(0); 1466 exit(0);
1457 } 1467 }
1458 // Bounce back to the login screen. 1468 // Bounce back to the login screen.
@@ -1471,8 +1481,8 @@ BOOL idle_startup()
1471 { 1481 {
1472 if (gNoRender) 1482 if (gNoRender)
1473 { 1483 {
1474 llinfos << "Failed to login!" << llendl; 1484 LL_WARNS("AppInit") << "Failed to login!" << LL_ENDL;
1475 llinfos << emsg << llendl; 1485 LL_WARNS("AppInit") << emsg << LL_ENDL;
1476 exit(0); 1486 exit(0);
1477 } 1487 }
1478 // Bounce back to the login screen. 1488 // Bounce back to the login screen.
@@ -1493,7 +1503,7 @@ BOOL idle_startup()
1493 //--------------------------------------------------------------------- 1503 //---------------------------------------------------------------------
1494 if (STATE_WORLD_INIT == LLStartUp::getStartupState()) 1504 if (STATE_WORLD_INIT == LLStartUp::getStartupState())
1495 { 1505 {
1496 set_startup_status(0.40f, "Initializing World...", gAgent.mMOTD.c_str()); 1506 set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld").c_str(), gAgent.mMOTD.c_str());
1497 display_startup(); 1507 display_startup();
1498 // We should have an agent id by this point. 1508 // We should have an agent id by this point.
1499 llassert(!(gAgentID == LLUUID::null)); 1509 llassert(!(gAgentID == LLUUID::null));
@@ -1541,11 +1551,11 @@ BOOL idle_startup()
1541 LLWorld::getInstance()->addRegion(first_sim_handle, first_sim); 1551 LLWorld::getInstance()->addRegion(first_sim_handle, first_sim);
1542 1552
1543 LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle); 1553 LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle);
1544 llinfos << "Adding initial simulator " << regionp->getOriginGlobal() << llendl; 1554 LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
1545 1555
1546 LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); 1556 LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT );
1547 regionp->setSeedCapability(first_sim_seed_cap); 1557 regionp->setSeedCapability(first_sim_seed_cap);
1548 llinfos << "Waiting for seed grant ...." << llendl; 1558 LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
1549 1559
1550 // Set agent's initial region to be the one we just created. 1560 // Set agent's initial region to be the one we just created.
1551 gAgent.setRegion(regionp); 1561 gAgent.setRegion(regionp);
@@ -1613,7 +1623,7 @@ BOOL idle_startup()
1613 // 1623 //
1614 // Set message handlers 1624 // Set message handlers
1615 // 1625 //
1616 llinfos << "Initializing communications..." << llendl; 1626 LL_INFOS("AppInit") << "Initializing communications..." << LL_ENDL;
1617 1627
1618 // register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted 1628 // register callbacks for messages. . . do this after initial handshake to make sure that we don't catch any unwanted
1619 register_viewer_callbacks(gMessageSystem); 1629 register_viewer_callbacks(gMessageSystem);
@@ -1662,7 +1672,7 @@ BOOL idle_startup()
1662 1672
1663 // Sets up the parameters for the first simulator 1673 // Sets up the parameters for the first simulator
1664 1674
1665 llinfos << "Initializing camera..." << llendl; 1675 LL_DEBUGS("AppInit") << "Initializing camera..." << LL_ENDL;
1666 gFrameTime = totalTime(); 1676 gFrameTime = totalTime();
1667 F32 last_time = gFrameTimeSeconds; 1677 F32 last_time = gFrameTimeSeconds;
1668 gFrameTimeSeconds = (S64)(gFrameTime - gStartTime)/SEC_TO_MICROSEC; 1678 gFrameTimeSeconds = (S64)(gFrameTime - gStartTime)/SEC_TO_MICROSEC;
@@ -1697,19 +1707,19 @@ BOOL idle_startup()
1697 // Initialize global class data needed for surfaces (i.e. textures) 1707 // Initialize global class data needed for surfaces (i.e. textures)
1698 if (!gNoRender) 1708 if (!gNoRender)
1699 { 1709 {
1700 llinfos << "Initializing sky..." << llendl; 1710 LL_DEBUGS("AppInit") << "Initializing sky..." << LL_ENDL;
1701 // Initialize all of the viewer object classes for the first time (doing things like texture fetches. 1711 // Initialize all of the viewer object classes for the first time (doing things like texture fetches.
1702 gSky.init(initial_sun_direction); 1712 gSky.init(initial_sun_direction);
1703 } 1713 }
1704 1714
1705 llinfos << "Decoding images..." << llendl; 1715 LL_DEBUGS("AppInit") << "Decoding images..." << LL_ENDL;
1706 // For all images pre-loaded into viewer cache, decode them. 1716 // For all images pre-loaded into viewer cache, decode them.
1707 // Need to do this AFTER we init the sky 1717 // Need to do this AFTER we init the sky
1708 const S32 DECODE_TIME_SEC = 2; 1718 const S32 DECODE_TIME_SEC = 2;
1709 for (int i = 0; i < DECODE_TIME_SEC; i++) 1719 for (int i = 0; i < DECODE_TIME_SEC; i++)
1710 { 1720 {
1711 F32 frac = (F32)i / (F32)DECODE_TIME_SEC; 1721 F32 frac = (F32)i / (F32)DECODE_TIME_SEC;
1712 set_startup_status(0.45f + frac*0.1f, "Decoding images...", gAgent.mMOTD.c_str()); 1722 set_startup_status(0.45f + frac*0.1f, LLTrans::getString("LoginDecodingImages").c_str(), gAgent.mMOTD.c_str());
1713 display_startup(); 1723 display_startup();
1714 gImageList.decodeAllImages(1.f); 1724 gImageList.decodeAllImages(1.f);
1715 } 1725 }
@@ -1720,14 +1730,14 @@ BOOL idle_startup()
1720 LLMessageSystem* msg = gMessageSystem; 1730 LLMessageSystem* msg = gMessageSystem;
1721 if (!msg->mOurCircuitCode) 1731 if (!msg->mOurCircuitCode)
1722 { 1732 {
1723 llwarns << "Attempting to connect to simulator with a zero circuit code!" << llendl; 1733 LL_WARNS("AppInit") << "Attempting to connect to simulator with a zero circuit code!" << LL_ENDL;
1724 } 1734 }
1725 1735
1726 gUseCircuitCallbackCalled = FALSE; 1736 gUseCircuitCallbackCalled = FALSE;
1727 1737
1728 msg->enableCircuit(first_sim, TRUE); 1738 msg->enableCircuit(first_sim, TRUE);
1729 // now, use the circuit info to tell simulator about us! 1739 // now, use the circuit info to tell simulator about us!
1730 llinfos << "viewer: UserLoginLocationReply() Enabling " << first_sim << " with code " << msg->mOurCircuitCode << llendl; 1740 LL_INFOS("AppInit") << "viewer: UserLoginLocationReply() Enabling " << first_sim << " with code " << msg->mOurCircuitCode << LL_ENDL;
1731 msg->newMessageFast(_PREHASH_UseCircuitCode); 1741 msg->newMessageFast(_PREHASH_UseCircuitCode);
1732 msg->nextBlockFast(_PREHASH_CircuitCode); 1742 msg->nextBlockFast(_PREHASH_CircuitCode);
1733 msg->addU32Fast(_PREHASH_Code, msg->mOurCircuitCode); 1743 msg->addU32Fast(_PREHASH_Code, msg->mOurCircuitCode);
@@ -1753,8 +1763,8 @@ BOOL idle_startup()
1753 //--------------------------------------------------------------------- 1763 //---------------------------------------------------------------------
1754 if(STATE_WORLD_WAIT == LLStartUp::getStartupState()) 1764 if(STATE_WORLD_WAIT == LLStartUp::getStartupState())
1755 { 1765 {
1756 //llinfos << "Waiting for simulator ack...." << llendl; 1766 LL_DEBUGS("AppInit") << "Waiting for simulator ack...." << LL_ENDL;
1757 set_startup_status(0.59f, "Waiting for region handshake...", gAgent.mMOTD.c_str()); 1767 set_startup_status(0.59f, LLTrans::getString("LoginWaitingForRegionHandshake").c_str(), gAgent.mMOTD.c_str());
1758 if(gGotUseCircuitCodeAck) 1768 if(gGotUseCircuitCodeAck)
1759 { 1769 {
1760 LLStartUp::setStartupState( STATE_AGENT_SEND ); 1770 LLStartUp::setStartupState( STATE_AGENT_SEND );
@@ -1772,8 +1782,8 @@ BOOL idle_startup()
1772 //--------------------------------------------------------------------- 1782 //---------------------------------------------------------------------
1773 if (STATE_AGENT_SEND == LLStartUp::getStartupState()) 1783 if (STATE_AGENT_SEND == LLStartUp::getStartupState())
1774 { 1784 {
1775 llinfos << "Connecting to region..." << llendl; 1785 LL_DEBUGS("AppInit") << "Connecting to region..." << LL_ENDL;
1776 set_startup_status(0.60f, "Connecting to region...", gAgent.mMOTD.c_str()); 1786 set_startup_status(0.60f, LLTrans::getString("LoginConnectingToRegion").c_str(), gAgent.mMOTD.c_str());
1777 // register with the message system so it knows we're 1787 // register with the message system so it knows we're
1778 // expecting this message 1788 // expecting this message
1779 LLMessageSystem* msg = gMessageSystem; 1789 LLMessageSystem* msg = gMessageSystem;
@@ -1824,8 +1834,8 @@ BOOL idle_startup()
1824 } 1834 }
1825 else 1835 else
1826 { 1836 {
1827 //llinfos << "Awaiting AvatarInitComplete, got " 1837 LL_DEBUGS("AppInit") << "Awaiting AvatarInitComplete, got "
1828 //<< msg->getMessageName() << llendl; 1838 << msg->getMessageName() << LL_ENDL;
1829 } 1839 }
1830 } 1840 }
1831 msg->processAcks(); 1841 msg->processAcks();
@@ -1877,7 +1887,7 @@ BOOL idle_startup()
1877 { 1887 {
1878 if(!gInventory.loadSkeleton(options, gInventoryLibraryOwner)) 1888 if(!gInventory.loadSkeleton(options, gInventoryLibraryOwner))
1879 { 1889 {
1880 llwarns << "Problem loading inventory-skel-lib" << llendl; 1890 LL_WARNS("AppInit") << "Problem loading inventory-skel-lib" << LL_ENDL;
1881 } 1891 }
1882 } 1892 }
1883 options.clear(); 1893 options.clear();
@@ -1885,8 +1895,7 @@ BOOL idle_startup()
1885 { 1895 {
1886 if(!gInventory.loadSkeleton(options, gAgent.getID())) 1896 if(!gInventory.loadSkeleton(options, gAgent.getID()))
1887 { 1897 {
1888 llwarns << "Problem loading inventory-skel-targets" 1898 LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL;
1889 << llendl;
1890 } 1899 }
1891 } 1900 }
1892 1901
@@ -2038,17 +2047,17 @@ BOOL idle_startup()
2038 if (rate_bps > FASTER_RATE_BPS 2047 if (rate_bps > FASTER_RATE_BPS
2039 && rate_bps > max_bandwidth) 2048 && rate_bps > max_bandwidth)
2040 { 2049 {
2041 llinfos << "Fast network connection, increasing max bandwidth to " 2050 LL_DEBUGS("AppInit") << "Fast network connection, increasing max bandwidth to "
2042 << FASTER_RATE_BPS/1024.f 2051 << FASTER_RATE_BPS/1024.f
2043 << " kbps" << llendl; 2052 << " kbps" << LL_ENDL;
2044 gViewerThrottle.setMaxBandwidth(FASTER_RATE_BPS / 1024.f); 2053 gViewerThrottle.setMaxBandwidth(FASTER_RATE_BPS / 1024.f);
2045 } 2054 }
2046 else if (rate_bps > FAST_RATE_BPS 2055 else if (rate_bps > FAST_RATE_BPS
2047 && rate_bps > max_bandwidth) 2056 && rate_bps > max_bandwidth)
2048 { 2057 {
2049 llinfos << "Fast network connection, increasing max bandwidth to " 2058 LL_DEBUGS("AppInit") << "Fast network connection, increasing max bandwidth to "
2050 << FAST_RATE_BPS/1024.f 2059 << FAST_RATE_BPS/1024.f
2051 << " kbps" << llendl; 2060 << " kbps" << LL_ENDL;
2052 gViewerThrottle.setMaxBandwidth(FAST_RATE_BPS / 1024.f); 2061 gViewerThrottle.setMaxBandwidth(FAST_RATE_BPS / 1024.f);
2053 } 2062 }
2054 } 2063 }
@@ -2080,8 +2089,8 @@ BOOL idle_startup()
2080 LLUserAuth::options_t gesture_options; 2089 LLUserAuth::options_t gesture_options;
2081 if (LLUserAuth::getInstance()->getOptions("gestures", gesture_options)) 2090 if (LLUserAuth::getInstance()->getOptions("gestures", gesture_options))
2082 { 2091 {
2083 llinfos << "Gesture Manager loading " << gesture_options.size() 2092 LL_DEBUGS("AppInit") << "Gesture Manager loading " << gesture_options.size()
2084 << llendl; 2093 << LL_ENDL;
2085 std::vector<LLUUID> item_ids; 2094 std::vector<LLUUID> item_ids;
2086 LLUserAuth::options_t::iterator resp_it; 2095 LLUserAuth::options_t::iterator resp_it;
2087 for (resp_it = gesture_options.begin(); 2096 for (resp_it = gesture_options.begin();
@@ -2134,7 +2143,7 @@ BOOL idle_startup()
2134 msg->setHandlerFuncFast(_PREHASH_AttachedSound, process_attached_sound); 2143 msg->setHandlerFuncFast(_PREHASH_AttachedSound, process_attached_sound);
2135 msg->setHandlerFuncFast(_PREHASH_AttachedSoundGainChange, process_attached_sound_gain_change); 2144 msg->setHandlerFuncFast(_PREHASH_AttachedSoundGainChange, process_attached_sound_gain_change);
2136 2145
2137 llinfos << "Initialization complete" << llendl; 2146 LL_DEBUGS("AppInit") << "Initialization complete" << LL_ENDL;
2138 2147
2139 gRenderStartTime.reset(); 2148 gRenderStartTime.reset();
2140 gForegroundTime.reset(); 2149 gForegroundTime.reset();
@@ -2249,7 +2258,7 @@ BOOL idle_startup()
2249 { 2258 {
2250 update_texture_fetch(); 2259 update_texture_fetch();
2251 set_startup_status(0.f + 0.25f * wearables_time / MAX_WEARABLES_TIME, 2260 set_startup_status(0.f + 0.25f * wearables_time / MAX_WEARABLES_TIME,
2252 "Downloading clothing...", 2261 LLTrans::getString("LoginDownloadingClothing").c_str(),
2253 gAgent.mMOTD.c_str()); 2262 gAgent.mMOTD.c_str());
2254 } 2263 }
2255 return do_normal_idle; 2264 return do_normal_idle;
@@ -2271,7 +2280,7 @@ BOOL idle_startup()
2271 gViewerWindow->showCursor(); 2280 gViewerWindow->showCursor();
2272 gViewerWindow->getWindow()->resetBusyCount(); 2281 gViewerWindow->getWindow()->resetBusyCount();
2273 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); 2282 gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW);
2274 //llinfos << "Done releasing bitmap" << llendl; 2283 LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL;
2275 gViewerWindow->setShowProgress(FALSE); 2284 gViewerWindow->setShowProgress(FALSE);
2276 gViewerWindow->setProgressCancelButtonVisible(FALSE, ""); 2285 gViewerWindow->setProgressCancelButtonVisible(FALSE, "");
2277 2286
@@ -2293,7 +2302,7 @@ BOOL idle_startup()
2293 if (gSavedSettings.getBOOL("StatsAutoRun")) 2302 if (gSavedSettings.getBOOL("StatsAutoRun"))
2294 { 2303 {
2295 LLUUID id; 2304 LLUUID id;
2296 llinfos << "Starting automatic playback" << llendl; 2305 LL_DEBUGS("AppInit") << "Starting automatic playback" << LL_ENDL;
2297 gAgentPilot.startPlayback(); 2306 gAgentPilot.startPlayback();
2298 } 2307 }
2299 2308
@@ -2309,9 +2318,9 @@ BOOL idle_startup()
2309 // Unmute audio if desired and setup volumes. 2318 // Unmute audio if desired and setup volumes.
2310 // This is a not-uncommon crash site, so surround it with 2319 // This is a not-uncommon crash site, so surround it with
2311 // llinfos output to aid diagnosis. 2320 // llinfos output to aid diagnosis.
2312 llinfos << "Doing first audio_update_volume..." << llendl; 2321 LL_INFOS("AppInit") << "Doing first audio_update_volume..." << LL_ENDL;
2313 audio_update_volume(); 2322 audio_update_volume();
2314 llinfos << "Done first audio_update_volume." << llendl; 2323 LL_INFOS("AppInit") << "Done first audio_update_volume." << LL_ENDL;
2315 2324
2316 // reset keyboard focus to sane state of pointing at world 2325 // reset keyboard focus to sane state of pointing at world
2317 gFocusMgr.setKeyboardFocus(NULL); 2326 gFocusMgr.setKeyboardFocus(NULL);
@@ -2320,10 +2329,12 @@ BOOL idle_startup()
2320 gDebugView->mFastTimerView->setVisible(TRUE); 2329 gDebugView->mFastTimerView->setVisible(TRUE);
2321#endif 2330#endif
2322 2331
2332 LLAppViewer::instance()->startMainloopTimeout();
2333
2323 return do_normal_idle; 2334 return do_normal_idle;
2324 } 2335 }
2325 2336
2326 llwarns << "Reached end of idle_startup for state " << LLStartUp::getStartupState() << llendl; 2337 LL_WARNS("AppInit") << "Reached end of idle_startup for state " << LLStartUp::getStartupState() << LL_ENDL;
2327 return do_normal_idle; 2338 return do_normal_idle;
2328} 2339}
2329 2340
@@ -2333,7 +2344,7 @@ BOOL idle_startup()
2333 2344
2334void login_show() 2345void login_show()
2335{ 2346{
2336 llinfos << "Initializing Login Screen" << llendl; 2347 LL_INFOS("AppInit") << "Initializing Login Screen" << LL_ENDL;
2337 2348
2338#ifdef LL_RELEASE_FOR_DOWNLOAD 2349#ifdef LL_RELEASE_FOR_DOWNLOAD
2339 BOOL bUseDebugLogin = gSavedSettings.getBOOL("UseDebugLogin"); 2350 BOOL bUseDebugLogin = gSavedSettings.getBOOL("UseDebugLogin");
@@ -2347,35 +2358,15 @@ void login_show()
2347 2358
2348 // UI textures have been previously loaded in doPreloadImages() 2359 // UI textures have been previously loaded in doPreloadImages()
2349 2360
2350 llinfos << "Setting Servers" << llendl; 2361 LL_DEBUGS("AppInit") << "Setting Servers" << LL_ENDL;
2351 2362
2352 if( GRID_INFO_OTHER == gGridChoice ) 2363 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel().c_str(), LLViewerLogin::getInstance()->getGridChoice());
2353 { 2364
2354 LLPanelLogin::addServer( gGridName.c_str(), GRID_INFO_OTHER ); 2365 LLViewerLogin* vl = LLViewerLogin::getInstance();
2355 } 2366 for(int grid_index = GRID_INFO_ADITI; grid_index < GRID_INFO_OTHER; ++grid_index)
2356 else
2357 { 2367 {
2358 LLPanelLogin::addServer( gGridInfo[gGridChoice].mLabel, gGridChoice ); 2368 LLPanelLogin::addServer(vl->getKnownGridLabel((EGridInfo)grid_index).c_str(), grid_index);
2359 } 2369 }
2360
2361 // Arg! We hate loops!
2362 LLPanelLogin::addServer( gGridInfo[GRID_INFO_ADITI].mLabel, GRID_INFO_ADITI );
2363 LLPanelLogin::addServer( gGridInfo[GRID_INFO_AGNI].mLabel, GRID_INFO_AGNI );
2364 LLPanelLogin::addServer( gGridInfo[GRID_INFO_ARUNA].mLabel, GRID_INFO_ARUNA );
2365 LLPanelLogin::addServer( gGridInfo[GRID_INFO_DURGA].mLabel, GRID_INFO_DURGA );
2366 LLPanelLogin::addServer( gGridInfo[GRID_INFO_GANGA].mLabel, GRID_INFO_GANGA );
2367 LLPanelLogin::addServer( gGridInfo[GRID_INFO_MITRA].mLabel, GRID_INFO_MITRA );
2368 LLPanelLogin::addServer( gGridInfo[GRID_INFO_MOHINI].mLabel, GRID_INFO_MOHINI );
2369 LLPanelLogin::addServer( gGridInfo[GRID_INFO_NANDI].mLabel, GRID_INFO_NANDI );
2370 LLPanelLogin::addServer( gGridInfo[GRID_INFO_RADHA].mLabel, GRID_INFO_RADHA );
2371 LLPanelLogin::addServer( gGridInfo[GRID_INFO_RAVI].mLabel, GRID_INFO_RAVI );
2372 LLPanelLogin::addServer( gGridInfo[GRID_INFO_SIVA].mLabel, GRID_INFO_SIVA );
2373 LLPanelLogin::addServer( gGridInfo[GRID_INFO_SHAKTI].mLabel, GRID_INFO_SHAKTI );
2374 LLPanelLogin::addServer( gGridInfo[GRID_INFO_SOMA].mLabel, GRID_INFO_SOMA );
2375 LLPanelLogin::addServer( gGridInfo[GRID_INFO_UMA].mLabel, GRID_INFO_UMA );
2376 LLPanelLogin::addServer( gGridInfo[GRID_INFO_VAAK].mLabel, GRID_INFO_VAAK );
2377 LLPanelLogin::addServer( gGridInfo[GRID_INFO_YAMI].mLabel, GRID_INFO_YAMI );
2378 LLPanelLogin::addServer( gGridInfo[GRID_INFO_LOCAL].mLabel, GRID_INFO_LOCAL );
2379} 2370}
2380 2371
2381// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2372// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
@@ -2416,7 +2407,7 @@ void login_callback(S32 option, void *userdata)
2416 } 2407 }
2417 else 2408 else
2418 { 2409 {
2419 llwarns << "Unknown login button clicked" << llendl; 2410 LL_WARNS("AppInit") << "Unknown login button clicked" << LL_ENDL;
2420 } 2411 }
2421} 2412}
2422 2413
@@ -2437,7 +2428,7 @@ LLString load_password_from_disk()
2437 2428
2438 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, 2429 std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
2439 "password.dat"); 2430 "password.dat");
2440 FILE* fp = LLFile::fopen(filepath.c_str(), "rb"); /* Flawfinder: ignore */ 2431 LLFILE* fp = LLFile::fopen(filepath.c_str(), "rb"); /* Flawfinder: ignore */
2441 if (!fp) 2432 if (!fp)
2442 { 2433 {
2443 return hashed_password; 2434 return hashed_password;
@@ -2484,7 +2475,7 @@ void save_password_to_disk(const char* hashed_password)
2484 } 2475 }
2485 else 2476 else
2486 { 2477 {
2487 FILE* fp = LLFile::fopen(filepath.c_str(), "wb"); /* Flawfinder: ignore */ 2478 LLFILE* fp = LLFile::fopen(filepath.c_str(), "wb"); /* Flawfinder: ignore */
2488 if (!fp) 2479 if (!fp)
2489 { 2480 {
2490 return; 2481 return;
@@ -2501,7 +2492,7 @@ void save_password_to_disk(const char* hashed_password)
2501 2492
2502 if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1) 2493 if (fwrite(buffer, HASHED_LENGTH, 1, fp) != 1)
2503 { 2494 {
2504 llwarns << "Short write" << llendl; 2495 LL_WARNS("AppInit") << "Short write" << LL_ENDL;
2505 } 2496 }
2506 2497
2507 fclose(fp); 2498 fclose(fp);
@@ -2551,7 +2542,7 @@ void first_run_dialog_callback(S32 option, void* userdata)
2551{ 2542{
2552 if (0 == option) 2543 if (0 == option)
2553 { 2544 {
2554 llinfos << "First run dialog cancelling" << llendl; 2545 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL;
2555 LLWeb::loadURL( CREATE_ACCOUNT_URL ); 2546 LLWeb::loadURL( CREATE_ACCOUNT_URL );
2556 } 2547 }
2557 2548
@@ -2584,7 +2575,7 @@ void login_alert_status(S32 option, void* user_data)
2584 LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); 2575 LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
2585 break; 2576 break;
2586 default: 2577 default:
2587 llwarns << "Missing case in login_alert_status switch" << llendl; 2578 LL_WARNS("AppInit") << "Missing case in login_alert_status switch" << LL_ENDL;
2588 } 2579 }
2589 2580
2590 LLPanelLogin::giveFocus(); 2581 LLPanelLogin::giveFocus();
@@ -2692,7 +2683,7 @@ void update_dialog_callback(S32 option, void *userdata)
2692#endif 2683#endif
2693 // *TODO change userserver to be grid on both viewer and sim, since 2684 // *TODO change userserver to be grid on both viewer and sim, since
2694 // userserver no longer exists. 2685 // userserver no longer exists.
2695 query_map["userserver"] = gGridName; 2686 query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel();
2696 query_map["channel"] = gSavedSettings.getString("VersionChannelName"); 2687 query_map["channel"] = gSavedSettings.getString("VersionChannelName");
2697 // *TODO constantize this guy 2688 // *TODO constantize this guy
2698 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); 2689 LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map);
@@ -2702,7 +2693,7 @@ void update_dialog_callback(S32 option, void *userdata)
2702 if (update_exe_path.empty()) 2693 if (update_exe_path.empty())
2703 { 2694 {
2704 // We're hosed, bail 2695 // We're hosed, bail
2705 llwarns << "LLDir::getTempFilename() failed" << llendl; 2696 LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL;
2706 LLAppViewer::instance()->forceQuit(); 2697 LLAppViewer::instance()->forceQuit();
2707 return; 2698 return;
2708 } 2699 }
@@ -2713,14 +2704,14 @@ void update_dialog_callback(S32 option, void *userdata)
2713 updater_source += gDirUtilp->getDirDelimiter(); 2704 updater_source += gDirUtilp->getDirDelimiter();
2714 updater_source += "updater.exe"; 2705 updater_source += "updater.exe";
2715 2706
2716 llinfos << "Calling CopyFile source: " << updater_source.c_str() 2707 LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source.c_str()
2717 << " dest: " << update_exe_path 2708 << " dest: " << update_exe_path
2718 << llendl; 2709 << LL_ENDL;
2719 2710
2720 2711
2721 if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) 2712 if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE))
2722 { 2713 {
2723 llinfos << "Unable to copy the updater!" << llendl; 2714 LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL;
2724 LLAppViewer::instance()->forceQuit(); 2715 LLAppViewer::instance()->forceQuit();
2725 return; 2716 return;
2726 } 2717 }
@@ -2758,14 +2749,14 @@ void update_dialog_callback(S32 option, void *userdata)
2758 params << " -program \"" << program_name << "\""; 2749 params << " -program \"" << program_name << "\"";
2759 } 2750 }
2760 2751
2761 llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; 2752 LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << " " << params.str() << LL_ENDL;
2762 2753
2763 //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. 2754 //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird.
2764 LLAppViewer::instance()->removeMarkerFile(); // In case updater fails 2755 LLAppViewer::instance()->removeMarkerFile(); // In case updater fails
2765 2756
2766 // Use spawn() to run asynchronously 2757 // Use spawn() to run asynchronously
2767 int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); 2758 int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL);
2768 llinfos << "Spawn returned " << retval << llendl; 2759 LL_DEBUGS("AppInit") << "Spawn returned " << retval << LL_ENDL;
2769 2760
2770#elif LL_DARWIN 2761#elif LL_DARWIN
2771 // if a sim name was passed in via command line parameter (typically through a SLURL) 2762 // if a sim name was passed in via command line parameter (typically through a SLURL)
@@ -2783,11 +2774,8 @@ void update_dialog_callback(S32 option, void *userdata)
2783 update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); 2774 update_exe_path += LLAppViewer::instance()->getSecondLifeTitle();
2784 update_exe_path += "\" &"; 2775 update_exe_path += "\" &";
2785 2776
2786 llinfos << "Calling updater: " << update_exe_path << llendl; 2777 LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << LL_ENDL;
2787 2778
2788 // *REMOVE:Mani The following call is handled through ~LLAppViewer.
2789 // remove_marker_file(); // In case updater fails
2790
2791 // Run the auto-updater. 2779 // Run the auto-updater.
2792 system(update_exe_path.c_str()); /* Flawfinder: ignore */ 2780 system(update_exe_path.c_str()); /* Flawfinder: ignore */
2793 2781
@@ -2795,10 +2783,6 @@ void update_dialog_callback(S32 option, void *userdata)
2795 OSMessageBox("Automatic updating is not yet implemented for Linux.\n" 2783 OSMessageBox("Automatic updating is not yet implemented for Linux.\n"
2796 "Please download the latest version from www.secondlife.com.", 2784 "Please download the latest version from www.secondlife.com.",
2797 NULL, OSMB_OK); 2785 NULL, OSMB_OK);
2798
2799 // *REMOVE:Mani The following call is handled through ~LLAppViewer.
2800 // remove_marker_file();
2801
2802#endif 2786#endif
2803 LLAppViewer::instance()->forceQuit(); 2787 LLAppViewer::instance()->forceQuit();
2804} 2788}
@@ -2813,7 +2797,7 @@ void use_circuit_callback(void**, S32 result)
2813 if (result) 2797 if (result)
2814 { 2798 {
2815 // Make sure user knows something bad happened. JC 2799 // Make sure user knows something bad happened. JC
2816 llinfos << "Backing up to login screen!" << llendl; 2800 LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL;
2817 gViewerWindow->alertXml("LoginPacketNeverReceived", 2801 gViewerWindow->alertXml("LoginPacketNeverReceived",
2818 login_alert_status, NULL); 2802 login_alert_status, NULL);
2819 reset_login(); 2803 reset_login();
@@ -2981,7 +2965,7 @@ void register_viewer_callbacks(LLMessageSystem* msg)
2981 //msg->setHandlerFunc("DirPicksReply", LLPanelDirBrowser::processDirPicksReply); 2965 //msg->setHandlerFunc("DirPicksReply", LLPanelDirBrowser::processDirPicksReply);
2982 msg->setHandlerFunc("DirClassifiedReply", LLPanelDirBrowser::processDirClassifiedReply); 2966 msg->setHandlerFunc("DirClassifiedReply", LLPanelDirBrowser::processDirClassifiedReply);
2983 msg->setHandlerFunc("DirLandReply", LLPanelDirBrowser::processDirLandReply); 2967 msg->setHandlerFunc("DirLandReply", LLPanelDirBrowser::processDirLandReply);
2984 msg->setHandlerFunc("DirPopularReply",LLPanelDirBrowser::processDirPopularReply); 2968 //msg->setHandlerFunc("DirPopularReply",LLPanelDirBrowser::processDirPopularReply);
2985 2969
2986 msg->setHandlerFunc("AvatarPickerReply", LLFloaterAvatarPicker::processAvatarPickerReply); 2970 msg->setHandlerFunc("AvatarPickerReply", LLFloaterAvatarPicker::processAvatarPickerReply);
2987 2971
@@ -3660,10 +3644,10 @@ void init_start_screen(S32 location_id)
3660 if (gStartImageGL.notNull()) 3644 if (gStartImageGL.notNull())
3661 { 3645 {
3662 gStartImageGL = NULL; 3646 gStartImageGL = NULL;
3663 llinfos << "re-initializing start screen" << llendl; 3647 LL_INFOS("AppInit") << "re-initializing start screen" << LL_ENDL;
3664 } 3648 }
3665 3649
3666 llinfos << "Loading startup bitmap..." << llendl; 3650 LL_DEBUGS("AppInit") << "Loading startup bitmap..." << LL_ENDL;
3667 3651
3668 LLString temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter(); 3652 LLString temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter();
3669 3653
@@ -3682,12 +3666,12 @@ void init_start_screen(S32 location_id)
3682 // driver bug 3666 // driver bug
3683 if(!gSavedSettings.getBOOL("UseStartScreen")) 3667 if(!gSavedSettings.getBOOL("UseStartScreen"))
3684 { 3668 {
3685 llinfos << "Bitmap load disabled" << llendl; 3669 LL_INFOS("AppInit") << "Bitmap load disabled" << LL_ENDL;
3686 return; 3670 return;
3687 } 3671 }
3688 else if(!start_image_bmp->load(temp_str) ) 3672 else if(!start_image_bmp->load(temp_str) )
3689 { 3673 {
3690 llinfos << "Bitmap load failed" << llendl; 3674 LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL;
3691 return; 3675 return;
3692 } 3676 }
3693 3677
@@ -3698,7 +3682,7 @@ void init_start_screen(S32 location_id)
3698 LLPointer<LLImageRaw> raw = new LLImageRaw; 3682 LLPointer<LLImageRaw> raw = new LLImageRaw;
3699 if (!start_image_bmp->decode(raw, 0.0f)) 3683 if (!start_image_bmp->decode(raw, 0.0f))
3700 { 3684 {
3701 llinfos << "Bitmap decode failed" << llendl; 3685 LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL;
3702 gStartImageGL = NULL; 3686 gStartImageGL = NULL;
3703 return; 3687 return;
3704 } 3688 }
@@ -3711,7 +3695,7 @@ void init_start_screen(S32 location_id)
3711// frees the bitmap 3695// frees the bitmap
3712void release_start_screen() 3696void release_start_screen()
3713{ 3697{
3714 //llinfos << "Releasing bitmap..." << llendl; 3698 LL_DEBUGS("AppInit") << "Releasing bitmap..." << LL_ENDL;
3715 gStartImageGL = NULL; 3699 gStartImageGL = NULL;
3716} 3700}
3717 3701
@@ -3719,7 +3703,7 @@ void release_start_screen()
3719// static 3703// static
3720void LLStartUp::setStartupState( S32 state ) 3704void LLStartUp::setStartupState( S32 state )
3721{ 3705{
3722 llinfos << "Startup state changing from " << gStartupState << " to " << state << llendl; 3706 LL_INFOS("AppInit") << "Startup state changing from " << gStartupState << " to " << state << LL_ENDL;
3723 gStartupState = state; 3707 gStartupState = state;
3724} 3708}
3725 3709