diff options
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 383 |
1 files changed, 143 insertions, 240 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 4a9a158..c6f4cdd 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -64,7 +64,7 @@ | |||
64 | #include "llurldispatcher.h" | 64 | #include "llurldispatcher.h" |
65 | #include "llurlhistory.h" | 65 | #include "llurlhistory.h" |
66 | #include "llfirstuse.h" | 66 | #include "llfirstuse.h" |
67 | #include "llglimmediate.h" | 67 | #include "llrender.h" |
68 | 68 | ||
69 | #include "llweb.h" | 69 | #include "llweb.h" |
70 | #include "llsecondlifeurls.h" | 70 | #include "llsecondlifeurls.h" |
@@ -102,6 +102,7 @@ | |||
102 | #include "audioengine.h" | 102 | #include "audioengine.h" |
103 | #include "llviewermenu.h" | 103 | #include "llviewermenu.h" |
104 | #include "llselectmgr.h" | 104 | #include "llselectmgr.h" |
105 | #include "lltrans.h" | ||
105 | #include "lltracker.h" | 106 | #include "lltracker.h" |
106 | #include "llviewerparcelmgr.h" | 107 | #include "llviewerparcelmgr.h" |
107 | #include "llworldmapview.h" | 108 | #include "llworldmapview.h" |
@@ -121,6 +122,7 @@ | |||
121 | #include "llhudeffecttrail.h" | 122 | #include "llhudeffecttrail.h" |
122 | #include "llvectorperfoptions.h" | 123 | #include "llvectorperfoptions.h" |
123 | #include "llurlsimstring.h" | 124 | #include "llurlsimstring.h" |
125 | #include "llwatchdog.h" | ||
124 | 126 | ||
125 | // Included so that constants/settings might be initialized | 127 | // Included so that constants/settings might be initialized |
126 | // in save_settings_to_globals() | 128 | // in save_settings_to_globals() |
@@ -160,6 +162,13 @@ | |||
160 | 162 | ||
161 | #include "llcommandlineparser.h" | 163 | #include "llcommandlineparser.h" |
162 | 164 | ||
165 | // annoying detail to determine whether font prefs are over-ridden | ||
166 | #if LL_LINUX | ||
167 | # define LL_DYNAMIC_FONT_DISCOVERY 1 | ||
168 | #else | ||
169 | # define LL_DYNAMIC_FONT_DISCOVERY 0 | ||
170 | #endif | ||
171 | |||
163 | // *FIX: These extern globals should be cleaned up. | 172 | // *FIX: These extern globals should be cleaned up. |
164 | // The globals either represent state/config/resource-storage of either | 173 | // The globals either represent state/config/resource-storage of either |
165 | // this app, or another 'component' of the viewer. App globals should be | 174 | // this app, or another 'component' of the viewer. App globals should be |
@@ -183,24 +192,6 @@ | |||
183 | // viewer.cpp - these are only used in viewer, should be easily moved. | 192 | // viewer.cpp - these are only used in viewer, should be easily moved. |
184 | extern void disable_win_error_reporting(); | 193 | extern void disable_win_error_reporting(); |
185 | 194 | ||
186 | //#define APPLE_PREVIEW // Define this if you're doing a preview build on the Mac | ||
187 | #if LL_RELEASE_FOR_DOWNLOAD | ||
188 | // Default userserver for production builds is agni | ||
189 | #ifndef APPLE_PREVIEW | ||
190 | static EGridInfo GridDefaultChoice = GRID_INFO_AGNI; | ||
191 | #else | ||
192 | static EGridInfo GridDefaultChoice = GRID_INFO_ADITI; | ||
193 | #endif | ||
194 | #else | ||
195 | // Default userserver for development builds is none | ||
196 | static EGridInfo GridDefaultChoice = GRID_INFO_NONE; | ||
197 | #endif | ||
198 | |||
199 | #if LL_WINDOWS | ||
200 | extern void create_console(); | ||
201 | #endif | ||
202 | |||
203 | |||
204 | #if LL_DARWIN | 195 | #if LL_DARWIN |
205 | #include <Carbon/Carbon.h> | 196 | #include <Carbon/Carbon.h> |
206 | extern void init_apple_menu(const char* product); | 197 | extern void init_apple_menu(const char* product); |
@@ -214,6 +205,7 @@ extern OSStatus DisplayReleaseNotes(void); | |||
214 | 205 | ||
215 | extern BOOL gRandomizeFramerate; | 206 | extern BOOL gRandomizeFramerate; |
216 | extern BOOL gPeriodicSlowFrame; | 207 | extern BOOL gPeriodicSlowFrame; |
208 | extern BOOL gDebugGL; | ||
217 | 209 | ||
218 | //////////////////////////////////////////////////////////// | 210 | //////////////////////////////////////////////////////////// |
219 | // All from the last globals push... | 211 | // All from the last globals push... |
@@ -413,7 +405,8 @@ static void settings_modify() | |||
413 | LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); | 405 | LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); |
414 | LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); | 406 | LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); |
415 | LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4] | 407 | LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4] |
416 | gGL.setClever(gSavedSettings.getBOOL("RenderUseCleverUI")); | 408 | gDebugGL = gSavedSettings.getBOOL("RenderDebugGL"); |
409 | gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); | ||
417 | 410 | ||
418 | #if LL_VECTORIZE | 411 | #if LL_VECTORIZE |
419 | if (gSysCPU.hasAltivec()) | 412 | if (gSysCPU.hasAltivec()) |
@@ -453,73 +446,35 @@ static void settings_modify() | |||
453 | gSavedSettings.setBOOL("PTTCurrentlyEnabled", TRUE); //gSavedSettings.getBOOL("EnablePushToTalk")); | 446 | gSavedSettings.setBOOL("PTTCurrentlyEnabled", TRUE); //gSavedSettings.getBOOL("EnablePushToTalk")); |
454 | } | 447 | } |
455 | 448 | ||
456 | void initGridChoice() | 449 | void LLAppViewer::initGridChoice() |
457 | { | 450 | { |
458 | LLString gridChoice = gSavedSettings.getString("GridChoice"); | 451 | // Load up the initial grid choice from: |
459 | if(!gridChoice.empty()) | 452 | // - hard coded defaults... |
460 | // Used to show first chunk of each argument passed in the | 453 | // - command line settings... |
461 | // window title. | 454 | // - if dev build, persisted settings... |
462 | { | ||
463 | // find the grid choice from the user setting. | ||
464 | int gridIndex = GRID_INFO_NONE; | ||
465 | for(;gridIndex < GRID_INFO_OTHER; ++gridIndex ) | ||
466 | { | ||
467 | if(0 == LLString::compareInsensitive(gGridInfo[gridIndex].mLabel, gridChoice.c_str())) | ||
468 | { | ||
469 | gGridChoice = (EGridInfo)gridIndex; | ||
470 | |||
471 | if(GRID_INFO_LOCAL == gGridChoice) | ||
472 | { | ||
473 | gGridName = LOOPBACK_ADDRESS_STRING; | ||
474 | break; | ||
475 | } | ||
476 | else | ||
477 | { | ||
478 | gGridName = gGridInfo[gGridChoice].mName; | ||
479 | break; | ||
480 | } | ||
481 | } | ||
482 | } | ||
483 | |||
484 | if(GRID_INFO_OTHER == gridIndex) | ||
485 | { | ||
486 | // *FIX:MEP Can and should we validate that this is an IP address? | ||
487 | gGridChoice = (EGridInfo)gridIndex; | ||
488 | gGridName = llformat("%s", gSavedSettings.getString("GridChoice").c_str()); | ||
489 | |||
490 | } | ||
491 | } | ||
492 | 455 | ||
456 | // Set the "grid choice", this is specified by command line. | ||
457 | std::string grid_choice = gSavedSettings.getString("CmdLineGridChoice"); | ||
458 | LLViewerLogin::getInstance()->setGridChoice(grid_choice); | ||
493 | 459 | ||
494 | #if !LL_RELEASE_FOR_DOWNLOAD | 460 | #if !LL_RELEASE_FOR_DOWNLOAD |
495 | if (gGridChoice == GRID_INFO_NONE) | 461 | // Development version: load last server choice by default |
462 | // ignored is the command line grid choice has been set | ||
463 | if(grid_choice.empty()) | ||
496 | { | 464 | { |
497 | // Development version: load last server choice by default (overridden by cmd line args) | 465 | S32 server = gSavedSettings.getS32("ServerChoice"); |
498 | S32 server = gSavedSettings.getS32("ServerChoice"); | 466 | server = llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); |
499 | if (server != 0) | 467 | if(server == GRID_INFO_OTHER) |
500 | gGridChoice = (EGridInfo)llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); | ||
501 | if (server == GRID_INFO_OTHER) | ||
502 | { | 468 | { |
503 | LLString custom_server = gSavedSettings.getString("CustomServer"); | 469 | LLString custom_server = gSavedSettings.getString("CustomServer"); |
504 | if (custom_server.empty()) | 470 | LLViewerLogin::getInstance()->setGridChoice(custom_server); |
505 | { | 471 | } |
506 | gGridName = "none"; | 472 | else if(server != 0) |
507 | } | 473 | { |
508 | else | 474 | LLViewerLogin::getInstance()->setGridChoice((EGridInfo)server); |
509 | { | ||
510 | gGridName = custom_server.c_str(); | ||
511 | } | ||
512 | } | 475 | } |
513 | |||
514 | gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mLabel); | ||
515 | } | 476 | } |
516 | #endif | 477 | #endif |
517 | |||
518 | if (gGridChoice == GRID_INFO_NONE) | ||
519 | { | ||
520 | gGridChoice = GridDefaultChoice; | ||
521 | gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mLabel); | ||
522 | } | ||
523 | } | 478 | } |
524 | 479 | ||
525 | bool send_url_to_other_instance(const std::string& url) | 480 | bool send_url_to_other_instance(const std::string& url) |
@@ -583,23 +538,22 @@ LLAppViewer::LLAppViewer() : | |||
583 | } | 538 | } |
584 | 539 | ||
585 | sInstance = this; | 540 | sInstance = this; |
541 | |||
542 | // Initialize the mainloop timeout. | ||
543 | mMainloopTimeout = new LLWatchdogTimeout(); | ||
586 | } | 544 | } |
587 | 545 | ||
588 | LLAppViewer::~LLAppViewer() | 546 | LLAppViewer::~LLAppViewer() |
589 | { | 547 | { |
548 | // Initialize the mainloop timeout. | ||
549 | delete mMainloopTimeout; | ||
550 | |||
590 | // If we got to this destructor somehow, the app didn't hang. | 551 | // If we got to this destructor somehow, the app didn't hang. |
591 | removeMarkerFile(); | 552 | removeMarkerFile(); |
592 | } | 553 | } |
593 | 554 | ||
594 | bool LLAppViewer::init() | 555 | bool LLAppViewer::init() |
595 | { | 556 | { |
596 | // *NOTE:Mani - LLCurl::initClass is not thread safe. | ||
597 | // Called before threads are created. | ||
598 | LLCurl::initClass(); | ||
599 | |||
600 | initThreads(); | ||
601 | |||
602 | |||
603 | // | 557 | // |
604 | // Start of the application | 558 | // Start of the application |
605 | // | 559 | // |
@@ -612,7 +566,6 @@ bool LLAppViewer::init() | |||
612 | // that touches files should really go through the lldir API | 566 | // that touches files should really go through the lldir API |
613 | gDirUtilp->initAppDirs("SecondLife"); | 567 | gDirUtilp->initAppDirs("SecondLife"); |
614 | 568 | ||
615 | |||
616 | initLogging(); | 569 | initLogging(); |
617 | 570 | ||
618 | // | 571 | // |
@@ -621,6 +574,12 @@ bool LLAppViewer::init() | |||
621 | if (!initConfiguration()) | 574 | if (!initConfiguration()) |
622 | return false; | 575 | return false; |
623 | 576 | ||
577 | // *NOTE:Mani - LLCurl::initClass is not thread safe. | ||
578 | // Called before threads are created. | ||
579 | LLCurl::initClass(); | ||
580 | |||
581 | initThreads(); | ||
582 | |||
624 | writeSystemInfo(); | 583 | writeSystemInfo(); |
625 | 584 | ||
626 | // Build a string representing the current version number. | 585 | // Build a string representing the current version number. |
@@ -640,7 +599,7 @@ bool LLAppViewer::init() | |||
640 | // | 599 | // |
641 | // Various introspection concerning the libs we're using. | 600 | // Various introspection concerning the libs we're using. |
642 | // | 601 | // |
643 | llinfos << "J2C Engine is: " << LLImageJ2C::getEngineInfo() << llendl; | 602 | LL_DEBUGS("InitInfo") << "J2C Engine is: " << LLImageJ2C::getEngineInfo() << LL_ENDL; |
644 | 603 | ||
645 | // Get the single value from the crash settings file, if it exists | 604 | // Get the single value from the crash settings file, if it exists |
646 | std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); | 605 | std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); |
@@ -683,15 +642,15 @@ bool LLAppViewer::init() | |||
683 | 642 | ||
684 | // Load art UUID information, don't require these strings to be declared in code. | 643 | // Load art UUID information, don't require these strings to be declared in code. |
685 | LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); | 644 | LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); |
686 | llinfos << "Loading base colors from " << colors_base_filename << llendl; | 645 | LL_DEBUGS("InitInfo") << "Loading base colors from " << colors_base_filename << LL_ENDL; |
687 | gColors.loadFromFileLegacy(colors_base_filename.c_str(), FALSE, TYPE_COL4U); | 646 | gColors.loadFromFileLegacy(colors_base_filename.c_str(), FALSE, TYPE_COL4U); |
688 | 647 | ||
689 | // Load overrides from user colors file | 648 | // Load overrides from user colors file |
690 | LLString user_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.xml"); | 649 | LLString user_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.xml"); |
691 | llinfos << "Loading user colors from " << user_colors_filename << llendl; | 650 | LL_DEBUGS("InitInfo") << "Loading user colors from " << user_colors_filename << LL_ENDL; |
692 | if (gColors.loadFromFileLegacy(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0) | 651 | if (gColors.loadFromFileLegacy(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0) |
693 | { | 652 | { |
694 | llinfos << "Cannot load user colors from " << user_colors_filename << llendl; | 653 | LL_DEBUGS("InitInfo") << "Cannot load user colors from " << user_colors_filename << LL_ENDL; |
695 | } | 654 | } |
696 | 655 | ||
697 | // Widget construction depends on LLUI being initialized | 656 | // Widget construction depends on LLUI being initialized |
@@ -782,7 +741,7 @@ bool LLAppViewer::init() | |||
782 | #endif | 741 | #endif |
783 | 742 | ||
784 | gGLManager.getGLInfo(gDebugInfo); | 743 | gGLManager.getGLInfo(gDebugInfo); |
785 | llinfos << gGLManager.getGLInfoString() << llendl; | 744 | gGLManager.printGLInfoString(); |
786 | 745 | ||
787 | //load key settings | 746 | //load key settings |
788 | bind_keyboard_functions(); | 747 | bind_keyboard_functions(); |
@@ -790,7 +749,7 @@ bool LLAppViewer::init() | |||
790 | // Load Default bindings | 749 | // Load Default bindings |
791 | if (!gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keys.ini").c_str())) | 750 | if (!gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keys.ini").c_str())) |
792 | { | 751 | { |
793 | llerrs << "Unable to open keys.ini" << llendl; | 752 | LL_ERRS("InitInfo") << "Unable to open keys.ini" << LL_ENDL; |
794 | } | 753 | } |
795 | // Load Custom bindings (override defaults) | 754 | // Load Custom bindings (override defaults) |
796 | gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini").c_str()); | 755 | gViewerKeyboard.loadBindings(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"custom_keys.ini").c_str()); |
@@ -865,20 +824,16 @@ bool LLAppViewer::init() | |||
865 | gSimFrames = (F32)gFrameCount; | 824 | gSimFrames = (F32)gFrameCount; |
866 | 825 | ||
867 | LLViewerJoystick::getInstance()->init(false); | 826 | LLViewerJoystick::getInstance()->init(false); |
868 | if (LLViewerJoystick::getInstance()->isLikeSpaceNavigator()) | 827 | |
869 | { | ||
870 | if (gSavedSettings.getString("JoystickInitialized") != "SpaceNavigator") | ||
871 | { | ||
872 | LLFloaterJoystick::setSNDefaults(); | ||
873 | gSavedSettings.setString("JoystickInitialized", "SpaceNavigator"); | ||
874 | } | ||
875 | } | ||
876 | |||
877 | return true; | 828 | return true; |
878 | } | 829 | } |
879 | 830 | ||
880 | bool LLAppViewer::mainLoop() | 831 | bool LLAppViewer::mainLoop() |
881 | { | 832 | { |
833 | mMainloopTimeout = new LLWatchdogTimeout(); | ||
834 | // *FIX:Mani - Make this a setting, once new settings exist in this branch. | ||
835 | mMainloopTimeout->setTimeout(5); | ||
836 | |||
882 | //------------------------------------------- | 837 | //------------------------------------------- |
883 | // Run main loop until time to quit | 838 | // Run main loop until time to quit |
884 | //------------------------------------------- | 839 | //------------------------------------------- |
@@ -910,7 +865,7 @@ bool LLAppViewer::mainLoop() | |||
910 | { | 865 | { |
911 | LLFastTimer t2(LLFastTimer::FTM_MESSAGES); | 866 | LLFastTimer t2(LLFastTimer::FTM_MESSAGES); |
912 | #if LL_WINDOWS | 867 | #if LL_WINDOWS |
913 | if (!LLWinDebug::setupExceptionHandler()) | 868 | if (!LLWinDebug::checkExceptionHandler()) |
914 | { | 869 | { |
915 | llwarns << " Someone took over my exception handler (post messagehandling)!" << llendl; | 870 | llwarns << " Someone took over my exception handler (post messagehandling)!" << llendl; |
916 | } | 871 | } |
@@ -1059,6 +1014,8 @@ bool LLAppViewer::mainLoop() | |||
1059 | } | 1014 | } |
1060 | //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering. | 1015 | //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering. |
1061 | //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering. | 1016 | //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering. |
1017 | |||
1018 | mMainloopTimeout->ping(); | ||
1062 | } | 1019 | } |
1063 | 1020 | ||
1064 | } | 1021 | } |
@@ -1083,6 +1040,8 @@ bool LLAppViewer::mainLoop() | |||
1083 | 1040 | ||
1084 | delete gServicePump; | 1041 | delete gServicePump; |
1085 | 1042 | ||
1043 | mMainloopTimeout->stop(); | ||
1044 | |||
1086 | llinfos << "Exiting main_loop" << llendflush; | 1045 | llinfos << "Exiting main_loop" << llendflush; |
1087 | 1046 | ||
1088 | return true; | 1047 | return true; |
@@ -1346,7 +1305,9 @@ bool LLAppViewer::cleanup() | |||
1346 | gStaticVFS = NULL; | 1305 | gStaticVFS = NULL; |
1347 | delete gVFS; | 1306 | delete gVFS; |
1348 | gVFS = NULL; | 1307 | gVFS = NULL; |
1349 | 1308 | ||
1309 | LLWatchdog::getInstance()->cleanup(); | ||
1310 | |||
1350 | end_messaging_system(); | 1311 | end_messaging_system(); |
1351 | 1312 | ||
1352 | // *NOTE:Mani - The following call is not thread safe. | 1313 | // *NOTE:Mani - The following call is not thread safe. |
@@ -1380,6 +1341,14 @@ bool LLAppViewer::initThreads() | |||
1380 | #else | 1341 | #else |
1381 | static const bool enable_threads = true; | 1342 | static const bool enable_threads = true; |
1382 | #endif | 1343 | #endif |
1344 | |||
1345 | const S32 NEVER_SUBMIT_REPORT = 2; | ||
1346 | if(TRUE == gSavedSettings.getBOOL("WatchdogEnabled") | ||
1347 | && (gCrashSettings.getS32("CrashSubmitBehavior") != NEVER_SUBMIT_REPORT)) | ||
1348 | { | ||
1349 | LLWatchdog::getInstance()->init(); | ||
1350 | } | ||
1351 | |||
1383 | LLVFSThread::initClass(enable_threads && true); | 1352 | LLVFSThread::initClass(enable_threads && true); |
1384 | LLLFSThread::initClass(enable_threads && true); | 1353 | LLLFSThread::initClass(enable_threads && true); |
1385 | 1354 | ||
@@ -1434,7 +1403,7 @@ bool LLAppViewer::initLogging() | |||
1434 | } | 1403 | } |
1435 | 1404 | ||
1436 | void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index) | 1405 | void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index) |
1437 | { | 1406 | { |
1438 | for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) | 1407 | for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) |
1439 | { | 1408 | { |
1440 | LLString settings_name = (*itr).first; | 1409 | LLString settings_name = (*itr).first; |
@@ -1487,7 +1456,7 @@ std::string LLAppViewer::getSettingsFileName(const std::string& file) | |||
1487 | } | 1456 | } |
1488 | 1457 | ||
1489 | bool LLAppViewer::initConfiguration() | 1458 | bool LLAppViewer::initConfiguration() |
1490 | { | 1459 | { |
1491 | //Set up internal pointers | 1460 | //Set up internal pointers |
1492 | gSettings[sGlobalSettingsName] = &gSavedSettings; | 1461 | gSettings[sGlobalSettingsName] = &gSavedSettings; |
1493 | gSettings[sPerAccountSettingsName] = &gSavedPerAccountSettings; | 1462 | gSettings[sPerAccountSettingsName] = &gSavedPerAccountSettings; |
@@ -1523,30 +1492,17 @@ bool LLAppViewer::initConfiguration() | |||
1523 | 1492 | ||
1524 | gSavedSettings.setString("VersionChannelName", LL_CHANNEL); | 1493 | gSavedSettings.setString("VersionChannelName", LL_CHANNEL); |
1525 | 1494 | ||
1526 | #ifndef LL_RELEASE_FOR_DOWNLOAD | 1495 | #ifndef LL_RELEASE_FOR_DOWNLOAD |
1527 | gSavedSettings.setBOOL("ShowConsoleWindow", TRUE); | 1496 | gSavedSettings.setBOOL("ShowConsoleWindow", TRUE); |
1528 | gSavedSettings.setBOOL("AllowMultipleViewers", TRUE); | 1497 | gSavedSettings.setBOOL("AllowMultipleViewers", TRUE); |
1529 | #endif | 1498 | #endif |
1530 | 1499 | ||
1531 | #if LL_WINDOWS | 1500 | #if !LL_DYNAMIC_FONT_DISCOVERY |
1532 | // Lists Japanese, Korean, and Chinese sanserif fonts available in | 1501 | // static font discovery - user settings can override. |
1533 | // Windows XP and Vista, as well as "Arial Unicode MS". | ||
1534 | gSavedSettings.setString("FontSansSerifFallback", | 1502 | gSavedSettings.setString("FontSansSerifFallback", |
1535 | "MSGOTHIC.TTC;gulim.ttc;simhei.ttf;ArialUni.ttf"); | 1503 | LLWindow::getFontListSans()); |
1536 | #elif LL_DARWIN | ||
1537 | // This is a fairly complete Japanese font that ships with Mac OS X. | ||
1538 | // The first filename is in UTF8, but it shows up in the font menu as "Hiragino Kaku Gothic Pro W3". | ||
1539 | // The third filename is in UTF8, but it shows up in the font menu as "STHeiti Light" | ||
1540 | gSavedSettings.setString("FontSansSerifFallback", | ||
1541 | "\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 Pro W3.otf;\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 ProN W3.otf;AppleGothic.dfont;AppleGothic.ttf;\xe5\x8d\x8e\xe6\x96\x87\xe7\xbb\x86\xe9\xbb\x91.ttf"); | ||
1542 | #else | ||
1543 | // 'unicode.ttf' doesn't exist, but hopefully an international | ||
1544 | // user can take the hint and drop in their favourite local font. | ||
1545 | gSavedSettings.setString("FontSansSerifFallback", | ||
1546 | "unicode.ttf"); | ||
1547 | #endif | 1504 | #endif |
1548 | 1505 | ||
1549 | |||
1550 | // These are warnings that appear on the first experience of that condition. | 1506 | // These are warnings that appear on the first experience of that condition. |
1551 | // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse | 1507 | // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse |
1552 | // for disable/reset ability | 1508 | // for disable/reset ability |
@@ -1590,7 +1546,16 @@ bool LLAppViewer::initConfiguration() | |||
1590 | // Do this *before* loading the settings file | 1546 | // Do this *before* loading the settings file |
1591 | LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE); | 1547 | LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE); |
1592 | 1548 | ||
1593 | // - read command line settings | 1549 | #if LL_DYNAMIC_FONT_DISCOVERY |
1550 | // Linux does *dynamic* font discovery which is preferable to | ||
1551 | // whatever got written-out into the config file last time. This | ||
1552 | // does remove the ability of the user to hand-define the fallbacks | ||
1553 | // though, so from a config-management point of view this is hacky. | ||
1554 | gSavedSettings.setString("FontSansSerifFallback", | ||
1555 | LLWindow::getFontListSans()); | ||
1556 | #endif | ||
1557 | |||
1558 | // - read command line settings. | ||
1594 | LLControlGroupCLP clp; | 1559 | LLControlGroupCLP clp; |
1595 | std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, | 1560 | std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, |
1596 | "cmd_line.xml"); | 1561 | "cmd_line.xml"); |
@@ -1769,18 +1734,6 @@ bool LLAppViewer::initConfiguration() | |||
1769 | } | 1734 | } |
1770 | } | 1735 | } |
1771 | 1736 | ||
1772 | const LLControlVariable* loginuri = gSavedSettings.getControl("LoginURI"); | ||
1773 | if(loginuri && LLString::null != loginuri->getValue().asString()) | ||
1774 | { | ||
1775 | addLoginURI(loginuri->getValue().asString()); | ||
1776 | } | ||
1777 | |||
1778 | const LLControlVariable* helperuri = gSavedSettings.getControl("HelperURI"); | ||
1779 | if(helperuri && LLString::null != helperuri->getValue().asString()) | ||
1780 | { | ||
1781 | setHelperURI(helperuri->getValue().asString()); | ||
1782 | } | ||
1783 | |||
1784 | const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinFolder"); | 1737 | const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinFolder"); |
1785 | if(skinfolder && LLString::null != skinfolder->getValue().asString()) | 1738 | if(skinfolder && LLString::null != skinfolder->getValue().asString()) |
1786 | { | 1739 | { |
@@ -2025,7 +1978,7 @@ bool LLAppViewer::initConfiguration() | |||
2025 | 1978 | ||
2026 | bool LLAppViewer::initWindow() | 1979 | bool LLAppViewer::initWindow() |
2027 | { | 1980 | { |
2028 | llinfos << "Initializing window..." << llendl; | 1981 | LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL; |
2029 | 1982 | ||
2030 | // store setting in a global for easy access and modification | 1983 | // store setting in a global for easy access and modification |
2031 | gNoRender = gSavedSettings.getBOOL("DisableRendering"); | 1984 | gNoRender = gSavedSettings.getBOOL("DisableRendering"); |
@@ -2085,6 +2038,7 @@ bool LLAppViewer::initWindow() | |||
2085 | 2038 | ||
2086 | LLAlertDialog::parseAlerts("alerts.xml"); | 2039 | LLAlertDialog::parseAlerts("alerts.xml"); |
2087 | LLNotifyBox::parseNotify("notify.xml"); | 2040 | LLNotifyBox::parseNotify("notify.xml"); |
2041 | LLTrans::parseStrings("strings.xml"); | ||
2088 | 2042 | ||
2089 | // Show watch cursor | 2043 | // Show watch cursor |
2090 | gViewerWindow->setCursor(UI_CURSOR_WAIT); | 2044 | gViewerWindow->setCursor(UI_CURSOR_WAIT); |
@@ -2160,10 +2114,6 @@ void LLAppViewer::cleanupSavedSettings() | |||
2160 | { | 2114 | { |
2161 | gSavedSettings.setF32("RenderFarClip", gAgent.mDrawDistance); | 2115 | gSavedSettings.setF32("RenderFarClip", gAgent.mDrawDistance); |
2162 | } | 2116 | } |
2163 | |||
2164 | // *REMOVE: This is now done via LLAppViewer::setCrashBehavior() | ||
2165 | // Left vestigially in case I borked it. | ||
2166 | // gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, gCrashBehavior); | ||
2167 | } | 2117 | } |
2168 | 2118 | ||
2169 | void LLAppViewer::removeCacheFiles(const char* file_mask) | 2119 | void LLAppViewer::removeCacheFiles(const char* file_mask) |
@@ -2194,22 +2144,22 @@ void LLAppViewer::writeSystemInfo() | |||
2194 | gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); | 2144 | gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); |
2195 | 2145 | ||
2196 | // Dump some debugging info | 2146 | // Dump some debugging info |
2197 | llinfos << gSecondLife | 2147 | LL_INFOS("SystemInfo") << gSecondLife |
2198 | << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH | 2148 | << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH |
2199 | << llendl; | 2149 | << LL_ENDL; |
2200 | 2150 | ||
2201 | // Dump the local time and time zone | 2151 | // Dump the local time and time zone |
2202 | time_t now; | 2152 | time_t now; |
2203 | time(&now); | 2153 | time(&now); |
2204 | char tbuffer[256]; /* Flawfinder: ignore */ | 2154 | char tbuffer[256]; /* Flawfinder: ignore */ |
2205 | strftime(tbuffer, 256, "%Y-%m-%dT%H:%M:%S %Z", localtime(&now)); | 2155 | strftime(tbuffer, 256, "%Y-%m-%dT%H:%M:%S %Z", localtime(&now)); |
2206 | llinfos << "Local time: " << tbuffer << llendl; | 2156 | LL_INFOS("SystemInfo") << "Local time: " << tbuffer << LL_ENDL; |
2207 | 2157 | ||
2208 | // query some system information | 2158 | // query some system information |
2209 | llinfos << "CPU info:\n" << gSysCPU << llendl; | 2159 | LL_INFOS("SystemInfo") << "CPU info:\n" << gSysCPU << LL_ENDL; |
2210 | llinfos << "Memory info:\n" << gSysMemory << llendl; | 2160 | LL_INFOS("SystemInfo") << "Memory info:\n" << gSysMemory << LL_ENDL; |
2211 | llinfos << "OS: " << getOSInfo().getOSStringSimple() << llendl; | 2161 | LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL; |
2212 | llinfos << "OS info: " << getOSInfo() << llendl; | 2162 | LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL; |
2213 | } | 2163 | } |
2214 | 2164 | ||
2215 | void LLAppViewer::handleSyncViewerCrash() | 2165 | void LLAppViewer::handleSyncViewerCrash() |
@@ -2221,6 +2171,8 @@ void LLAppViewer::handleSyncViewerCrash() | |||
2221 | 2171 | ||
2222 | void LLAppViewer::handleViewerCrash() | 2172 | void LLAppViewer::handleViewerCrash() |
2223 | { | 2173 | { |
2174 | llinfos << "Handle viewer crash entry." << llendl; | ||
2175 | |||
2224 | LLAppViewer* pApp = LLAppViewer::instance(); | 2176 | LLAppViewer* pApp = LLAppViewer::instance(); |
2225 | if (pApp->beingDebugged()) | 2177 | if (pApp->beingDebugged()) |
2226 | { | 2178 | { |
@@ -2287,11 +2239,11 @@ void LLAppViewer::handleViewerCrash() | |||
2287 | apr_file_t* crash_file = ll_apr_file_open(crash_file_name, LL_APR_W); | 2239 | apr_file_t* crash_file = ll_apr_file_open(crash_file_name, LL_APR_W); |
2288 | if (crash_file) | 2240 | if (crash_file) |
2289 | { | 2241 | { |
2290 | llinfos << "Created crash marker file " << crash_file_name << llendl; | 2242 | LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL; |
2291 | } | 2243 | } |
2292 | else | 2244 | else |
2293 | { | 2245 | { |
2294 | llwarns << "Cannot create error marker file " << crash_file_name << llendl; | 2246 | LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_file_name << LL_ENDL; |
2295 | } | 2247 | } |
2296 | apr_file_close(crash_file); | 2248 | apr_file_close(crash_file); |
2297 | } | 2249 | } |
@@ -2303,6 +2255,7 @@ void LLAppViewer::handleViewerCrash() | |||
2303 | llofstream file(filename.c_str(), llofstream::binary); | 2255 | llofstream file(filename.c_str(), llofstream::binary); |
2304 | if(file.good()) | 2256 | if(file.good()) |
2305 | { | 2257 | { |
2258 | llinfos << "Handle viewer crash generating stats log." << llendl; | ||
2306 | gMessageSystem->summarizeLogs(file); | 2259 | gMessageSystem->summarizeLogs(file); |
2307 | file.close(); | 2260 | file.close(); |
2308 | } | 2261 | } |
@@ -2318,6 +2271,7 @@ void LLAppViewer::handleViewerCrash() | |||
2318 | 2271 | ||
2319 | // Close the debug file | 2272 | // Close the debug file |
2320 | pApp->closeDebug(); | 2273 | pApp->closeDebug(); |
2274 | |||
2321 | LLError::logToFile(""); | 2275 | LLError::logToFile(""); |
2322 | 2276 | ||
2323 | // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked | 2277 | // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked |
@@ -2348,7 +2302,7 @@ bool LLAppViewer::anotherInstanceRunning() | |||
2348 | // If the file is currently locked, that means another process is already running. | 2302 | // If the file is currently locked, that means another process is already running. |
2349 | 2303 | ||
2350 | std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, MARKER_FILE_NAME); | 2304 | std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, MARKER_FILE_NAME); |
2351 | llinfos << "Checking marker file for lock..." << llendl; | 2305 | LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; |
2352 | 2306 | ||
2353 | //Freeze case checks | 2307 | //Freeze case checks |
2354 | apr_file_t* fMarker = ll_apr_file_open(marker_file, LL_APR_RB); | 2308 | apr_file_t* fMarker = ll_apr_file_open(marker_file, LL_APR_RB); |
@@ -2360,19 +2314,19 @@ bool LLAppViewer::anotherInstanceRunning() | |||
2360 | if (fMarker == NULL) | 2314 | if (fMarker == NULL) |
2361 | { | 2315 | { |
2362 | // Another instance is running. Skip the rest of these operations. | 2316 | // Another instance is running. Skip the rest of these operations. |
2363 | llinfos << "Marker file is locked." << llendl; | 2317 | LL_INFOS("MarkerFile") << "Marker file is locked." << LL_ENDL; |
2364 | return TRUE; | 2318 | return TRUE; |
2365 | } | 2319 | } |
2366 | if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) | 2320 | if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) |
2367 | { | 2321 | { |
2368 | apr_file_close(fMarker); | 2322 | apr_file_close(fMarker); |
2369 | llinfos << "Marker file is locked." << llendl; | 2323 | LL_INFOS("MarkerFile") << "Marker file is locked." << LL_ENDL; |
2370 | return TRUE; | 2324 | return TRUE; |
2371 | } | 2325 | } |
2372 | // No other instances; we'll lock this file now & delete on quit. | 2326 | // No other instances; we'll lock this file now & delete on quit. |
2373 | apr_file_close(fMarker); | 2327 | apr_file_close(fMarker); |
2374 | } | 2328 | } |
2375 | llinfos << "Marker file isn't locked." << llendl; | 2329 | LL_DEBUGS("MarkerFile") << "Marker file isn't locked." << LL_ENDL; |
2376 | return FALSE; | 2330 | return FALSE; |
2377 | } | 2331 | } |
2378 | 2332 | ||
@@ -2383,7 +2337,7 @@ void LLAppViewer::initMarkerFile() | |||
2383 | //There are marker files for two different types of crashes | 2337 | //There are marker files for two different types of crashes |
2384 | 2338 | ||
2385 | mMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,MARKER_FILE_NAME); | 2339 | mMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,MARKER_FILE_NAME); |
2386 | llinfos << "Checking marker file for lock..." << llendl; | 2340 | LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; |
2387 | 2341 | ||
2388 | //We've got 4 things to test for here | 2342 | //We've got 4 things to test for here |
2389 | // - Other Process Running (SecondLife.exec_marker present, locked) | 2343 | // - Other Process Running (SecondLife.exec_marker present, locked) |
@@ -2401,7 +2355,7 @@ void LLAppViewer::initMarkerFile() | |||
2401 | if(fMarker != NULL) | 2355 | if(fMarker != NULL) |
2402 | { | 2356 | { |
2403 | apr_file_close(fMarker); | 2357 | apr_file_close(fMarker); |
2404 | llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl; | 2358 | LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL; |
2405 | gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; | 2359 | gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; |
2406 | } | 2360 | } |
2407 | fMarker = ll_apr_file_open(llerror_marker_file, LL_APR_RB); | 2361 | fMarker = ll_apr_file_open(llerror_marker_file, LL_APR_RB); |
@@ -2416,7 +2370,7 @@ void LLAppViewer::initMarkerFile() | |||
2416 | if(fMarker != NULL) | 2370 | if(fMarker != NULL) |
2417 | { | 2371 | { |
2418 | apr_file_close(fMarker); | 2372 | apr_file_close(fMarker); |
2419 | llinfos << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << llendl; | 2373 | LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL; |
2420 | if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; | 2374 | if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; |
2421 | else gLastExecEvent = LAST_EXEC_OTHER_CRASH; | 2375 | else gLastExecEvent = LAST_EXEC_OTHER_CRASH; |
2422 | } | 2376 | } |
@@ -2436,34 +2390,33 @@ void LLAppViewer::initMarkerFile() | |||
2436 | { | 2390 | { |
2437 | apr_file_close(fMarker); | 2391 | apr_file_close(fMarker); |
2438 | gLastExecEvent = LAST_EXEC_FROZE; | 2392 | gLastExecEvent = LAST_EXEC_FROZE; |
2439 | llinfos << "Exec marker found: program froze on previous execution" << llendl; | 2393 | LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; |
2440 | } | 2394 | } |
2441 | 2395 | ||
2442 | // Create the marker file for this execution & lock it | 2396 | // Create the marker file for this execution & lock it |
2443 | mMarkerFile = ll_apr_file_open(mMarkerFileName, LL_APR_W); | 2397 | mMarkerFile = ll_apr_file_open(mMarkerFileName, LL_APR_W); |
2444 | if (mMarkerFile) | 2398 | if (mMarkerFile) |
2445 | { | 2399 | { |
2446 | llinfos << "Marker file created." << llendl; | 2400 | LL_DEBUGS("MarkerFile") << "Marker file created." << LL_ENDL; |
2447 | } | 2401 | } |
2448 | else | 2402 | else |
2449 | { | 2403 | { |
2450 | llinfos << "Failed to create marker file." << llendl; | 2404 | LL_INFOS("MarkerFile") << "Failed to create marker file." << LL_ENDL; |
2451 | return; | 2405 | return; |
2452 | } | 2406 | } |
2453 | if (apr_file_lock(mMarkerFile, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) | 2407 | if (apr_file_lock(mMarkerFile, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) |
2454 | { | 2408 | { |
2455 | apr_file_close(mMarkerFile); | 2409 | apr_file_close(mMarkerFile); |
2456 | llinfos << "Marker file cannot be locked." << llendl; | 2410 | LL_INFOS("MarkerFile") << "Marker file cannot be locked." << LL_ENDL; |
2457 | return; | 2411 | return; |
2458 | } | 2412 | } |
2459 | 2413 | ||
2460 | llinfos << "Marker file locked." << llendl; | 2414 | LL_DEBUGS("MarkerFile") << "Marker file locked." << LL_ENDL; |
2461 | llinfos << "Exiting initMarkerFile()." << llendl; | ||
2462 | } | 2415 | } |
2463 | 2416 | ||
2464 | void LLAppViewer::removeMarkerFile(bool leave_logout_marker) | 2417 | void LLAppViewer::removeMarkerFile(bool leave_logout_marker) |
2465 | { | 2418 | { |
2466 | llinfos << "removeMarkerFile()" << llendl; | 2419 | LL_DEBUGS("MarkerFile") << "removeMarkerFile()" << LL_ENDL; |
2467 | if (mMarkerFile != NULL) | 2420 | if (mMarkerFile != NULL) |
2468 | { | 2421 | { |
2469 | ll_apr_file_remove( mMarkerFileName ); | 2422 | ll_apr_file_remove( mMarkerFileName ); |
@@ -2588,7 +2541,7 @@ bool LLAppViewer::initCache() | |||
2588 | 2541 | ||
2589 | if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"))) | 2542 | if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"))) |
2590 | { | 2543 | { |
2591 | llwarns << "Unable to set cache location" << llendl; | 2544 | LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL; |
2592 | gSavedSettings.setString("CacheLocation", ""); | 2545 | gSavedSettings.setString("CacheLocation", ""); |
2593 | } | 2546 | } |
2594 | 2547 | ||
@@ -2625,7 +2578,7 @@ bool LLAppViewer::initCache() | |||
2625 | { | 2578 | { |
2626 | gSavedSettings.setU32("VFSOldSize", vfs_size_u32/MB); | 2579 | gSavedSettings.setU32("VFSOldSize", vfs_size_u32/MB); |
2627 | } | 2580 | } |
2628 | llinfos << "VFS CACHE SIZE: " << vfs_size/(1024*1024) << " MB" << llendl; | 2581 | LL_INFOS("AppCache") << "VFS CACHE SIZE: " << vfs_size/(1024*1024) << " MB" << LL_ENDL; |
2629 | 2582 | ||
2630 | // This has to happen BEFORE starting the vfs | 2583 | // This has to happen BEFORE starting the vfs |
2631 | //time_t ltime; | 2584 | //time_t ltime; |
@@ -2689,8 +2642,7 @@ bool LLAppViewer::initCache() | |||
2689 | { | 2642 | { |
2690 | sscanf(found_file.c_str() + start_pos, "%d", &old_salt); | 2643 | sscanf(found_file.c_str() + start_pos, "%d", &old_salt); |
2691 | } | 2644 | } |
2692 | llinfos << "Default vfs data file not present, found " << old_vfs_data_file << llendl; | 2645 | LL_DEBUGS("AppCache") << "Default vfs data file not present, found: " << old_vfs_data_file << " Old salt: " << old_salt << llendl; |
2693 | llinfos << "Old salt: " << old_salt << llendl; | ||
2694 | } | 2646 | } |
2695 | } | 2647 | } |
2696 | 2648 | ||
@@ -2702,8 +2654,8 @@ bool LLAppViewer::initCache() | |||
2702 | if (stat_result) | 2654 | if (stat_result) |
2703 | { | 2655 | { |
2704 | // We've got a bad/missing index file, nukem! | 2656 | // We've got a bad/missing index file, nukem! |
2705 | llwarns << "Bad or missing vfx index file " << old_vfs_index_file << llendl; | 2657 | LL_WARNS("AppCache") << "Bad or missing vfx index file " << old_vfs_index_file << LL_ENDL; |
2706 | llwarns << "Removing old vfs data file " << old_vfs_data_file << llendl; | 2658 | LL_WARNS("AppCache") << "Removing old vfs data file " << old_vfs_data_file << LL_ENDL; |
2707 | LLFile::remove(old_vfs_data_file); | 2659 | LLFile::remove(old_vfs_data_file); |
2708 | LLFile::remove(old_vfs_index_file); | 2660 | LLFile::remove(old_vfs_index_file); |
2709 | 2661 | ||
@@ -2740,7 +2692,7 @@ bool LLAppViewer::initCache() | |||
2740 | 2692 | ||
2741 | if (resize_vfs) | 2693 | if (resize_vfs) |
2742 | { | 2694 | { |
2743 | llinfos << "Removing old vfs and re-sizing" << llendl; | 2695 | LL_DEBUGS("AppCache") << "Removing old vfs and re-sizing" << LL_ENDL; |
2744 | 2696 | ||
2745 | LLFile::remove(old_vfs_data_file); | 2697 | LLFile::remove(old_vfs_data_file); |
2746 | LLFile::remove(old_vfs_index_file); | 2698 | LLFile::remove(old_vfs_index_file); |
@@ -2748,8 +2700,8 @@ bool LLAppViewer::initCache() | |||
2748 | else if (old_salt != new_salt) | 2700 | else if (old_salt != new_salt) |
2749 | { | 2701 | { |
2750 | // move the vfs files to a new name before opening | 2702 | // move the vfs files to a new name before opening |
2751 | llinfos << "Renaming " << old_vfs_data_file << " to " << new_vfs_data_file << llendl; | 2703 | LL_DEBUGS("AppCache") << "Renaming " << old_vfs_data_file << " to " << new_vfs_data_file << LL_ENDL; |
2752 | llinfos << "Renaming " << old_vfs_index_file << " to " << new_vfs_index_file << llendl; | 2704 | LL_DEBUGS("AppCache") << "Renaming " << old_vfs_index_file << " to " << new_vfs_index_file << LL_ENDL; |
2753 | LLFile::rename(old_vfs_data_file, new_vfs_data_file); | 2705 | LLFile::rename(old_vfs_data_file, new_vfs_data_file); |
2754 | LLFile::rename(old_vfs_index_file, new_vfs_index_file); | 2706 | LLFile::rename(old_vfs_index_file, new_vfs_index_file); |
2755 | } | 2707 | } |
@@ -2763,7 +2715,7 @@ bool LLAppViewer::initCache() | |||
2763 | { | 2715 | { |
2764 | // Try again with fresh files | 2716 | // Try again with fresh files |
2765 | // (The constructor deletes corrupt files when it finds them.) | 2717 | // (The constructor deletes corrupt files when it finds them.) |
2766 | llwarns << "VFS corrupt, deleted. Making new VFS." << llendl; | 2718 | LL_WARNS("AppCache") << "VFS corrupt, deleted. Making new VFS." << LL_ENDL; |
2767 | delete gVFS; | 2719 | delete gVFS; |
2768 | gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); | 2720 | gVFS = new LLVFS(new_vfs_index_file, new_vfs_data_file, false, vfs_size_u32, false); |
2769 | } | 2721 | } |
@@ -2784,9 +2736,8 @@ bool LLAppViewer::initCache() | |||
2784 | 2736 | ||
2785 | void LLAppViewer::purgeCache() | 2737 | void LLAppViewer::purgeCache() |
2786 | { | 2738 | { |
2787 | llinfos << "Purging Texture Cache..." << llendl; | 2739 | LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl; |
2788 | LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); | 2740 | LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); |
2789 | llinfos << "Purging Cache..." << llendl; | ||
2790 | std::string mask = gDirUtilp->getDirDelimiter() + "*.*"; | 2741 | std::string mask = gDirUtilp->getDirDelimiter() + "*.*"; |
2791 | gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); | 2742 | gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"").c_str(),mask); |
2792 | } | 2743 | } |
@@ -2801,61 +2752,6 @@ const LLString& LLAppViewer::getWindowTitle() const | |||
2801 | return gWindowTitle; | 2752 | return gWindowTitle; |
2802 | } | 2753 | } |
2803 | 2754 | ||
2804 | void LLAppViewer::resetURIs() const | ||
2805 | { | ||
2806 | // Clear URIs when picking a new server | ||
2807 | gLoginURIs.clear(); | ||
2808 | gHelperURI.clear(); | ||
2809 | } | ||
2810 | |||
2811 | const std::vector<std::string>& LLAppViewer::getLoginURIs() const | ||
2812 | { | ||
2813 | if (gLoginURIs.empty()) | ||
2814 | { | ||
2815 | // not specified on the command line, use value from table | ||
2816 | gLoginURIs.push_back(gGridInfo[gGridChoice].mLoginURI); | ||
2817 | } | ||
2818 | return gLoginURIs; | ||
2819 | } | ||
2820 | |||
2821 | const std::string& LLAppViewer::getHelperURI() const | ||
2822 | { | ||
2823 | if (gHelperURI.empty()) | ||
2824 | { | ||
2825 | // not specified on the command line, use value from table | ||
2826 | gHelperURI = gGridInfo[gGridChoice].mHelperURI; | ||
2827 | } | ||
2828 | return gHelperURI; | ||
2829 | } | ||
2830 | |||
2831 | void LLAppViewer::addLoginURI(const std::string& uri) | ||
2832 | { | ||
2833 | // *NOTE:Mani - login uri trumps the --grid (gGridChoice) setting. | ||
2834 | // Update gGridChoice to reflect the loginURI setting. | ||
2835 | gLoginURIs.push_back(uri); | ||
2836 | |||
2837 | const std::string& top_uri = getLoginURIs()[0]; | ||
2838 | int i = 0; | ||
2839 | for(; i < GRID_INFO_COUNT; ++i) | ||
2840 | { | ||
2841 | if(top_uri == gGridInfo[i].mLoginURI) | ||
2842 | { | ||
2843 | gGridChoice = (EGridInfo)i; | ||
2844 | break; | ||
2845 | } | ||
2846 | } | ||
2847 | |||
2848 | if(GRID_INFO_COUNT == i) | ||
2849 | { | ||
2850 | gGridChoice = GRID_INFO_OTHER; | ||
2851 | } | ||
2852 | } | ||
2853 | |||
2854 | void LLAppViewer::setHelperURI(const std::string& uri) | ||
2855 | { | ||
2856 | gHelperURI = uri; | ||
2857 | } | ||
2858 | |||
2859 | // Callback from a dialog indicating user was logged out. | 2755 | // Callback from a dialog indicating user was logged out. |
2860 | void finish_disconnect(S32 option, void* userdata) | 2756 | void finish_disconnect(S32 option, void* userdata) |
2861 | { | 2757 | { |
@@ -2916,7 +2812,7 @@ void LLAppViewer::badNetworkHandler() | |||
2916 | 2812 | ||
2917 | #if LL_WINDOWS | 2813 | #if LL_WINDOWS |
2918 | // Generates the minidump. | 2814 | // Generates the minidump. |
2919 | LLWinDebug::handleException(NULL); | 2815 | LLWinDebug::generateCrashStacks(NULL); |
2920 | #endif | 2816 | #endif |
2921 | LLAppViewer::handleSyncViewerCrash(); | 2817 | LLAppViewer::handleSyncViewerCrash(); |
2922 | LLAppViewer::handleViewerCrash(); | 2818 | LLAppViewer::handleViewerCrash(); |
@@ -2972,7 +2868,7 @@ void LLAppViewer::loadNameCache() | |||
2972 | 2868 | ||
2973 | // Try to load from the legacy format. This should go away after a | 2869 | // Try to load from the legacy format. This should go away after a |
2974 | // while. Phoenix 2008-01-30 | 2870 | // while. Phoenix 2008-01-30 |
2975 | FILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "r"); // Flawfinder: ignore | 2871 | LLFILE* name_cache_fp = LLFile::fopen(name_cache.c_str(), "r"); // Flawfinder: ignore |
2976 | if (name_cache_fp) | 2872 | if (name_cache_fp) |
2977 | { | 2873 | { |
2978 | gCacheName->importFile(name_cache_fp); | 2874 | gCacheName->importFile(name_cache_fp); |
@@ -2993,15 +2889,6 @@ void LLAppViewer::saveNameCache() | |||
2993 | } | 2889 | } |
2994 | } | 2890 | } |
2995 | 2891 | ||
2996 | bool LLAppViewer::isInProductionGrid() | ||
2997 | { | ||
2998 | // *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice, | ||
2999 | // but it seems that loginURI trumps that. | ||
3000 | const std::string& loginURI = getLoginURIs()[0]; | ||
3001 | return (loginURI == gGridInfo[GRID_INFO_AGNI].mLoginURI); | ||
3002 | } | ||
3003 | |||
3004 | |||
3005 | /*! @brief This class is an LLFrameTimer that can be created with | 2892 | /*! @brief This class is an LLFrameTimer that can be created with |
3006 | an elapsed time that starts counting up from the given value | 2893 | an elapsed time that starts counting up from the given value |
3007 | rather than 0.0. | 2894 | rather than 0.0. |
@@ -3694,3 +3581,19 @@ void LLAppViewer::forceErrorSoftwareException() | |||
3694 | // *FIX: Any way to insure it won't be handled? | 3581 | // *FIX: Any way to insure it won't be handled? |
3695 | throw; | 3582 | throw; |
3696 | } | 3583 | } |
3584 | |||
3585 | void LLAppViewer::startMainloopTimeout(F32 secs) | ||
3586 | { | ||
3587 | if(secs < 0.0f) | ||
3588 | { | ||
3589 | secs = gSavedSettings.getF32("MainloopTimeoutDefault"); | ||
3590 | } | ||
3591 | |||
3592 | mMainloopTimeout->setTimeout(secs); | ||
3593 | mMainloopTimeout->start(); | ||
3594 | } | ||
3595 | |||
3596 | void LLAppViewer::stopMainloopTimeout() | ||
3597 | { | ||
3598 | mMainloopTimeout->stop(); | ||
3599 | } | ||