diff options
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 285 |
1 files changed, 179 insertions, 106 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 84a5ecd..bb1982f 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; |
@@ -1664,6 +1689,11 @@ bool idle_startup() | |||
1664 | LLFloaterActiveSpeakers::showInstance(); | 1689 | LLFloaterActiveSpeakers::showInstance(); |
1665 | } | 1690 | } |
1666 | 1691 | ||
1692 | if (gSavedSettings.getBOOL("BeaconAlwaysOn")) | ||
1693 | { | ||
1694 | LLFloaterBeacons::showInstance(); | ||
1695 | } | ||
1696 | |||
1667 | if (!gNoRender) | 1697 | if (!gNoRender) |
1668 | { | 1698 | { |
1669 | // Move the progress view in front of the UI | 1699 | // Move the progress view in front of the UI |
@@ -2465,7 +2495,7 @@ bool idle_startup() | |||
2465 | gDebugView->mFastTimerView->setVisible(TRUE); | 2495 | gDebugView->mFastTimerView->setVisible(TRUE); |
2466 | #endif | 2496 | #endif |
2467 | 2497 | ||
2468 | LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); | 2498 | LLAppViewer::instance()->handleLoginComplete(); |
2469 | 2499 | ||
2470 | return TRUE; | 2500 | return TRUE; |
2471 | } | 2501 | } |
@@ -2781,7 +2811,6 @@ void update_app(BOOL mandatory, const std::string& auth_msg) | |||
2781 | 2811 | ||
2782 | void update_dialog_callback(S32 option, void *userdata) | 2812 | void update_dialog_callback(S32 option, void *userdata) |
2783 | { | 2813 | { |
2784 | std::string update_exe_path; | ||
2785 | bool mandatory = userdata != NULL; | 2814 | bool mandatory = userdata != NULL; |
2786 | 2815 | ||
2787 | #if !LL_RELEASE_FOR_DOWNLOAD | 2816 | #if !LL_RELEASE_FOR_DOWNLOAD |
@@ -2824,29 +2853,41 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2824 | // *TODO constantize this guy | 2853 | // *TODO constantize this guy |
2825 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2854 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2826 | 2855 | ||
2856 | if(LLAppViewer::sUpdaterInfo) | ||
2857 | { | ||
2858 | delete LLAppViewer::sUpdaterInfo ; | ||
2859 | } | ||
2860 | LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ; | ||
2861 | |||
2827 | #if LL_WINDOWS | 2862 | #if LL_WINDOWS |
2828 | update_exe_path = gDirUtilp->getTempFilename(); | 2863 | LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename(); |
2829 | if (update_exe_path.empty()) | 2864 | if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty()) |
2830 | { | 2865 | { |
2866 | delete LLAppViewer::sUpdaterInfo ; | ||
2867 | LLAppViewer::sUpdaterInfo = NULL ; | ||
2868 | |||
2831 | // We're hosed, bail | 2869 | // We're hosed, bail |
2832 | LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; | 2870 | LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; |
2833 | LLAppViewer::instance()->forceQuit(); | 2871 | LLAppViewer::instance()->forceQuit(); |
2834 | return; | 2872 | return; |
2835 | } | 2873 | } |
2836 | 2874 | ||
2837 | update_exe_path += ".exe"; | 2875 | LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; |
2838 | 2876 | ||
2839 | std::string updater_source = gDirUtilp->getAppRODataDir(); | 2877 | std::string updater_source = gDirUtilp->getAppRODataDir(); |
2840 | updater_source += gDirUtilp->getDirDelimiter(); | 2878 | updater_source += gDirUtilp->getDirDelimiter(); |
2841 | updater_source += "updater.exe"; | 2879 | updater_source += "updater.exe"; |
2842 | 2880 | ||
2843 | LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source | 2881 | LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source |
2844 | << " dest: " << update_exe_path | 2882 | << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath |
2845 | << LL_ENDL; | 2883 | << LL_ENDL; |
2846 | 2884 | ||
2847 | 2885 | ||
2848 | if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) | 2886 | if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE)) |
2849 | { | 2887 | { |
2888 | delete LLAppViewer::sUpdaterInfo ; | ||
2889 | LLAppViewer::sUpdaterInfo = NULL ; | ||
2890 | |||
2850 | LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; | 2891 | LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; |
2851 | LLAppViewer::instance()->forceQuit(); | 2892 | LLAppViewer::instance()->forceQuit(); |
2852 | return; | 2893 | return; |
@@ -2859,41 +2900,13 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2859 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); | 2900 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); |
2860 | }; | 2901 | }; |
2861 | 2902 | ||
2862 | std::ostringstream params; | 2903 | 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 | 2904 | ||
2888 | LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << " " << params.str() << LL_ENDL; | 2905 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL; |
2889 | 2906 | ||
2890 | //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. | 2907 | //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 | 2908 | LLAppViewer::instance()->removeMarkerFile(); // In case updater fails |
2892 | 2909 | ||
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 | 2910 | #elif LL_DARWIN |
2898 | // if a sim name was passed in via command line parameter (typically through a SLURL) | 2911 | // if a sim name was passed in via command line parameter (typically through a SLURL) |
2899 | if ( LLURLSimString::sInstance.mSimString.length() ) | 2912 | if ( LLURLSimString::sInstance.mSimString.length() ) |
@@ -2902,19 +2915,19 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2902 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); | 2915 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); |
2903 | }; | 2916 | }; |
2904 | 2917 | ||
2905 | update_exe_path = "'"; | 2918 | LLAppViewer::sUpdaterInfo->mUpdateExePath = "'"; |
2906 | update_exe_path += gDirUtilp->getAppRODataDir(); | 2919 | LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir(); |
2907 | update_exe_path += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; | 2920 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; |
2908 | update_exe_path += update_url.asString(); | 2921 | LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString(); |
2909 | update_exe_path += "\" -name \""; | 2922 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \""; |
2910 | update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); | 2923 | LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle(); |
2911 | update_exe_path += "\" &"; | 2924 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &"; |
2912 | 2925 | ||
2913 | LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << LL_ENDL; | 2926 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; |
2914 | 2927 | ||
2915 | // Run the auto-updater. | 2928 | // Run the auto-updater. |
2916 | system(update_exe_path.c_str()); /* Flawfinder: ignore */ | 2929 | system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ |
2917 | 2930 | ||
2918 | #elif LL_LINUX | 2931 | #elif LL_LINUX |
2919 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 2932 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
2920 | "Please download the latest version from www.secondlife.com.", | 2933 | "Please download the latest version from www.secondlife.com.", |
@@ -3570,7 +3583,7 @@ void init_stat_view() | |||
3570 | stat_barp->mDisplayBar = FALSE; | 3583 | stat_barp->mDisplayBar = FALSE; |
3571 | stat_barp->mDisplayMean = FALSE; | 3584 | stat_barp->mDisplayMean = FALSE; |
3572 | 3585 | ||
3573 | stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); | 3586 | stat_barp = sim_time_viewp->addStat("Physics Time", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); |
3574 | stat_barp->setUnitLabel("ms"); | 3587 | stat_barp->setUnitLabel("ms"); |
3575 | stat_barp->mPrecision = 1; | 3588 | stat_barp->mPrecision = 1; |
3576 | stat_barp->mMinBar = 0.f; | 3589 | stat_barp->mMinBar = 0.f; |
@@ -3581,45 +3594,7 @@ void init_stat_view() | |||
3581 | stat_barp->mDisplayBar = FALSE; | 3594 | stat_barp->mDisplayBar = FALSE; |
3582 | stat_barp->mDisplayMean = FALSE; | 3595 | stat_barp->mDisplayMean = FALSE; |
3583 | 3596 | ||
3584 | LLStatView *physics_time_viewp; | 3597 | 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"); | 3598 | stat_barp->setUnitLabel("ms"); |
3624 | stat_barp->mPrecision = 1; | 3599 | stat_barp->mPrecision = 1; |
3625 | stat_barp->mMinBar = 0.f; | 3600 | stat_barp->mMinBar = 0.f; |
@@ -3663,6 +3638,79 @@ void init_stat_view() | |||
3663 | stat_barp->mDisplayBar = FALSE; | 3638 | stat_barp->mDisplayBar = FALSE; |
3664 | stat_barp->mDisplayMean = FALSE; | 3639 | stat_barp->mDisplayMean = FALSE; |
3665 | 3640 | ||
3641 | stat_barp = sim_time_viewp->addStat("Spare Time", &(LLViewerStats::getInstance()->mSimSpareMsec)); | ||
3642 | stat_barp->setUnitLabel("ms"); | ||
3643 | stat_barp->mPrecision = 1; | ||
3644 | stat_barp->mMinBar = 0.f; | ||
3645 | stat_barp->mMaxBar = 40.f; | ||
3646 | stat_barp->mTickSpacing = 10.f; | ||
3647 | stat_barp->mLabelSpacing = 20.f; | ||
3648 | stat_barp->mPerSec = FALSE; | ||
3649 | stat_barp->mDisplayBar = FALSE; | ||
3650 | stat_barp->mDisplayMean = FALSE; | ||
3651 | |||
3652 | |||
3653 | // 2nd level time blocks under 'Details' second | ||
3654 | LLStatView *detailed_time_viewp; | ||
3655 | detailed_time_viewp = new LLStatView("sim perf view", "Time Details (ms)", "", rect); | ||
3656 | sim_time_viewp->addChildAtEnd(detailed_time_viewp); | ||
3657 | { | ||
3658 | stat_barp = detailed_time_viewp->addStat(" Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec)); | ||
3659 | stat_barp->setUnitLabel("ms"); | ||
3660 | stat_barp->mPrecision = 1; | ||
3661 | stat_barp->mMinBar = 0.f; | ||
3662 | stat_barp->mMaxBar = 40.f; | ||
3663 | stat_barp->mTickSpacing = 10.f; | ||
3664 | stat_barp->mLabelSpacing = 20.f; | ||
3665 | stat_barp->mPerSec = FALSE; | ||
3666 | stat_barp->mDisplayBar = FALSE; | ||
3667 | stat_barp->mDisplayMean = FALSE; | ||
3668 | |||
3669 | stat_barp = detailed_time_viewp->addStat(" Update Physics Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec)); | ||
3670 | stat_barp->setUnitLabel("ms"); | ||
3671 | stat_barp->mPrecision = 1; | ||
3672 | stat_barp->mMinBar = 0.f; | ||
3673 | stat_barp->mMaxBar = 40.f; | ||
3674 | stat_barp->mTickSpacing = 10.f; | ||
3675 | stat_barp->mLabelSpacing = 20.f; | ||
3676 | stat_barp->mPerSec = FALSE; | ||
3677 | stat_barp->mDisplayBar = FALSE; | ||
3678 | stat_barp->mDisplayMean = FALSE; | ||
3679 | |||
3680 | stat_barp = detailed_time_viewp->addStat(" Physics Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec)); | ||
3681 | stat_barp->setUnitLabel("ms"); | ||
3682 | stat_barp->mPrecision = 1; | ||
3683 | stat_barp->mMinBar = 0.f; | ||
3684 | stat_barp->mMaxBar = 40.f; | ||
3685 | stat_barp->mTickSpacing = 10.f; | ||
3686 | stat_barp->mLabelSpacing = 20.f; | ||
3687 | stat_barp->mPerSec = FALSE; | ||
3688 | stat_barp->mDisplayBar = FALSE; | ||
3689 | stat_barp->mDisplayMean = FALSE; | ||
3690 | |||
3691 | stat_barp = detailed_time_viewp->addStat(" Sleep Time", &(LLViewerStats::getInstance()->mSimSleepMsec)); | ||
3692 | stat_barp->setUnitLabel("ms"); | ||
3693 | stat_barp->mPrecision = 1; | ||
3694 | stat_barp->mMinBar = 0.f; | ||
3695 | stat_barp->mMaxBar = 40.f; | ||
3696 | stat_barp->mTickSpacing = 10.f; | ||
3697 | stat_barp->mLabelSpacing = 20.f; | ||
3698 | stat_barp->mPerSec = FALSE; | ||
3699 | stat_barp->mDisplayBar = FALSE; | ||
3700 | stat_barp->mDisplayMean = FALSE; | ||
3701 | |||
3702 | stat_barp = detailed_time_viewp->addStat(" Pump IO", &(LLViewerStats::getInstance()->mSimPumpIOMsec)); | ||
3703 | stat_barp->setUnitLabel("ms"); | ||
3704 | stat_barp->mPrecision = 1; | ||
3705 | stat_barp->mMinBar = 0.f; | ||
3706 | stat_barp->mMaxBar = 40.f; | ||
3707 | stat_barp->mTickSpacing = 10.f; | ||
3708 | stat_barp->mLabelSpacing = 20.f; | ||
3709 | stat_barp->mPerSec = FALSE; | ||
3710 | stat_barp->mDisplayBar = FALSE; | ||
3711 | stat_barp->mDisplayMean = FALSE; | ||
3712 | } | ||
3713 | |||
3666 | LLRect r = gDebugView->mFloaterStatsp->getRect(); | 3714 | LLRect r = gDebugView->mFloaterStatsp->getRect(); |
3667 | 3715 | ||
3668 | // Reshape based on the parameters we set. | 3716 | // Reshape based on the parameters we set. |
@@ -3924,3 +3972,28 @@ void login_alert_done(S32 option, void* user_data) | |||
3924 | LLPanelLogin::giveFocus(); | 3972 | LLPanelLogin::giveFocus(); |
3925 | } | 3973 | } |
3926 | 3974 | ||
3975 | |||
3976 | void apply_udp_blacklist(const std::string& csv) | ||
3977 | { | ||
3978 | |||
3979 | std::string::size_type start = 0; | ||
3980 | std::string::size_type comma = 0; | ||
3981 | do | ||
3982 | { | ||
3983 | comma = csv.find(",", start); | ||
3984 | if (comma == std::string::npos) | ||
3985 | { | ||
3986 | comma = csv.length(); | ||
3987 | } | ||
3988 | std::string item(csv, start, comma-start); | ||
3989 | |||
3990 | lldebugs << "udp_blacklist " << item << llendl; | ||
3991 | gMessageSystem->banUdpMessage(item); | ||
3992 | |||
3993 | start = comma + 1; | ||
3994 | |||
3995 | } | ||
3996 | while(comma < csv.length()); | ||
3997 | |||
3998 | } | ||
3999 | |||