aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r--linden/indra/newview/llappviewer.cpp99
1 files changed, 89 insertions, 10 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index e95180c..a2d70af 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -251,8 +251,6 @@ LLString gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle
251 251
252BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally 252BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally
253 253
254BOOL gInProductionGrid = FALSE;
255
256BOOL gAllowIdleAFK = TRUE; 254BOOL gAllowIdleAFK = TRUE;
257F32 gAFKTimeout = DEFAULT_AFK_TIMEOUT; 255F32 gAFKTimeout = DEFAULT_AFK_TIMEOUT;
258BOOL gShowObjectUpdates = FALSE; 256BOOL gShowObjectUpdates = FALSE;
@@ -371,6 +369,7 @@ static LLString gWindowTitle;
371 static char sWindowClass[] = "Second Life"; 369 static char sWindowClass[] = "Second Life";
372#endif 370#endif
373 371
372std::string gLoginPage;
374std::vector<std::string> gLoginURIs; 373std::vector<std::string> gLoginURIs;
375static std::string gHelperURI; 374static std::string gHelperURI;
376 375
@@ -379,6 +378,7 @@ static const char USAGE[] = "\n"
379"options:\n" 378"options:\n"
380" -login <first> <last> <password> log in as a user\n" 379" -login <first> <last> <password> log in as a user\n"
381" -autologin log in as last saved user\n" 380" -autologin log in as last saved user\n"
381" -loginpage <URL> login authentication page to use\n"
382" -loginuri <URI> login server and CGI script to use\n" 382" -loginuri <URI> login server and CGI script to use\n"
383" -helperuri <URI> helper web CGI prefix to use\n" 383" -helperuri <URI> helper web CGI prefix to use\n"
384" -settings <filename> specify the filename of a\n" 384" -settings <filename> specify the filename of a\n"
@@ -628,6 +628,41 @@ int parse_args(int argc, char **argv)
628 gGridChoice = GRID_INFO_UMA; 628 gGridChoice = GRID_INFO_UMA;
629 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); 629 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
630 } 630 }
631 else if (!strcmp(argv[j], "--mohini"))
632 {
633 gGridChoice = GRID_INFO_MOHINI;
634 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
635 }
636 else if (!strcmp(argv[j], "--yami"))
637 {
638 gGridChoice = GRID_INFO_YAMI;
639 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
640 }
641 else if (!strcmp(argv[j], "--nandi"))
642 {
643 gGridChoice = GRID_INFO_NANDI;
644 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
645 }
646 else if (!strcmp(argv[j], "--mitra"))
647 {
648 gGridChoice = GRID_INFO_MITRA;
649 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
650 }
651 else if (!strcmp(argv[j], "--radha"))
652 {
653 gGridChoice = GRID_INFO_RADHA;
654 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
655 }
656 else if (!strcmp(argv[j], "--ravi"))
657 {
658 gGridChoice = GRID_INFO_RAVI;
659 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
660 }
661 else if (!strcmp(argv[j], "--aruna"))
662 {
663 gGridChoice = GRID_INFO_ARUNA;
664 sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName);
665 }
631 else if (!strcmp(argv[j], "-user") && (++j < argc)) 666 else if (!strcmp(argv[j], "-user") && (++j < argc))
632 { 667 {
633 if (!strcmp(argv[j], "-")) 668 if (!strcmp(argv[j], "-"))
@@ -643,6 +678,10 @@ int parse_args(int argc, char **argv)
643 snprintf(gGridName, MAX_STRING, "%s", ip_string.c_str()); // Flawfinder: ignore 678 snprintf(gGridName, MAX_STRING, "%s", ip_string.c_str()); // Flawfinder: ignore
644 } 679 }
645 } 680 }
681 else if (!strcmp(argv[j], "-loginpage") && (++j < argc))
682 {
683 LLAppViewer::instance()->setLoginPage(utf8str_trim(argv[j]));
684 }
646 else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) 685 else if (!strcmp(argv[j], "-loginuri") && (++j < argc))
647 { 686 {
648 LLAppViewer::instance()->addLoginURI(utf8str_trim(argv[j])); 687 LLAppViewer::instance()->addLoginURI(utf8str_trim(argv[j]));
@@ -1866,6 +1905,34 @@ bool LLAppViewer::initEarlyConfiguration()
1866 { 1905 {
1867 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_UMA].mName); 1906 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_UMA].mName);
1868 } 1907 }
1908 else if (!strcmp(argv[j], "--mohini"))
1909 {
1910 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_MOHINI].mName);
1911 }
1912 else if (!strcmp(argv[j], "--yami"))
1913 {
1914 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_YAMI].mName);
1915 }
1916 else if (!strcmp(argv[j], "--nandi"))
1917 {
1918 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_NANDI].mName);
1919 }
1920 else if (!strcmp(argv[j], "--mitra"))
1921 {
1922 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_MITRA].mName);
1923 }
1924 else if (!strcmp(argv[j], "--radha"))
1925 {
1926 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_RADHA].mName);
1927 }
1928 else if (!strcmp(argv[j], "--ravi"))
1929 {
1930 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_RAVI].mName);
1931 }
1932 else if (!strcmp(argv[j], "--aruna"))
1933 {
1934 sprintf(gGridName,"%s", gGridInfo[GRID_INFO_ARUNA].mName);
1935 }
1869 else if (!strcmp(argv[j], "-user") && (++j < argc)) 1936 else if (!strcmp(argv[j], "-user") && (++j < argc))
1870 { 1937 {
1871 if (!strcmp(argv[j], "-")) 1938 if (!strcmp(argv[j], "-"))
@@ -2292,11 +2359,6 @@ bool LLAppViewer::doConfigFromCommandLine()
2292 removeMarkerFile(); 2359 removeMarkerFile();
2293 return false; 2360 return false;
2294 } 2361 }
2295
2296 if (!strcmp(gGridName, gGridInfo[GRID_INFO_AGNI].mName))
2297 {
2298 gInProductionGrid = TRUE;
2299 }
2300 2362
2301 return true; 2363 return true;
2302} 2364}
@@ -2540,7 +2602,7 @@ bool LLAppViewer::anotherInstanceRunning()
2540 llinfos << "Checking marker file for lock..." << llendl; 2602 llinfos << "Checking marker file for lock..." << llendl;
2541 2603
2542 // If file doesn't exist, we create it 2604 // If file doesn't exist, we create it
2543 // If file does exist, try to get writing privilages 2605 // If file does exist, try to get writing privileges
2544 FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); // Flawfinder: ignore 2606 FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); // Flawfinder: ignore
2545 if (fMarker != NULL) 2607 if (fMarker != NULL)
2546 { 2608 {
@@ -2555,7 +2617,7 @@ bool LLAppViewer::anotherInstanceRunning()
2555 2617
2556 // *FIX:Mani - rather than have this exception here, 2618 // *FIX:Mani - rather than have this exception here,
2557 // LLFile::fopen() have consistent behavior across platforms? 2619 // LLFile::fopen() have consistent behavior across platforms?
2558#if LL_DARWIN 2620#if LL_DARWIN || LL_LINUX || LL_SOLARIS
2559 // Try to lock it. On Mac, this is the only way to test if it's actually locked. 2621 // Try to lock it. On Mac, this is the only way to test if it's actually locked.
2560 if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) 2622 if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1)
2561 { 2623 {
@@ -2601,7 +2663,7 @@ void LLAppViewer::initMarkerFile()
2601 llinfos << "Marker file is locked." << llendl; 2663 llinfos << "Marker file is locked." << llendl;
2602 return; 2664 return;
2603 } 2665 }
2604#if LL_DARWIN 2666#if LL_DARWIN || LL_LINUX || LL_SOLARIS
2605 // Try to lock it. On Mac, this is the only way to test if it's actually locked. 2667 // Try to lock it. On Mac, this is the only way to test if it's actually locked.
2606 if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) 2668 if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1)
2607 { 2669 {
@@ -3044,6 +3106,17 @@ void LLAppViewer::setHelperURI(const std::string& uri)
3044 gHelperURI = uri; 3106 gHelperURI = uri;
3045} 3107}
3046 3108
3109void LLAppViewer::setLoginPage(const std::string& login_page)
3110{
3111 gLoginPage = login_page;
3112}
3113
3114const std::string& LLAppViewer::getLoginPage()
3115{
3116 return gLoginPage;
3117}
3118
3119
3047// Callback from a dialog indicating user was logged out. 3120// Callback from a dialog indicating user was logged out.
3048void finish_disconnect(S32 option, void* userdata) 3121void finish_disconnect(S32 option, void* userdata)
3049{ 3122{
@@ -3172,6 +3245,12 @@ void LLAppViewer::saveNameCache()
3172 } 3245 }
3173} 3246}
3174 3247
3248bool LLAppViewer::isInProductionGrid()
3249{
3250 return (GRID_INFO_AGNI == gGridChoice);
3251}
3252
3253
3175/*! @brief This class is an LLFrameTimer that can be created with 3254/*! @brief This class is an LLFrameTimer that can be created with
3176 an elapsed time that starts counting up from the given value 3255 an elapsed time that starts counting up from the given value
3177 rather than 0.0. 3256 rather than 0.0.