diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 2dc666568d..9bd8341c5c 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -24,7 +24,12 @@ endif (NOT CMAKE_BUILD_TYPE) option(OPENSIM "OpenSim support" OFF) if (OPENSIM) add_definitions(-DOPENSIM=1) - message("compiling with OpenSim support") + if (SINGLEGRID) + add_definitions(-DSINGLEGRID=1 -DSINGLEGRID_URI=\"${SINGLEGRID_URI}\") + message("compiling with OpenSim support - Single Grid version (${SINGLEGRID_URI})") + else (SINGLEGRID) + message("compiling with OpenSim support") + endif (SINGLEGRID) else (OPENSIM) message("compiling without OpenSim support") endif (OPENSIM) diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 4d14e46566..15d86fb839 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -180,15 +180,19 @@ void LLGridManager::initGrids() mGridList = LLSD(); std::string grid_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "grids.xml"); +#ifndef SINGLEGRID std::string grid_user_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids.user.xml"); std::string grid_remote_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids.remote.xml"); mGridFile = grid_user_file; +#endif initSystemGrids(); +#ifndef SINGLEGRID initGridList(grid_file, FINISH); initGridList(grid_remote_file, FINISH); initGridList(grid_user_file, FINISH); +#endif if(!mCommandLineDone) { @@ -263,6 +267,7 @@ void LLGridManager::initCmdLineGrids() // set it as the 'selected' grid. std::string grid; +#ifndef SINGLEGRID std::string cmd_line_grid = gSavedSettings.getString("CmdLineGridChoice"); if (!cmd_line_grid.empty()) { @@ -294,7 +299,8 @@ void LLGridManager::initCmdLineGrids() grid = gSavedSettings.getString("CurrentGrid"); LL_DEBUGS("GridManager") << "Setting grid from last selection " << grid << LL_ENDL; } - +#endif + if (grid.empty()) { // no grid was specified so default to maingrid @@ -1290,6 +1296,7 @@ void LLGridManager::saveGridList() LLSDSerialize::toPrettyXML(output_grid_list, llsd_xml); llsd_xml.close(); } + // std::string LLGridManager::trimHypergrid(const std::string& trim) { diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 61b698c746..f262733a71 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -227,6 +227,9 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect, LLComboBox* server_choice_combo = getChild("server_combo"); server_choice_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectServer, this)); +#ifdef SINGLEGRID + server_choice_combo->setEnabled(FALSE); +#endif updateServer(); if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 74b5c68814..480675389b 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -726,7 +726,7 @@ BOOL LLFloaterPreference::postBuild() // [/SL:KB] // -#ifndef OPENSIM// +#if !defined(OPENSIM) || defined(SINGLEGRID)// // Hide the opensim tab if opensim isn't enabled LLTabContainer* tab_container = getChild("pref core"); if (tab_container) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 30bf125e12..cd3adf262d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -893,6 +893,7 @@ bool idle_startup() // // +#ifndef SINGLEGRID if(!gSavedSettings.getBOOL("GridListDownload")) { sGridListRequestReady = true; @@ -912,6 +913,10 @@ bool idle_startup() std::string url = gSavedSettings.getString("GridListDownloadURL"); FSCoreHttpUtil::callbackHttpGet(url, last_modified, boost::bind(downloadGridlistComplete, _1), boost::bind(downloadGridlistError, _1, url)); } +#else + sGridListRequestReady = true; +#endif + #ifdef OPENSIM // // Fetch grid infos as needed LLGridManager::getInstance()->initGrids(); @@ -1654,7 +1659,7 @@ bool idle_startup() // This call to LLLoginInstance::connect() starts the // authentication process. login->connect(gUserCredential); -#ifdef OPENSIM // +#if defined(OPENSIM) && !defined(SINGLEGRID) // // LLGridManager::getInstance()->saveGridList(); // diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index a335f2b48a..02de79b263 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -32,7 +32,11 @@ const std::string SECOND_LIFE_MAIN_LABEL = "Second Life"; const std::string SECOND_LIFE_BETA_LABEL = "Second Life Beta"; // @TODO this really should be private, but is used in llslurl +#if defined(OPENSIM) && defined(SINGLEGRID) +const std::string MAINGRID = SINGLEGRID_URI; +#else const std::string MAINGRID = "util.agni.lindenlab.com"; +#endif // #ifdef OPENSIM