Add build option to allow logging into a single grid only:

* Specify -DSINGLEGRID:BOOL=TRUE and -DSINGLEGRID_URI:STRING=<grid_uri> during configuration
* Only works for OpenSim build (Specify -DOPENSIM:BOOL=TRUE)

Changes compared to default version:
* Grid at <grid_uri> is set as main grid
* Grid selector on login screen is disabled
* Grid list download is disabled
* Grid list is ignored - grid data is always fetched on startup
* OpenSim panel from preferences is removed
* Grid selection via command line parameter is ignored
master
Ansariel 2018-09-30 21:29:26 +02:00
parent 2dfb4ec1e2
commit f4c2ed2103
6 changed files with 28 additions and 4 deletions

View File

@ -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)

View File

@ -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();
}
//<AW opensim>
std::string LLGridManager::trimHypergrid(const std::string& trim)
{

View File

@ -227,6 +227,9 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
LLComboBox* server_choice_combo = getChild<LLComboBox>("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)

View File

@ -726,7 +726,7 @@ BOOL LLFloaterPreference::postBuild()
// [/SL:KB]
// <FS:AW opensim preferences>
#ifndef OPENSIM// <FS:AW optional opensim support/>
#if !defined(OPENSIM) || defined(SINGLEGRID)// <FS:AW optional opensim support/>
// Hide the opensim tab if opensim isn't enabled
LLTabContainer* tab_container = getChild<LLTabContainer>("pref core");
if (tab_container)

View File

@ -893,6 +893,7 @@ bool idle_startup()
// </FS:Techwolf Lupindo>
// <AW: opensim>
#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 // <FS:AW optional opensim support>
// 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 // <FS:AW optional opensim support>
#if defined(OPENSIM) && !defined(SINGLEGRID) // <FS:AW optional opensim support>
// <AW: opensim>
LLGridManager::getInstance()->saveGridList();
// </AW: opensim>

View File

@ -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
// <FS:AW optional opensim support>
#ifdef OPENSIM