Hopefully more correctness in grid manager editor
This commit is contained in:
@@ -2,15 +2,16 @@
|
||||
<array>
|
||||
|
||||
<map>
|
||||
<key>default_grids_version</key><string>2</string>
|
||||
<key>default_grids_version</key><string>20</string>
|
||||
</map>
|
||||
|
||||
<!-- Second Life -->
|
||||
<map>
|
||||
<key>gridnick</key><string>secondlife</string>
|
||||
<key>gridname</key><string>Second Life</string>
|
||||
<key>platform</key><string>SecondLife</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>website</key><string>http://secondlife.com/</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>render_compat</key><boolean>1</boolean>
|
||||
<key>inventory_links</key><boolean>1</boolean>
|
||||
<key>auto_update</key><boolean>0</boolean>
|
||||
</map>
|
||||
|
||||
<map>
|
||||
<key>gridnick</key><string>secondlife_beta</string>
|
||||
<key>gridname</key><string>Second Life BETA</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>password</key><string>http://secondlife.com/account/request.php</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>render_compat</key><boolean>0</boolean>
|
||||
<key>inventory_links</key><boolean>1</boolean>
|
||||
<key>support</key><string>http://secondlife.com/support/</string>
|
||||
<key>version</key><integer>0</integer>
|
||||
<key>website</key><string>http://secondlife.com/</string>
|
||||
<key>auto_update</key><boolean>0</boolean>
|
||||
</map>
|
||||
|
||||
|
||||
<!-- Local Host -->
|
||||
<map>
|
||||
<key>gridnick</key><string>local</string>
|
||||
<key>gridname</key><string>Local Host</string>
|
||||
<key>platform</key><string>OpenSim</string>
|
||||
<key>loginuri</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>
|
||||
|
||||
</array>
|
||||
|
||||
@@ -40,8 +40,9 @@ HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO("");
|
||||
// Initialize
|
||||
|
||||
HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
||||
mPlatform(PLATFORM_AURORA),
|
||||
mPlatform(PLATFORM_OPENSIM),
|
||||
mGridName(gridName),
|
||||
mGridNick(LLStringUtil::null),
|
||||
mLoginUri(LLStringUtil::null),
|
||||
mLoginPage(LLStringUtil::null),
|
||||
mHelperUri(LLStringUtil::null),
|
||||
@@ -50,14 +51,12 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
||||
mRegisterUrl(LLStringUtil::null),
|
||||
mPasswordUrl(LLStringUtil::null),
|
||||
mSearchUrl(LLStringUtil::null),
|
||||
mFirstName(LLStringUtil::null),
|
||||
mLastName(LLStringUtil::null),
|
||||
mAvatarPassword(LLStringUtil::null),
|
||||
mGridMessage(""),
|
||||
mXmlState(XML_VOID),
|
||||
mVoiceConnector("SLVoice"),
|
||||
mRenderCompat(true),
|
||||
mInvLinks(false),
|
||||
mAutoUpdate(false),
|
||||
mMaxAgentGroups(-1),
|
||||
mCurrencySymbol("OS$"),
|
||||
mRealCurrencySymbol("US$"),
|
||||
@@ -143,21 +142,6 @@ const std::string& HippoGridInfo::getGridMessage() const
|
||||
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
|
||||
{
|
||||
return mRenderCompat;
|
||||
@@ -215,7 +199,26 @@ void HippoGridInfo::setPlatform(const std::string& platform)
|
||||
|
||||
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;
|
||||
/*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)
|
||||
@@ -265,21 +268,6 @@ void HippoGridInfo::setGridMessage(const std::string& 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)
|
||||
{
|
||||
mRenderCompat = compat;
|
||||
@@ -376,25 +364,25 @@ std::string HippoGridInfo::getSearchUrl(SearchType ty, bool is_web) const
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use the old search all
|
||||
if (ty == SEARCH_ALL_EMPTY)
|
||||
// Use the old search all
|
||||
if (ty == SEARCH_ALL_EMPTY)
|
||||
{
|
||||
return (mSearchUrl + "panel=All&");
|
||||
}
|
||||
return (mSearchUrl + "panel=All&");
|
||||
}
|
||||
else if (ty == SEARCH_ALL_QUERY)
|
||||
{
|
||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||
}
|
||||
return (mSearchUrl + "q=[QUERY]&s=[COLLECTION]&");
|
||||
}
|
||||
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
|
||||
{
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
llinfos << "Illegal search URL type " << ty << llendl;
|
||||
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)
|
||||
{
|
||||
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;
|
||||
else if (strcasecmp(name, "platform") == 0)
|
||||
self->mXmlState = XML_PLATFORM;
|
||||
@@ -439,28 +429,35 @@ void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int le
|
||||
HippoGridInfo* self = (HippoGridInfo*)userData;
|
||||
switch (self->mXmlState)
|
||||
{
|
||||
case XML_PLATFORM:
|
||||
case XML_GRIDNICK:
|
||||
{
|
||||
if (self->mGridNick == "") self->mGridNick.assign(s, len);
|
||||
self->mGridNick = sanitizeGridNick(self->mGridNick);
|
||||
break;
|
||||
}
|
||||
|
||||
case XML_PLATFORM:
|
||||
{
|
||||
std::string platform(s, len);
|
||||
self->setPlatform(platform);
|
||||
break;
|
||||
}
|
||||
|
||||
case XML_LOGINURI:
|
||||
case XML_LOGINURI:
|
||||
{
|
||||
std::string loginuri(s, len);
|
||||
self->mLoginUri = sanitizeUri( loginuri );
|
||||
break;
|
||||
}
|
||||
|
||||
case XML_HELPERURI:
|
||||
case XML_HELPERURI:
|
||||
{
|
||||
std::string helperuri(s, len);
|
||||
self->mHelperUri = sanitizeUri( helperuri );
|
||||
break;
|
||||
}
|
||||
|
||||
case XML_SEARCH:
|
||||
case XML_SEARCH:
|
||||
{
|
||||
self->mSearchUrl.assign(s, len);
|
||||
//sanitizeQueryUrl(mSearchUrl);
|
||||
@@ -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
|
||||
@@ -589,14 +619,16 @@ void HippoGridInfo::initFallback()
|
||||
FALLBACK_GRIDINFO.setHelperUri("http://127.0.0.1:9000/");
|
||||
}
|
||||
|
||||
bool HippoGridInfo::supportsInvLinks(){
|
||||
bool HippoGridInfo::supportsInvLinks()
|
||||
{
|
||||
if(isSecondLife())
|
||||
return true;
|
||||
else
|
||||
return mInvLinks;
|
||||
}
|
||||
|
||||
void HippoGridInfo::setSupportsInvLinks(bool b) {
|
||||
void HippoGridInfo::setSupportsInvLinks(bool b)
|
||||
{
|
||||
if (b == true && mInvLinks == false)
|
||||
{
|
||||
llinfos << "Inventory Link support detected" << llendl;
|
||||
@@ -604,6 +636,19 @@ void HippoGridInfo::setSupportsInvLinks(bool b) {
|
||||
mInvLinks = b;
|
||||
}
|
||||
|
||||
bool HippoGridInfo::getAutoUpdate()
|
||||
{
|
||||
if(isSecondLife())
|
||||
return false;
|
||||
else
|
||||
return mAutoUpdate;
|
||||
}
|
||||
|
||||
void HippoGridInfo::setAutoUpdate(bool b)
|
||||
{
|
||||
mAutoUpdate = b;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// ********************************************************************
|
||||
// HippoGridManager
|
||||
@@ -615,8 +660,8 @@ void HippoGridInfo::setSupportsInvLinks(bool b) {
|
||||
// Initialize
|
||||
|
||||
HippoGridManager::HippoGridManager() :
|
||||
mConnectedGrid(0),
|
||||
mDefaultGridsVersion(0),
|
||||
mConnectedGrid(0),
|
||||
mDefaultGridsVersion(0),
|
||||
mCurrentGrid("Local Host"),
|
||||
mDefaultGrid("Local Host")
|
||||
{
|
||||
@@ -759,13 +804,13 @@ void HippoGridManager::setDefaultGrid(const std::string& 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())
|
||||
{
|
||||
mDefaultGrid = mGridInfo.begin()->first;
|
||||
mDefaultGrid = mGridInfo.begin()->first;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -784,7 +829,7 @@ void HippoGridManager::setCurrentGrid(const std::string& grid)
|
||||
else if (!mGridInfo.empty())
|
||||
{
|
||||
llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl;
|
||||
mCurrentGrid = mDefaultGrid;
|
||||
mCurrentGrid = mDefaultGrid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,9 +841,9 @@ void HippoGridManager::loadFromFile()
|
||||
{
|
||||
mDefaultGridsVersion = 0;
|
||||
// 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.
|
||||
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.
|
||||
if (gSavedSettings.getBOOL("CheckForGridUpdates"))
|
||||
parseUrl(gSavedSettings.getString("GridUpdateList"), !mGridInfo.empty());
|
||||
@@ -886,14 +931,32 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
{
|
||||
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"];
|
||||
|
||||
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());
|
||||
if (newGrid)
|
||||
{
|
||||
if(gridname.empty())
|
||||
{
|
||||
gridname = gridnick;
|
||||
}
|
||||
// create new grid info
|
||||
grid = new HippoGridInfo(gridname);
|
||||
}
|
||||
@@ -905,6 +968,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
grid->setLoginUri(gridMap["loginuri"]);
|
||||
if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]);
|
||||
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("helperuri")) grid->setHelperUri(gridMap["helperuri"]);
|
||||
if (gridMap.has("website")) grid->setWebSite(gridMap["website"]);
|
||||
@@ -913,10 +977,8 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
||||
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
|
||||
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
||||
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
||||
if (gridMap.has("inventory_links")) grid->setSupportsInvLinks(gridMap["inventory_links"]);
|
||||
// if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
|
||||
// if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
|
||||
// if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
|
||||
if (gridMap.has("inventory_links")) grid->setSupportsInvLinks(gridMap["inventory_links"]);
|
||||
if (gridMap.has("auto_update")) grid->setAutoUpdate(gridMap["auto_update"]);
|
||||
if (newGrid) addGrid(grid);
|
||||
}
|
||||
}
|
||||
@@ -939,6 +1001,7 @@ void HippoGridManager::saveFile()
|
||||
{
|
||||
HippoGridInfo* grid = it->second;
|
||||
gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform());
|
||||
gridInfo[i]["gridnick"] = grid->getGridNick();
|
||||
gridInfo[i]["gridname"] = grid->getGridName();
|
||||
gridInfo[i]["loginuri"] = grid->getLoginUri();
|
||||
gridInfo[i]["loginpage"] = grid->getLoginPage();
|
||||
@@ -947,17 +1010,15 @@ void HippoGridManager::saveFile()
|
||||
gridInfo[i]["support"] = grid->getSupportUrl();
|
||||
gridInfo[i]["register"] = grid->getRegisterUrl();
|
||||
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]["render_compat"] = grid->isRenderCompat();
|
||||
gridInfo[i]["inventory_links"] = grid->supportsInvLinks();
|
||||
gridInfo[i]["auto_update"] = grid->getAutoUpdate();
|
||||
}
|
||||
|
||||
// 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;
|
||||
file.open(fileName.c_str());
|
||||
if (file.is_open())
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
Platform getPlatform();
|
||||
bool isOpenSimulator() const;
|
||||
bool isSecondLife() const;
|
||||
const std::string& getGridNick();
|
||||
const std::string& getGridName() const;
|
||||
const std::string& getGridOwner() const;
|
||||
const std::string& getLoginUri() const;
|
||||
@@ -51,9 +52,6 @@ public:
|
||||
// Returns the url base used for the Web Search tab
|
||||
const std::string& getSearchUrl() 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; }
|
||||
std::string getSearchUrl(SearchType ty, bool is_web) const;
|
||||
bool isRenderCompat() const;
|
||||
@@ -67,6 +65,7 @@ public:
|
||||
|
||||
void setPlatform (const std::string& platform);
|
||||
void setPlatform (Platform platform);
|
||||
void setGridNick (std::string gridNick);
|
||||
void setGridName (const std::string& gridName);
|
||||
void setLoginUri (const std::string& loginUri);
|
||||
void setLoginPage(const std::string& loginPage);
|
||||
@@ -80,9 +79,6 @@ public:
|
||||
void setGridMessage(const std::string& message);
|
||||
void setRenderCompat(bool compat);
|
||||
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 setCurrencySymbol(const std::string& sym);
|
||||
@@ -90,10 +86,13 @@ public:
|
||||
void setDirectoryFee(int fee);
|
||||
bool supportsInvLinks();
|
||||
void setSupportsInvLinks(bool b);
|
||||
bool getAutoUpdate();
|
||||
void setAutoUpdate(bool b);
|
||||
|
||||
bool retrieveGridInfo();
|
||||
|
||||
static const char* getPlatformString(Platform platform);
|
||||
static std::string sanitizeGridNick(std::string &gridnick);
|
||||
|
||||
static HippoGridInfo FALLBACK_GRIDINFO;
|
||||
static void initFallback();
|
||||
@@ -101,6 +100,7 @@ public:
|
||||
private:
|
||||
Platform mPlatform;
|
||||
std::string mGridName;
|
||||
std::string mGridNick;
|
||||
std::string mLoginUri;
|
||||
std::string mLoginPage;
|
||||
std::string mHelperUri;
|
||||
@@ -110,11 +110,9 @@ private:
|
||||
std::string mPasswordUrl;
|
||||
std::string mSearchUrl;
|
||||
std::string mVoiceConnector;
|
||||
std::string mFirstName;
|
||||
std::string mLastName;
|
||||
std::string mAvatarPassword;
|
||||
bool mRenderCompat;
|
||||
bool mInvLinks;
|
||||
bool mAutoUpdate;
|
||||
int mMaxAgentGroups;
|
||||
|
||||
std::string mCurrencySymbol;
|
||||
@@ -125,7 +123,7 @@ private:
|
||||
// for parsing grid info XML
|
||||
enum XmlState
|
||||
{
|
||||
XML_VOID, XML_PLATFORM, XML_GRIDNAME,
|
||||
XML_VOID, XML_PLATFORM, XML_GRIDNAME, XML_GRIDNICK,
|
||||
XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
|
||||
XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH, XML_MESSAGE
|
||||
};
|
||||
@@ -168,6 +166,7 @@ public:
|
||||
GridIterator endGrid() { return mGridInfo.end(); }
|
||||
|
||||
private:
|
||||
friend class HippoGridInfo;
|
||||
std::map<std::string, HippoGridInfo*> mGridInfo;
|
||||
std::string mDefaultGrid;
|
||||
std::string mCurrentGrid;
|
||||
|
||||
@@ -295,14 +295,21 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
||||
HippoGridInfo *gridInfo = 0;
|
||||
|
||||
gridInfo = gHippoGridManager->getGrid(mCurGrid);
|
||||
gridInfo->retrieveGridInfo();
|
||||
//gridInfo->retrieveGridInfo();
|
||||
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)) {
|
||||
|
||||
// check nickname
|
||||
std::string gridname = childGetValue("gridname");
|
||||
if (gridname == "<required>") gridname = "";
|
||||
childSetValue("gridname", (gridname != "")? gridname: "<required>");
|
||||
if (gridname == "") {
|
||||
LLNotificationsUtil::add("GridsNoNick");
|
||||
@@ -316,8 +323,7 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
||||
}
|
||||
|
||||
// check login URI
|
||||
std::string loginuri = childGetValue("loginuri");
|
||||
if ((loginuri == "") || (loginuri == "<required>")) {
|
||||
if (loginuri == "") {
|
||||
LLSD args;
|
||||
args["NAME"] = gridname;
|
||||
LLNotificationsUtil::add("GridsNoLoginUri", args);
|
||||
@@ -329,11 +335,6 @@ bool HippoPanelGridsImpl::saveCurGrid()
|
||||
gridInfo = new HippoGridInfo(gridname);
|
||||
gHippoGridManager->addGrid(gridInfo);
|
||||
gridInfo->retrieveGridInfo();
|
||||
} else {
|
||||
|
||||
llwarns << "Illegal state " << mState << '.' << llendl;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if (!gridInfo) {
|
||||
|
||||
@@ -861,7 +861,7 @@ void LLPanelLogin::updateGridCombo()
|
||||
}
|
||||
HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid();
|
||||
for (it = gHippoGridManager->beginGrid(); it != end; ++it) {
|
||||
const std::string &grid = it->second->getGridName();
|
||||
std::string grid = it->second->getGridName();
|
||||
if (grid != defaultGrid) {
|
||||
grids->add(grid);
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void LLPrefsIMImpl::apply()
|
||||
}
|
||||
else
|
||||
{
|
||||
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(),
|
||||
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getConnectedGrid()->getGridNick(),
|
||||
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
|
||||
}
|
||||
|
||||
|
||||
@@ -1019,7 +1019,7 @@ bool idle_startup()
|
||||
}
|
||||
else
|
||||
{
|
||||
gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
|
||||
gDirUtilp->setLindenUserDir(gHippoGridManager->getConnectedGrid()->getGridNick(), firstname, lastname);
|
||||
}
|
||||
LLFile::mkdir(gDirUtilp->getLindenUserDir());
|
||||
|
||||
@@ -1059,7 +1059,7 @@ bool idle_startup()
|
||||
}
|
||||
else
|
||||
{
|
||||
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(),
|
||||
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getConnectedGrid()->getGridNick(),
|
||||
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
|
||||
}
|
||||
LLFile::mkdir(gDirUtilp->getChatLogsDir());
|
||||
|
||||
Reference in New Issue
Block a user