diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/viewer.cpp | 100 |
1 files changed, 39 insertions, 61 deletions
diff --git a/linden/indra/newview/viewer.cpp b/linden/indra/newview/viewer.cpp index 69e98f4..d42872d 100644 --- a/linden/indra/newview/viewer.cpp +++ b/linden/indra/newview/viewer.cpp | |||
@@ -138,7 +138,7 @@ | |||
138 | #include "llmemtype.h" | 138 | #include "llmemtype.h" |
139 | #include "llmd5.h" | 139 | #include "llmd5.h" |
140 | #include "llsecondlifeurls.h" | 140 | #include "llsecondlifeurls.h" |
141 | #include "llversion.h" | 141 | #include "llversionviewer.h" |
142 | #include "llvfile.h" | 142 | #include "llvfile.h" |
143 | #include "llvfs.h" | 143 | #include "llvfs.h" |
144 | #include "llwindow.h" // for shell_open | 144 | #include "llwindow.h" // for shell_open |
@@ -296,8 +296,6 @@ std::string gSerialNumber; | |||
296 | // Application constants | 296 | // Application constants |
297 | ///////////////////////////////////////////////////////////////////////////////// | 297 | ///////////////////////////////////////////////////////////////////////////////// |
298 | 298 | ||
299 | S32 gStartupState = STATE_FIRST; | ||
300 | |||
301 | BOOL gAgentMovementCompleted = FALSE; | 299 | BOOL gAgentMovementCompleted = FALSE; |
302 | BOOL gHaveSavedSnapshot = FALSE; | 300 | BOOL gHaveSavedSnapshot = FALSE; |
303 | 301 | ||
@@ -391,7 +389,6 @@ BOOL gPrintMessagesThisFrame = FALSE; | |||
391 | const char* DEFAULT_SETTINGS_FILE = "settings.xml"; | 389 | const char* DEFAULT_SETTINGS_FILE = "settings.xml"; |
392 | const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; | 390 | const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; |
393 | BOOL gUseWireframe = FALSE; | 391 | BOOL gUseWireframe = FALSE; |
394 | BOOL gRunLocal = FALSE; | ||
395 | LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. | 392 | LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. |
396 | LLPumpIO* gServicePump = NULL; | 393 | LLPumpIO* gServicePump = NULL; |
397 | S32 gNumSessions = 0; | 394 | S32 gNumSessions = 0; |
@@ -468,6 +465,8 @@ BOOL gPacificDaylightTime = FALSE; | |||
468 | U32 gSecondsPerDay = 0; | 465 | U32 gSecondsPerDay = 0; |
469 | U32 gSecondsPerYear = 0; | 466 | U32 gSecondsPerYear = 0; |
470 | 467 | ||
468 | LLString gLastVersionChannel; | ||
469 | |||
471 | // | 470 | // |
472 | // Region/Object globals | 471 | // Region/Object globals |
473 | // | 472 | // |
@@ -513,7 +512,6 @@ static const char USAGE[] = "\n" | |||
513 | " -user <user_server_ip> specify userserver in dotted quad\n" | 512 | " -user <user_server_ip> specify userserver in dotted quad\n" |
514 | #if !LL_RELEASE_FOR_DOWNLOAD | 513 | #if !LL_RELEASE_FOR_DOWNLOAD |
515 | " -sim <simulator_ip> specify the simulator ip address\n" | 514 | " -sim <simulator_ip> specify the simulator ip address\n" |
516 | " -local run without simulator\n" | ||
517 | #endif | 515 | #endif |
518 | " -god log in as god if you have god access\n" | 516 | " -god log in as god if you have god access\n" |
519 | " -purge delete files in cache\n" | 517 | " -purge delete files in cache\n" |
@@ -543,13 +541,12 @@ BOOL gGodConnect = FALSE; | |||
543 | BOOL gUseConsole = TRUE; | 541 | BOOL gUseConsole = TRUE; |
544 | BOOL gUseAudio = TRUE; | 542 | BOOL gUseAudio = TRUE; |
545 | BOOL gUseFMOD = TRUE; | 543 | BOOL gUseFMOD = TRUE; |
546 | BOOL gConnectToSomething = TRUE; | ||
547 | BOOL gLogMessages = FALSE; | 544 | BOOL gLogMessages = FALSE; |
548 | BOOL gRequestInventoryLibrary = TRUE; | 545 | BOOL gRequestInventoryLibrary = TRUE; |
549 | BOOL gAcceptTOS = FALSE; | 546 | BOOL gAcceptTOS = FALSE; |
550 | BOOL gAcceptCriticalMessage = FALSE; | 547 | BOOL gAcceptCriticalMessage = FALSE; |
551 | // this is the channel the viewer uses to check for updates/login | 548 | // this is the channel the viewer uses to check for updates/login |
552 | std::string gChannelName = "Second Life Release"; | 549 | std::string gChannelName = LL_CHANNEL; |
553 | 550 | ||
554 | LLUUID gInventoryLibraryOwner; | 551 | LLUUID gInventoryLibraryOwner; |
555 | LLUUID gInventoryLibraryRoot; | 552 | LLUUID gInventoryLibraryRoot; |
@@ -629,7 +626,7 @@ void main_loop(); | |||
629 | // | 626 | // |
630 | // Callbacks and other stuff that's not directly used in main | 627 | // Callbacks and other stuff that's not directly used in main |
631 | // | 628 | // |
632 | void uuid_table_request_file_callback(void **user_data, S32 result); | 629 | void uuid_table_request_file_callback(void **user_data, S32 result, LLExtStat ext_status); |
633 | void send_stats(); | 630 | void send_stats(); |
634 | 631 | ||
635 | // | 632 | // |
@@ -808,6 +805,11 @@ int main( int argc, char **argv ) | |||
808 | #if LL_SOLARIS && defined(__sparc) | 805 | #if LL_SOLARIS && defined(__sparc) |
809 | asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC | 806 | asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC |
810 | #endif | 807 | #endif |
808 | |||
809 | #if LL_DARWIN | ||
810 | // Set the working dir to <bundle>/Contents/Resources | ||
811 | (void) chdir(gDirUtilp->getAppRODataDir().c_str()); | ||
812 | #endif | ||
811 | 813 | ||
812 | #if 1 | 814 | #if 1 |
813 | // This will eventually be done in LLApp | 815 | // This will eventually be done in LLApp |
@@ -944,6 +946,10 @@ int main( int argc, char **argv ) | |||
944 | // May need to know this early also | 946 | // May need to know this early also |
945 | gDisableVoice = TRUE; | 947 | gDisableVoice = TRUE; |
946 | } | 948 | } |
949 | else if (!strcmp(argv[j], "-url") && (++j < argc)) | ||
950 | { | ||
951 | LLURLSimString::setString(argv[j]); | ||
952 | } | ||
947 | } | 953 | } |
948 | 954 | ||
949 | if (!strcmp(gUserServerName, gUserServerDomainName[USERSERVER_AGNI].mName)) | 955 | if (!strcmp(gUserServerName, gUserServerDomainName[USERSERVER_AGNI].mName)) |
@@ -1347,7 +1353,6 @@ int main( int argc, char **argv ) | |||
1347 | if ( nextLoginLocation.length() ) | 1353 | if ( nextLoginLocation.length() ) |
1348 | { | 1354 | { |
1349 | LLURLSimString::setString( nextLoginLocation.c_str() ); | 1355 | LLURLSimString::setString( nextLoginLocation.c_str() ); |
1350 | gConnectToSomething = TRUE; | ||
1351 | }; | 1356 | }; |
1352 | 1357 | ||
1353 | // Merge with the command line overrides | 1358 | // Merge with the command line overrides |
@@ -1853,7 +1858,7 @@ void main_loop() | |||
1853 | if (gViewerWindow->mWindow->getVisible() | 1858 | if (gViewerWindow->mWindow->getVisible() |
1854 | && gViewerWindow->getActive() | 1859 | && gViewerWindow->getActive() |
1855 | && !gViewerWindow->mWindow->getMinimized() | 1860 | && !gViewerWindow->mWindow->getMinimized() |
1856 | && gStartupState == STATE_STARTED | 1861 | && LLStartUp::getStartupState() == STATE_STARTED |
1857 | && !gViewerWindow->getShowProgress() | 1862 | && !gViewerWindow->getShowProgress() |
1858 | && !gFocusMgr.focusLocked()) | 1863 | && !gFocusMgr.focusLocked()) |
1859 | { | 1864 | { |
@@ -1871,7 +1876,7 @@ void main_loop() | |||
1871 | gServicePump->callback(); | 1876 | gServicePump->callback(); |
1872 | } | 1877 | } |
1873 | 1878 | ||
1874 | if (gDoDisconnect && (gStartupState == STATE_STARTED)) | 1879 | if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED)) |
1875 | { | 1880 | { |
1876 | save_final_snapshot(NULL); | 1881 | save_final_snapshot(NULL); |
1877 | disconnect_viewer(NULL); | 1882 | disconnect_viewer(NULL); |
@@ -1981,7 +1986,7 @@ void main_loop() | |||
1981 | } | 1986 | } |
1982 | 1987 | ||
1983 | // Save snapshot for next time, if we made it through initialization | 1988 | // Save snapshot for next time, if we made it through initialization |
1984 | if (STATE_STARTED == gStartupState) | 1989 | if (STATE_STARTED == LLStartUp::getStartupState()) |
1985 | { | 1990 | { |
1986 | save_final_snapshot(NULL); | 1991 | save_final_snapshot(NULL); |
1987 | } | 1992 | } |
@@ -2023,7 +2028,7 @@ void process_keystrokes_async() | |||
2023 | if (gViewerWindow->mWindow->getVisible() | 2028 | if (gViewerWindow->mWindow->getVisible() |
2024 | && gViewerWindow->getActive() | 2029 | && gViewerWindow->getActive() |
2025 | && !gViewerWindow->mWindow->getMinimized() | 2030 | && !gViewerWindow->mWindow->getMinimized() |
2026 | && gStartupState == STATE_STARTED | 2031 | && LLStartUp::getStartupState() == STATE_STARTED |
2027 | && !gViewerWindow->getShowProgress() | 2032 | && !gViewerWindow->getShowProgress() |
2028 | && !gFocusMgr.focusLocked()) | 2033 | && !gFocusMgr.focusLocked()) |
2029 | { | 2034 | { |
@@ -2196,7 +2201,7 @@ void write_system_info() | |||
2196 | write_debug(gSysCPU.getCPUString()); | 2201 | write_debug(gSysCPU.getCPUString()); |
2197 | write_debug("\n"); | 2202 | write_debug("\n"); |
2198 | 2203 | ||
2199 | tmp_str = llformat("RAM: %u\n", gSysMemory.getPhysicalMemory()); | 2204 | tmp_str = llformat("RAM: %u KB\n", gSysMemory.getPhysicalMemoryKB()); |
2200 | write_debug(tmp_str.c_str()); | 2205 | write_debug(tmp_str.c_str()); |
2201 | write_debug("OS: "); | 2206 | write_debug("OS: "); |
2202 | write_debug(gSysOS.getOSString().c_str()); | 2207 | write_debug(gSysOS.getOSString().c_str()); |
@@ -2951,7 +2956,6 @@ OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) | |||
2951 | 2956 | ||
2952 | // Parse it and stash in globals. | 2957 | // Parse it and stash in globals. |
2953 | LLURLSimString::setString(buffer); | 2958 | LLURLSimString::setString(buffer); |
2954 | gConnectToSomething = TRUE; | ||
2955 | 2959 | ||
2956 | if(gFloaterWorldMap != NULL) | 2960 | if(gFloaterWorldMap != NULL) |
2957 | { | 2961 | { |
@@ -3192,12 +3196,11 @@ void save_final_snapshot(void*) | |||
3192 | gAgent.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch | 3196 | gAgent.changeCameraToThirdPerson( FALSE ); // don't animate, need immediate switch |
3193 | gSavedSettings.setBOOL("ShowParcelOwners", FALSE); | 3197 | gSavedSettings.setBOOL("ShowParcelOwners", FALSE); |
3194 | idle(); | 3198 | idle(); |
3195 | char temp_str[MAX_PATH]; /* Flawfinder: ignore */ | 3199 | |
3196 | strncpy (temp_str,gDirUtilp->getLindenUserDir().c_str(), MAX_PATH -1); /* Flawfinder: ignore */ | 3200 | LLString snap_filename = gDirUtilp->getLindenUserDir(); |
3197 | temp_str[MAX_PATH -1] = '\0'; | 3201 | snap_filename += gDirUtilp->getDirDelimiter(); |
3198 | strcat (temp_str,"/"); /* Flawfinder: ignore */ | 3202 | snap_filename += SCREEN_LAST_FILENAME; |
3199 | strcat (temp_str,SCREEN_LAST_FILENAME); /* Flawfinder: ignore */ | 3203 | gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, TRUE); |
3200 | gViewerWindow->saveSnapshot(temp_str, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, TRUE); | ||
3201 | gHaveSavedSnapshot = TRUE; | 3204 | gHaveSavedSnapshot = TRUE; |
3202 | } | 3205 | } |
3203 | } | 3206 | } |
@@ -3239,7 +3242,7 @@ void app_request_quit() | |||
3239 | 3242 | ||
3240 | LLViewerRegion* region = gAgent.getRegion(); | 3243 | LLViewerRegion* region = gAgent.getRegion(); |
3241 | 3244 | ||
3242 | if( (gStartupState < STATE_STARTED) || !region ) | 3245 | if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) |
3243 | { | 3246 | { |
3244 | // Quit immediately | 3247 | // Quit immediately |
3245 | app_force_quit(NULL); | 3248 | app_force_quit(NULL); |
@@ -3495,7 +3498,7 @@ void idle_network() | |||
3495 | gObjectList.mNumNewObjects = 0; | 3498 | gObjectList.mNumNewObjects = 0; |
3496 | S32 total_decoded = 0; | 3499 | S32 total_decoded = 0; |
3497 | 3500 | ||
3498 | if (!gSavedSettings.getBOOL("SpeedTest") && !gRunLocal) | 3501 | if (!gSavedSettings.getBOOL("SpeedTest")) |
3499 | { | 3502 | { |
3500 | LLFastTimer t(LLFastTimer::FTM_IDLE_NETWORK); // decode | 3503 | LLFastTimer t(LLFastTimer::FTM_IDLE_NETWORK); // decode |
3501 | 3504 | ||
@@ -3663,7 +3666,7 @@ void idle() | |||
3663 | // Special case idle if still starting up | 3666 | // Special case idle if still starting up |
3664 | // | 3667 | // |
3665 | 3668 | ||
3666 | if (gStartupState < STATE_STARTED) | 3669 | if (LLStartUp::getStartupState() < STATE_STARTED) |
3667 | { | 3670 | { |
3668 | // Skip rest if idle startup returns false (essentially, no world yet) | 3671 | // Skip rest if idle startup returns false (essentially, no world yet) |
3669 | if (!idle_startup()) | 3672 | if (!idle_startup()) |
@@ -4004,13 +4007,13 @@ void idle() | |||
4004 | { | 4007 | { |
4005 | gFrameStats.start(LLFrameStats::AUDIO); | 4008 | gFrameStats.start(LLFrameStats::AUDIO); |
4006 | LLFastTimer t(LLFastTimer::FTM_AUDIO_UPDATE); | 4009 | LLFastTimer t(LLFastTimer::FTM_AUDIO_UPDATE); |
4007 | |||
4008 | audio_update_volume(false); | ||
4009 | audio_update_listener(); | ||
4010 | audio_update_wind(false); | ||
4011 | 4010 | ||
4012 | if (gAudiop) | 4011 | if (gAudiop) |
4013 | { | 4012 | { |
4013 | audio_update_volume(false); | ||
4014 | audio_update_listener(); | ||
4015 | audio_update_wind(false); | ||
4016 | |||
4014 | // this line actually commits the changes we've made to source positions, etc. | 4017 | // this line actually commits the changes we've made to source positions, etc. |
4015 | const F32 max_audio_decode_time = 0.002f; // 2 ms decode time | 4018 | const F32 max_audio_decode_time = 0.002f; // 2 ms decode time |
4016 | gAudiop->idle(max_audio_decode_time); | 4019 | gAudiop->idle(max_audio_decode_time); |
@@ -5192,7 +5195,7 @@ void send_stats() | |||
5192 | gMessageSystem->addF32Fast(_PREHASH_Ping, gAvgSimPing); | 5195 | gMessageSystem->addF32Fast(_PREHASH_Ping, gAvgSimPing); |
5193 | gMessageSystem->addF64Fast(_PREHASH_MetersTraveled, gAgent.getDistanceTraveled()); | 5196 | gMessageSystem->addF64Fast(_PREHASH_MetersTraveled, gAgent.getDistanceTraveled()); |
5194 | gMessageSystem->addS32Fast(_PREHASH_RegionsVisited, gAgent.getRegionsVisited()); | 5197 | gMessageSystem->addS32Fast(_PREHASH_RegionsVisited, gAgent.getRegionsVisited()); |
5195 | gMessageSystem->addU32Fast(_PREHASH_SysRAM, gSysMemory.getPhysicalMemory()); | 5198 | gMessageSystem->addU32Fast(_PREHASH_SysRAM, gSysMemory.getPhysicalMemoryClamped()); |
5196 | gMessageSystem->addStringFast(_PREHASH_SysOS, gSysOS.getOSString()); | 5199 | gMessageSystem->addStringFast(_PREHASH_SysOS, gSysOS.getOSString()); |
5197 | gMessageSystem->addStringFast(_PREHASH_SysCPU, gSysCPU.getCPUString()); | 5200 | gMessageSystem->addStringFast(_PREHASH_SysCPU, gSysCPU.getCPUString()); |
5198 | 5201 | ||
@@ -5341,13 +5344,18 @@ int parse_args(int argc, char **argv) | |||
5341 | // Sometimes IP addresses passed in on the command line have leading | 5344 | // Sometimes IP addresses passed in on the command line have leading |
5342 | // or trailing white space. Use LLString to clean that up. | 5345 | // or trailing white space. Use LLString to clean that up. |
5343 | LLString ip_string; | 5346 | LLString ip_string; |
5347 | |||
5344 | S32 j; | 5348 | S32 j; |
5349 | // agent_sim_host holds the settings for connecting to the first simulator. | ||
5345 | 5350 | ||
5346 | for (j = 1; j < argc; j++) | 5351 | for (j = 1; j < argc; j++) |
5347 | { | 5352 | { |
5348 | gArgs += argv[j]; | 5353 | gArgs += argv[j]; |
5349 | gArgs += " "; | 5354 | gArgs += " "; |
5355 | } | ||
5350 | 5356 | ||
5357 | for (j = 1; j < argc; j++) | ||
5358 | { | ||
5351 | LLString argument = argv[j]; | 5359 | LLString argument = argv[j]; |
5352 | if ((!strcmp(argv[j], "-port")) && (++j < argc)) | 5360 | if ((!strcmp(argv[j], "-port")) && (++j < argc)) |
5353 | { | 5361 | { |
@@ -5369,61 +5377,51 @@ int parse_args(int argc, char **argv) | |||
5369 | { | 5377 | { |
5370 | gUserServerChoice = USERSERVER_ADITI; | 5378 | gUserServerChoice = USERSERVER_ADITI; |
5371 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5379 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5372 | gConnectToSomething = TRUE; | ||
5373 | } | 5380 | } |
5374 | else if (!strcmp(argv[j], "--agni")) | 5381 | else if (!strcmp(argv[j], "--agni")) |
5375 | { | 5382 | { |
5376 | gUserServerChoice = USERSERVER_AGNI; | 5383 | gUserServerChoice = USERSERVER_AGNI; |
5377 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5384 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5378 | gConnectToSomething = TRUE; | ||
5379 | } | 5385 | } |
5380 | else if (!strcmp(argv[j], "--dmz")) | 5386 | else if (!strcmp(argv[j], "--dmz")) |
5381 | { | 5387 | { |
5382 | gUserServerChoice = USERSERVER_DMZ; | 5388 | gUserServerChoice = USERSERVER_DMZ; |
5383 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5389 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5384 | gConnectToSomething = TRUE; | ||
5385 | } | 5390 | } |
5386 | else if (!strcmp(argv[j], "--siva")) | 5391 | else if (!strcmp(argv[j], "--siva")) |
5387 | { | 5392 | { |
5388 | gUserServerChoice = USERSERVER_SIVA; | 5393 | gUserServerChoice = USERSERVER_SIVA; |
5389 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5394 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5390 | gConnectToSomething = TRUE; | ||
5391 | } | 5395 | } |
5392 | else if (!strcmp(argv[j], "--shakti")) | 5396 | else if (!strcmp(argv[j], "--shakti")) |
5393 | { | 5397 | { |
5394 | gUserServerChoice = USERSERVER_SHAKTI; | 5398 | gUserServerChoice = USERSERVER_SHAKTI; |
5395 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5399 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5396 | gConnectToSomething = TRUE; | ||
5397 | } | 5400 | } |
5398 | else if (!strcmp(argv[j], "--durga")) | 5401 | else if (!strcmp(argv[j], "--durga")) |
5399 | { | 5402 | { |
5400 | gUserServerChoice = USERSERVER_DURGA; | 5403 | gUserServerChoice = USERSERVER_DURGA; |
5401 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5404 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5402 | gConnectToSomething = TRUE; | ||
5403 | } | 5405 | } |
5404 | else if (!strcmp(argv[j], "--soma")) | 5406 | else if (!strcmp(argv[j], "--soma")) |
5405 | { | 5407 | { |
5406 | gUserServerChoice = USERSERVER_SOMA; | 5408 | gUserServerChoice = USERSERVER_SOMA; |
5407 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ | 5409 | snprintf(gUserServerName, MAX_STRING, "%s", gUserServerDomainName[gUserServerChoice].mName); /* Flawfinder: ignore */ |
5408 | gConnectToSomething = TRUE; | ||
5409 | } | 5410 | } |
5410 | else if (!strcmp(argv[j], "--ganga")) | 5411 | else if (!strcmp(argv[j], "--ganga")) |
5411 | { | 5412 | { |
5412 | gUserServerChoice = USERSERVER_GANGA; | 5413 | gUserServerChoice = USERSERVER_GANGA; |
5413 | sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); | 5414 | sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); |
5414 | gConnectToSomething = TRUE; | ||
5415 | } | 5415 | } |
5416 | else if (!strcmp(argv[j], "--vaak")) | 5416 | else if (!strcmp(argv[j], "--vaak")) |
5417 | { | 5417 | { |
5418 | gUserServerChoice = USERSERVER_VAAK; | 5418 | gUserServerChoice = USERSERVER_VAAK; |
5419 | sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); | 5419 | sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); |
5420 | gConnectToSomething = TRUE; | ||
5421 | } | 5420 | } |
5422 | else if (!strcmp(argv[j], "--uma")) | 5421 | else if (!strcmp(argv[j], "--uma")) |
5423 | { | 5422 | { |
5424 | gUserServerChoice = USERSERVER_UMA; | 5423 | gUserServerChoice = USERSERVER_UMA; |
5425 | sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); | 5424 | sprintf(gUserServerName,"%s", gUserServerDomainName[gUserServerChoice].mName); |
5426 | gConnectToSomething = TRUE; | ||
5427 | } | 5425 | } |
5428 | else if (!strcmp(argv[j], "-user") && (++j < argc)) | 5426 | else if (!strcmp(argv[j], "-user") && (++j < argc)) |
5429 | { | 5427 | { |
@@ -5439,7 +5437,6 @@ int parse_args(int argc, char **argv) | |||
5439 | LLString::trim(ip_string); | 5437 | LLString::trim(ip_string); |
5440 | snprintf(gUserServerName, MAX_STRING, "%s", ip_string.c_str()); /* Flawfinder: ignore */ | 5438 | snprintf(gUserServerName, MAX_STRING, "%s", ip_string.c_str()); /* Flawfinder: ignore */ |
5441 | } | 5439 | } |
5442 | gConnectToSomething = TRUE; | ||
5443 | } | 5440 | } |
5444 | else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) | 5441 | else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) |
5445 | { | 5442 | { |
@@ -5509,11 +5506,6 @@ int parse_args(int argc, char **argv) | |||
5509 | { | 5506 | { |
5510 | purge_cache(); | 5507 | purge_cache(); |
5511 | } | 5508 | } |
5512 | else if (!strcmp(argv[j], "-local")) | ||
5513 | { | ||
5514 | gConnectToSomething = FALSE; | ||
5515 | gRunLocal = TRUE; | ||
5516 | } | ||
5517 | else if(!strcmp(argv[j], "-noinvlib")) | 5509 | else if(!strcmp(argv[j], "-noinvlib")) |
5518 | { | 5510 | { |
5519 | gRequestInventoryLibrary = FALSE; | 5511 | gRequestInventoryLibrary = FALSE; |
@@ -5621,25 +5613,11 @@ int parse_args(int argc, char **argv) | |||
5621 | // so this allows us to parse the URL straight off the command line without a "-url" paramater | 5613 | // so this allows us to parse the URL straight off the command line without a "-url" paramater |
5622 | else if (!argument.compare(0, std::string( "secondlife://" ).length(), std::string("secondlife://"))) | 5614 | else if (!argument.compare(0, std::string( "secondlife://" ).length(), std::string("secondlife://"))) |
5623 | { | 5615 | { |
5624 | // *NOTE: After setting the url, bail. What can happen is | ||
5625 | // that someone can use IE (or potentially other browsers) | ||
5626 | // and do the rough equivalent of command injection and | ||
5627 | // steal passwords. Phoenix. SL-55321 | ||
5628 | LLURLSimString::setString(argv[j]); | 5616 | LLURLSimString::setString(argv[j]); |
5629 | gConnectToSomething = TRUE; | ||
5630 | gArgs += argv[j]; | ||
5631 | return 0; | ||
5632 | } | 5617 | } |
5633 | else if (!strcmp(argv[j], "-url") && (++j < argc)) | 5618 | else if (!strcmp(argv[j], "-url") && (++j < argc)) |
5634 | { | 5619 | { |
5635 | // *NOTE: After setting the url, bail. What can happen is | ||
5636 | // that someone can use IE (or potentially other browsers) | ||
5637 | // and do the rough equivalent of command injection and | ||
5638 | // steal passwords. Phoenix. SL-55321 | ||
5639 | LLURLSimString::setString(argv[j]); | 5620 | LLURLSimString::setString(argv[j]); |
5640 | gConnectToSomething = TRUE; | ||
5641 | gArgs += argv[j]; | ||
5642 | return 0; | ||
5643 | } | 5621 | } |
5644 | else if (!strcmp(argv[j], "-ignorepixeldepth")) | 5622 | else if (!strcmp(argv[j], "-ignorepixeldepth")) |
5645 | { | 5623 | { |
@@ -6024,7 +6002,7 @@ void do_disconnect(const LLString& mesg) | |||
6024 | } | 6002 | } |
6025 | 6003 | ||
6026 | //RN: just quit if we haven't logged in | 6004 | //RN: just quit if we haven't logged in |
6027 | if (gStartupState < STATE_STARTED) | 6005 | if (LLStartUp::getStartupState() < STATE_STARTED) |
6028 | { | 6006 | { |
6029 | finish_disconnect(1, NULL); | 6007 | finish_disconnect(1, NULL); |
6030 | return; | 6008 | return; |