diff options
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 295 |
1 files changed, 185 insertions, 110 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 84a5ecd..aca3cac 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2004&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2004&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2004-2008, Linden Research, Inc. | 7 | * Copyright (c) 2004-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -93,6 +93,7 @@ | |||
93 | #include "llfeaturemanager.h" | 93 | #include "llfeaturemanager.h" |
94 | #include "llfirstuse.h" | 94 | #include "llfirstuse.h" |
95 | #include "llfloateractivespeakers.h" | 95 | #include "llfloateractivespeakers.h" |
96 | #include "llfloaterbeacons.h" | ||
96 | #include "llfloatercamera.h" | 97 | #include "llfloatercamera.h" |
97 | #include "llfloaterchat.h" | 98 | #include "llfloaterchat.h" |
98 | #include "llfloatergesture.h" | 99 | #include "llfloatergesture.h" |
@@ -248,6 +249,7 @@ void callback_choose_gender(S32 option, void* userdata); | |||
248 | void init_start_screen(S32 location_id); | 249 | void init_start_screen(S32 location_id); |
249 | void release_start_screen(); | 250 | void release_start_screen(); |
250 | void reset_login(); | 251 | void reset_login(); |
252 | void apply_udp_blacklist(const std::string& csv); | ||
251 | 253 | ||
252 | void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) | 254 | void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) |
253 | { | 255 | { |
@@ -876,6 +878,20 @@ bool idle_startup() | |||
876 | LLFile::mkdir(gDirUtilp->getChatLogsDir()); | 878 | LLFile::mkdir(gDirUtilp->getChatLogsDir()); |
877 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); | 879 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); |
878 | 880 | ||
881 | //good as place as any to create user windlight directories | ||
882 | std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); | ||
883 | LLFile::mkdir(user_windlight_path_name.c_str()); | ||
884 | |||
885 | std::string user_windlight_skies_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); | ||
886 | LLFile::mkdir(user_windlight_skies_path_name.c_str()); | ||
887 | |||
888 | std::string user_windlight_water_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); | ||
889 | LLFile::mkdir(user_windlight_water_path_name.c_str()); | ||
890 | |||
891 | std::string user_windlight_days_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/days", "")); | ||
892 | LLFile::mkdir(user_windlight_days_path_name.c_str()); | ||
893 | |||
894 | |||
879 | if (show_connect_box) | 895 | if (show_connect_box) |
880 | { | 896 | { |
881 | if ( LLPanelLogin::isGridComboDirty() ) | 897 | if ( LLPanelLogin::isGridComboDirty() ) |
@@ -1128,6 +1144,7 @@ bool idle_startup() | |||
1128 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; | 1144 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; |
1129 | std::ostringstream emsg; | 1145 | std::ostringstream emsg; |
1130 | bool quit = false; | 1146 | bool quit = false; |
1147 | bool update = false; | ||
1131 | std::string login_response; | 1148 | std::string login_response; |
1132 | std::string reason_response; | 1149 | std::string reason_response; |
1133 | std::string message_response; | 1150 | std::string message_response; |
@@ -1171,11 +1188,7 @@ bool idle_startup() | |||
1171 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); | 1188 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); |
1172 | message_response = LLUserAuth::getInstance()->getResponse("message"); | 1189 | message_response = LLUserAuth::getInstance()->getResponse("message"); |
1173 | 1190 | ||
1174 | if (gHideLinks && reason_response == "disabled") | 1191 | if (!message_response.empty()) |
1175 | { | ||
1176 | emsg << gDisabledMessage; | ||
1177 | } | ||
1178 | else if (!message_response.empty()) | ||
1179 | { | 1192 | { |
1180 | // XUI: fix translation for strings returned during login | 1193 | // XUI: fix translation for strings returned during login |
1181 | // We need a generic table for translations | 1194 | // We need a generic table for translations |
@@ -1233,16 +1246,7 @@ bool idle_startup() | |||
1233 | if(reason_response == "update") | 1246 | if(reason_response == "update") |
1234 | { | 1247 | { |
1235 | auth_message = LLUserAuth::getInstance()->getResponse("message"); | 1248 | auth_message = LLUserAuth::getInstance()->getResponse("message"); |
1236 | if (show_connect_box) | 1249 | update = true; |
1237 | { | ||
1238 | update_app(TRUE, auth_message); | ||
1239 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1240 | return false; | ||
1241 | } | ||
1242 | else | ||
1243 | { | ||
1244 | quit = true; | ||
1245 | } | ||
1246 | } | 1250 | } |
1247 | if(reason_response == "optional") | 1251 | if(reason_response == "optional") |
1248 | { | 1252 | { |
@@ -1280,6 +1284,21 @@ bool idle_startup() | |||
1280 | break; | 1284 | break; |
1281 | } | 1285 | } |
1282 | 1286 | ||
1287 | if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate")) | ||
1288 | { | ||
1289 | gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); | ||
1290 | if (show_connect_box) | ||
1291 | { | ||
1292 | update_app(TRUE, auth_message); | ||
1293 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1294 | return false; | ||
1295 | } | ||
1296 | else | ||
1297 | { | ||
1298 | quit = true; | ||
1299 | } | ||
1300 | } | ||
1301 | |||
1283 | // Version update and we're not showing the dialog | 1302 | // Version update and we're not showing the dialog |
1284 | if(quit) | 1303 | if(quit) |
1285 | { | 1304 | { |
@@ -1290,8 +1309,14 @@ bool idle_startup() | |||
1290 | 1309 | ||
1291 | if(successful_login) | 1310 | if(successful_login) |
1292 | { | 1311 | { |
1293 | // unpack login data needed by the application | ||
1294 | std::string text; | 1312 | std::string text; |
1313 | text = LLUserAuth::getInstance()->getResponse("udp_blacklist"); | ||
1314 | if(!text.empty()) | ||
1315 | { | ||
1316 | apply_udp_blacklist(text); | ||
1317 | } | ||
1318 | |||
1319 | // unpack login data needed by the application | ||
1295 | text = LLUserAuth::getInstance()->getResponse("agent_id"); | 1320 | text = LLUserAuth::getInstance()->getResponse("agent_id"); |
1296 | if(!text.empty()) gAgentID.set(text); | 1321 | if(!text.empty()) gAgentID.set(text); |
1297 | gDebugInfo["AgentID"] = text; | 1322 | gDebugInfo["AgentID"] = text; |
@@ -1645,11 +1670,14 @@ bool idle_startup() | |||
1645 | gLoginMenuBarView->setVisible( FALSE ); | 1670 | gLoginMenuBarView->setVisible( FALSE ); |
1646 | gLoginMenuBarView->setEnabled( FALSE ); | 1671 | gLoginMenuBarView->setEnabled( FALSE ); |
1647 | 1672 | ||
1648 | gFloaterMap->setVisible( gSavedSettings.getBOOL("ShowMiniMap") ); | ||
1649 | |||
1650 | LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0); | 1673 | LLRect window(0, gViewerWindow->getWindowHeight(), gViewerWindow->getWindowWidth(), 0); |
1651 | gViewerWindow->adjustControlRectanglesForFirstUse(window); | 1674 | gViewerWindow->adjustControlRectanglesForFirstUse(window); |
1652 | 1675 | ||
1676 | if(gSavedSettings.getBOOL("ShowMiniMap")) | ||
1677 | { | ||
1678 | LLFloaterMap::showInstance(); | ||
1679 | } | ||
1680 | |||
1653 | if (gSavedSettings.getBOOL("ShowCameraControls")) | 1681 | if (gSavedSettings.getBOOL("ShowCameraControls")) |
1654 | { | 1682 | { |
1655 | LLFloaterCamera::showInstance(); | 1683 | LLFloaterCamera::showInstance(); |
@@ -1664,6 +1692,11 @@ bool idle_startup() | |||
1664 | LLFloaterActiveSpeakers::showInstance(); | 1692 | LLFloaterActiveSpeakers::showInstance(); |
1665 | } | 1693 | } |
1666 | 1694 | ||
1695 | if (gSavedSettings.getBOOL("BeaconsEnabled")) | ||
1696 | { | ||
1697 | LLFloaterBeacons::showInstance(); | ||
1698 | } | ||
1699 | |||
1667 | if (!gNoRender) | 1700 | if (!gNoRender) |
1668 | { | 1701 | { |
1669 | // Move the progress view in front of the UI | 1702 | // Move the progress view in front of the UI |
@@ -2465,7 +2498,7 @@ bool idle_startup() | |||
2465 | gDebugView->mFastTimerView->setVisible(TRUE); | 2498 | gDebugView->mFastTimerView->setVisible(TRUE); |
2466 | #endif | 2499 | #endif |
2467 | 2500 | ||
2468 | LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); | 2501 | LLAppViewer::instance()->handleLoginComplete(); |
2469 | 2502 | ||
2470 | return TRUE; | 2503 | return TRUE; |
2471 | } | 2504 | } |
@@ -2781,7 +2814,6 @@ void update_app(BOOL mandatory, const std::string& auth_msg) | |||
2781 | 2814 | ||
2782 | void update_dialog_callback(S32 option, void *userdata) | 2815 | void update_dialog_callback(S32 option, void *userdata) |
2783 | { | 2816 | { |
2784 | std::string update_exe_path; | ||
2785 | bool mandatory = userdata != NULL; | 2817 | bool mandatory = userdata != NULL; |
2786 | 2818 | ||
2787 | #if !LL_RELEASE_FOR_DOWNLOAD | 2819 | #if !LL_RELEASE_FOR_DOWNLOAD |
@@ -2824,29 +2856,41 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2824 | // *TODO constantize this guy | 2856 | // *TODO constantize this guy |
2825 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2857 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2826 | 2858 | ||
2859 | if(LLAppViewer::sUpdaterInfo) | ||
2860 | { | ||
2861 | delete LLAppViewer::sUpdaterInfo ; | ||
2862 | } | ||
2863 | LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ; | ||
2864 | |||
2827 | #if LL_WINDOWS | 2865 | #if LL_WINDOWS |
2828 | update_exe_path = gDirUtilp->getTempFilename(); | 2866 | LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename(); |
2829 | if (update_exe_path.empty()) | 2867 | if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty()) |
2830 | { | 2868 | { |
2869 | delete LLAppViewer::sUpdaterInfo ; | ||
2870 | LLAppViewer::sUpdaterInfo = NULL ; | ||
2871 | |||
2831 | // We're hosed, bail | 2872 | // We're hosed, bail |
2832 | LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; | 2873 | LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; |
2833 | LLAppViewer::instance()->forceQuit(); | 2874 | LLAppViewer::instance()->forceQuit(); |
2834 | return; | 2875 | return; |
2835 | } | 2876 | } |
2836 | 2877 | ||
2837 | update_exe_path += ".exe"; | 2878 | LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; |
2838 | 2879 | ||
2839 | std::string updater_source = gDirUtilp->getAppRODataDir(); | 2880 | std::string updater_source = gDirUtilp->getAppRODataDir(); |
2840 | updater_source += gDirUtilp->getDirDelimiter(); | 2881 | updater_source += gDirUtilp->getDirDelimiter(); |
2841 | updater_source += "updater.exe"; | 2882 | updater_source += "updater.exe"; |
2842 | 2883 | ||
2843 | LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source | 2884 | LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source |
2844 | << " dest: " << update_exe_path | 2885 | << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath |
2845 | << LL_ENDL; | 2886 | << LL_ENDL; |
2846 | 2887 | ||
2847 | 2888 | ||
2848 | if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) | 2889 | if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE)) |
2849 | { | 2890 | { |
2891 | delete LLAppViewer::sUpdaterInfo ; | ||
2892 | LLAppViewer::sUpdaterInfo = NULL ; | ||
2893 | |||
2850 | LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; | 2894 | LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; |
2851 | LLAppViewer::instance()->forceQuit(); | 2895 | LLAppViewer::instance()->forceQuit(); |
2852 | return; | 2896 | return; |
@@ -2859,41 +2903,13 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2859 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); | 2903 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); |
2860 | }; | 2904 | }; |
2861 | 2905 | ||
2862 | std::ostringstream params; | 2906 | LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\""; |
2863 | params << "-url \"" << update_url.asString() << "\""; | ||
2864 | if (gHideLinks) | ||
2865 | { | ||
2866 | // Figure out the program name. | ||
2867 | const std::string& data_dir = gDirUtilp->getAppRODataDir(); | ||
2868 | // Roll back from the end, stopping at the first '\' | ||
2869 | const char* program_name = data_dir.c_str() + data_dir.size(); /* Flawfinder: ignore */ | ||
2870 | while ( (data_dir != --program_name) && | ||
2871 | *(program_name) != '\\'); | ||
2872 | |||
2873 | if ( *(program_name) == '\\') | ||
2874 | { | ||
2875 | // We found a '\'. | ||
2876 | program_name++; | ||
2877 | } | ||
2878 | else | ||
2879 | { | ||
2880 | // Oops. | ||
2881 | program_name = "SecondLife"; | ||
2882 | } | ||
2883 | |||
2884 | params << " -silent -name \"" << LLAppViewer::instance()->getSecondLifeTitle() << "\""; | ||
2885 | params << " -program \"" << program_name << "\""; | ||
2886 | } | ||
2887 | 2907 | ||
2888 | LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << " " << params.str() << LL_ENDL; | 2908 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL; |
2889 | 2909 | ||
2890 | //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. | 2910 | //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. |
2891 | LLAppViewer::instance()->removeMarkerFile(); // In case updater fails | 2911 | LLAppViewer::instance()->removeMarkerFile(); // In case updater fails |
2892 | 2912 | ||
2893 | // Use spawn() to run asynchronously | ||
2894 | int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); | ||
2895 | LL_DEBUGS("AppInit") << "Spawn returned " << retval << LL_ENDL; | ||
2896 | |||
2897 | #elif LL_DARWIN | 2913 | #elif LL_DARWIN |
2898 | // if a sim name was passed in via command line parameter (typically through a SLURL) | 2914 | // if a sim name was passed in via command line parameter (typically through a SLURL) |
2899 | if ( LLURLSimString::sInstance.mSimString.length() ) | 2915 | if ( LLURLSimString::sInstance.mSimString.length() ) |
@@ -2902,19 +2918,19 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2902 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); | 2918 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); |
2903 | }; | 2919 | }; |
2904 | 2920 | ||
2905 | update_exe_path = "'"; | 2921 | LLAppViewer::sUpdaterInfo->mUpdateExePath = "'"; |
2906 | update_exe_path += gDirUtilp->getAppRODataDir(); | 2922 | LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir(); |
2907 | update_exe_path += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; | 2923 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; |
2908 | update_exe_path += update_url.asString(); | 2924 | LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString(); |
2909 | update_exe_path += "\" -name \""; | 2925 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \""; |
2910 | update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); | 2926 | LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle(); |
2911 | update_exe_path += "\" &"; | 2927 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &"; |
2912 | 2928 | ||
2913 | LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << LL_ENDL; | 2929 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; |
2914 | 2930 | ||
2915 | // Run the auto-updater. | 2931 | // Run the auto-updater. |
2916 | system(update_exe_path.c_str()); /* Flawfinder: ignore */ | 2932 | system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ |
2917 | 2933 | ||
2918 | #elif LL_LINUX | 2934 | #elif LL_LINUX |
2919 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 2935 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
2920 | "Please download the latest version from www.secondlife.com.", | 2936 | "Please download the latest version from www.secondlife.com.", |
@@ -3570,7 +3586,7 @@ void init_stat_view() | |||
3570 | stat_barp->mDisplayBar = FALSE; | 3586 | stat_barp->mDisplayBar = FALSE; |
3571 | stat_barp->mDisplayMean = FALSE; | 3587 | stat_barp->mDisplayMean = FALSE; |
3572 | 3588 | ||
3573 | stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); | 3589 | stat_barp = sim_time_viewp->addStat("Physics Time", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); |
3574 | stat_barp->setUnitLabel("ms"); | 3590 | stat_barp->setUnitLabel("ms"); |
3575 | stat_barp->mPrecision = 1; | 3591 | stat_barp->mPrecision = 1; |
3576 | stat_barp->mMinBar = 0.f; | 3592 | stat_barp->mMinBar = 0.f; |
@@ -3581,45 +3597,7 @@ void init_stat_view() | |||
3581 | stat_barp->mDisplayBar = FALSE; | 3597 | stat_barp->mDisplayBar = FALSE; |
3582 | stat_barp->mDisplayMean = FALSE; | 3598 | stat_barp->mDisplayMean = FALSE; |
3583 | 3599 | ||
3584 | LLStatView *physics_time_viewp; | 3600 | stat_barp = sim_time_viewp->addStat("Simulation Time", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); |
3585 | physics_time_viewp = new LLStatView("physics perf view", "Physics Details (ms)", "", rect); | ||
3586 | sim_time_viewp->addChildAtEnd(physics_time_viewp); | ||
3587 | { | ||
3588 | stat_barp = physics_time_viewp->addStat("Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec)); | ||
3589 | stat_barp->setUnitLabel("ms"); | ||
3590 | stat_barp->mPrecision = 1; | ||
3591 | stat_barp->mMinBar = 0.f; | ||
3592 | stat_barp->mMaxBar = 40.f; | ||
3593 | stat_barp->mTickSpacing = 10.f; | ||
3594 | stat_barp->mLabelSpacing = 20.f; | ||
3595 | stat_barp->mPerSec = FALSE; | ||
3596 | stat_barp->mDisplayBar = FALSE; | ||
3597 | stat_barp->mDisplayMean = FALSE; | ||
3598 | |||
3599 | stat_barp = physics_time_viewp->addStat("Update Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec)); | ||
3600 | stat_barp->setUnitLabel("ms"); | ||
3601 | stat_barp->mPrecision = 1; | ||
3602 | stat_barp->mMinBar = 0.f; | ||
3603 | stat_barp->mMaxBar = 40.f; | ||
3604 | stat_barp->mTickSpacing = 10.f; | ||
3605 | stat_barp->mLabelSpacing = 20.f; | ||
3606 | stat_barp->mPerSec = FALSE; | ||
3607 | stat_barp->mDisplayBar = FALSE; | ||
3608 | stat_barp->mDisplayMean = FALSE; | ||
3609 | |||
3610 | stat_barp = physics_time_viewp->addStat("Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec)); | ||
3611 | stat_barp->setUnitLabel("ms"); | ||
3612 | stat_barp->mPrecision = 1; | ||
3613 | stat_barp->mMinBar = 0.f; | ||
3614 | stat_barp->mMaxBar = 40.f; | ||
3615 | stat_barp->mTickSpacing = 10.f; | ||
3616 | stat_barp->mLabelSpacing = 20.f; | ||
3617 | stat_barp->mPerSec = FALSE; | ||
3618 | stat_barp->mDisplayBar = FALSE; | ||
3619 | stat_barp->mDisplayMean = FALSE; | ||
3620 | } | ||
3621 | |||
3622 | stat_barp = sim_time_viewp->addStat("Sim Time (Other)", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); | ||
3623 | stat_barp->setUnitLabel("ms"); | 3601 | stat_barp->setUnitLabel("ms"); |
3624 | stat_barp->mPrecision = 1; | 3602 | stat_barp->mPrecision = 1; |
3625 | stat_barp->mMinBar = 0.f; | 3603 | stat_barp->mMinBar = 0.f; |
@@ -3663,6 +3641,79 @@ void init_stat_view() | |||
3663 | stat_barp->mDisplayBar = FALSE; | 3641 | stat_barp->mDisplayBar = FALSE; |
3664 | stat_barp->mDisplayMean = FALSE; | 3642 | stat_barp->mDisplayMean = FALSE; |
3665 | 3643 | ||
3644 | stat_barp = sim_time_viewp->addStat("Spare Time", &(LLViewerStats::getInstance()->mSimSpareMsec)); | ||
3645 | stat_barp->setUnitLabel("ms"); | ||
3646 | stat_barp->mPrecision = 1; | ||
3647 | stat_barp->mMinBar = 0.f; | ||
3648 | stat_barp->mMaxBar = 40.f; | ||
3649 | stat_barp->mTickSpacing = 10.f; | ||
3650 | stat_barp->mLabelSpacing = 20.f; | ||
3651 | stat_barp->mPerSec = FALSE; | ||
3652 | stat_barp->mDisplayBar = FALSE; | ||
3653 | stat_barp->mDisplayMean = FALSE; | ||
3654 | |||
3655 | |||
3656 | // 2nd level time blocks under 'Details' second | ||
3657 | LLStatView *detailed_time_viewp; | ||
3658 | detailed_time_viewp = new LLStatView("sim perf view", "Time Details (ms)", "", rect); | ||
3659 | sim_time_viewp->addChildAtEnd(detailed_time_viewp); | ||
3660 | { | ||
3661 | stat_barp = detailed_time_viewp->addStat(" Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec)); | ||
3662 | stat_barp->setUnitLabel("ms"); | ||
3663 | stat_barp->mPrecision = 1; | ||
3664 | stat_barp->mMinBar = 0.f; | ||
3665 | stat_barp->mMaxBar = 40.f; | ||
3666 | stat_barp->mTickSpacing = 10.f; | ||
3667 | stat_barp->mLabelSpacing = 20.f; | ||
3668 | stat_barp->mPerSec = FALSE; | ||
3669 | stat_barp->mDisplayBar = FALSE; | ||
3670 | stat_barp->mDisplayMean = FALSE; | ||
3671 | |||
3672 | stat_barp = detailed_time_viewp->addStat(" Update Physics Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec)); | ||
3673 | stat_barp->setUnitLabel("ms"); | ||
3674 | stat_barp->mPrecision = 1; | ||
3675 | stat_barp->mMinBar = 0.f; | ||
3676 | stat_barp->mMaxBar = 40.f; | ||
3677 | stat_barp->mTickSpacing = 10.f; | ||
3678 | stat_barp->mLabelSpacing = 20.f; | ||
3679 | stat_barp->mPerSec = FALSE; | ||
3680 | stat_barp->mDisplayBar = FALSE; | ||
3681 | stat_barp->mDisplayMean = FALSE; | ||
3682 | |||
3683 | stat_barp = detailed_time_viewp->addStat(" Physics Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec)); | ||
3684 | stat_barp->setUnitLabel("ms"); | ||
3685 | stat_barp->mPrecision = 1; | ||
3686 | stat_barp->mMinBar = 0.f; | ||
3687 | stat_barp->mMaxBar = 40.f; | ||
3688 | stat_barp->mTickSpacing = 10.f; | ||
3689 | stat_barp->mLabelSpacing = 20.f; | ||
3690 | stat_barp->mPerSec = FALSE; | ||
3691 | stat_barp->mDisplayBar = FALSE; | ||
3692 | stat_barp->mDisplayMean = FALSE; | ||
3693 | |||
3694 | stat_barp = detailed_time_viewp->addStat(" Sleep Time", &(LLViewerStats::getInstance()->mSimSleepMsec)); | ||
3695 | stat_barp->setUnitLabel("ms"); | ||
3696 | stat_barp->mPrecision = 1; | ||
3697 | stat_barp->mMinBar = 0.f; | ||
3698 | stat_barp->mMaxBar = 40.f; | ||
3699 | stat_barp->mTickSpacing = 10.f; | ||
3700 | stat_barp->mLabelSpacing = 20.f; | ||
3701 | stat_barp->mPerSec = FALSE; | ||
3702 | stat_barp->mDisplayBar = FALSE; | ||
3703 | stat_barp->mDisplayMean = FALSE; | ||
3704 | |||
3705 | stat_barp = detailed_time_viewp->addStat(" Pump IO", &(LLViewerStats::getInstance()->mSimPumpIOMsec)); | ||
3706 | stat_barp->setUnitLabel("ms"); | ||
3707 | stat_barp->mPrecision = 1; | ||
3708 | stat_barp->mMinBar = 0.f; | ||
3709 | stat_barp->mMaxBar = 40.f; | ||
3710 | stat_barp->mTickSpacing = 10.f; | ||
3711 | stat_barp->mLabelSpacing = 20.f; | ||
3712 | stat_barp->mPerSec = FALSE; | ||
3713 | stat_barp->mDisplayBar = FALSE; | ||
3714 | stat_barp->mDisplayMean = FALSE; | ||
3715 | } | ||
3716 | |||
3666 | LLRect r = gDebugView->mFloaterStatsp->getRect(); | 3717 | LLRect r = gDebugView->mFloaterStatsp->getRect(); |
3667 | 3718 | ||
3668 | // Reshape based on the parameters we set. | 3719 | // Reshape based on the parameters we set. |
@@ -3863,8 +3914,7 @@ void reset_login() | |||
3863 | } | 3914 | } |
3864 | 3915 | ||
3865 | // Hide any other stuff | 3916 | // Hide any other stuff |
3866 | if ( gFloaterMap ) | 3917 | LLFloaterMap::hideInstance(); |
3867 | gFloaterMap->setVisible( FALSE ); | ||
3868 | } | 3918 | } |
3869 | 3919 | ||
3870 | //--------------------------------------------------------------------------- | 3920 | //--------------------------------------------------------------------------- |
@@ -3924,3 +3974,28 @@ void login_alert_done(S32 option, void* user_data) | |||
3924 | LLPanelLogin::giveFocus(); | 3974 | LLPanelLogin::giveFocus(); |
3925 | } | 3975 | } |
3926 | 3976 | ||
3977 | |||
3978 | void apply_udp_blacklist(const std::string& csv) | ||
3979 | { | ||
3980 | |||
3981 | std::string::size_type start = 0; | ||
3982 | std::string::size_type comma = 0; | ||
3983 | do | ||
3984 | { | ||
3985 | comma = csv.find(",", start); | ||
3986 | if (comma == std::string::npos) | ||
3987 | { | ||
3988 | comma = csv.length(); | ||
3989 | } | ||
3990 | std::string item(csv, start, comma-start); | ||
3991 | |||
3992 | lldebugs << "udp_blacklist " << item << llendl; | ||
3993 | gMessageSystem->banUdpMessage(item); | ||
3994 | |||
3995 | start = comma + 1; | ||
3996 | |||
3997 | } | ||
3998 | while(comma < csv.length()); | ||
3999 | |||
4000 | } | ||
4001 | |||