diff options
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 289 |
1 files changed, 184 insertions, 105 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 0978fbb..2ce111f 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -89,6 +89,7 @@ | |||
89 | #include "llfeaturemanager.h" | 89 | #include "llfeaturemanager.h" |
90 | #include "llfirstuse.h" | 90 | #include "llfirstuse.h" |
91 | #include "llfloateractivespeakers.h" | 91 | #include "llfloateractivespeakers.h" |
92 | #include "llfloaterbeacons.h" | ||
92 | #include "llfloatercamera.h" | 93 | #include "llfloatercamera.h" |
93 | #include "llfloaterchat.h" | 94 | #include "llfloaterchat.h" |
94 | #include "llfloatergesture.h" | 95 | #include "llfloatergesture.h" |
@@ -244,6 +245,7 @@ void callback_choose_gender(S32 option, void* userdata); | |||
244 | void init_start_screen(S32 location_id); | 245 | void init_start_screen(S32 location_id); |
245 | void release_start_screen(); | 246 | void release_start_screen(); |
246 | void reset_login(); | 247 | void reset_login(); |
248 | void apply_udp_blacklist(const std::string& csv); | ||
247 | 249 | ||
248 | void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) | 250 | void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) |
249 | { | 251 | { |
@@ -750,6 +752,12 @@ bool idle_startup() | |||
750 | gLoginMenuBarView->setVisible( TRUE ); | 752 | gLoginMenuBarView->setVisible( TRUE ); |
751 | gLoginMenuBarView->setEnabled( TRUE ); | 753 | gLoginMenuBarView->setEnabled( TRUE ); |
752 | 754 | ||
755 | // DEV-16927. The following code removes errant keystrokes that happen while the window is being | ||
756 | // first made visible. | ||
757 | #ifdef _WIN32 | ||
758 | MSG msg; | ||
759 | while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) ); | ||
760 | #endif | ||
753 | timeout.reset(); | 761 | timeout.reset(); |
754 | return FALSE; | 762 | return FALSE; |
755 | } | 763 | } |
@@ -842,6 +850,20 @@ bool idle_startup() | |||
842 | LLFile::mkdir(gDirUtilp->getChatLogsDir()); | 850 | LLFile::mkdir(gDirUtilp->getChatLogsDir()); |
843 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); | 851 | LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); |
844 | 852 | ||
853 | //good as place as any to create user windlight directories | ||
854 | std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); | ||
855 | LLFile::mkdir(user_windlight_path_name.c_str()); | ||
856 | |||
857 | std::string user_windlight_skies_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); | ||
858 | LLFile::mkdir(user_windlight_skies_path_name.c_str()); | ||
859 | |||
860 | std::string user_windlight_water_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); | ||
861 | LLFile::mkdir(user_windlight_water_path_name.c_str()); | ||
862 | |||
863 | std::string user_windlight_days_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/days", "")); | ||
864 | LLFile::mkdir(user_windlight_days_path_name.c_str()); | ||
865 | |||
866 | |||
845 | if (show_connect_box) | 867 | if (show_connect_box) |
846 | { | 868 | { |
847 | if ( LLPanelLogin::isGridComboDirty() ) | 869 | if ( LLPanelLogin::isGridComboDirty() ) |
@@ -1094,6 +1116,7 @@ bool idle_startup() | |||
1094 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; | 1116 | LL_DEBUGS("AppInit") << "STATE_LOGIN_PROCESS_RESPONSE" << LL_ENDL; |
1095 | std::ostringstream emsg; | 1117 | std::ostringstream emsg; |
1096 | bool quit = false; | 1118 | bool quit = false; |
1119 | bool update = false; | ||
1097 | std::string login_response; | 1120 | std::string login_response; |
1098 | std::string reason_response; | 1121 | std::string reason_response; |
1099 | std::string message_response; | 1122 | std::string message_response; |
@@ -1137,11 +1160,7 @@ bool idle_startup() | |||
1137 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); | 1160 | reason_response = LLUserAuth::getInstance()->getResponse("reason"); |
1138 | message_response = LLUserAuth::getInstance()->getResponse("message"); | 1161 | message_response = LLUserAuth::getInstance()->getResponse("message"); |
1139 | 1162 | ||
1140 | if (gHideLinks && reason_response == "disabled") | 1163 | if (!message_response.empty()) |
1141 | { | ||
1142 | emsg << gDisabledMessage; | ||
1143 | } | ||
1144 | else if (!message_response.empty()) | ||
1145 | { | 1164 | { |
1146 | // XUI: fix translation for strings returned during login | 1165 | // XUI: fix translation for strings returned during login |
1147 | // We need a generic table for translations | 1166 | // We need a generic table for translations |
@@ -1199,16 +1218,7 @@ bool idle_startup() | |||
1199 | if(reason_response == "update") | 1218 | if(reason_response == "update") |
1200 | { | 1219 | { |
1201 | auth_message = LLUserAuth::getInstance()->getResponse("message"); | 1220 | auth_message = LLUserAuth::getInstance()->getResponse("message"); |
1202 | if (show_connect_box) | 1221 | update = true; |
1203 | { | ||
1204 | update_app(TRUE, auth_message); | ||
1205 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1206 | return false; | ||
1207 | } | ||
1208 | else | ||
1209 | { | ||
1210 | quit = true; | ||
1211 | } | ||
1212 | } | 1222 | } |
1213 | if(reason_response == "optional") | 1223 | if(reason_response == "optional") |
1214 | { | 1224 | { |
@@ -1246,6 +1256,21 @@ bool idle_startup() | |||
1246 | break; | 1256 | break; |
1247 | } | 1257 | } |
1248 | 1258 | ||
1259 | if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate")) | ||
1260 | { | ||
1261 | gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); | ||
1262 | if (show_connect_box) | ||
1263 | { | ||
1264 | update_app(TRUE, auth_message); | ||
1265 | LLStartUp::setStartupState( STATE_UPDATE_CHECK ); | ||
1266 | return false; | ||
1267 | } | ||
1268 | else | ||
1269 | { | ||
1270 | quit = true; | ||
1271 | } | ||
1272 | } | ||
1273 | |||
1249 | // Version update and we're not showing the dialog | 1274 | // Version update and we're not showing the dialog |
1250 | if(quit) | 1275 | if(quit) |
1251 | { | 1276 | { |
@@ -1256,8 +1281,14 @@ bool idle_startup() | |||
1256 | 1281 | ||
1257 | if(successful_login) | 1282 | if(successful_login) |
1258 | { | 1283 | { |
1259 | // unpack login data needed by the application | ||
1260 | std::string text; | 1284 | std::string text; |
1285 | text = LLUserAuth::getInstance()->getResponse("udp_blacklist"); | ||
1286 | if(!text.empty()) | ||
1287 | { | ||
1288 | apply_udp_blacklist(text); | ||
1289 | } | ||
1290 | |||
1291 | // unpack login data needed by the application | ||
1261 | text = LLUserAuth::getInstance()->getResponse("agent_id"); | 1292 | text = LLUserAuth::getInstance()->getResponse("agent_id"); |
1262 | if(!text.empty()) gAgentID.set(text); | 1293 | if(!text.empty()) gAgentID.set(text); |
1263 | gDebugInfo["AgentID"] = text; | 1294 | gDebugInfo["AgentID"] = text; |
@@ -1630,6 +1661,11 @@ bool idle_startup() | |||
1630 | LLFloaterActiveSpeakers::showInstance(); | 1661 | LLFloaterActiveSpeakers::showInstance(); |
1631 | } | 1662 | } |
1632 | 1663 | ||
1664 | if (gSavedSettings.getBOOL("BeaconAlwaysOn")) | ||
1665 | { | ||
1666 | LLFloaterBeacons::showInstance(); | ||
1667 | } | ||
1668 | |||
1633 | if (!gNoRender) | 1669 | if (!gNoRender) |
1634 | { | 1670 | { |
1635 | // Move the progress view in front of the UI | 1671 | // Move the progress view in front of the UI |
@@ -2251,6 +2287,9 @@ bool idle_startup() | |||
2251 | } | 2287 | } |
2252 | } | 2288 | } |
2253 | 2289 | ||
2290 | //DEV-17797. get null folder. Any items found here moved to Lost and Found | ||
2291 | LLInventoryModel::findLostItems(); | ||
2292 | |||
2254 | LLStartUp::setStartupState( STATE_PRECACHE ); | 2293 | LLStartUp::setStartupState( STATE_PRECACHE ); |
2255 | timeout.reset(); | 2294 | timeout.reset(); |
2256 | return FALSE; | 2295 | return FALSE; |
@@ -2428,7 +2467,7 @@ bool idle_startup() | |||
2428 | gDebugView->mFastTimerView->setVisible(TRUE); | 2467 | gDebugView->mFastTimerView->setVisible(TRUE); |
2429 | #endif | 2468 | #endif |
2430 | 2469 | ||
2431 | LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); | 2470 | LLAppViewer::instance()->handleLoginComplete(); |
2432 | 2471 | ||
2433 | return TRUE; | 2472 | return TRUE; |
2434 | } | 2473 | } |
@@ -2744,7 +2783,6 @@ void update_app(BOOL mandatory, const std::string& auth_msg) | |||
2744 | 2783 | ||
2745 | void update_dialog_callback(S32 option, void *userdata) | 2784 | void update_dialog_callback(S32 option, void *userdata) |
2746 | { | 2785 | { |
2747 | std::string update_exe_path; | ||
2748 | bool mandatory = userdata != NULL; | 2786 | bool mandatory = userdata != NULL; |
2749 | 2787 | ||
2750 | #if !LL_RELEASE_FOR_DOWNLOAD | 2788 | #if !LL_RELEASE_FOR_DOWNLOAD |
@@ -2787,29 +2825,41 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2787 | // *TODO constantize this guy | 2825 | // *TODO constantize this guy |
2788 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); | 2826 | LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); |
2789 | 2827 | ||
2828 | if(LLAppViewer::sUpdaterInfo) | ||
2829 | { | ||
2830 | delete LLAppViewer::sUpdaterInfo ; | ||
2831 | } | ||
2832 | LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ; | ||
2833 | |||
2790 | #if LL_WINDOWS | 2834 | #if LL_WINDOWS |
2791 | update_exe_path = gDirUtilp->getTempFilename(); | 2835 | LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename(); |
2792 | if (update_exe_path.empty()) | 2836 | if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty()) |
2793 | { | 2837 | { |
2838 | delete LLAppViewer::sUpdaterInfo ; | ||
2839 | LLAppViewer::sUpdaterInfo = NULL ; | ||
2840 | |||
2794 | // We're hosed, bail | 2841 | // We're hosed, bail |
2795 | LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; | 2842 | LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; |
2796 | LLAppViewer::instance()->forceQuit(); | 2843 | LLAppViewer::instance()->forceQuit(); |
2797 | return; | 2844 | return; |
2798 | } | 2845 | } |
2799 | 2846 | ||
2800 | update_exe_path += ".exe"; | 2847 | LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; |
2801 | 2848 | ||
2802 | std::string updater_source = gDirUtilp->getAppRODataDir(); | 2849 | std::string updater_source = gDirUtilp->getAppRODataDir(); |
2803 | updater_source += gDirUtilp->getDirDelimiter(); | 2850 | updater_source += gDirUtilp->getDirDelimiter(); |
2804 | updater_source += "updater.exe"; | 2851 | updater_source += "updater.exe"; |
2805 | 2852 | ||
2806 | LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source | 2853 | LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source |
2807 | << " dest: " << update_exe_path | 2854 | << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath |
2808 | << LL_ENDL; | 2855 | << LL_ENDL; |
2809 | 2856 | ||
2810 | 2857 | ||
2811 | if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) | 2858 | if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE)) |
2812 | { | 2859 | { |
2860 | delete LLAppViewer::sUpdaterInfo ; | ||
2861 | LLAppViewer::sUpdaterInfo = NULL ; | ||
2862 | |||
2813 | LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; | 2863 | LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; |
2814 | LLAppViewer::instance()->forceQuit(); | 2864 | LLAppViewer::instance()->forceQuit(); |
2815 | return; | 2865 | return; |
@@ -2822,41 +2872,13 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2822 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); | 2872 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); |
2823 | }; | 2873 | }; |
2824 | 2874 | ||
2825 | std::ostringstream params; | 2875 | LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\""; |
2826 | params << "-url \"" << update_url.asString() << "\""; | ||
2827 | if (gHideLinks) | ||
2828 | { | ||
2829 | // Figure out the program name. | ||
2830 | const std::string& data_dir = gDirUtilp->getAppRODataDir(); | ||
2831 | // Roll back from the end, stopping at the first '\' | ||
2832 | const char* program_name = data_dir.c_str() + data_dir.size(); /* Flawfinder: ignore */ | ||
2833 | while ( (data_dir != --program_name) && | ||
2834 | *(program_name) != '\\'); | ||
2835 | |||
2836 | if ( *(program_name) == '\\') | ||
2837 | { | ||
2838 | // We found a '\'. | ||
2839 | program_name++; | ||
2840 | } | ||
2841 | else | ||
2842 | { | ||
2843 | // Oops. | ||
2844 | program_name = "SecondLife"; | ||
2845 | } | ||
2846 | 2876 | ||
2847 | params << " -silent -name \"" << LLAppViewer::instance()->getSecondLifeTitle() << "\""; | 2877 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL; |
2848 | params << " -program \"" << program_name << "\""; | ||
2849 | } | ||
2850 | |||
2851 | LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << " " << params.str() << LL_ENDL; | ||
2852 | 2878 | ||
2853 | //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. | 2879 | //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. |
2854 | LLAppViewer::instance()->removeMarkerFile(); // In case updater fails | 2880 | LLAppViewer::instance()->removeMarkerFile(); // In case updater fails |
2855 | 2881 | ||
2856 | // Use spawn() to run asynchronously | ||
2857 | int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); | ||
2858 | LL_DEBUGS("AppInit") << "Spawn returned " << retval << LL_ENDL; | ||
2859 | |||
2860 | #elif LL_DARWIN | 2882 | #elif LL_DARWIN |
2861 | // if a sim name was passed in via command line parameter (typically through a SLURL) | 2883 | // if a sim name was passed in via command line parameter (typically through a SLURL) |
2862 | if ( LLURLSimString::sInstance.mSimString.length() ) | 2884 | if ( LLURLSimString::sInstance.mSimString.length() ) |
@@ -2865,18 +2887,15 @@ void update_dialog_callback(S32 option, void *userdata) | |||
2865 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); | 2887 | gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); |
2866 | }; | 2888 | }; |
2867 | 2889 | ||
2868 | update_exe_path = "'"; | 2890 | LLAppViewer::sUpdaterInfo->mUpdateExePath = "'"; |
2869 | update_exe_path += gDirUtilp->getAppRODataDir(); | 2891 | LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir(); |
2870 | update_exe_path += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; | 2892 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; |
2871 | update_exe_path += update_url.asString(); | 2893 | LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString(); |
2872 | update_exe_path += "\" -name \""; | 2894 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \""; |
2873 | update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); | 2895 | LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle(); |
2874 | update_exe_path += "\" &"; | 2896 | LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &"; |
2875 | 2897 | ||
2876 | LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << LL_ENDL; | 2898 | LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; |
2877 | |||
2878 | // Run the auto-updater. | ||
2879 | system(update_exe_path.c_str()); /* Flawfinder: ignore */ | ||
2880 | 2899 | ||
2881 | #elif LL_LINUX | 2900 | #elif LL_LINUX |
2882 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" | 2901 | OSMessageBox("Automatic updating is not yet implemented for Linux.\n" |
@@ -3533,7 +3552,7 @@ void init_stat_view() | |||
3533 | stat_barp->mDisplayBar = FALSE; | 3552 | stat_barp->mDisplayBar = FALSE; |
3534 | stat_barp->mDisplayMean = FALSE; | 3553 | stat_barp->mDisplayMean = FALSE; |
3535 | 3554 | ||
3536 | stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); | 3555 | stat_barp = sim_time_viewp->addStat("Physics Time", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); |
3537 | stat_barp->setUnitLabel("ms"); | 3556 | stat_barp->setUnitLabel("ms"); |
3538 | stat_barp->mPrecision = 1; | 3557 | stat_barp->mPrecision = 1; |
3539 | stat_barp->mMinBar = 0.f; | 3558 | stat_barp->mMinBar = 0.f; |
@@ -3544,45 +3563,7 @@ void init_stat_view() | |||
3544 | stat_barp->mDisplayBar = FALSE; | 3563 | stat_barp->mDisplayBar = FALSE; |
3545 | stat_barp->mDisplayMean = FALSE; | 3564 | stat_barp->mDisplayMean = FALSE; |
3546 | 3565 | ||
3547 | LLStatView *physics_time_viewp; | 3566 | stat_barp = sim_time_viewp->addStat("Simulation Time", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); |
3548 | physics_time_viewp = new LLStatView("physics perf view", "Physics Details (ms)", "", rect); | ||
3549 | sim_time_viewp->addChildAtEnd(physics_time_viewp); | ||
3550 | { | ||
3551 | stat_barp = physics_time_viewp->addStat("Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec)); | ||
3552 | stat_barp->setUnitLabel("ms"); | ||
3553 | stat_barp->mPrecision = 1; | ||
3554 | stat_barp->mMinBar = 0.f; | ||
3555 | stat_barp->mMaxBar = 40.f; | ||
3556 | stat_barp->mTickSpacing = 10.f; | ||
3557 | stat_barp->mLabelSpacing = 20.f; | ||
3558 | stat_barp->mPerSec = FALSE; | ||
3559 | stat_barp->mDisplayBar = FALSE; | ||
3560 | stat_barp->mDisplayMean = FALSE; | ||
3561 | |||
3562 | stat_barp = physics_time_viewp->addStat("Update Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec)); | ||
3563 | stat_barp->setUnitLabel("ms"); | ||
3564 | stat_barp->mPrecision = 1; | ||
3565 | stat_barp->mMinBar = 0.f; | ||
3566 | stat_barp->mMaxBar = 40.f; | ||
3567 | stat_barp->mTickSpacing = 10.f; | ||
3568 | stat_barp->mLabelSpacing = 20.f; | ||
3569 | stat_barp->mPerSec = FALSE; | ||
3570 | stat_barp->mDisplayBar = FALSE; | ||
3571 | stat_barp->mDisplayMean = FALSE; | ||
3572 | |||
3573 | stat_barp = physics_time_viewp->addStat("Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec)); | ||
3574 | stat_barp->setUnitLabel("ms"); | ||
3575 | stat_barp->mPrecision = 1; | ||
3576 | stat_barp->mMinBar = 0.f; | ||
3577 | stat_barp->mMaxBar = 40.f; | ||
3578 | stat_barp->mTickSpacing = 10.f; | ||
3579 | stat_barp->mLabelSpacing = 20.f; | ||
3580 | stat_barp->mPerSec = FALSE; | ||
3581 | stat_barp->mDisplayBar = FALSE; | ||
3582 | stat_barp->mDisplayMean = FALSE; | ||
3583 | } | ||
3584 | |||
3585 | stat_barp = sim_time_viewp->addStat("Sim Time (Other)", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); | ||
3586 | stat_barp->setUnitLabel("ms"); | 3567 | stat_barp->setUnitLabel("ms"); |
3587 | stat_barp->mPrecision = 1; | 3568 | stat_barp->mPrecision = 1; |
3588 | stat_barp->mMinBar = 0.f; | 3569 | stat_barp->mMinBar = 0.f; |
@@ -3626,6 +3607,79 @@ void init_stat_view() | |||
3626 | stat_barp->mDisplayBar = FALSE; | 3607 | stat_barp->mDisplayBar = FALSE; |
3627 | stat_barp->mDisplayMean = FALSE; | 3608 | stat_barp->mDisplayMean = FALSE; |
3628 | 3609 | ||
3610 | stat_barp = sim_time_viewp->addStat("Spare Time", &(LLViewerStats::getInstance()->mSimSpareMsec)); | ||
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 | // 2nd level time blocks under 'Details' second | ||
3623 | LLStatView *detailed_time_viewp; | ||
3624 | detailed_time_viewp = new LLStatView("sim perf view", "Time Details (ms)", "", rect); | ||
3625 | sim_time_viewp->addChildAtEnd(detailed_time_viewp); | ||
3626 | { | ||
3627 | stat_barp = detailed_time_viewp->addStat(" Physics Step", &(LLViewerStats::getInstance()->mSimSimPhysicsStepMsec)); | ||
3628 | stat_barp->setUnitLabel("ms"); | ||
3629 | stat_barp->mPrecision = 1; | ||
3630 | stat_barp->mMinBar = 0.f; | ||
3631 | stat_barp->mMaxBar = 40.f; | ||
3632 | stat_barp->mTickSpacing = 10.f; | ||
3633 | stat_barp->mLabelSpacing = 20.f; | ||
3634 | stat_barp->mPerSec = FALSE; | ||
3635 | stat_barp->mDisplayBar = FALSE; | ||
3636 | stat_barp->mDisplayMean = FALSE; | ||
3637 | |||
3638 | stat_barp = detailed_time_viewp->addStat(" Update Physics Shapes", &(LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec)); | ||
3639 | stat_barp->setUnitLabel("ms"); | ||
3640 | stat_barp->mPrecision = 1; | ||
3641 | stat_barp->mMinBar = 0.f; | ||
3642 | stat_barp->mMaxBar = 40.f; | ||
3643 | stat_barp->mTickSpacing = 10.f; | ||
3644 | stat_barp->mLabelSpacing = 20.f; | ||
3645 | stat_barp->mPerSec = FALSE; | ||
3646 | stat_barp->mDisplayBar = FALSE; | ||
3647 | stat_barp->mDisplayMean = FALSE; | ||
3648 | |||
3649 | stat_barp = detailed_time_viewp->addStat(" Physics Other", &(LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec)); | ||
3650 | stat_barp->setUnitLabel("ms"); | ||
3651 | stat_barp->mPrecision = 1; | ||
3652 | stat_barp->mMinBar = 0.f; | ||
3653 | stat_barp->mMaxBar = 40.f; | ||
3654 | stat_barp->mTickSpacing = 10.f; | ||
3655 | stat_barp->mLabelSpacing = 20.f; | ||
3656 | stat_barp->mPerSec = FALSE; | ||
3657 | stat_barp->mDisplayBar = FALSE; | ||
3658 | stat_barp->mDisplayMean = FALSE; | ||
3659 | |||
3660 | stat_barp = detailed_time_viewp->addStat(" Sleep Time", &(LLViewerStats::getInstance()->mSimSleepMsec)); | ||
3661 | stat_barp->setUnitLabel("ms"); | ||
3662 | stat_barp->mPrecision = 1; | ||
3663 | stat_barp->mMinBar = 0.f; | ||
3664 | stat_barp->mMaxBar = 40.f; | ||
3665 | stat_barp->mTickSpacing = 10.f; | ||
3666 | stat_barp->mLabelSpacing = 20.f; | ||
3667 | stat_barp->mPerSec = FALSE; | ||
3668 | stat_barp->mDisplayBar = FALSE; | ||
3669 | stat_barp->mDisplayMean = FALSE; | ||
3670 | |||
3671 | stat_barp = detailed_time_viewp->addStat(" Pump IO", &(LLViewerStats::getInstance()->mSimPumpIOMsec)); | ||
3672 | stat_barp->setUnitLabel("ms"); | ||
3673 | stat_barp->mPrecision = 1; | ||
3674 | stat_barp->mMinBar = 0.f; | ||
3675 | stat_barp->mMaxBar = 40.f; | ||
3676 | stat_barp->mTickSpacing = 10.f; | ||
3677 | stat_barp->mLabelSpacing = 20.f; | ||
3678 | stat_barp->mPerSec = FALSE; | ||
3679 | stat_barp->mDisplayBar = FALSE; | ||
3680 | stat_barp->mDisplayMean = FALSE; | ||
3681 | } | ||
3682 | |||
3629 | LLRect r = gDebugView->mFloaterStatsp->getRect(); | 3683 | LLRect r = gDebugView->mFloaterStatsp->getRect(); |
3630 | 3684 | ||
3631 | // Reshape based on the parameters we set. | 3685 | // Reshape based on the parameters we set. |
@@ -3887,3 +3941,28 @@ void login_alert_done(S32 option, void* user_data) | |||
3887 | LLPanelLogin::giveFocus(); | 3941 | LLPanelLogin::giveFocus(); |
3888 | } | 3942 | } |
3889 | 3943 | ||
3944 | |||
3945 | void apply_udp_blacklist(const std::string& csv) | ||
3946 | { | ||
3947 | |||
3948 | std::string::size_type start = 0; | ||
3949 | std::string::size_type comma = 0; | ||
3950 | do | ||
3951 | { | ||
3952 | comma = csv.find(",", start); | ||
3953 | if (comma == std::string::npos) | ||
3954 | { | ||
3955 | comma = csv.length(); | ||
3956 | } | ||
3957 | std::string item(csv, start, comma-start); | ||
3958 | |||
3959 | lldebugs << "udp_blacklist " << item << llendl; | ||
3960 | gMessageSystem->banUdpMessage(item); | ||
3961 | |||
3962 | start = comma + 1; | ||
3963 | |||
3964 | } | ||
3965 | while(comma < csv.length()); | ||
3966 | |||
3967 | } | ||
3968 | |||