Hopefully more correctness in grid manager editor
This commit is contained in:
@@ -2,15 +2,16 @@
|
|||||||
<array>
|
<array>
|
||||||
|
|
||||||
<map>
|
<map>
|
||||||
<key>default_grids_version</key><string>2</string>
|
<key>default_grids_version</key><string>20</string>
|
||||||
</map>
|
</map>
|
||||||
|
|
||||||
<!-- Second Life -->
|
<!-- Second Life -->
|
||||||
<map>
|
<map>
|
||||||
|
<key>gridnick</key><string>secondlife</string>
|
||||||
<key>gridname</key><string>Second Life</string>
|
<key>gridname</key><string>Second Life</string>
|
||||||
<key>platform</key><string>SecondLife</string>
|
<key>platform</key><string>SecondLife</string>
|
||||||
<key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
|
<key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
|
||||||
<key>loginpage</key><string>http://viewer-login.agni.lindenlab.com/</string>
|
<key>loginpage</key><string>http://viewer-login.agni.lindenlab.com/</string>
|
||||||
<key>helperuri</key><string>https://secondlife.com/helpers/</string>
|
<key>helperuri</key><string>https://secondlife.com/helpers/</string>
|
||||||
<key>website</key><string>http://secondlife.com/</string>
|
<key>website</key><string>http://secondlife.com/</string>
|
||||||
<key>support</key><string>http://secondlife.com/support/</string>
|
<key>support</key><string>http://secondlife.com/support/</string>
|
||||||
@@ -18,30 +19,34 @@
|
|||||||
<key>password</key><string>http://secondlife.com/account/request.php</string>
|
<key>password</key><string>http://secondlife.com/account/request.php</string>
|
||||||
<key>render_compat</key><boolean>1</boolean>
|
<key>render_compat</key><boolean>1</boolean>
|
||||||
<key>inventory_links</key><boolean>1</boolean>
|
<key>inventory_links</key><boolean>1</boolean>
|
||||||
|
<key>auto_update</key><boolean>0</boolean>
|
||||||
</map>
|
</map>
|
||||||
|
|
||||||
<map>
|
<map>
|
||||||
|
<key>gridnick</key><string>secondlife_beta</string>
|
||||||
<key>gridname</key><string>Second Life BETA</string>
|
<key>gridname</key><string>Second Life BETA</string>
|
||||||
<key>helperuri</key><string>http://aditi-secondlife.webdev.lindenlab.com/helpers/</string>
|
<key>helperuri</key><string>http://aditi-secondlife.webdev.lindenlab.com/helpers/</string>
|
||||||
<key>loginpage</key><string>http://viewer-login.agni.lindenlab.com/</string>
|
<key>loginpage</key><string>http://viewer-login.agni.lindenlab.com/</string>
|
||||||
<key>loginuri</key><string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string>
|
<key>loginuri</key><string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string>
|
||||||
<key>password</key><string>http://secondlife.com/account/request.php</string>
|
<key>password</key><string>http://secondlife.com/account/request.php</string>
|
||||||
<key>platform</key><string>SecondLife</string>
|
<key>platform</key><string>SecondLife</string>
|
||||||
|
<key>website</key><string>http://secondlife.com/</string>
|
||||||
|
<key>support</key><string>http://secondlife.com/support/</string>
|
||||||
<key>register</key><string>http://secondlife.com/registration/</string>
|
<key>register</key><string>http://secondlife.com/registration/</string>
|
||||||
<key>render_compat</key><boolean>0</boolean>
|
<key>render_compat</key><boolean>0</boolean>
|
||||||
<key>inventory_links</key><boolean>1</boolean>
|
<key>inventory_links</key><boolean>1</boolean>
|
||||||
<key>support</key><string>http://secondlife.com/support/</string>
|
<key>auto_update</key><boolean>0</boolean>
|
||||||
<key>version</key><integer>0</integer>
|
|
||||||
<key>website</key><string>http://secondlife.com/</string>
|
|
||||||
</map>
|
</map>
|
||||||
|
|
||||||
|
|
||||||
<!-- Local Host -->
|
<!-- Local Host -->
|
||||||
<map>
|
<map>
|
||||||
|
<key>gridnick</key><string>local</string>
|
||||||
<key>gridname</key><string>Local Host</string>
|
<key>gridname</key><string>Local Host</string>
|
||||||
<key>platform</key><string>OpenSim</string>
|
<key>platform</key><string>OpenSim</string>
|
||||||
<key>loginuri</key><string>http://127.0.0.1:9000/</string>
|
<key>loginuri</key><string>http://127.0.0.1:9000/</string>
|
||||||
<key>helperuri</key><string>http://127.0.0.1:9000/</string>
|
<key>helperuri</key><string>http://127.0.0.1:9000/</string>
|
||||||
|
<key>auto_update</key><boolean>0</boolean>
|
||||||
</map>
|
</map>
|
||||||
|
|
||||||
</array>
|
</array>
|
||||||
|
|||||||
@@ -40,8 +40,9 @@ HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO("");
|
|||||||
// Initialize
|
// Initialize
|
||||||
|
|
||||||
HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
||||||
mPlatform(PLATFORM_AURORA),
|
mPlatform(PLATFORM_OPENSIM),
|
||||||
mGridName(gridName),
|
mGridName(gridName),
|
||||||
|
mGridNick(LLStringUtil::null),
|
||||||
mLoginUri(LLStringUtil::null),
|
mLoginUri(LLStringUtil::null),
|
||||||
mLoginPage(LLStringUtil::null),
|
mLoginPage(LLStringUtil::null),
|
||||||
mHelperUri(LLStringUtil::null),
|
mHelperUri(LLStringUtil::null),
|
||||||
@@ -50,14 +51,12 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
|||||||
mRegisterUrl(LLStringUtil::null),
|
mRegisterUrl(LLStringUtil::null),
|
||||||
mPasswordUrl(LLStringUtil::null),
|
mPasswordUrl(LLStringUtil::null),
|
||||||
mSearchUrl(LLStringUtil::null),
|
mSearchUrl(LLStringUtil::null),
|
||||||
mFirstName(LLStringUtil::null),
|
|
||||||
mLastName(LLStringUtil::null),
|
|
||||||
mAvatarPassword(LLStringUtil::null),
|
|
||||||
mGridMessage(""),
|
mGridMessage(""),
|
||||||
mXmlState(XML_VOID),
|
mXmlState(XML_VOID),
|
||||||
mVoiceConnector("SLVoice"),
|
mVoiceConnector("SLVoice"),
|
||||||
mRenderCompat(true),
|
mRenderCompat(true),
|
||||||
mInvLinks(false),
|
mInvLinks(false),
|
||||||
|
mAutoUpdate(false),
|
||||||
mMaxAgentGroups(-1),
|
mMaxAgentGroups(-1),
|
||||||
mCurrencySymbol("OS$"),
|
mCurrencySymbol("OS$"),
|
||||||
mRealCurrencySymbol("US$"),
|
mRealCurrencySymbol("US$"),
|
||||||
@@ -143,21 +142,6 @@ const std::string& HippoGridInfo::getGridMessage() const
|
|||||||
return mGridMessage;
|
return mGridMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& HippoGridInfo::getFirstName() const
|
|
||||||
{
|
|
||||||
return mFirstName;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& HippoGridInfo::getLastName() const
|
|
||||||
{
|
|
||||||
return mLastName;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& HippoGridInfo::getAvatarPassword() const
|
|
||||||
{
|
|
||||||
return mAvatarPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HippoGridInfo::isRenderCompat() const
|
bool HippoGridInfo::isRenderCompat() const
|
||||||
{
|
{
|
||||||
return mRenderCompat;
|
return mRenderCompat;
|
||||||
@@ -215,7 +199,26 @@ void HippoGridInfo::setPlatform(const std::string& platform)
|
|||||||
|
|
||||||
void HippoGridInfo::setGridName(const std::string& gridName)
|
void HippoGridInfo::setGridName(const std::string& gridName)
|
||||||
{
|
{
|
||||||
|
HippoGridManager::GridIterator it = gHippoGridManager->mGridInfo.find(mGridName);
|
||||||
|
if(it != gHippoGridManager->endGrid())
|
||||||
|
{
|
||||||
|
gHippoGridManager->mGridInfo.erase(it);
|
||||||
|
gHippoGridManager->mGridInfo[gridName] = this;
|
||||||
|
}
|
||||||
mGridName = gridName;
|
mGridName = gridName;
|
||||||
|
/*if(mGridNick.empty() && !gridName.empty())
|
||||||
|
{
|
||||||
|
setGridNick(gridName);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void HippoGridInfo::setGridNick(std::string gridNick)
|
||||||
|
{
|
||||||
|
mGridNick = sanitizeGridNick(gridNick);
|
||||||
|
if(mGridName.empty() && !gridNick.empty())
|
||||||
|
{
|
||||||
|
setGridName(gridNick);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HippoGridInfo::setLoginUri(const std::string& loginUri)
|
void HippoGridInfo::setLoginUri(const std::string& loginUri)
|
||||||
@@ -265,21 +268,6 @@ void HippoGridInfo::setGridMessage(const std::string& message)
|
|||||||
mGridMessage = message;
|
mGridMessage = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HippoGridInfo::setFirstName(const std::string& firstName)
|
|
||||||
{
|
|
||||||
mFirstName = firstName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HippoGridInfo::setLastName(const std::string& lastName)
|
|
||||||
{
|
|
||||||
mLastName = lastName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HippoGridInfo::setAvatarPassword(const std::string& avatarPassword)
|
|
||||||
{
|
|
||||||
mAvatarPassword = avatarPassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HippoGridInfo::setRenderCompat(bool compat)
|
void HippoGridInfo::setRenderCompat(bool compat)
|
||||||
{
|
{
|
||||||
mRenderCompat = compat;
|
mRenderCompat = compat;
|
||||||
@@ -376,25 +364,25 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use the old search all
|
// Use the old search all
|
||||||
if (ty == SEARCH_ALL_EMPTY)
|
if (ty == SEARCH_ALL_EMPTY)
|
||||||
{
|
{
|
||||||
return (mSearchUrl + "panel=All&");
|
return (mSearchUrl + "panel=All&");
|
||||||
}
|
}
|
||||||
else if (ty == SEARCH_ALL_QUERY)
|
else if (ty == SEARCH_ALL_QUERY)
|
||||||
{
|
{
|
||||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||||
}
|
}
|
||||||
else if (ty == SEARCH_ALL_TEMPLATE)
|
else if (ty == SEARCH_ALL_TEMPLATE)
|
||||||
{
|
{
|
||||||
return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
|
return "lang=[LANG]&m=[MATURITY]&t=[TEEN]®ion=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
llinfos << "Illegal search URL type " << ty << llendl;
|
llinfos << "Illegal search URL type " << ty << llendl;
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -402,7 +390,9 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const
|
|||||||
void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts)
|
void HippoGridInfo::onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts)
|
||||||
{
|
{
|
||||||
HippoGridInfo* self = (HippoGridInfo*)userData;
|
HippoGridInfo* self = (HippoGridInfo*)userData;
|
||||||
if (strcasecmp(name, "gridname") == 0)
|
if (strcasecmp(name, "gridnick") == 0)
|
||||||
|
self->mXmlState = XML_GRIDNICK;
|
||||||
|
else if (strcasecmp(name, "gridname") == 0)
|
||||||
self->mXmlState = XML_GRIDNAME;
|
self->mXmlState = XML_GRIDNAME;
|
||||||
else if (strcasecmp(name, "platform") == 0)
|
else if (strcasecmp(name, "platform") == 0)
|
||||||
self->mXmlState = XML_PLATFORM;
|
self->mXmlState = XML_PLATFORM;
|
||||||
@@ -439,6 +429,13 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le
|
|||||||
HippoGridInfo* self = (HippoGridInfo*)userData;
|
HippoGridInfo* self = (HippoGridInfo*)userData;
|
||||||
switch (self->mXmlState)
|
switch (self->mXmlState)
|
||||||
{
|
{
|
||||||
|
case XML_GRIDNICK:
|
||||||
|
{
|
||||||
|
if (self->mGridNick == "") self->mGridNick.assign(s, len);
|
||||||
|
self->mGridNick = sanitizeGridNick(self->mGridNick);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case XML_PLATFORM:
|
case XML_PLATFORM:
|
||||||
{
|
{
|
||||||
std::string platform(s, len);
|
std::string platform(s, len);
|
||||||
@@ -547,6 +544,39 @@ void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick)
|
||||||
|
{
|
||||||
|
std::string tmp;
|
||||||
|
int size = gridnick.size();
|
||||||
|
for (int i=0; i<size; i++)
|
||||||
|
{
|
||||||
|
char c = gridnick[i];
|
||||||
|
if ((c == '_') || isalnum(c))
|
||||||
|
{
|
||||||
|
tmp += tolower(c);
|
||||||
|
}
|
||||||
|
else if (isspace(c))
|
||||||
|
{
|
||||||
|
tmp += "_";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tmp.length() > 16) {
|
||||||
|
tmp.resize(16);
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const std::string& HippoGridInfo::getGridNick()
|
||||||
|
{
|
||||||
|
if(mGridNick.empty())
|
||||||
|
{
|
||||||
|
mGridNick = sanitizeGridNick(mGridName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mGridNick;
|
||||||
|
}
|
||||||
|
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
// Static Helpers
|
// Static Helpers
|
||||||
@@ -589,14 +619,16 @@ void HippoGridInfo::initFallback()
|
|||||||
FALLBACK_GRIDINFO.setHelperUri("http://127.0.0.1:9000/");
|
FALLBACK_GRIDINFO.setHelperUri("http://127.0.0.1:9000/");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HippoGridInfo::supportsInvLinks(){
|
bool HippoGridInfo::supportsInvLinks()
|
||||||
|
{
|
||||||
if(isSecondLife())
|
if(isSecondLife())
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return mInvLinks;
|
return mInvLinks;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HippoGridInfo::setSupportsInvLinks(bool b) {
|
void HippoGridInfo::setSupportsInvLinks(bool b)
|
||||||
|
{
|
||||||
if (b == true && mInvLinks == false)
|
if (b == true && mInvLinks == false)
|
||||||
{
|
{
|
||||||
llinfos << "Inventory Link support detected" << llendl;
|
llinfos << "Inventory Link support detected" << llendl;
|
||||||
@@ -604,6 +636,19 @@ void HippoGridInfo::setSupportsInvLinks(bool b) {
|
|||||||
mInvLinks = b;
|
mInvLinks = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HippoGridInfo::getAutoUpdate()
|
||||||
|
{
|
||||||
|
if(isSecondLife())
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return mAutoUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HippoGridInfo::setAutoUpdate(bool b)
|
||||||
|
{
|
||||||
|
mAutoUpdate = b;
|
||||||
|
}
|
||||||
|
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
// HippoGridManager
|
// HippoGridManager
|
||||||
@@ -615,8 +660,8 @@ void HippoGridInfo::setSupportsInvLinks(bool b) {
|
|||||||
// Initialize
|
// Initialize
|
||||||
|
|
||||||
HippoGridManager::HippoGridManager() :
|
HippoGridManager::HippoGridManager() :
|
||||||
mConnectedGrid(0),
|
mConnectedGrid(0),
|
||||||
mDefaultGridsVersion(0),
|
mDefaultGridsVersion(0),
|
||||||
mCurrentGrid("Local Host"),
|
mCurrentGrid("Local Host"),
|
||||||
mDefaultGrid("Local Host")
|
mDefaultGrid("Local Host")
|
||||||
{
|
{
|
||||||
@@ -759,13 +804,13 @@ void HippoGridManager::setDefaultGrid(const std::string& grid)
|
|||||||
{
|
{
|
||||||
mDefaultGrid = grid;
|
mDefaultGrid = grid;
|
||||||
}
|
}
|
||||||
else if (mGridInfo.find("secondlife") != mGridInfo.end())
|
else if (mGridInfo.find("Second life") != mGridInfo.end())
|
||||||
{
|
{
|
||||||
mDefaultGrid = "secondlife";
|
mDefaultGrid = "Second Life";
|
||||||
}
|
}
|
||||||
else if (!mGridInfo.empty())
|
else if (!mGridInfo.empty())
|
||||||
{
|
{
|
||||||
mDefaultGrid = mGridInfo.begin()->first;
|
mDefaultGrid = mGridInfo.begin()->first;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -784,7 +829,7 @@ void HippoGridManager::setCurrentGrid(const std::string& grid)
|
|||||||
else if (!mGridInfo.empty())
|
else if (!mGridInfo.empty())
|
||||||
{
|
{
|
||||||
llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
|
llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
|
||||||
mCurrentGrid = mDefaultGrid;
|
mCurrentGrid = mDefaultGrid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -796,9 +841,9 @@ void HippoGridManager::loadFromFile()
|
|||||||
{
|
{
|
||||||
mDefaultGridsVersion = 0;
|
mDefaultGridsVersion = 0;
|
||||||
// load user grid info
|
// load user grid info
|
||||||
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg2.xml"), false);
|
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml"), false);
|
||||||
// merge default grid info, if newer. Force load, if list of grids is empty.
|
// merge default grid info, if newer. Force load, if list of grids is empty.
|
||||||
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
|
parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), true);
|
||||||
// merge grid info from web site, if newer. Force load, if list of grids is empty.
|
// merge grid info from web site, if newer. Force load, if list of grids is empty.
|
||||||
if (gSavedSettings.getBOOL("CheckForGridUpdates"))
|
if (gSavedSettings.getBOOL("CheckForGridUpdates"))
|
||||||
parseUrl(gSavedSettings.getString("GridUpdateList"), !mGridInfo.empty());
|
parseUrl(gSavedSettings.getString("GridUpdateList"), !mGridInfo.empty());
|
||||||
@@ -886,14 +931,32 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
|||||||
{
|
{
|
||||||
mDefaultGridsVersion = gridMap["default_grids_version"];
|
mDefaultGridsVersion = gridMap["default_grids_version"];
|
||||||
}
|
}
|
||||||
else if (gridMap.has("gridname") && gridMap.has("loginuri"))
|
else if ((gridMap.has("gridnick") || gridMap.has("gridname")) && gridMap.has("loginuri"))
|
||||||
{
|
{
|
||||||
|
std::string gridnick = gridMap["gridnick"];
|
||||||
std::string gridname = gridMap["gridname"];
|
std::string gridname = gridMap["gridname"];
|
||||||
|
|
||||||
HippoGridInfo* grid;
|
HippoGridInfo* grid;
|
||||||
GridIterator it = mGridInfo.find(gridname);
|
GridIterator it = mGridInfo.end();
|
||||||
|
for (it = mGridInfo.begin(); it != mGridInfo.end(); ++it)
|
||||||
|
{
|
||||||
|
if(!gridnick.empty() && (it->second->getGridNick() == gridnick))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(gridnick.empty() && !gridname.empty() && (it->first == gridname))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool newGrid = (it == mGridInfo.end());
|
bool newGrid = (it == mGridInfo.end());
|
||||||
if (newGrid)
|
if (newGrid)
|
||||||
{
|
{
|
||||||
|
if(gridname.empty())
|
||||||
|
{
|
||||||
|
gridname = gridnick;
|
||||||
|
}
|
||||||
// create new grid info
|
// create new grid info
|
||||||
grid = new HippoGridInfo(gridname);
|
grid = new HippoGridInfo(gridname);
|
||||||
}
|
}
|
||||||
@@ -905,6 +968,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
|||||||
grid->setLoginUri(gridMap["loginuri"]);
|
grid->setLoginUri(gridMap["loginuri"]);
|
||||||
if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
|
if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
|
||||||
if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
|
if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]);
|
||||||
|
if (gridMap.has("gridnick")) grid->setGridNick(gridMap["gridnick"]);
|
||||||
if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
|
if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]);
|
||||||
if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
|
if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
|
||||||
if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
|
if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
|
||||||
@@ -914,9 +978,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
|||||||
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
||||||
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
||||||
if (gridMap.has("inventory_links")) grid->setSupportsInvLinks(gridMap["inventory_links"]);
|
if (gridMap.has("inventory_links")) grid->setSupportsInvLinks(gridMap["inventory_links"]);
|
||||||
// if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
|
if (gridMap.has("auto_update")) grid->setAutoUpdate(gridMap["auto_update"]);
|
||||||
// if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
|
|
||||||
// if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
|
|
||||||
if (newGrid) addGrid(grid);
|
if (newGrid) addGrid(grid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -939,6 +1001,7 @@ void HippoGridManager::saveFile()
|
|||||||
{
|
{
|
||||||
HippoGridInfo* grid = it->second;
|
HippoGridInfo* grid = it->second;
|
||||||
gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
|
gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
|
||||||
|
gridInfo[i]["gridnick"] = grid->getGridNick();
|
||||||
gridInfo[i]["gridname"] = grid->getGridName();
|
gridInfo[i]["gridname"] = grid->getGridName();
|
||||||
gridInfo[i]["loginuri"] = grid->getLoginUri();
|
gridInfo[i]["loginuri"] = grid->getLoginUri();
|
||||||
gridInfo[i]["loginpage"] = grid->getLoginPage();
|
gridInfo[i]["loginpage"] = grid->getLoginPage();
|
||||||
@@ -947,17 +1010,15 @@ void HippoGridManager::saveFile()
|
|||||||
gridInfo[i]["support"] = grid->getSupportUrl();
|
gridInfo[i]["support"] = grid->getSupportUrl();
|
||||||
gridInfo[i]["register"] = grid->getRegisterUrl();
|
gridInfo[i]["register"] = grid->getRegisterUrl();
|
||||||
gridInfo[i]["password"] = grid->getPasswordUrl();
|
gridInfo[i]["password"] = grid->getPasswordUrl();
|
||||||
// gridInfo[i]["firstname"] = grid->getFirstName();
|
|
||||||
// gridInfo[i]["lastname"] = grid->getLastName();
|
|
||||||
// gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
|
|
||||||
|
|
||||||
gridInfo[i]["search"] = grid->getSearchUrl();
|
gridInfo[i]["search"] = grid->getSearchUrl();
|
||||||
gridInfo[i]["render_compat"] = grid->isRenderCompat();
|
gridInfo[i]["render_compat"] = grid->isRenderCompat();
|
||||||
gridInfo[i]["inventory_links"] = grid->supportsInvLinks();
|
gridInfo[i]["inventory_links"] = grid->supportsInvLinks();
|
||||||
|
gridInfo[i]["auto_update"] = grid->getAutoUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// write client grid info file
|
// write client grid info file
|
||||||
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg2.xml");
|
std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml");
|
||||||
llofstream file;
|
llofstream file;
|
||||||
file.open(fileName.c_str());
|
file.open(fileName.c_str());
|
||||||
if (file.is_open())
|
if (file.is_open())
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public:
|
|||||||
Platform getPlatform();
|
Platform getPlatform();
|
||||||
bool isOpenSimulator() const;
|
bool isOpenSimulator() const;
|
||||||
bool isSecondLife() const;
|
bool isSecondLife() const;
|
||||||
|
const std::string& getGridNick();
|
||||||
const std::string& getGridName() const;
|
const std::string& getGridName() const;
|
||||||
const std::string& getGridOwner() const;
|
const std::string& getGridOwner() const;
|
||||||
const std::string& getLoginUri() const;
|
const std::string& getLoginUri() const;
|
||||||
@@ -51,9 +52,6 @@ public:
|
|||||||
// Returns the url base used for the Web Search tab
|
// Returns the url base used for the Web Search tab
|
||||||
const std::string& getSearchUrl() const;
|
const std::string& getSearchUrl() const;
|
||||||
const std::string& getGridMessage() const;
|
const std::string& getGridMessage() const;
|
||||||
const std::string& getFirstName() const;
|
|
||||||
const std::string& getLastName() const;
|
|
||||||
const std::string& getAvatarPassword() const;
|
|
||||||
const std::string& getVoiceConnector() const { return mVoiceConnector; }
|
const std::string& getVoiceConnector() const { return mVoiceConnector; }
|
||||||
std::string getSearchUrl(SearchType ty, bool is_web) const;
|
std::string getSearchUrl(SearchType ty, bool is_web) const;
|
||||||
bool isRenderCompat() const;
|
bool isRenderCompat() const;
|
||||||
@@ -67,6 +65,7 @@ public:
|
|||||||
|
|
||||||
void setPlatform (const std::string& platform);
|
void setPlatform (const std::string& platform);
|
||||||
void setPlatform (Platform platform);
|
void setPlatform (Platform platform);
|
||||||
|
void setGridNick (std::string gridNick);
|
||||||
void setGridName (const std::string& gridName);
|
void setGridName (const std::string& gridName);
|
||||||
void setLoginUri (const std::string& loginUri);
|
void setLoginUri (const std::string& loginUri);
|
||||||
void setLoginPage(const std::string& loginPage);
|
void setLoginPage(const std::string& loginPage);
|
||||||
@@ -80,9 +79,6 @@ public:
|
|||||||
void setGridMessage(const std::string& message);
|
void setGridMessage(const std::string& message);
|
||||||
void setRenderCompat(bool compat);
|
void setRenderCompat(bool compat);
|
||||||
void setMaxAgentGroups(int max) { mMaxAgentGroups = max; }
|
void setMaxAgentGroups(int max) { mMaxAgentGroups = max; }
|
||||||
void setFirstName(const std::string& firstName);
|
|
||||||
void setLastName(const std::string& lastName);
|
|
||||||
void setAvatarPassword(const std::string& avatarPassword);
|
|
||||||
void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; }
|
void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; }
|
||||||
|
|
||||||
void setCurrencySymbol(const std::string& sym);
|
void setCurrencySymbol(const std::string& sym);
|
||||||
@@ -90,10 +86,13 @@ public:
|
|||||||
void setDirectoryFee(int fee);
|
void setDirectoryFee(int fee);
|
||||||
bool supportsInvLinks();
|
bool supportsInvLinks();
|
||||||
void setSupportsInvLinks(bool b);
|
void setSupportsInvLinks(bool b);
|
||||||
|
bool getAutoUpdate();
|
||||||
|
void setAutoUpdate(bool b);
|
||||||
|
|
||||||
bool retrieveGridInfo();
|
bool retrieveGridInfo();
|
||||||
|
|
||||||
static const char* getPlatformString(Platform platform);
|
static const char* getPlatformString(Platform platform);
|
||||||
|
static std::string sanitizeGridNick(std::string &gridnick);
|
||||||
|
|
||||||
static HippoGridInfo FALLBACK_GRIDINFO;
|
static HippoGridInfo FALLBACK_GRIDINFO;
|
||||||
static void initFallback();
|
static void initFallback();
|
||||||
@@ -101,6 +100,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
Platform mPlatform;
|
Platform mPlatform;
|
||||||
std::string mGridName;
|
std::string mGridName;
|
||||||
|
std::string mGridNick;
|
||||||
std::string mLoginUri;
|
std::string mLoginUri;
|
||||||
std::string mLoginPage;
|
std::string mLoginPage;
|
||||||
std::string mHelperUri;
|
std::string mHelperUri;
|
||||||
@@ -110,11 +110,9 @@ private:
|
|||||||
std::string mPasswordUrl;
|
std::string mPasswordUrl;
|
||||||
std::string mSearchUrl;
|
std::string mSearchUrl;
|
||||||
std::string mVoiceConnector;
|
std::string mVoiceConnector;
|
||||||
std::string mFirstName;
|
|
||||||
std::string mLastName;
|
|
||||||
std::string mAvatarPassword;
|
|
||||||
bool mRenderCompat;
|
bool mRenderCompat;
|
||||||
bool mInvLinks;
|
bool mInvLinks;
|
||||||
|
bool mAutoUpdate;
|
||||||
int mMaxAgentGroups;
|
int mMaxAgentGroups;
|
||||||
|
|
||||||
std::string mCurrencySymbol;
|
std::string mCurrencySymbol;
|
||||||
@@ -125,7 +123,7 @@ private:
|
|||||||
// for parsing grid info XML
|
// for parsing grid info XML
|
||||||
enum XmlState
|
enum XmlState
|
||||||
{
|
{
|
||||||
XML_VOID, XML_PLATFORM, XML_GRIDNAME,
|
XML_VOID, XML_PLATFORM, XML_GRIDNAME, XML_GRIDNICK,
|
||||||
XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
|
XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
|
||||||
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH, XML_MESSAGE
|
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH, XML_MESSAGE
|
||||||
};
|
};
|
||||||
@@ -168,6 +166,7 @@ public:
|
|||||||
GridIterator endGrid() { return mGridInfo.end(); }
|
GridIterator endGrid() { return mGridInfo.end(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class HippoGridInfo;
|
||||||
std::map<std::string, HippoGridInfo*> mGridInfo;
|
std::map<std::string, HippoGridInfo*> mGridInfo;
|
||||||
std::string mDefaultGrid;
|
std::string mDefaultGrid;
|
||||||
std::string mCurrentGrid;
|
std::string mCurrentGrid;
|
||||||
|
|||||||
@@ -295,14 +295,21 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
|||||||
HippoGridInfo *gridInfo = 0;
|
HippoGridInfo *gridInfo = 0;
|
||||||
|
|
||||||
gridInfo = gHippoGridManager->getGrid(mCurGrid);
|
gridInfo = gHippoGridManager->getGrid(mCurGrid);
|
||||||
gridInfo->retrieveGridInfo();
|
//gridInfo->retrieveGridInfo();
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
|
std::string gridname = childGetValue("gridname");
|
||||||
|
if (gridname == "<required>") gridname = "";
|
||||||
|
std::string loginuri = childGetValue("loginuri");
|
||||||
|
if (loginuri == "<required>") loginuri = "";
|
||||||
|
|
||||||
|
if (gridname.empty() && !loginuri.empty())
|
||||||
|
this->retrieveGridInfo();
|
||||||
|
|
||||||
if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
|
if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
|
||||||
|
|
||||||
// check nickname
|
// check nickname
|
||||||
std::string gridname = childGetValue("gridname");
|
std::string gridname = childGetValue("gridname");
|
||||||
if (gridname == "<required>") gridname = "";
|
|
||||||
childSetValue("gridname", (gridname != "")? gridname: "<required>");
|
childSetValue("gridname", (gridname != "")? gridname: "<required>");
|
||||||
if (gridname == "") {
|
if (gridname == "") {
|
||||||
LLNotificationsUtil::add("GridsNoNick");
|
LLNotificationsUtil::add("GridsNoNick");
|
||||||
@@ -316,8 +323,7 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check login URI
|
// check login URI
|
||||||
std::string loginuri = childGetValue("loginuri");
|
if (loginuri == "") {
|
||||||
if ((loginuri == "") || (loginuri == "<required>")) {
|
|
||||||
LLSD args;
|
LLSD args;
|
||||||
args["NAME"] = gridname;
|
args["NAME"] = gridname;
|
||||||
LLNotificationsUtil::add("GridsNoLoginUri", args);
|
LLNotificationsUtil::add("GridsNoLoginUri", args);
|
||||||
@@ -329,11 +335,6 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
|||||||
gridInfo = new HippoGridInfo(gridname);
|
gridInfo = new HippoGridInfo(gridname);
|
||||||
gHippoGridManager->addGrid(gridInfo);
|
gHippoGridManager->addGrid(gridInfo);
|
||||||
gridInfo->retrieveGridInfo();
|
gridInfo->retrieveGridInfo();
|
||||||
} else {
|
|
||||||
|
|
||||||
llwarns << "Illegal state " << mState << '.' << llendl;
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gridInfo) {
|
if (!gridInfo) {
|
||||||
|
|||||||
@@ -861,7 +861,7 @@ void LLPanelLogin::updateGridCombo()
|
|||||||
}
|
}
|
||||||
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
|
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
|
||||||
for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
|
for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
|
||||||
const std::string &grid = it->second->getGridName();
|
std::string grid = it->second->getGridName();
|
||||||
if (grid != defaultGrid) {
|
if (grid != defaultGrid) {
|
||||||
grids->add(grid);
|
grids->add(grid);
|
||||||
if (grid == currentGrid) selectIndex = i;
|
if (grid == currentGrid) selectIndex = i;
|
||||||
@@ -959,7 +959,10 @@ void LLPanelLogin::loadLoginPage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (gHippoGridManager->getConnectedGrid()->isOpenSimulator()){
|
||||||
|
oStr << "&grid=" << gHippoGridManager->getConnectedGrid()->getGridNick();
|
||||||
|
}
|
||||||
|
else if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA)
|
||||||
{
|
{
|
||||||
oStr << "&grid=" << LLWeb::curlEscape(LLViewerLogin::getInstance()->getGridLabel());
|
oStr << "&grid=" << LLWeb::curlEscape(LLViewerLogin::getInstance()->getGridLabel());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ void LLPrefsIMImpl::apply()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(),
|
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getConnectedGrid()->getGridNick(),
|
||||||
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
|
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1019,7 +1019,7 @@ bool idle_startup()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
|
gDirUtilp->setLindenUserDir(gHippoGridManager->getConnectedGrid()->getGridNick(), firstname, lastname);
|
||||||
}
|
}
|
||||||
LLFile::mkdir(gDirUtilp->getLindenUserDir());
|
LLFile::mkdir(gDirUtilp->getLindenUserDir());
|
||||||
|
|
||||||
@@ -1059,7 +1059,7 @@ bool idle_startup()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(),
|
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getConnectedGrid()->getGridNick(),
|
||||||
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
|
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
|
||||||
}
|
}
|
||||||
LLFile::mkdir(gDirUtilp->getChatLogsDir());
|
LLFile::mkdir(gDirUtilp->getChatLogsDir());
|
||||||
|
|||||||
Reference in New Issue
Block a user