From 3f7f854bd1d75a3d22df931ff4e30fbb8b642a50 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 3 Nov 2010 17:53:55 +0100 Subject: Rename hippo* files to lower case (PART 1 OF 2) There was a problem with #include "hippolimits.h" because the file is called hippoLimits.h (with an uppercase L). After some discussion on IRC it was reluctantly decided that filenames should be lowercase, as is done for every Linden file. Moreover, hippolimits.h is about the class HippoLimits, with uppercase H, so even that doesn't match. Of course, then we immediately rename all hippo* files to lowercase. This patch ONLY renames the file, with no other changes. This is done in order to make sure that git won't get confused ;). All other necessary changes will be in the next commit. --- linden/indra/newview/hippoGridManager.cpp | 970 ------------------------------ linden/indra/newview/hippoGridManager.h | 183 ------ linden/indra/newview/hippoLimits.cpp | 224 ------- linden/indra/newview/hippoLimits.h | 72 --- linden/indra/newview/hippoRestRequest.cpp | 352 ----------- linden/indra/newview/hippoRestRequest.h | 104 ---- linden/indra/newview/hippoUpdate.cpp | 92 --- linden/indra/newview/hippoUpdate.h | 12 - linden/indra/newview/hippogridmanager.cpp | 970 ++++++++++++++++++++++++++++++ linden/indra/newview/hippogridmanager.h | 183 ++++++ linden/indra/newview/hippolimits.cpp | 224 +++++++ linden/indra/newview/hippolimits.h | 72 +++ linden/indra/newview/hipporestrequest.cpp | 352 +++++++++++ linden/indra/newview/hipporestrequest.h | 104 ++++ linden/indra/newview/hippoupdate.cpp | 92 +++ linden/indra/newview/hippoupdate.h | 12 + 16 files changed, 2009 insertions(+), 2009 deletions(-) delete mode 100644 linden/indra/newview/hippoGridManager.cpp delete mode 100644 linden/indra/newview/hippoGridManager.h delete mode 100644 linden/indra/newview/hippoLimits.cpp delete mode 100644 linden/indra/newview/hippoLimits.h delete mode 100644 linden/indra/newview/hippoRestRequest.cpp delete mode 100644 linden/indra/newview/hippoRestRequest.h delete mode 100644 linden/indra/newview/hippoUpdate.cpp delete mode 100644 linden/indra/newview/hippoUpdate.h create mode 100644 linden/indra/newview/hippogridmanager.cpp create mode 100644 linden/indra/newview/hippogridmanager.h create mode 100644 linden/indra/newview/hippolimits.cpp create mode 100644 linden/indra/newview/hippolimits.h create mode 100644 linden/indra/newview/hipporestrequest.cpp create mode 100644 linden/indra/newview/hipporestrequest.h create mode 100644 linden/indra/newview/hippoupdate.cpp create mode 100644 linden/indra/newview/hippoupdate.h (limited to 'linden') diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp deleted file mode 100644 index dd0fa35..0000000 --- a/linden/indra/newview/hippoGridManager.cpp +++ /dev/null @@ -1,970 +0,0 @@ -// Ported to Imprudence from the Hippo OpenSim Viewer by Jacek Antonelli - -#include "llviewerprecompiledheaders.h" - -#include "hippoGridManager.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include "lltrans.h" -#include "llviewercontrol.h" -#include "llweb.h" - -#include "hippoRestRequest.h" - - -// ******************************************************************** -// Global Variables - -HippoGridManager* gHippoGridManager = 0; - -HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); - - - -// ******************************************************************** -// ******************************************************************** -// HippoGridInfo -// ******************************************************************** -// ******************************************************************** - - -// ******************************************************************** -// Initialize - -HippoGridInfo::HippoGridInfo(const std::string& gridNick) : - mPlatform(PLATFORM_OPENSIM), - mGridNick(gridNick), - mGridName(LLStringUtil::null), - mLoginUri(LLStringUtil::null), - mLoginPage(LLStringUtil::null), - mHelperUri(LLStringUtil::null), - mWebSite(LLStringUtil::null), - mSupportUrl(LLStringUtil::null), - mRegisterUrl(LLStringUtil::null), - mPasswordUrl(LLStringUtil::null), - mSearchUrl(LLStringUtil::null), - mFirstName(LLStringUtil::null), - mLastName(LLStringUtil::null), - mAvatarPassword(LLStringUtil::null), - mXmlState(XML_VOID), - mVoiceConnector("SLVoice"), - mRenderCompat(true), - mMaxAgentGroups(-1), - mCurrencySymbol("OS$"), - mRealCurrencySymbol("US$"), - mDirectoryFee(30) -{ - std::string nick = gridNick; - mGridNick = sanitizeGridNick( nick ); -} - - -// ******************************************************************** -// Getters - -HippoGridInfo::Platform HippoGridInfo::getPlatform() -{ - return mPlatform; -} - -bool HippoGridInfo::isOpenSimulator() const -{ - return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM); -} - -bool HippoGridInfo::isSecondLife() const -{ - return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); -} - -const std::string& HippoGridInfo::getGridNick() const -{ - return mGridNick; -} - -const std::string& HippoGridInfo::getGridName() const -{ - return mGridName; -} - -const std::string& HippoGridInfo::getLoginUri() const -{ - return mLoginUri; -} - -const std::string& HippoGridInfo::getLoginPage() const -{ - return mLoginPage; -} - -const std::string& HippoGridInfo::getHelperUri() const -{ - return mHelperUri; -} - -const std::string& HippoGridInfo::getWebSite() const -{ - return mWebSite; -} - -const std::string& HippoGridInfo::getSupportUrl() const -{ - return mSupportUrl; -} - -const std::string& HippoGridInfo::getRegisterUrl() const -{ - return mRegisterUrl; -} - -const std::string& HippoGridInfo::getPasswordUrl() const -{ - return mPasswordUrl; -} - -const std::string& HippoGridInfo::getSearchUrl() const -{ - return mSearchUrl; -} - -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; -} - -const std::string& HippoGridInfo::getCurrencySymbol() const -{ - return mCurrencySymbol; -} - -const std::string& HippoGridInfo::getRealCurrencySymbol() const -{ - return mRealCurrencySymbol; -} - - - -// ******************************************************************** -// Setters - -void HippoGridInfo::setPlatform(Platform platform) -{ - mPlatform = platform; - if (mPlatform == PLATFORM_SECONDLIFE) - { - mCurrencySymbol = "L$"; - } -} - - -void HippoGridInfo::setPlatform(const std::string& platform) -{ - std::string tmp = platform; - for (unsigned i=0; imXmlState = XML_GRIDNICK; - else if (strcasecmp(name, "gridname") == 0) - self->mXmlState = XML_GRIDNAME; - else if (strcasecmp(name, "platform") == 0) - self->mXmlState = XML_PLATFORM; - else if ((strcasecmp(name, "login") == 0) || (strcasecmp(name, "loginuri") == 0)) - self->mXmlState = XML_LOGINURI; - else if ((strcasecmp(name, "welcome") == 0) || (strcasecmp(name, "loginpage") == 0)) - self->mXmlState = XML_LOGINPAGE; - else if ((strcasecmp(name, "economy") == 0) || (strcasecmp(name, "helperuri") == 0)) - self->mXmlState = XML_HELPERURI; - else if ((strcasecmp(name, "about") == 0) || (strcasecmp(name, "website") == 0)) - self->mXmlState = XML_WEBSITE; - else if ((strcasecmp(name, "help") == 0) || (strcasecmp(name, "support") == 0)) - self->mXmlState = XML_SUPPORT; - else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0)) - self->mXmlState = XML_REGISTER; - else if (strcasecmp(name, "password") == 0) - self->mXmlState = XML_PASSWORD; - else if (strcasecmp(name, "search") == 0) - self->mXmlState = XML_SEARCH; -} - -//static -void HippoGridInfo::onXmlElementEnd(void* userData, const XML_Char* name) -{ - HippoGridInfo* self = (HippoGridInfo*)userData; - self->mXmlState = XML_VOID; -} - -//static -void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int len) -{ - HippoGridInfo* self = (HippoGridInfo*)userData; - switch (self->mXmlState) - { - 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: - { - std::string loginuri(s, len); - self->mLoginUri = sanitizeUri( loginuri ); - break; - } - - case XML_HELPERURI: - { - std::string helperuri(s, len); - self->mHelperUri = sanitizeUri( helperuri ); - break; - } - - case XML_SEARCH: - { - self->mSearchUrl.assign(s, len); - //sanitizeQueryUrl(mSearchUrl); - break; - } - - case XML_GRIDNAME: self->mGridName.assign(s, len); break; - case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break; - case XML_WEBSITE: self->mWebSite.assign(s, len); break; - case XML_SUPPORT: self->mSupportUrl.assign(s, len); break; - case XML_REGISTER: self->mRegisterUrl.assign(s, len); break; - case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break; - - case XML_VOID: break; - } -} - - -bool HippoGridInfo::retrieveGridInfo() -{ - if (mLoginUri == "") return false; - - // If last character in uri is not "/" - std::string uri = mLoginUri; - if (uri.compare(uri.length()-1, 1, "/") != 0) - { - uri += '/'; - } - std::string reply; - int result = HippoRestRequest::getBlocking(uri + "get_grid_info", &reply); - if (result != 200) return false; - - llinfos << "Received: " << reply << llendl; - - bool success = true; - XML_Parser parser = XML_ParserCreate(0); - XML_SetUserData(parser, this); - XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd); - XML_SetCharacterDataHandler(parser, onXmlCharacterData); - mXmlState = XML_VOID; - if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) - { - llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl; - success = false; - } - XML_ParserFree(parser); - - return success; -} - - -std::string HippoGridInfo::getUploadFee() const -{ - std::string fee; - formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true); - return fee; -} - -std::string HippoGridInfo::getGroupCreationFee() const -{ - std::string fee; - formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false); - return fee; -} - -std::string HippoGridInfo::getDirectoryFee() const -{ - std::string fee; - formatFee(fee, mDirectoryFee, true); - if (fee != LLTrans::getString("hippo_label_free")) fee += "/" + LLTrans::getString("hippo_label_week"); - return fee; -} - -void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const -{ - if (showFree && (cost == 0)) - { - fee = LLTrans::getString("hippo_label_free"); - } - else - { - fee = llformat("%s%d", getCurrencySymbol().c_str(), cost); - } -} - - -// ******************************************************************** -// Static Helpers - -// static -const char* HippoGridInfo::getPlatformString(Platform platform) -{ - static const char* platformStrings[PLATFORM_LAST] = - { - "Other", "OpenSim", "SecondLife" - }; - - if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST)) - platform = PLATFORM_OTHER; - return platformStrings[platform]; -} - - -// static -std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick) -{ - std::string tmp; - int size = gridnick.size(); - for (int i=0; i::iterator it, end = mGridInfo.end(); - for (it=mGridInfo.begin(); it != end; ++it) - { - delete it->second; - } - mGridInfo.clear(); -} - - -void HippoGridManager::init() -{ - HippoGridInfo::initFallback(); - loadFromFile(); - - // !!!### gSavedSettings.getControl("CmdLineLoginURI"); - // !!!### gSavedSettings.getString("CmdLineLoginPage"); - // !!!### gSavedSettings.getString("CmdLineHelperURI"); - // !!!### LLString::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name.c_str())) -} - - -void HippoGridManager::discardAndReload() -{ - cleanup(); - loadFromFile(); -} - - -// ******************************************************************** -// Public Access - -HippoGridInfo* HippoGridManager::getGrid(const std::string& grid) const -{ - std::map::const_iterator it; - it = mGridInfo.find(grid); - if (it != mGridInfo.end()) - { - return it->second; - } - else - { - return 0; - } -} - - -HippoGridInfo* HippoGridManager::getConnectedGrid() const -{ - return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); -} - - -HippoGridInfo* HippoGridManager::getCurrentGrid() const -{ - HippoGridInfo* grid = getGrid(mCurrentGrid); - if (grid) - { - return grid; - } - else - { - return &HippoGridInfo::FALLBACK_GRIDINFO; - } -} - -const std::string& HippoGridManager::getDefaultGridNick() const -{ - return mDefaultGrid; -} - -const std::string& HippoGridManager::getCurrentGridNick() const -{ - if (mCurrentGrid.empty()) - { - return mDefaultGrid; - } - return mCurrentGrid; -} - -void HippoGridManager::setCurrentGridAsConnected() -{ - mConnectedGrid = getCurrentGrid(); -} - - -void HippoGridManager::addGrid(HippoGridInfo* grid) -{ - if (!grid) return; - const std::string& nick = grid->getGridNick(); - if (nick == "") - { - llwarns << "Ignoring to try adding grid with empty nick." << llendl; - delete grid; - return; - } - if (mGridInfo.find(nick) != mGridInfo.end()) - { - llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl; - delete grid; - return; - } - mGridInfo[nick] = grid; -} - - -void HippoGridManager::deleteGrid(const std::string& grid) -{ - GridIterator it = mGridInfo.find(grid); - if (it == mGridInfo.end()) { - llwarns << "Trying to delete non-existing grid " << grid << '.' << llendl; - return; - } - mGridInfo.erase(it); - llinfos << "Number of grids now: " << mGridInfo.size() << llendl; - if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl; - if (grid == mDefaultGrid) - setDefaultGrid(LLStringUtil::null); // sets first grid, if map not empty - if (grid == mCurrentGrid) - mCurrentGrid = mDefaultGrid; -} - - -void HippoGridManager::setDefaultGrid(const std::string& grid) -{ - GridIterator it = mGridInfo.find(grid); - if (it != mGridInfo.end()) - { - mDefaultGrid = grid; - } - else if (mGridInfo.find("secondlife") != mGridInfo.end()) - { - mDefaultGrid = "secondlife"; - } - else if (!mGridInfo.empty()) - { - mDefaultGrid = mGridInfo.begin()->first; - } - else - { - mDefaultGrid = ""; - } -} - - -void HippoGridManager::setCurrentGrid(const std::string& grid) -{ - GridIterator it = mGridInfo.find(grid); - if (it != mGridInfo.end()) - { - mCurrentGrid = grid; - } - else if (!mGridInfo.empty()) - { - llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl; - mCurrentGrid = mDefaultGrid; - } -} - - -// ******************************************************************** -// Persistent Store - -void HippoGridManager::loadFromFile() -{ - mDefaultGridsVersion = 0; - // load user grid info - parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.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()); - // 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()); - - std::string last_grid = gSavedSettings.getString("LastSelectedGrid"); - if (last_grid.empty()) last_grid = gSavedSettings.getString("DefaultGrid"); - setDefaultGrid(last_grid); - setCurrentGrid(last_grid); -} - - -void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) -{ - llinfos << "Loading grid info from '" << url << "'." << llendl; - - // query update server - std::string escaped_url = LLWeb::escapeURL(url); - LLSD response = LLHTTPClient::blockingGet(url); - - // check response, return on error - S32 status = response["status"].asInteger(); - if ((status != 200) || !response["body"].isArray()) - { - llinfos << "GridInfo Update failed (" << status << "): " - << (response["body"].isString()? response["body"].asString(): "") - << llendl; - return; - } - - LLSD gridInfo = response["body"]; - parseData(gridInfo, mergeIfNewer); -} - -void HippoGridManager::parseFile(const std::string& fileName, bool mergeIfNewer) -{ - llifstream infile; - infile.open(fileName.c_str()); - if (!infile.is_open()) - { - llwarns << "Cannot find grid info file " << fileName << " to load." << llendl; - return; - } - - LLSD gridInfo; - if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) - { - llwarns << "Unable to parse grid info file " << fileName << '.' << llendl; - return; - } - - llinfos << "Loading grid info file " << fileName << '.' << llendl; - parseData(gridInfo, mergeIfNewer); -} - - -void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer) -{ - if (mergeIfNewer) - { - LLSD::array_const_iterator it, end = gridInfo.endArray(); - for (it = gridInfo.beginArray(); it != end; ++it) - { - LLSD gridMap = *it; - if (gridMap.has("default_grids_version")) - { - int version = gridMap["default_grids_version"]; - if (version <= mDefaultGridsVersion) return; - else break; - } - } - if (it == end) - { - llwarns << "Grid data has no version number." << llendl; - return; - } - } - - llinfos << "Loading grid data." << llendl; - - LLSD::array_const_iterator it, end = gridInfo.endArray(); - for (it = gridInfo.beginArray(); it != end; ++it) - { - LLSD gridMap = *it; - if (gridMap.has("default_grids_version")) - { - mDefaultGridsVersion = gridMap["default_grids_version"]; - } - else if (gridMap.has("gridnick") && gridMap.has("loginuri")) - { - std::string gridnick = gridMap["gridnick"]; - HippoGridInfo* grid; - GridIterator it = mGridInfo.find(gridnick); - bool newGrid = (it == mGridInfo.end()); - if (newGrid) - { - // create new grid info - grid = new HippoGridInfo(gridnick); - } - else - { - // update existing grid info - grid = it->second; - } - grid->setLoginUri(gridMap["loginuri"]); - if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]); - if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]); - if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]); - if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]); - if (gridMap.has("website")) grid->setWebSite(gridMap["website"]); - if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]); - if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]); - 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("firstname")) grid->setFirstName(gridMap["firstname"]); - // if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]); - // if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]); - if (newGrid) addGrid(grid); - } - } -} - - -void HippoGridManager::saveFile() -{ - // save default grid to client settings - gSavedSettings.setString("DefaultGrid", mDefaultGrid); - - // build LLSD - LLSD gridInfo; - gridInfo[0]["default_grids_version"] = mDefaultGridsVersion; - - // add grids - S32 i = 1; - GridIterator it, end = mGridInfo.end(); - for (it = mGridInfo.begin(); it != end; ++it, i++) - { - HippoGridInfo* grid = it->second; - gridInfo[i]["gridnick"] = grid->getGridNick(); - gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform()); - gridInfo[i]["gridname"] = grid->getGridName(); - gridInfo[i]["loginuri"] = grid->getLoginUri(); - gridInfo[i]["loginpage"] = grid->getLoginPage(); - gridInfo[i]["helperuri"] = grid->getHelperUri(); - gridInfo[i]["website"] = grid->getWebSite(); - 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(); - } - - // write client grid info file - std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"); - llofstream file; - file.open(fileName.c_str()); - if (file.is_open()) - { - LLSDSerialize::toPrettyXML(gridInfo, file); - file.close(); - llinfos << "Saved grids to " << fileName << llendl; - } - else - { - llerrs << "Unable to open grid info file: " << fileName << llendl; - } -} diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h deleted file mode 100644 index 8429dba..0000000 --- a/linden/indra/newview/hippoGridManager.h +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef __HIPPO_GRID_MANAGER_H__ -#define __HIPPO_GRID_MANAGER_H__ - - -#include -#include - -#ifndef XML_STATIC -#define XML_STATIC -#endif - -#ifdef LL_STANDALONE -#include -#else -#include "expat/expat.h" -#endif - -class LLSD; - - -class HippoGridInfo -{ -public: - enum Platform { - PLATFORM_OTHER = 0, - PLATFORM_OPENSIM, - PLATFORM_SECONDLIFE, - PLATFORM_LAST - }; - enum SearchType { - SEARCH_ALL_EMPTY, - SEARCH_ALL_QUERY, - SEARCH_ALL_TEMPLATE - }; - - explicit HippoGridInfo(const std::string& gridNick); - - Platform getPlatform(); - bool isOpenSimulator() const; - bool isSecondLife() const; - const std::string& getGridNick() const; - const std::string& getGridName() const; - const std::string& getLoginUri() const; - const std::string& getLoginPage() const; - const std::string& getHelperUri() const; - const std::string& getWebSite() const; - const std::string& getSupportUrl() const; - const std::string& getRegisterUrl() const; - const std::string& getPasswordUrl() const; - // Returns the url base used for the Web Search tab - const std::string& getSearchUrl() 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; - int getMaxAgentGroups() const { return mMaxAgentGroups; } - - const std::string& getCurrencySymbol() const; - const std::string& getRealCurrencySymbol() const; - std::string getUploadFee() const; - std::string getGroupCreationFee() const; - std::string getDirectoryFee() const; - - void setPlatform (const std::string& platform); - void setPlatform (Platform platform); - void setGridName (const std::string& gridName); - void setLoginUri (const std::string& loginUri); - void setLoginPage(const std::string& loginPage); - void setHelperUri(const std::string& helperUri); - void setWebSite (const std::string& website); - void setSupportUrl(const std::string& url); - void setRegisterUrl(const std::string& url); - void setPasswordUrl(const std::string& url); - // sets the url base used for the Web Search tab - void setSearchUrl(const std::string& url); - 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); - void setRealCurrencySymbol(const std::string& sym); - void setDirectoryFee(int fee); - - bool retrieveGridInfo(); - - static const char* getPlatformString(Platform platform); - static std::string sanitizeGridNick(std::string &gridnick); - - static HippoGridInfo FALLBACK_GRIDINFO; - static void initFallback(); - -private: - Platform mPlatform; - std::string mGridNick; - std::string mGridName; - std::string mLoginUri; - std::string mLoginPage; - std::string mHelperUri; - std::string mWebSite; - std::string mSupportUrl; - std::string mRegisterUrl; - std::string mPasswordUrl; - std::string mSearchUrl; - std::string mVoiceConnector; - std::string mFirstName; - std::string mLastName; - std::string mAvatarPassword; - bool mRenderCompat; - int mMaxAgentGroups; - - std::string mCurrencySymbol; - std::string mRealCurrencySymbol; - int mDirectoryFee; - - // for parsing grid info XML - enum XmlState - { - XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME, - XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI, - XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH - }; - XmlState mXmlState; - - static std::string sanitizeUri(std::string &uri); - void formatFee(std::string &fee, int cost, bool showFree) const; - - static void onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts); - static void onXmlElementEnd(void* userData, const XML_Char* name); - static void onXmlCharacterData(void* userData, const XML_Char* s, int len); -}; - - -class HippoGridManager -{ -public: - HippoGridManager(); - ~HippoGridManager(); - - void init(); - void saveFile(); - void discardAndReload(); - - HippoGridInfo* getGrid(const std::string& grid) const; - HippoGridInfo* getConnectedGrid() const; - HippoGridInfo* getCurrentGrid() const; - const std::string& getDefaultGridNick() const; - const std::string& getCurrentGridNick() const; - - void setDefaultGrid(const std::string& grid); - void setCurrentGrid(const std::string& grid); - void setCurrentGridAsConnected(); - - void addGrid(HippoGridInfo* grid); - void deleteGrid(const std::string& grid); - - typedef std::map::iterator GridIterator; - GridIterator beginGrid() { return mGridInfo.begin(); } - GridIterator endGrid() { return mGridInfo.end(); } - -private: - std::map mGridInfo; - std::string mDefaultGrid; - std::string mCurrentGrid; - HippoGridInfo* mConnectedGrid; - int mDefaultGridsVersion; - - void cleanup(); - void loadFromFile(); - void parseFile(const std::string& fileName, bool mergeIfNewer); - void parseUrl(const std::string url, bool mergeIfNewer); - void parseData(LLSD &gridInfo, bool mergeIfNewer); -}; - - -extern HippoGridManager* gHippoGridManager; - - -#endif diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp deleted file mode 100644 index a5d6ee6..0000000 --- a/linden/indra/newview/hippoLimits.cpp +++ /dev/null @@ -1,224 +0,0 @@ - - -#include "llviewerprecompiledheaders.h" - -#include "hippoLimits.h" - -#include "hippoGridManager.h" -#include "llviewercontrol.h" - -#include - - -HippoLimits *gHippoLimits = 0; - - -HippoLimits::HippoLimits() -: - mMaxAgentGroups(100), - mMaxHeight(10000.0f), - mMinHoleSize(0.05f), - mMaxHollow(0.95f), - mMinPrimScale(0.001f), - mMaxPrimScale(256.0f), - mMaxLinkedPrims(-1) -{ - setLimits(); -} - - -void HippoLimits::setLimits() -{ - if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) - { - setSecondLifeLimits(); - } - else - { - setOpenSimLimits(); - } -} - - -void HippoLimits::setOpenSimLimits() -{ - mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups(); - - if (mMaxAgentGroups < 0) - mMaxAgentGroups = 50; - - mMaxPrimScale = 256.0f; - mMinPrimScale = 0.001f; - mMinPrimXPos = 0; - mMinPrimYPos = 0; - mMinPrimZPos = 0; - mMaxPrimXPos = F32_MAX; - mMaxPrimYPos = F32_MAX; - mMaxPrimZPos = F32_MAX; - mMaxHeight = 10000.0f; - mMaxLinkedPrims = -1; - mMaxPhysLinkedPrims = -1; - mAllowParcelWindLight = TRUE; - mAllowMinimap = TRUE; - mMaxInventoryItemsTransfer = -1; - mRenderName = 2; - mAllowPhysicalPrims = TRUE; - skyUseClassicClouds = TRUE; - mEnableTeenMode = FALSE; - mEnforceMaxBuild = FALSE; - mRenderWater = TRUE; - - if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { - llinfos << "Using rendering compatible OpenSim limits" << llendl; - mMinHoleSize = 0.05f; - mMaxHollow = 0.95f; - } - else - { - llinfos << "Using Hippo OpenSim limits" << llendl; - mMinHoleSize = 0.01f; - mMaxHollow = 0.99f; - } -} - -void HippoLimits::setSecondLifeLimits() -{ - llinfos << "Using Second Life limits" << llendl; - mMaxAgentGroups = 25; - mMaxPrimScale = 10.0f; - mMinPrimScale = 0.01f; - mMaxHeight = 4096.0f; - mMinHoleSize = 0.05f; - mMaxHollow = 0.95f; - mMaxLinkedPrims = 255; - mMaxPhysLinkedPrims = 32; - mMinPrimXPos = 0; - mMinPrimYPos = 0; - mMinPrimZPos = 0; - mMaxPrimXPos = 256; - mMaxPrimYPos = 256; - mMaxPrimZPos = 4096; - mAllowParcelWindLight = FALSE; - mAllowMinimap = TRUE; - mMaxInventoryItemsTransfer = 42; - mRenderName = 2; - mAllowPhysicalPrims = TRUE; - skyUseClassicClouds = TRUE; - mEnableTeenMode = FALSE; - mEnforceMaxBuild = FALSE; - mRenderWater = TRUE; -} - -F32 HippoLimits::getMaxPrimScale() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MAX; - } - else - { - return mMaxPrimScale; - } -} - -F32 HippoLimits::getMinPrimScale() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return 0; - } - else - { - return mMinPrimScale; - } -} - -F32 HippoLimits::getMaxPrimXPos() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MAX; - } - else - { - return mMaxPrimXPos; - } -} - -F32 HippoLimits::getMaxPrimYPos() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MAX; - } - else - { - return mMaxPrimYPos; - } -} - -F32 HippoLimits::getMaxPrimZPos() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MAX; - } - else - { - return mMaxPrimZPos; - } -} - -F32 HippoLimits::getMinPrimXPos() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MIN; - } - else - { - return mMinPrimXPos; - } -} - -F32 HippoLimits::getMinPrimYPos() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MIN; - } - else - { - return mMinPrimYPos; - } -} - -F32 HippoLimits::getMinPrimZPos() const -{ - if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) - { - return FLT_MIN; - } - else - { - return mMinPrimZPos; - } -} - -F32 HippoLimits::getMaxDragDistance() const -{ - if (mMaxDragDistance == 0) - { - return FLT_MAX; - } - else - { - F32 max_drag_distance = gSavedSettings.getBOOL("LimitDragDistance") ? gSavedSettings.getF32("MaxDragDistance") : FLT_MAX; - - if(max_drag_distance > mMaxDragDistance) //Chose the more restrictive - { - max_drag_distance = mMaxDragDistance; - } - return max_drag_distance; - } -} \ No newline at end of file diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h deleted file mode 100644 index 7792a2c..0000000 --- a/linden/indra/newview/hippoLimits.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef __HIPPO_LIMITS_H__ -#define __HIPPO_LIMITS_H__ - - -class HippoLimits -{ -public: - HippoLimits(); - - const S32& getMaxAgentGroups() const { return mMaxAgentGroups; } - const F32& getMaxHeight() const { return mMaxHeight; } - const F32& getMinHoleSize() const { return mMinHoleSize; } - const F32& getMaxHollow() const { return mMaxHollow; } - const S32& getMaxLinkedPrims() const { return mMaxLinkedPrims; } - const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; } - const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; } - - - // Returns the max prim size we can use on a grid - F32 getMinPrimScale() const; - F32 getMaxPrimScale() const; - - F32 getMaxDragDistance() const; - - F32 getMinPrimXPos() const; - F32 getMinPrimYPos() const; - F32 getMinPrimZPos() const; - F32 getMaxPrimXPos() const; - F32 getMaxPrimYPos() const; - F32 getMaxPrimZPos() const; - - void setLimits(); - - S32 mMaxAgentGroups; - - F32 mMaxHeight; - F32 mMinHoleSize; - F32 mMaxHollow; - F32 mMaxPrimScale; - F32 mMinPrimScale; - S32 mMaxLinkedPrims; - S32 mMaxPhysLinkedPrims; - F32 mMaxPrimXPos; - F32 mMaxPrimYPos; - F32 mMaxPrimZPos; - F32 mMinPrimXPos; - F32 mMinPrimYPos; - F32 mMinPrimZPos; - - S32 mRenderName; - - F32 mMaxInventoryItemsTransfer; - F32 mMaxDragDistance; - - BOOL skyUseClassicClouds; - BOOL mAllowParcelWindLight; - BOOL mAllowMinimap; - BOOL mAllowPhysicalPrims; - BOOL mEnableTeenMode; - BOOL mEnforceMaxBuild; - BOOL mRenderWater; - -private: - void setOpenSimLimits(); - void setSecondLifeLimits(); -}; - - -extern HippoLimits* gHippoLimits; - - -#endif diff --git a/linden/indra/newview/hippoRestRequest.cpp b/linden/indra/newview/hippoRestRequest.cpp deleted file mode 100644 index ed15907..0000000 --- a/linden/indra/newview/hippoRestRequest.cpp +++ /dev/null @@ -1,352 +0,0 @@ - - -#include "llviewerprecompiledheaders.h" - -#include "hippoRestRequest.h" - -#ifndef CURL_STATICLIB -#define CURL_STATICLIB 1 -#endif -#include - -#include -#include -#include -#include -#include -#include - - -// ******************************************************************** - - -class HippoRestComplete : public LLURLRequestComplete -{ - public: - HippoRestComplete(HippoRestHandler *handler) : - mHandler(handler), - mStatus(499), - mReason("Request completed w/o status") - { - } - - ~HippoRestComplete() - { - delete mHandler; - } - - // Called once for each header received, prior to httpStatus - void header(const std::string& header, const std::string& value) - { - mHandler->addHeader(header, value); - } - - // Always called on request completion, prior to complete - void httpStatus(U32 status, const std::string& reason) - { - LLURLRequestComplete::httpStatus(status, reason); - mStatus = status; - mReason = reason; - } - - void complete(const LLChannelDescriptors &channels, const buffer_ptr_t &buffer) - { - mHandler->handle(mStatus, mReason, channels, buffer); - } - - private: - HippoRestHandler *mHandler; - int mStatus; - std::string mReason; -}; - - -// ******************************************************************** - - -static std::string gEmptyString; - -void HippoRestHandler::addHeader(const std::string &header, const std::string &content) -{ - mHeaders[header] = content; -} - -bool HippoRestHandler::hasHeader(const std::string &header) const -{ - return (mHeaders.find(header) != mHeaders.end()); -} - -const std::string &HippoRestHandler::getHeader(const std::string &header) const -{ - std::map::const_iterator it; - it = mHeaders.find(header); - if (it != mHeaders.end()) { - return it->second; - } else { - return gEmptyString; - } -} - - -// ******************************************************************** - - -void HippoRestHandlerRaw::handle(int status, const std::string &reason, - const LLChannelDescriptors &channels, - const boost::shared_ptr &body) -{ - if (status == 200) { - std::string data; - LLBufferArray *buffer = body.get(); - LLBufferArray::segment_iterator_t it, end = buffer->endSegment(); - for (it=buffer->beginSegment(); it!=end; ++it) - if (it->isOnChannel(channels.in())) - data.append((char*)it->data(), it->size()); - result(data); - } else { - llwarns << "Rest request error " << status << ": " << reason << llendl; - } -} - -void HippoRestHandlerXml::handle(int status, const std::string &reason, - const LLChannelDescriptors &channels, - const boost::shared_ptr &body) -{ - if (status == 200) { - LLXmlTree *tree = new LLXmlTree(); - bool success = tree->parseBufferStart(); - LLBufferArray *buffer = body.get(); - LLBufferArray::segment_iterator_t it, end = buffer->endSegment(); - for (it=buffer->beginSegment(); success && (it!=end); ++it) - if (it->isOnChannel(channels.in())) - success = success && tree->parseBuffer((char*)it->data(), it->size()); - success = success && tree->parseBufferFinalize(); - if (success) result(tree); - delete tree; - } else { - llwarns << "Rest request error " << status << ": " << reason << llendl; - } -} - - -// ******************************************************************** - - -class BodyData : public LLIOPipe -{ - public: - virtual ~BodyData() { } - virtual const char *getContentMimeType() const = 0; -}; - -class BodyDataRaw : public BodyData -{ - public: - explicit BodyDataRaw(const std::string &data) : - mData(data) - { - } - virtual ~BodyDataRaw() { } - - const char *getContentMimeType() const { return "application/octet-stream"; } - - EStatus process_impl(const LLChannelDescriptors &channels, - buffer_ptr_t &buffer, bool &eos, - LLSD &context, LLPumpIO *pump) - { - LLBufferStream ostream(channels, buffer.get()); - ostream.write(mData.data(), mData.size()); - eos = true; - return STATUS_DONE; - } - - private: - std::string mData; -}; - -class BodyDataXml : public BodyData -{ - public: - explicit BodyDataXml(const LLXmlTree *tree) : - mTree(tree) - { - } - - virtual ~BodyDataXml() - { - if (mTree) delete mTree; - } - - const char *getContentMimeType() const { return "application/xml"; } - - EStatus process_impl(const LLChannelDescriptors &channels, - buffer_ptr_t &buffer, bool &eos, - LLSD &context, LLPumpIO *pump) - { - std::string data; - mTree->write(data); - LLBufferStream ostream(channels, buffer.get()); - ostream.write(data.data(), data.size()); - eos = true; - return STATUS_DONE; - } - - private: - const LLXmlTree *mTree; -}; - - -// ******************************************************************** - - -static void request(const std::string &url, - LLURLRequest::ERequestAction method, - BodyData *body, - HippoRestHandler *handler, float timeout); - - -// static -void HippoRestRequest::get(const std::string &url, - HippoRestHandler *handler, float timeout) -{ - request(url, LLURLRequest::HTTP_GET, 0, handler, timeout); -} - -// static -void HippoRestRequest::put(const std::string &url, const std::string &body, - HippoRestHandler *handler, float timeout) -{ - request(url, LLURLRequest::HTTP_PUT, new BodyDataRaw(body), handler, timeout); -} - -// static -void HippoRestRequest::put(const std::string &url, const LLXmlTree *body, - HippoRestHandler *handler, float timeout) -{ - request(url, LLURLRequest::HTTP_PUT, new BodyDataXml(body), handler, timeout); -} - -// static -void HippoRestRequest::post(const std::string &url, const std::string &body, - HippoRestHandler *handler, float timeout) -{ - request(url, LLURLRequest::HTTP_POST, new BodyDataRaw(body), handler, timeout); -} - -// static -void HippoRestRequest::post(const std::string &url, const LLXmlTree *body, - HippoRestHandler *handler, float timeout) -{ - request(url, LLURLRequest::HTTP_POST, new BodyDataXml(body), handler, timeout); -} - - -// ******************************************************************** - - -static void request(const std::string &url, - LLURLRequest::ERequestAction method, - BodyData *body, - HippoRestHandler *handler, float timeout) -{ - if (!LLHTTPClient::hasPump()) - { - // !!! responder->completed(U32_MAX, "No pump", LLSD()); - return; - } - LLPumpIO::chain_t chain; - - LLURLRequest *req = new LLURLRequest(method, url); - req->checkRootCertificate(true); - - /* - // Insert custom headers if the caller sent any - if (headers.isMap()) - { - LLSD::map_const_iterator iter = headers.beginMap(); - LLSD::map_const_iterator end = headers.endMap(); - - for (; iter != end; ++iter) - { - std::ostringstream header; - //if the header is "Pragma" with no value - //the caller intends to force libcurl to drop - //the Pragma header it so gratuitously inserts - //Before inserting the header, force libcurl - //to not use the proxy (read: llurlrequest.cpp) - static const std::string PRAGMA("Pragma"); - if ((iter->first == PRAGMA) && (iter->second.asString().empty())) - { - req->useProxy(false); - } - header << iter->first << ": " << iter->second.asString() ; - lldebugs << "header = " << header.str() << llendl; - req->addHeader(header.str().c_str()); - } - } - */ - - if ((method != LLURLRequest::HTTP_PUT) && (method != LLURLRequest::HTTP_POST)) { - std::string accept = "Accept: "; - accept += handler->getAcceptMimeType(); - req->addHeader(accept.c_str()); - } - - req->setCallback(new HippoRestComplete(handler)); - - if ((method == LLURLRequest::HTTP_PUT) || (method == LLURLRequest::HTTP_POST)) { - std::string content = "Content-Type: "; - content += body->getContentMimeType(); - req->addHeader(content.c_str()); - chain.push_back(LLIOPipe::ptr_t(body)); - } - - chain.push_back(LLIOPipe::ptr_t(req)); - LLHTTPClient::getPump().addChain(chain, timeout); -} - - -// ******************************************************************** - - -static size_t curlWrite(void *ptr, size_t size, size_t nmemb, void *userData) -{ - std::string *result = (std::string*)userData; - size_t bytes = (size * nmemb); - result->append((char*)ptr, bytes); - return nmemb; -} - - -// static -int HippoRestRequest::getBlocking(const std::string &url, std::string *result) -{ - llinfos << "Requesting: " << url << llendl; - - char curlErrorBuffer[CURL_ERROR_SIZE]; - CURL* curlp = curl_easy_init(); - - curl_easy_setopt(curlp, CURLOPT_NOSIGNAL, 1); // don't use SIGALRM for timeouts - curl_easy_setopt(curlp, CURLOPT_TIMEOUT, 5); // seconds - - curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, curlWrite); - curl_easy_setopt(curlp, CURLOPT_WRITEDATA, result); - curl_easy_setopt(curlp, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curlErrorBuffer); - curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1); - - *result = ""; - S32 curlSuccess = curl_easy_perform(curlp); - S32 httpStatus = 499; - curl_easy_getinfo(curlp, CURLINFO_RESPONSE_CODE, &httpStatus); - - if (curlSuccess != 0) { - llwarns << "CURL ERROR (HTTP Status " << httpStatus << "): " << curlErrorBuffer << llendl; - } else if (httpStatus != 200) { - llwarns << "HTTP Error " << httpStatus << ", but no Curl error." << llendl; - } - - curl_easy_cleanup(curlp); - return httpStatus; -} - diff --git a/linden/indra/newview/hippoRestRequest.h b/linden/indra/newview/hippoRestRequest.h deleted file mode 100644 index 727dbf7..0000000 --- a/linden/indra/newview/hippoRestRequest.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef __HIPPO_REST_REQUEST_H__ -#define __HIPPO_REST_REQUEST_H__ - - -#include -#include - -#include - -class LLBufferArray; -class LLChannelDescriptors; -class LLXmlTree; - - -#define HIPPO_REST_TIMEOUT 60.f - - -// ******************************************************************** - - -class HippoRestHandler -{ - public: - virtual ~HippoRestHandler() { } - - virtual const char *getAcceptMimeType() const = 0; - - bool hasHeader(const std::string &header) const; - const std::string &getHeader(const std::string &header) const; - - private: - // These functions are called by the request engine - void addHeader(const std::string &header, const std::string &content); - virtual void handle(int status, const std::string &reason, - const LLChannelDescriptors &channels, - const boost::shared_ptr &body) = 0; - - std::map mHeaders; - - friend class HippoRestComplete; -}; - - -class HippoRestHandlerRaw : public HippoRestHandler -{ - public: - virtual ~HippoRestHandlerRaw() { } - - const char *getAcceptMimeType() const { return "application/octet-stream"; } - - private: - // This function must be implemented to receive the content - // it is executed on (status == 200) only - virtual void result(const std::string &content) = 0; - - // This function is called by the request engine - void handle(int status, const std::string &reason, - const LLChannelDescriptors &channels, - const boost::shared_ptr &body); -}; - - -class HippoRestHandlerXml : public HippoRestHandler -{ - public: - virtual ~HippoRestHandlerXml() { } - - const char *getAcceptMimeType() const { return "application/xml"; } - - private: - // This function must be implemented to receive the content - virtual void result(LLXmlTree *content) = 0; - - // This function is called by the request engine - void handle(int status, const std::string &reason, - const LLChannelDescriptors &channels, - const boost::shared_ptr &body); -}; - - -// ******************************************************************** - - -class HippoRestRequest -{ - public: - // asynchronous interface - static void get(const std::string &url, - HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); - static void put(const std::string &url, const std::string &body, - HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); - static void put(const std::string &url, const LLXmlTree *body, - HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); - static void post(const std::string &url, const std::string &body, - HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); - static void post(const std::string &url, const LLXmlTree *body, - HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); - - // synchronous interface - static int getBlocking(const std::string &url, std::string *result); -}; - - -#endif diff --git a/linden/indra/newview/hippoUpdate.cpp b/linden/indra/newview/hippoUpdate.cpp deleted file mode 100644 index f6947ad..0000000 --- a/linden/indra/newview/hippoUpdate.cpp +++ /dev/null @@ -1,92 +0,0 @@ - -#include "hippoUpdate.h" - -#include -#include -#include - -#include -#include -#include -//#include -#include "llviewercontrol.h" -#include "llviewernetwork.h" -#include "llweb.h" -#include - - -std::string gHippoChannel; - - -// static -bool HippoUpdate::checkUpdate() -{ - llinfos << "Hippo Update Check..." << llendl; - - // get channel name - gHippoChannel = gSavedSettings.getString("ChannelName"); - - // get mac address - char macAddress[18]; - sprintf(macAddress, "%02x:%02x:%02x:%02x:%02x:%02x", - gMACAddress[0], gMACAddress[1], gMACAddress[2], gMACAddress[3], gMACAddress[4], gMACAddress[5]); - - // build URL for update check - char url[1000]; - snprintf(url, 1000, -/* "http://update.mjm.game-host.org/os/viewer.php?" - "product=%s&channel=%s&" - "version_major=%d&version_minor=%d&version_patch=%d&version_base=%s&" - "platform=%s&mac=%s", - LL_PRODUCT, LL_CHANNEL_CSTR, - LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BASE, - LL_PLATFORM*/"", macAddress); - - // query update server - std::string escaped_url = LLWeb::escapeURL(url); - LLSD response = LLHTTPClient::blockingGet(escaped_url.c_str()); - - // check response, return on error - S32 status = response["status"].asInteger(); - if ((status != 200) || !response["body"].isMap()) { - llinfos << "Hippo Update failed (" << status << "): " - << (response["body"].isString()? response["body"].asString(): "") - << llendl; - return true; - } - - // get data from response - LLSD data = response["body"]; - std::string webpage = (data.has("webpage") && data["webpage"].isString())? data["webpage"].asString(): ""; - std::string message = (data.has("message") && data["message"].isString())? data["message"].asString(): ""; - std::string yourVersion = (data.has("yourVersion") && data["yourVersion"].isString())? data["yourVersion"].asString(): ""; - std::string curVersion = (data.has("curVersion") && data["curVersion"].isString())? data["curVersion"].asString(): ""; - bool update = (data.has("update") && data["update"].isBoolean())? data["update"].asBoolean(): false; - bool mandatory = (data.has("mandatory") && data["mandatory"].isBoolean())? data["mandatory"].asBoolean(): false; - - // log and return, if no update available - llinfos << "Your version is " << yourVersion << ", current version is " << curVersion << '.' << llendl; - if (!update) return true; - llinfos << "Update is " << (mandatory? "mandatory.": "optional.") << llendl; - - // show update dialog - char msg[1000]; - snprintf(msg, 1000, - "There is a new viewer version available.\n" - "\n" - "Your version: %s\n" - "Current version: %s\n" - "%s\n" - "Do you want to visit the web site?", - yourVersion.c_str(), curVersion.c_str(), - mandatory? "\nThis is a mandatory update.\n": ""); - S32 button = OSMessageBox(msg, "Hippo OpenSim Viewer Update", OSMB_YESNO); - if (button == OSBTN_YES) { - llinfos << "Taking user to " << webpage << llendl; - LLWeb::loadURLExternal(webpage); - // exit the viewer - return false; - } - - return !mandatory; -} diff --git a/linden/indra/newview/hippoUpdate.h b/linden/indra/newview/hippoUpdate.h deleted file mode 100644 index 559c8b3..0000000 --- a/linden/indra/newview/hippoUpdate.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __HIPPO_UPDATE_H__ -#define __HIPPO_UPDATE_H__ - - -class HippoUpdate -{ - public: - static bool checkUpdate(); -}; - - -#endif diff --git a/linden/indra/newview/hippogridmanager.cpp b/linden/indra/newview/hippogridmanager.cpp new file mode 100644 index 0000000..dd0fa35 --- /dev/null +++ b/linden/indra/newview/hippogridmanager.cpp @@ -0,0 +1,970 @@ +// Ported to Imprudence from the Hippo OpenSim Viewer by Jacek Antonelli + +#include "llviewerprecompiledheaders.h" + +#include "hippoGridManager.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include "lltrans.h" +#include "llviewercontrol.h" +#include "llweb.h" + +#include "hippoRestRequest.h" + + +// ******************************************************************** +// Global Variables + +HippoGridManager* gHippoGridManager = 0; + +HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); + + + +// ******************************************************************** +// ******************************************************************** +// HippoGridInfo +// ******************************************************************** +// ******************************************************************** + + +// ******************************************************************** +// Initialize + +HippoGridInfo::HippoGridInfo(const std::string& gridNick) : + mPlatform(PLATFORM_OPENSIM), + mGridNick(gridNick), + mGridName(LLStringUtil::null), + mLoginUri(LLStringUtil::null), + mLoginPage(LLStringUtil::null), + mHelperUri(LLStringUtil::null), + mWebSite(LLStringUtil::null), + mSupportUrl(LLStringUtil::null), + mRegisterUrl(LLStringUtil::null), + mPasswordUrl(LLStringUtil::null), + mSearchUrl(LLStringUtil::null), + mFirstName(LLStringUtil::null), + mLastName(LLStringUtil::null), + mAvatarPassword(LLStringUtil::null), + mXmlState(XML_VOID), + mVoiceConnector("SLVoice"), + mRenderCompat(true), + mMaxAgentGroups(-1), + mCurrencySymbol("OS$"), + mRealCurrencySymbol("US$"), + mDirectoryFee(30) +{ + std::string nick = gridNick; + mGridNick = sanitizeGridNick( nick ); +} + + +// ******************************************************************** +// Getters + +HippoGridInfo::Platform HippoGridInfo::getPlatform() +{ + return mPlatform; +} + +bool HippoGridInfo::isOpenSimulator() const +{ + return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM); +} + +bool HippoGridInfo::isSecondLife() const +{ + return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); +} + +const std::string& HippoGridInfo::getGridNick() const +{ + return mGridNick; +} + +const std::string& HippoGridInfo::getGridName() const +{ + return mGridName; +} + +const std::string& HippoGridInfo::getLoginUri() const +{ + return mLoginUri; +} + +const std::string& HippoGridInfo::getLoginPage() const +{ + return mLoginPage; +} + +const std::string& HippoGridInfo::getHelperUri() const +{ + return mHelperUri; +} + +const std::string& HippoGridInfo::getWebSite() const +{ + return mWebSite; +} + +const std::string& HippoGridInfo::getSupportUrl() const +{ + return mSupportUrl; +} + +const std::string& HippoGridInfo::getRegisterUrl() const +{ + return mRegisterUrl; +} + +const std::string& HippoGridInfo::getPasswordUrl() const +{ + return mPasswordUrl; +} + +const std::string& HippoGridInfo::getSearchUrl() const +{ + return mSearchUrl; +} + +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; +} + +const std::string& HippoGridInfo::getCurrencySymbol() const +{ + return mCurrencySymbol; +} + +const std::string& HippoGridInfo::getRealCurrencySymbol() const +{ + return mRealCurrencySymbol; +} + + + +// ******************************************************************** +// Setters + +void HippoGridInfo::setPlatform(Platform platform) +{ + mPlatform = platform; + if (mPlatform == PLATFORM_SECONDLIFE) + { + mCurrencySymbol = "L$"; + } +} + + +void HippoGridInfo::setPlatform(const std::string& platform) +{ + std::string tmp = platform; + for (unsigned i=0; imXmlState = XML_GRIDNICK; + else if (strcasecmp(name, "gridname") == 0) + self->mXmlState = XML_GRIDNAME; + else if (strcasecmp(name, "platform") == 0) + self->mXmlState = XML_PLATFORM; + else if ((strcasecmp(name, "login") == 0) || (strcasecmp(name, "loginuri") == 0)) + self->mXmlState = XML_LOGINURI; + else if ((strcasecmp(name, "welcome") == 0) || (strcasecmp(name, "loginpage") == 0)) + self->mXmlState = XML_LOGINPAGE; + else if ((strcasecmp(name, "economy") == 0) || (strcasecmp(name, "helperuri") == 0)) + self->mXmlState = XML_HELPERURI; + else if ((strcasecmp(name, "about") == 0) || (strcasecmp(name, "website") == 0)) + self->mXmlState = XML_WEBSITE; + else if ((strcasecmp(name, "help") == 0) || (strcasecmp(name, "support") == 0)) + self->mXmlState = XML_SUPPORT; + else if ((strcasecmp(name, "register") == 0) || (strcasecmp(name, "account") == 0)) + self->mXmlState = XML_REGISTER; + else if (strcasecmp(name, "password") == 0) + self->mXmlState = XML_PASSWORD; + else if (strcasecmp(name, "search") == 0) + self->mXmlState = XML_SEARCH; +} + +//static +void HippoGridInfo::onXmlElementEnd(void* userData, const XML_Char* name) +{ + HippoGridInfo* self = (HippoGridInfo*)userData; + self->mXmlState = XML_VOID; +} + +//static +void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int len) +{ + HippoGridInfo* self = (HippoGridInfo*)userData; + switch (self->mXmlState) + { + 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: + { + std::string loginuri(s, len); + self->mLoginUri = sanitizeUri( loginuri ); + break; + } + + case XML_HELPERURI: + { + std::string helperuri(s, len); + self->mHelperUri = sanitizeUri( helperuri ); + break; + } + + case XML_SEARCH: + { + self->mSearchUrl.assign(s, len); + //sanitizeQueryUrl(mSearchUrl); + break; + } + + case XML_GRIDNAME: self->mGridName.assign(s, len); break; + case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break; + case XML_WEBSITE: self->mWebSite.assign(s, len); break; + case XML_SUPPORT: self->mSupportUrl.assign(s, len); break; + case XML_REGISTER: self->mRegisterUrl.assign(s, len); break; + case XML_PASSWORD: self->mPasswordUrl.assign(s, len); break; + + case XML_VOID: break; + } +} + + +bool HippoGridInfo::retrieveGridInfo() +{ + if (mLoginUri == "") return false; + + // If last character in uri is not "/" + std::string uri = mLoginUri; + if (uri.compare(uri.length()-1, 1, "/") != 0) + { + uri += '/'; + } + std::string reply; + int result = HippoRestRequest::getBlocking(uri + "get_grid_info", &reply); + if (result != 200) return false; + + llinfos << "Received: " << reply << llendl; + + bool success = true; + XML_Parser parser = XML_ParserCreate(0); + XML_SetUserData(parser, this); + XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd); + XML_SetCharacterDataHandler(parser, onXmlCharacterData); + mXmlState = XML_VOID; + if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) + { + llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl; + success = false; + } + XML_ParserFree(parser); + + return success; +} + + +std::string HippoGridInfo::getUploadFee() const +{ + std::string fee; + formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true); + return fee; +} + +std::string HippoGridInfo::getGroupCreationFee() const +{ + std::string fee; + formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false); + return fee; +} + +std::string HippoGridInfo::getDirectoryFee() const +{ + std::string fee; + formatFee(fee, mDirectoryFee, true); + if (fee != LLTrans::getString("hippo_label_free")) fee += "/" + LLTrans::getString("hippo_label_week"); + return fee; +} + +void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const +{ + if (showFree && (cost == 0)) + { + fee = LLTrans::getString("hippo_label_free"); + } + else + { + fee = llformat("%s%d", getCurrencySymbol().c_str(), cost); + } +} + + +// ******************************************************************** +// Static Helpers + +// static +const char* HippoGridInfo::getPlatformString(Platform platform) +{ + static const char* platformStrings[PLATFORM_LAST] = + { + "Other", "OpenSim", "SecondLife" + }; + + if ((platform < PLATFORM_OTHER) || (platform >= PLATFORM_LAST)) + platform = PLATFORM_OTHER; + return platformStrings[platform]; +} + + +// static +std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick) +{ + std::string tmp; + int size = gridnick.size(); + for (int i=0; i::iterator it, end = mGridInfo.end(); + for (it=mGridInfo.begin(); it != end; ++it) + { + delete it->second; + } + mGridInfo.clear(); +} + + +void HippoGridManager::init() +{ + HippoGridInfo::initFallback(); + loadFromFile(); + + // !!!### gSavedSettings.getControl("CmdLineLoginURI"); + // !!!### gSavedSettings.getString("CmdLineLoginPage"); + // !!!### gSavedSettings.getString("CmdLineHelperURI"); + // !!!### LLString::compareInsensitive(gGridInfo[grid_index].mLabel, grid_name.c_str())) +} + + +void HippoGridManager::discardAndReload() +{ + cleanup(); + loadFromFile(); +} + + +// ******************************************************************** +// Public Access + +HippoGridInfo* HippoGridManager::getGrid(const std::string& grid) const +{ + std::map::const_iterator it; + it = mGridInfo.find(grid); + if (it != mGridInfo.end()) + { + return it->second; + } + else + { + return 0; + } +} + + +HippoGridInfo* HippoGridManager::getConnectedGrid() const +{ + return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); +} + + +HippoGridInfo* HippoGridManager::getCurrentGrid() const +{ + HippoGridInfo* grid = getGrid(mCurrentGrid); + if (grid) + { + return grid; + } + else + { + return &HippoGridInfo::FALLBACK_GRIDINFO; + } +} + +const std::string& HippoGridManager::getDefaultGridNick() const +{ + return mDefaultGrid; +} + +const std::string& HippoGridManager::getCurrentGridNick() const +{ + if (mCurrentGrid.empty()) + { + return mDefaultGrid; + } + return mCurrentGrid; +} + +void HippoGridManager::setCurrentGridAsConnected() +{ + mConnectedGrid = getCurrentGrid(); +} + + +void HippoGridManager::addGrid(HippoGridInfo* grid) +{ + if (!grid) return; + const std::string& nick = grid->getGridNick(); + if (nick == "") + { + llwarns << "Ignoring to try adding grid with empty nick." << llendl; + delete grid; + return; + } + if (mGridInfo.find(nick) != mGridInfo.end()) + { + llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl; + delete grid; + return; + } + mGridInfo[nick] = grid; +} + + +void HippoGridManager::deleteGrid(const std::string& grid) +{ + GridIterator it = mGridInfo.find(grid); + if (it == mGridInfo.end()) { + llwarns << "Trying to delete non-existing grid " << grid << '.' << llendl; + return; + } + mGridInfo.erase(it); + llinfos << "Number of grids now: " << mGridInfo.size() << llendl; + if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl; + if (grid == mDefaultGrid) + setDefaultGrid(LLStringUtil::null); // sets first grid, if map not empty + if (grid == mCurrentGrid) + mCurrentGrid = mDefaultGrid; +} + + +void HippoGridManager::setDefaultGrid(const std::string& grid) +{ + GridIterator it = mGridInfo.find(grid); + if (it != mGridInfo.end()) + { + mDefaultGrid = grid; + } + else if (mGridInfo.find("secondlife") != mGridInfo.end()) + { + mDefaultGrid = "secondlife"; + } + else if (!mGridInfo.empty()) + { + mDefaultGrid = mGridInfo.begin()->first; + } + else + { + mDefaultGrid = ""; + } +} + + +void HippoGridManager::setCurrentGrid(const std::string& grid) +{ + GridIterator it = mGridInfo.find(grid); + if (it != mGridInfo.end()) + { + mCurrentGrid = grid; + } + else if (!mGridInfo.empty()) + { + llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl; + mCurrentGrid = mDefaultGrid; + } +} + + +// ******************************************************************** +// Persistent Store + +void HippoGridManager::loadFromFile() +{ + mDefaultGridsVersion = 0; + // load user grid info + parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.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()); + // 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()); + + std::string last_grid = gSavedSettings.getString("LastSelectedGrid"); + if (last_grid.empty()) last_grid = gSavedSettings.getString("DefaultGrid"); + setDefaultGrid(last_grid); + setCurrentGrid(last_grid); +} + + +void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) +{ + llinfos << "Loading grid info from '" << url << "'." << llendl; + + // query update server + std::string escaped_url = LLWeb::escapeURL(url); + LLSD response = LLHTTPClient::blockingGet(url); + + // check response, return on error + S32 status = response["status"].asInteger(); + if ((status != 200) || !response["body"].isArray()) + { + llinfos << "GridInfo Update failed (" << status << "): " + << (response["body"].isString()? response["body"].asString(): "") + << llendl; + return; + } + + LLSD gridInfo = response["body"]; + parseData(gridInfo, mergeIfNewer); +} + +void HippoGridManager::parseFile(const std::string& fileName, bool mergeIfNewer) +{ + llifstream infile; + infile.open(fileName.c_str()); + if (!infile.is_open()) + { + llwarns << "Cannot find grid info file " << fileName << " to load." << llendl; + return; + } + + LLSD gridInfo; + if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) + { + llwarns << "Unable to parse grid info file " << fileName << '.' << llendl; + return; + } + + llinfos << "Loading grid info file " << fileName << '.' << llendl; + parseData(gridInfo, mergeIfNewer); +} + + +void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer) +{ + if (mergeIfNewer) + { + LLSD::array_const_iterator it, end = gridInfo.endArray(); + for (it = gridInfo.beginArray(); it != end; ++it) + { + LLSD gridMap = *it; + if (gridMap.has("default_grids_version")) + { + int version = gridMap["default_grids_version"]; + if (version <= mDefaultGridsVersion) return; + else break; + } + } + if (it == end) + { + llwarns << "Grid data has no version number." << llendl; + return; + } + } + + llinfos << "Loading grid data." << llendl; + + LLSD::array_const_iterator it, end = gridInfo.endArray(); + for (it = gridInfo.beginArray(); it != end; ++it) + { + LLSD gridMap = *it; + if (gridMap.has("default_grids_version")) + { + mDefaultGridsVersion = gridMap["default_grids_version"]; + } + else if (gridMap.has("gridnick") && gridMap.has("loginuri")) + { + std::string gridnick = gridMap["gridnick"]; + HippoGridInfo* grid; + GridIterator it = mGridInfo.find(gridnick); + bool newGrid = (it == mGridInfo.end()); + if (newGrid) + { + // create new grid info + grid = new HippoGridInfo(gridnick); + } + else + { + // update existing grid info + grid = it->second; + } + grid->setLoginUri(gridMap["loginuri"]); + if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]); + if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]); + if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]); + if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]); + if (gridMap.has("website")) grid->setWebSite(gridMap["website"]); + if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]); + if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]); + 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("firstname")) grid->setFirstName(gridMap["firstname"]); + // if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]); + // if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]); + if (newGrid) addGrid(grid); + } + } +} + + +void HippoGridManager::saveFile() +{ + // save default grid to client settings + gSavedSettings.setString("DefaultGrid", mDefaultGrid); + + // build LLSD + LLSD gridInfo; + gridInfo[0]["default_grids_version"] = mDefaultGridsVersion; + + // add grids + S32 i = 1; + GridIterator it, end = mGridInfo.end(); + for (it = mGridInfo.begin(); it != end; ++it, i++) + { + HippoGridInfo* grid = it->second; + gridInfo[i]["gridnick"] = grid->getGridNick(); + gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform()); + gridInfo[i]["gridname"] = grid->getGridName(); + gridInfo[i]["loginuri"] = grid->getLoginUri(); + gridInfo[i]["loginpage"] = grid->getLoginPage(); + gridInfo[i]["helperuri"] = grid->getHelperUri(); + gridInfo[i]["website"] = grid->getWebSite(); + 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(); + } + + // write client grid info file + std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"); + llofstream file; + file.open(fileName.c_str()); + if (file.is_open()) + { + LLSDSerialize::toPrettyXML(gridInfo, file); + file.close(); + llinfos << "Saved grids to " << fileName << llendl; + } + else + { + llerrs << "Unable to open grid info file: " << fileName << llendl; + } +} diff --git a/linden/indra/newview/hippogridmanager.h b/linden/indra/newview/hippogridmanager.h new file mode 100644 index 0000000..8429dba --- /dev/null +++ b/linden/indra/newview/hippogridmanager.h @@ -0,0 +1,183 @@ +#ifndef __HIPPO_GRID_MANAGER_H__ +#define __HIPPO_GRID_MANAGER_H__ + + +#include +#include + +#ifndef XML_STATIC +#define XML_STATIC +#endif + +#ifdef LL_STANDALONE +#include +#else +#include "expat/expat.h" +#endif + +class LLSD; + + +class HippoGridInfo +{ +public: + enum Platform { + PLATFORM_OTHER = 0, + PLATFORM_OPENSIM, + PLATFORM_SECONDLIFE, + PLATFORM_LAST + }; + enum SearchType { + SEARCH_ALL_EMPTY, + SEARCH_ALL_QUERY, + SEARCH_ALL_TEMPLATE + }; + + explicit HippoGridInfo(const std::string& gridNick); + + Platform getPlatform(); + bool isOpenSimulator() const; + bool isSecondLife() const; + const std::string& getGridNick() const; + const std::string& getGridName() const; + const std::string& getLoginUri() const; + const std::string& getLoginPage() const; + const std::string& getHelperUri() const; + const std::string& getWebSite() const; + const std::string& getSupportUrl() const; + const std::string& getRegisterUrl() const; + const std::string& getPasswordUrl() const; + // Returns the url base used for the Web Search tab + const std::string& getSearchUrl() 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; + int getMaxAgentGroups() const { return mMaxAgentGroups; } + + const std::string& getCurrencySymbol() const; + const std::string& getRealCurrencySymbol() const; + std::string getUploadFee() const; + std::string getGroupCreationFee() const; + std::string getDirectoryFee() const; + + void setPlatform (const std::string& platform); + void setPlatform (Platform platform); + void setGridName (const std::string& gridName); + void setLoginUri (const std::string& loginUri); + void setLoginPage(const std::string& loginPage); + void setHelperUri(const std::string& helperUri); + void setWebSite (const std::string& website); + void setSupportUrl(const std::string& url); + void setRegisterUrl(const std::string& url); + void setPasswordUrl(const std::string& url); + // sets the url base used for the Web Search tab + void setSearchUrl(const std::string& url); + 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); + void setRealCurrencySymbol(const std::string& sym); + void setDirectoryFee(int fee); + + bool retrieveGridInfo(); + + static const char* getPlatformString(Platform platform); + static std::string sanitizeGridNick(std::string &gridnick); + + static HippoGridInfo FALLBACK_GRIDINFO; + static void initFallback(); + +private: + Platform mPlatform; + std::string mGridNick; + std::string mGridName; + std::string mLoginUri; + std::string mLoginPage; + std::string mHelperUri; + std::string mWebSite; + std::string mSupportUrl; + std::string mRegisterUrl; + std::string mPasswordUrl; + std::string mSearchUrl; + std::string mVoiceConnector; + std::string mFirstName; + std::string mLastName; + std::string mAvatarPassword; + bool mRenderCompat; + int mMaxAgentGroups; + + std::string mCurrencySymbol; + std::string mRealCurrencySymbol; + int mDirectoryFee; + + // for parsing grid info XML + enum XmlState + { + XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME, + XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI, + XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH + }; + XmlState mXmlState; + + static std::string sanitizeUri(std::string &uri); + void formatFee(std::string &fee, int cost, bool showFree) const; + + static void onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts); + static void onXmlElementEnd(void* userData, const XML_Char* name); + static void onXmlCharacterData(void* userData, const XML_Char* s, int len); +}; + + +class HippoGridManager +{ +public: + HippoGridManager(); + ~HippoGridManager(); + + void init(); + void saveFile(); + void discardAndReload(); + + HippoGridInfo* getGrid(const std::string& grid) const; + HippoGridInfo* getConnectedGrid() const; + HippoGridInfo* getCurrentGrid() const; + const std::string& getDefaultGridNick() const; + const std::string& getCurrentGridNick() const; + + void setDefaultGrid(const std::string& grid); + void setCurrentGrid(const std::string& grid); + void setCurrentGridAsConnected(); + + void addGrid(HippoGridInfo* grid); + void deleteGrid(const std::string& grid); + + typedef std::map::iterator GridIterator; + GridIterator beginGrid() { return mGridInfo.begin(); } + GridIterator endGrid() { return mGridInfo.end(); } + +private: + std::map mGridInfo; + std::string mDefaultGrid; + std::string mCurrentGrid; + HippoGridInfo* mConnectedGrid; + int mDefaultGridsVersion; + + void cleanup(); + void loadFromFile(); + void parseFile(const std::string& fileName, bool mergeIfNewer); + void parseUrl(const std::string url, bool mergeIfNewer); + void parseData(LLSD &gridInfo, bool mergeIfNewer); +}; + + +extern HippoGridManager* gHippoGridManager; + + +#endif diff --git a/linden/indra/newview/hippolimits.cpp b/linden/indra/newview/hippolimits.cpp new file mode 100644 index 0000000..a5d6ee6 --- /dev/null +++ b/linden/indra/newview/hippolimits.cpp @@ -0,0 +1,224 @@ + + +#include "llviewerprecompiledheaders.h" + +#include "hippoLimits.h" + +#include "hippoGridManager.h" +#include "llviewercontrol.h" + +#include + + +HippoLimits *gHippoLimits = 0; + + +HippoLimits::HippoLimits() +: + mMaxAgentGroups(100), + mMaxHeight(10000.0f), + mMinHoleSize(0.05f), + mMaxHollow(0.95f), + mMinPrimScale(0.001f), + mMaxPrimScale(256.0f), + mMaxLinkedPrims(-1) +{ + setLimits(); +} + + +void HippoLimits::setLimits() +{ + if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) + { + setSecondLifeLimits(); + } + else + { + setOpenSimLimits(); + } +} + + +void HippoLimits::setOpenSimLimits() +{ + mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups(); + + if (mMaxAgentGroups < 0) + mMaxAgentGroups = 50; + + mMaxPrimScale = 256.0f; + mMinPrimScale = 0.001f; + mMinPrimXPos = 0; + mMinPrimYPos = 0; + mMinPrimZPos = 0; + mMaxPrimXPos = F32_MAX; + mMaxPrimYPos = F32_MAX; + mMaxPrimZPos = F32_MAX; + mMaxHeight = 10000.0f; + mMaxLinkedPrims = -1; + mMaxPhysLinkedPrims = -1; + mAllowParcelWindLight = TRUE; + mAllowMinimap = TRUE; + mMaxInventoryItemsTransfer = -1; + mRenderName = 2; + mAllowPhysicalPrims = TRUE; + skyUseClassicClouds = TRUE; + mEnableTeenMode = FALSE; + mEnforceMaxBuild = FALSE; + mRenderWater = TRUE; + + if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { + llinfos << "Using rendering compatible OpenSim limits" << llendl; + mMinHoleSize = 0.05f; + mMaxHollow = 0.95f; + } + else + { + llinfos << "Using Hippo OpenSim limits" << llendl; + mMinHoleSize = 0.01f; + mMaxHollow = 0.99f; + } +} + +void HippoLimits::setSecondLifeLimits() +{ + llinfos << "Using Second Life limits" << llendl; + mMaxAgentGroups = 25; + mMaxPrimScale = 10.0f; + mMinPrimScale = 0.01f; + mMaxHeight = 4096.0f; + mMinHoleSize = 0.05f; + mMaxHollow = 0.95f; + mMaxLinkedPrims = 255; + mMaxPhysLinkedPrims = 32; + mMinPrimXPos = 0; + mMinPrimYPos = 0; + mMinPrimZPos = 0; + mMaxPrimXPos = 256; + mMaxPrimYPos = 256; + mMaxPrimZPos = 4096; + mAllowParcelWindLight = FALSE; + mAllowMinimap = TRUE; + mMaxInventoryItemsTransfer = 42; + mRenderName = 2; + mAllowPhysicalPrims = TRUE; + skyUseClassicClouds = TRUE; + mEnableTeenMode = FALSE; + mEnforceMaxBuild = FALSE; + mRenderWater = TRUE; +} + +F32 HippoLimits::getMaxPrimScale() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MAX; + } + else + { + return mMaxPrimScale; + } +} + +F32 HippoLimits::getMinPrimScale() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return 0; + } + else + { + return mMinPrimScale; + } +} + +F32 HippoLimits::getMaxPrimXPos() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MAX; + } + else + { + return mMaxPrimXPos; + } +} + +F32 HippoLimits::getMaxPrimYPos() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MAX; + } + else + { + return mMaxPrimYPos; + } +} + +F32 HippoLimits::getMaxPrimZPos() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MAX; + } + else + { + return mMaxPrimZPos; + } +} + +F32 HippoLimits::getMinPrimXPos() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MIN; + } + else + { + return mMinPrimXPos; + } +} + +F32 HippoLimits::getMinPrimYPos() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MIN; + } + else + { + return mMinPrimYPos; + } +} + +F32 HippoLimits::getMinPrimZPos() const +{ + if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild) + { + return FLT_MIN; + } + else + { + return mMinPrimZPos; + } +} + +F32 HippoLimits::getMaxDragDistance() const +{ + if (mMaxDragDistance == 0) + { + return FLT_MAX; + } + else + { + F32 max_drag_distance = gSavedSettings.getBOOL("LimitDragDistance") ? gSavedSettings.getF32("MaxDragDistance") : FLT_MAX; + + if(max_drag_distance > mMaxDragDistance) //Chose the more restrictive + { + max_drag_distance = mMaxDragDistance; + } + return max_drag_distance; + } +} \ No newline at end of file diff --git a/linden/indra/newview/hippolimits.h b/linden/indra/newview/hippolimits.h new file mode 100644 index 0000000..7792a2c --- /dev/null +++ b/linden/indra/newview/hippolimits.h @@ -0,0 +1,72 @@ +#ifndef __HIPPO_LIMITS_H__ +#define __HIPPO_LIMITS_H__ + + +class HippoLimits +{ +public: + HippoLimits(); + + const S32& getMaxAgentGroups() const { return mMaxAgentGroups; } + const F32& getMaxHeight() const { return mMaxHeight; } + const F32& getMinHoleSize() const { return mMinHoleSize; } + const F32& getMaxHollow() const { return mMaxHollow; } + const S32& getMaxLinkedPrims() const { return mMaxLinkedPrims; } + const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; } + const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; } + + + // Returns the max prim size we can use on a grid + F32 getMinPrimScale() const; + F32 getMaxPrimScale() const; + + F32 getMaxDragDistance() const; + + F32 getMinPrimXPos() const; + F32 getMinPrimYPos() const; + F32 getMinPrimZPos() const; + F32 getMaxPrimXPos() const; + F32 getMaxPrimYPos() const; + F32 getMaxPrimZPos() const; + + void setLimits(); + + S32 mMaxAgentGroups; + + F32 mMaxHeight; + F32 mMinHoleSize; + F32 mMaxHollow; + F32 mMaxPrimScale; + F32 mMinPrimScale; + S32 mMaxLinkedPrims; + S32 mMaxPhysLinkedPrims; + F32 mMaxPrimXPos; + F32 mMaxPrimYPos; + F32 mMaxPrimZPos; + F32 mMinPrimXPos; + F32 mMinPrimYPos; + F32 mMinPrimZPos; + + S32 mRenderName; + + F32 mMaxInventoryItemsTransfer; + F32 mMaxDragDistance; + + BOOL skyUseClassicClouds; + BOOL mAllowParcelWindLight; + BOOL mAllowMinimap; + BOOL mAllowPhysicalPrims; + BOOL mEnableTeenMode; + BOOL mEnforceMaxBuild; + BOOL mRenderWater; + +private: + void setOpenSimLimits(); + void setSecondLifeLimits(); +}; + + +extern HippoLimits* gHippoLimits; + + +#endif diff --git a/linden/indra/newview/hipporestrequest.cpp b/linden/indra/newview/hipporestrequest.cpp new file mode 100644 index 0000000..ed15907 --- /dev/null +++ b/linden/indra/newview/hipporestrequest.cpp @@ -0,0 +1,352 @@ + + +#include "llviewerprecompiledheaders.h" + +#include "hippoRestRequest.h" + +#ifndef CURL_STATICLIB +#define CURL_STATICLIB 1 +#endif +#include + +#include +#include +#include +#include +#include +#include + + +// ******************************************************************** + + +class HippoRestComplete : public LLURLRequestComplete +{ + public: + HippoRestComplete(HippoRestHandler *handler) : + mHandler(handler), + mStatus(499), + mReason("Request completed w/o status") + { + } + + ~HippoRestComplete() + { + delete mHandler; + } + + // Called once for each header received, prior to httpStatus + void header(const std::string& header, const std::string& value) + { + mHandler->addHeader(header, value); + } + + // Always called on request completion, prior to complete + void httpStatus(U32 status, const std::string& reason) + { + LLURLRequestComplete::httpStatus(status, reason); + mStatus = status; + mReason = reason; + } + + void complete(const LLChannelDescriptors &channels, const buffer_ptr_t &buffer) + { + mHandler->handle(mStatus, mReason, channels, buffer); + } + + private: + HippoRestHandler *mHandler; + int mStatus; + std::string mReason; +}; + + +// ******************************************************************** + + +static std::string gEmptyString; + +void HippoRestHandler::addHeader(const std::string &header, const std::string &content) +{ + mHeaders[header] = content; +} + +bool HippoRestHandler::hasHeader(const std::string &header) const +{ + return (mHeaders.find(header) != mHeaders.end()); +} + +const std::string &HippoRestHandler::getHeader(const std::string &header) const +{ + std::map::const_iterator it; + it = mHeaders.find(header); + if (it != mHeaders.end()) { + return it->second; + } else { + return gEmptyString; + } +} + + +// ******************************************************************** + + +void HippoRestHandlerRaw::handle(int status, const std::string &reason, + const LLChannelDescriptors &channels, + const boost::shared_ptr &body) +{ + if (status == 200) { + std::string data; + LLBufferArray *buffer = body.get(); + LLBufferArray::segment_iterator_t it, end = buffer->endSegment(); + for (it=buffer->beginSegment(); it!=end; ++it) + if (it->isOnChannel(channels.in())) + data.append((char*)it->data(), it->size()); + result(data); + } else { + llwarns << "Rest request error " << status << ": " << reason << llendl; + } +} + +void HippoRestHandlerXml::handle(int status, const std::string &reason, + const LLChannelDescriptors &channels, + const boost::shared_ptr &body) +{ + if (status == 200) { + LLXmlTree *tree = new LLXmlTree(); + bool success = tree->parseBufferStart(); + LLBufferArray *buffer = body.get(); + LLBufferArray::segment_iterator_t it, end = buffer->endSegment(); + for (it=buffer->beginSegment(); success && (it!=end); ++it) + if (it->isOnChannel(channels.in())) + success = success && tree->parseBuffer((char*)it->data(), it->size()); + success = success && tree->parseBufferFinalize(); + if (success) result(tree); + delete tree; + } else { + llwarns << "Rest request error " << status << ": " << reason << llendl; + } +} + + +// ******************************************************************** + + +class BodyData : public LLIOPipe +{ + public: + virtual ~BodyData() { } + virtual const char *getContentMimeType() const = 0; +}; + +class BodyDataRaw : public BodyData +{ + public: + explicit BodyDataRaw(const std::string &data) : + mData(data) + { + } + virtual ~BodyDataRaw() { } + + const char *getContentMimeType() const { return "application/octet-stream"; } + + EStatus process_impl(const LLChannelDescriptors &channels, + buffer_ptr_t &buffer, bool &eos, + LLSD &context, LLPumpIO *pump) + { + LLBufferStream ostream(channels, buffer.get()); + ostream.write(mData.data(), mData.size()); + eos = true; + return STATUS_DONE; + } + + private: + std::string mData; +}; + +class BodyDataXml : public BodyData +{ + public: + explicit BodyDataXml(const LLXmlTree *tree) : + mTree(tree) + { + } + + virtual ~BodyDataXml() + { + if (mTree) delete mTree; + } + + const char *getContentMimeType() const { return "application/xml"; } + + EStatus process_impl(const LLChannelDescriptors &channels, + buffer_ptr_t &buffer, bool &eos, + LLSD &context, LLPumpIO *pump) + { + std::string data; + mTree->write(data); + LLBufferStream ostream(channels, buffer.get()); + ostream.write(data.data(), data.size()); + eos = true; + return STATUS_DONE; + } + + private: + const LLXmlTree *mTree; +}; + + +// ******************************************************************** + + +static void request(const std::string &url, + LLURLRequest::ERequestAction method, + BodyData *body, + HippoRestHandler *handler, float timeout); + + +// static +void HippoRestRequest::get(const std::string &url, + HippoRestHandler *handler, float timeout) +{ + request(url, LLURLRequest::HTTP_GET, 0, handler, timeout); +} + +// static +void HippoRestRequest::put(const std::string &url, const std::string &body, + HippoRestHandler *handler, float timeout) +{ + request(url, LLURLRequest::HTTP_PUT, new BodyDataRaw(body), handler, timeout); +} + +// static +void HippoRestRequest::put(const std::string &url, const LLXmlTree *body, + HippoRestHandler *handler, float timeout) +{ + request(url, LLURLRequest::HTTP_PUT, new BodyDataXml(body), handler, timeout); +} + +// static +void HippoRestRequest::post(const std::string &url, const std::string &body, + HippoRestHandler *handler, float timeout) +{ + request(url, LLURLRequest::HTTP_POST, new BodyDataRaw(body), handler, timeout); +} + +// static +void HippoRestRequest::post(const std::string &url, const LLXmlTree *body, + HippoRestHandler *handler, float timeout) +{ + request(url, LLURLRequest::HTTP_POST, new BodyDataXml(body), handler, timeout); +} + + +// ******************************************************************** + + +static void request(const std::string &url, + LLURLRequest::ERequestAction method, + BodyData *body, + HippoRestHandler *handler, float timeout) +{ + if (!LLHTTPClient::hasPump()) + { + // !!! responder->completed(U32_MAX, "No pump", LLSD()); + return; + } + LLPumpIO::chain_t chain; + + LLURLRequest *req = new LLURLRequest(method, url); + req->checkRootCertificate(true); + + /* + // Insert custom headers if the caller sent any + if (headers.isMap()) + { + LLSD::map_const_iterator iter = headers.beginMap(); + LLSD::map_const_iterator end = headers.endMap(); + + for (; iter != end; ++iter) + { + std::ostringstream header; + //if the header is "Pragma" with no value + //the caller intends to force libcurl to drop + //the Pragma header it so gratuitously inserts + //Before inserting the header, force libcurl + //to not use the proxy (read: llurlrequest.cpp) + static const std::string PRAGMA("Pragma"); + if ((iter->first == PRAGMA) && (iter->second.asString().empty())) + { + req->useProxy(false); + } + header << iter->first << ": " << iter->second.asString() ; + lldebugs << "header = " << header.str() << llendl; + req->addHeader(header.str().c_str()); + } + } + */ + + if ((method != LLURLRequest::HTTP_PUT) && (method != LLURLRequest::HTTP_POST)) { + std::string accept = "Accept: "; + accept += handler->getAcceptMimeType(); + req->addHeader(accept.c_str()); + } + + req->setCallback(new HippoRestComplete(handler)); + + if ((method == LLURLRequest::HTTP_PUT) || (method == LLURLRequest::HTTP_POST)) { + std::string content = "Content-Type: "; + content += body->getContentMimeType(); + req->addHeader(content.c_str()); + chain.push_back(LLIOPipe::ptr_t(body)); + } + + chain.push_back(LLIOPipe::ptr_t(req)); + LLHTTPClient::getPump().addChain(chain, timeout); +} + + +// ******************************************************************** + + +static size_t curlWrite(void *ptr, size_t size, size_t nmemb, void *userData) +{ + std::string *result = (std::string*)userData; + size_t bytes = (size * nmemb); + result->append((char*)ptr, bytes); + return nmemb; +} + + +// static +int HippoRestRequest::getBlocking(const std::string &url, std::string *result) +{ + llinfos << "Requesting: " << url << llendl; + + char curlErrorBuffer[CURL_ERROR_SIZE]; + CURL* curlp = curl_easy_init(); + + curl_easy_setopt(curlp, CURLOPT_NOSIGNAL, 1); // don't use SIGALRM for timeouts + curl_easy_setopt(curlp, CURLOPT_TIMEOUT, 5); // seconds + + curl_easy_setopt(curlp, CURLOPT_WRITEFUNCTION, curlWrite); + curl_easy_setopt(curlp, CURLOPT_WRITEDATA, result); + curl_easy_setopt(curlp, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curlp, CURLOPT_ERRORBUFFER, curlErrorBuffer); + curl_easy_setopt(curlp, CURLOPT_FAILONERROR, 1); + + *result = ""; + S32 curlSuccess = curl_easy_perform(curlp); + S32 httpStatus = 499; + curl_easy_getinfo(curlp, CURLINFO_RESPONSE_CODE, &httpStatus); + + if (curlSuccess != 0) { + llwarns << "CURL ERROR (HTTP Status " << httpStatus << "): " << curlErrorBuffer << llendl; + } else if (httpStatus != 200) { + llwarns << "HTTP Error " << httpStatus << ", but no Curl error." << llendl; + } + + curl_easy_cleanup(curlp); + return httpStatus; +} + diff --git a/linden/indra/newview/hipporestrequest.h b/linden/indra/newview/hipporestrequest.h new file mode 100644 index 0000000..727dbf7 --- /dev/null +++ b/linden/indra/newview/hipporestrequest.h @@ -0,0 +1,104 @@ +#ifndef __HIPPO_REST_REQUEST_H__ +#define __HIPPO_REST_REQUEST_H__ + + +#include +#include + +#include + +class LLBufferArray; +class LLChannelDescriptors; +class LLXmlTree; + + +#define HIPPO_REST_TIMEOUT 60.f + + +// ******************************************************************** + + +class HippoRestHandler +{ + public: + virtual ~HippoRestHandler() { } + + virtual const char *getAcceptMimeType() const = 0; + + bool hasHeader(const std::string &header) const; + const std::string &getHeader(const std::string &header) const; + + private: + // These functions are called by the request engine + void addHeader(const std::string &header, const std::string &content); + virtual void handle(int status, const std::string &reason, + const LLChannelDescriptors &channels, + const boost::shared_ptr &body) = 0; + + std::map mHeaders; + + friend class HippoRestComplete; +}; + + +class HippoRestHandlerRaw : public HippoRestHandler +{ + public: + virtual ~HippoRestHandlerRaw() { } + + const char *getAcceptMimeType() const { return "application/octet-stream"; } + + private: + // This function must be implemented to receive the content + // it is executed on (status == 200) only + virtual void result(const std::string &content) = 0; + + // This function is called by the request engine + void handle(int status, const std::string &reason, + const LLChannelDescriptors &channels, + const boost::shared_ptr &body); +}; + + +class HippoRestHandlerXml : public HippoRestHandler +{ + public: + virtual ~HippoRestHandlerXml() { } + + const char *getAcceptMimeType() const { return "application/xml"; } + + private: + // This function must be implemented to receive the content + virtual void result(LLXmlTree *content) = 0; + + // This function is called by the request engine + void handle(int status, const std::string &reason, + const LLChannelDescriptors &channels, + const boost::shared_ptr &body); +}; + + +// ******************************************************************** + + +class HippoRestRequest +{ + public: + // asynchronous interface + static void get(const std::string &url, + HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); + static void put(const std::string &url, const std::string &body, + HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); + static void put(const std::string &url, const LLXmlTree *body, + HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); + static void post(const std::string &url, const std::string &body, + HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); + static void post(const std::string &url, const LLXmlTree *body, + HippoRestHandler *handler, float timeout=HIPPO_REST_TIMEOUT); + + // synchronous interface + static int getBlocking(const std::string &url, std::string *result); +}; + + +#endif diff --git a/linden/indra/newview/hippoupdate.cpp b/linden/indra/newview/hippoupdate.cpp new file mode 100644 index 0000000..f6947ad --- /dev/null +++ b/linden/indra/newview/hippoupdate.cpp @@ -0,0 +1,92 @@ + +#include "hippoUpdate.h" + +#include +#include +#include + +#include +#include +#include +//#include +#include "llviewercontrol.h" +#include "llviewernetwork.h" +#include "llweb.h" +#include + + +std::string gHippoChannel; + + +// static +bool HippoUpdate::checkUpdate() +{ + llinfos << "Hippo Update Check..." << llendl; + + // get channel name + gHippoChannel = gSavedSettings.getString("ChannelName"); + + // get mac address + char macAddress[18]; + sprintf(macAddress, "%02x:%02x:%02x:%02x:%02x:%02x", + gMACAddress[0], gMACAddress[1], gMACAddress[2], gMACAddress[3], gMACAddress[4], gMACAddress[5]); + + // build URL for update check + char url[1000]; + snprintf(url, 1000, +/* "http://update.mjm.game-host.org/os/viewer.php?" + "product=%s&channel=%s&" + "version_major=%d&version_minor=%d&version_patch=%d&version_base=%s&" + "platform=%s&mac=%s", + LL_PRODUCT, LL_CHANNEL_CSTR, + LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BASE, + LL_PLATFORM*/"", macAddress); + + // query update server + std::string escaped_url = LLWeb::escapeURL(url); + LLSD response = LLHTTPClient::blockingGet(escaped_url.c_str()); + + // check response, return on error + S32 status = response["status"].asInteger(); + if ((status != 200) || !response["body"].isMap()) { + llinfos << "Hippo Update failed (" << status << "): " + << (response["body"].isString()? response["body"].asString(): "") + << llendl; + return true; + } + + // get data from response + LLSD data = response["body"]; + std::string webpage = (data.has("webpage") && data["webpage"].isString())? data["webpage"].asString(): ""; + std::string message = (data.has("message") && data["message"].isString())? data["message"].asString(): ""; + std::string yourVersion = (data.has("yourVersion") && data["yourVersion"].isString())? data["yourVersion"].asString(): ""; + std::string curVersion = (data.has("curVersion") && data["curVersion"].isString())? data["curVersion"].asString(): ""; + bool update = (data.has("update") && data["update"].isBoolean())? data["update"].asBoolean(): false; + bool mandatory = (data.has("mandatory") && data["mandatory"].isBoolean())? data["mandatory"].asBoolean(): false; + + // log and return, if no update available + llinfos << "Your version is " << yourVersion << ", current version is " << curVersion << '.' << llendl; + if (!update) return true; + llinfos << "Update is " << (mandatory? "mandatory.": "optional.") << llendl; + + // show update dialog + char msg[1000]; + snprintf(msg, 1000, + "There is a new viewer version available.\n" + "\n" + "Your version: %s\n" + "Current version: %s\n" + "%s\n" + "Do you want to visit the web site?", + yourVersion.c_str(), curVersion.c_str(), + mandatory? "\nThis is a mandatory update.\n": ""); + S32 button = OSMessageBox(msg, "Hippo OpenSim Viewer Update", OSMB_YESNO); + if (button == OSBTN_YES) { + llinfos << "Taking user to " << webpage << llendl; + LLWeb::loadURLExternal(webpage); + // exit the viewer + return false; + } + + return !mandatory; +} diff --git a/linden/indra/newview/hippoupdate.h b/linden/indra/newview/hippoupdate.h new file mode 100644 index 0000000..559c8b3 --- /dev/null +++ b/linden/indra/newview/hippoupdate.h @@ -0,0 +1,12 @@ +#ifndef __HIPPO_UPDATE_H__ +#define __HIPPO_UPDATE_H__ + + +class HippoUpdate +{ + public: + static bool checkUpdate(); +}; + + +#endif -- cgit v1.1 From 30cf280a26413ea950cd11f5dc7530633a7e2957 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 3 Nov 2010 17:58:09 +0100 Subject: Rename hippo* files to lower case (PART 2 OF 2) There was a problem with #include "hippolimits.h" because the file is called hippoLimits.h (with an uppercase L). After some discussion on IRC it was reluctantly decided that filenames should be lowercase, as is done for every Linden file. This is part 2 or 2 (the first part just renamed the files). This part changes all files to make the viewer compile again after the renaming. --- linden/indra/llinventory/lltransactionflags.cpp | 2 +- linden/indra/llui/llnotifications.cpp | 2 +- linden/indra/newview/CMakeLists.txt | 12 ++++++------ linden/indra/newview/chatbar_as_cmdline.cpp | 2 +- linden/indra/newview/floatercommandline.cpp | 2 +- linden/indra/newview/floatergriddefault.cpp | 2 +- linden/indra/newview/floatergridmanager.cpp | 2 +- linden/indra/newview/floaterlocalassetbrowse.cpp | 2 +- linden/indra/newview/hippogridmanager.cpp | 4 ++-- linden/indra/newview/hippolimits.cpp | 4 ++-- linden/indra/newview/hipporestrequest.cpp | 2 +- linden/indra/newview/hippoupdate.cpp | 2 +- linden/indra/newview/kowopenregionsettings.cpp | 2 +- linden/indra/newview/llappviewer.cpp | 6 +++--- linden/indra/newview/llassetuploadresponders.cpp | 2 +- linden/indra/newview/llcurrencyuimanager.cpp | 2 +- linden/indra/newview/llfirstuse.cpp | 2 +- linden/indra/newview/llfloaterabout.cpp | 2 +- linden/indra/newview/llfloateranimpreview.cpp | 2 +- linden/indra/newview/llfloaterbuy.cpp | 2 +- linden/indra/newview/llfloaterbuycontents.cpp | 2 +- linden/indra/newview/llfloaterbuycurrency.cpp | 2 +- linden/indra/newview/llfloaterbuyland.cpp | 2 +- linden/indra/newview/llfloatergodtools.cpp | 2 +- linden/indra/newview/llfloatergroups.cpp | 2 +- linden/indra/newview/llfloaterhtmlhelp.cpp | 2 +- linden/indra/newview/llfloaterimagepreview.cpp | 2 +- linden/indra/newview/llfloaterland.cpp | 2 +- linden/indra/newview/llfloatermap.cpp | 2 +- linden/indra/newview/llfloaternamedesc.cpp | 2 +- linden/indra/newview/llfloaterpostcard.cpp | 2 +- linden/indra/newview/llfloaterproperties.cpp | 2 +- linden/indra/newview/llfloaterregioninfo.cpp | 2 +- linden/indra/newview/llfloatersellland.cpp | 2 +- linden/indra/newview/llfloatersnapshot.cpp | 2 +- linden/indra/newview/llfloatertools.cpp | 2 +- linden/indra/newview/llfloatertos.cpp | 2 +- linden/indra/newview/llfloaterworldmap.cpp | 2 +- linden/indra/newview/llgivemoney.cpp | 2 +- linden/indra/newview/llhoverview.cpp | 2 +- linden/indra/newview/llmanipscale.cpp | 2 +- linden/indra/newview/llmaniptranslate.cpp | 2 +- linden/indra/newview/llnetmap.cpp | 2 +- linden/indra/newview/llnotify.cpp | 2 +- linden/indra/newview/llpanelaudioprefs.cpp | 2 +- linden/indra/newview/llpanelclassified.cpp | 2 +- linden/indra/newview/llpaneldirfind.cpp | 2 +- linden/indra/newview/llpaneldirland.cpp | 2 +- linden/indra/newview/llpanelgroupgeneral.cpp | 2 +- linden/indra/newview/llpanelgrouplandmoney.cpp | 2 +- linden/indra/newview/llpanelinventory.cpp | 2 +- linden/indra/newview/llpanelland.cpp | 2 +- linden/indra/newview/llpanellandmedia.cpp | 2 +- linden/indra/newview/llpanellogin.cpp | 4 ++-- linden/indra/newview/llpanelmsgs.cpp | 2 +- linden/indra/newview/llpanelobject.cpp | 2 +- linden/indra/newview/llpanelpermissions.cpp | 2 +- linden/indra/newview/llpanelplace.cpp | 2 +- linden/indra/newview/llpanelweb.cpp | 2 +- linden/indra/newview/llprefsim.cpp | 2 +- linden/indra/newview/llstartup.cpp | 4 ++-- linden/indra/newview/llstatusbar.cpp | 2 +- linden/indra/newview/lltexturefetch.cpp | 2 +- linden/indra/newview/lltooldraganddrop.cpp | 2 +- linden/indra/newview/lltoolgrab.cpp | 2 +- linden/indra/newview/llviewerdisplay.cpp | 2 +- linden/indra/newview/llviewermenu.cpp | 4 ++-- linden/indra/newview/llviewermessage.cpp | 4 ++-- linden/indra/newview/llviewernetwork.cpp | 2 +- linden/indra/newview/llviewerparcelmgr.cpp | 2 +- linden/indra/newview/llvoavatar.cpp | 2 +- linden/indra/newview/llworld.cpp | 2 +- linden/indra/newview/llworldmap.cpp | 2 +- linden/indra/newview/llxmlrpctransaction.cpp | 2 +- linden/indra/newview/primbackup.cpp | 2 +- linden/indra/newview/windlightsettingsupdate.cpp | 2 +- linden/indra/newview/wlfloatermanager.cpp | 2 +- linden/indra/newview/wlfloaterwindlightsend.cpp | 2 +- linden/indra/newview/wlretrievesettings.cpp | 2 +- linden/indra/newview/wlsettingsmanager.cpp | 2 +- 80 files changed, 93 insertions(+), 93 deletions(-) (limited to 'linden') diff --git a/linden/indra/llinventory/lltransactionflags.cpp b/linden/indra/llinventory/lltransactionflags.cpp index aaea161..fda8cad 100644 --- a/linden/indra/llinventory/lltransactionflags.cpp +++ b/linden/indra/llinventory/lltransactionflags.cpp @@ -37,7 +37,7 @@ #include "lltransactionflags.h" #include "lltransactiontypes.h" -#include "../newview/hippoGridManager.h" +#include "../newview/hippogridmanager.h" const U8 TRANSACTION_FLAGS_NONE = 0; const U8 TRANSACTION_FLAG_SOURCE_GROUP = 1; diff --git a/linden/indra/llui/llnotifications.cpp b/linden/indra/llui/llnotifications.cpp index 4d3ff46..77f2ff7 100644 --- a/linden/indra/llui/llnotifications.cpp +++ b/linden/indra/llui/llnotifications.cpp @@ -40,7 +40,7 @@ #include #include -#include "../newview/hippoGridManager.h" +#include "../newview/hippogridmanager.h" const std::string NOTIFICATION_PERSIST_VERSION = "0.93"; diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 58c89eb..e3a1745 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -82,9 +82,9 @@ set(viewer_SOURCE_FILES floaterlocalassetbrowse.cpp floatervoicelicense.cpp hbfloatergrouptitles.cpp - hippoGridManager.cpp - hippoLimits.cpp - hippoRestRequest.cpp + hippogridmanager.cpp + hippolimits.cpp + hipporestrequest.cpp impprefsfonts.cpp jcfloater_animation_list.cpp jcfloaterareasearch.cpp @@ -534,9 +534,9 @@ set(viewer_HEADER_FILES floaterlocalassetbrowse.h floatervoicelicense.h hbfloatergrouptitles.h - hippoGridManager.h - hippoLimits.h - hippoRestRequest.h + hippogridmanager.h + hippolimits.h + hipporestrequest.h impprefsfonts.h jcfloater_animation_list.h jcfloaterareasearch.h diff --git a/linden/indra/newview/chatbar_as_cmdline.cpp b/linden/indra/newview/chatbar_as_cmdline.cpp index 96787ad..0593091 100644 --- a/linden/indra/newview/chatbar_as_cmdline.cpp +++ b/linden/indra/newview/chatbar_as_cmdline.cpp @@ -43,7 +43,7 @@ #include "lluuid.h" #include "llviewercontrol.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "material_codes.h" #include "llvolume.h" #include "object_flags.h" diff --git a/linden/indra/newview/floatercommandline.cpp b/linden/indra/newview/floatercommandline.cpp index c093a58..6889696 100644 --- a/linden/indra/newview/floatercommandline.cpp +++ b/linden/indra/newview/floatercommandline.cpp @@ -32,7 +32,7 @@ #include "floatercommandline.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" diff --git a/linden/indra/newview/floatergriddefault.cpp b/linden/indra/newview/floatergriddefault.cpp index 2c31fb6..6a2526d 100644 --- a/linden/indra/newview/floatergriddefault.cpp +++ b/linden/indra/newview/floatergriddefault.cpp @@ -32,7 +32,7 @@ #include "floatergriddefault.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llpanellogin.h" #include "llscrolllistctrl.h" #include "lluictrlfactory.h" diff --git a/linden/indra/newview/floatergridmanager.cpp b/linden/indra/newview/floatergridmanager.cpp index 3d4b17f..298fe35 100644 --- a/linden/indra/newview/floatergridmanager.cpp +++ b/linden/indra/newview/floatergridmanager.cpp @@ -17,7 +17,7 @@ #include "llmd5.h" #include "llurlsimstring.h" #include "lluictrlfactory.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llviewernetwork.h" #include "llpanellogin.h" diff --git a/linden/indra/newview/floaterlocalassetbrowse.cpp b/linden/indra/newview/floaterlocalassetbrowse.cpp index 991d2fd..8ea13cc 100644 --- a/linden/indra/newview/floaterlocalassetbrowse.cpp +++ b/linden/indra/newview/floaterlocalassetbrowse.cpp @@ -53,7 +53,7 @@ this feature is still a work in progress. /* misc headers */ #include #include -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llviewerimagelist.h" #include "llviewerobjectlist.h" #include "llfilepicker.h" diff --git a/linden/indra/newview/hippogridmanager.cpp b/linden/indra/newview/hippogridmanager.cpp index dd0fa35..d56214c 100644 --- a/linden/indra/newview/hippogridmanager.cpp +++ b/linden/indra/newview/hippogridmanager.cpp @@ -2,7 +2,7 @@ #include "llviewerprecompiledheaders.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include @@ -17,7 +17,7 @@ #include "llviewercontrol.h" #include "llweb.h" -#include "hippoRestRequest.h" +#include "hipporestrequest.h" // ******************************************************************** diff --git a/linden/indra/newview/hippolimits.cpp b/linden/indra/newview/hippolimits.cpp index a5d6ee6..851e191 100644 --- a/linden/indra/newview/hippolimits.cpp +++ b/linden/indra/newview/hippolimits.cpp @@ -2,9 +2,9 @@ #include "llviewerprecompiledheaders.h" -#include "hippoLimits.h" +#include "hippolimits.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llviewercontrol.h" #include diff --git a/linden/indra/newview/hipporestrequest.cpp b/linden/indra/newview/hipporestrequest.cpp index ed15907..9d24aed 100644 --- a/linden/indra/newview/hipporestrequest.cpp +++ b/linden/indra/newview/hipporestrequest.cpp @@ -2,7 +2,7 @@ #include "llviewerprecompiledheaders.h" -#include "hippoRestRequest.h" +#include "hipporestrequest.h" #ifndef CURL_STATICLIB #define CURL_STATICLIB 1 diff --git a/linden/indra/newview/hippoupdate.cpp b/linden/indra/newview/hippoupdate.cpp index f6947ad..192e3d7 100644 --- a/linden/indra/newview/hippoupdate.cpp +++ b/linden/indra/newview/hippoupdate.cpp @@ -1,5 +1,5 @@ -#include "hippoUpdate.h" +#include "hippoupdate.h" #include #include diff --git a/linden/indra/newview/kowopenregionsettings.cpp b/linden/indra/newview/kowopenregionsettings.cpp index 86a426c..8aac87c 100644 --- a/linden/indra/newview/kowopenregionsettings.cpp +++ b/linden/indra/newview/kowopenregionsettings.cpp @@ -27,7 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llhttpnode.h" -#include "hippoLimits.h" +#include "hippolimits.h" #include "llfloatertools.h" #include "llviewercontrol.h" #include "llagent.h" diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 3d8be5f..38985d3 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -176,9 +176,9 @@ #include "llcommandlineparser.h" -#include "hippoGridManager.h" -#include "hippoLimits.h" -#include "hippoUpdate.h" +#include "hippogridmanager.h" +#include "hippolimits.h" +#include "hippoupdate.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp index b9ec9a0..d4a75f7 100644 --- a/linden/indra/newview/llassetuploadresponders.cpp +++ b/linden/indra/newview/llassetuploadresponders.cpp @@ -63,7 +63,7 @@ #include "llscrolllistctrl.h" #include "llsdserialize.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // When uploading multiple files, don't display any of them when uploading more than this number. static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; diff --git a/linden/indra/newview/llcurrencyuimanager.cpp b/linden/indra/newview/llcurrencyuimanager.cpp index 99d0430..07b1287 100644 --- a/linden/indra/newview/llcurrencyuimanager.cpp +++ b/linden/indra/newview/llcurrencyuimanager.cpp @@ -47,7 +47,7 @@ #include "llxmlrpctransaction.h" #include "llviewernetwork.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" const F64 CURRENCY_ESTIMATE_FREQUENCY = 2.0; // how long of a pause in typing a currency buy amount before an diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index 0b777ea..18efa9e 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -47,7 +47,7 @@ #include "floatergriddefault.h" #include "floatervoicelicense.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llstartup.h" #include "llvoavatar.h" diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp index 4be83b6..5c037d6 100644 --- a/linden/indra/newview/llfloaterabout.cpp +++ b/linden/indra/newview/llfloaterabout.cpp @@ -44,7 +44,7 @@ #include "llimagej2c.h" #include "llaudioengine.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llviewertexteditor.h" #include "llviewercontrol.h" #include "llagent.h" diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index 09d3b2c..232530c 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -68,7 +68,7 @@ #include "pipeline.h" #include "lluictrlfactory.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" S32 LLFloaterAnimPreview::sUploadAmount = 10; diff --git a/linden/indra/newview/llfloaterbuy.cpp b/linden/indra/newview/llfloaterbuy.cpp index 86cab43..99c9fed 100644 --- a/linden/indra/newview/llfloaterbuy.cpp +++ b/linden/indra/newview/llfloaterbuy.cpp @@ -50,7 +50,7 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" LLFloaterBuy* LLFloaterBuy::sInstance = NULL; diff --git a/linden/indra/newview/llfloaterbuycontents.cpp b/linden/indra/newview/llfloaterbuycontents.cpp index 498d6ac..e16f98d 100644 --- a/linden/indra/newview/llfloaterbuycontents.cpp +++ b/linden/indra/newview/llfloaterbuycontents.cpp @@ -54,7 +54,7 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" LLFloaterBuyContents* LLFloaterBuyContents::sInstance = NULL; diff --git a/linden/indra/newview/llfloaterbuycurrency.cpp b/linden/indra/newview/llfloaterbuycurrency.cpp index 5096495..6a0dd68 100644 --- a/linden/indra/newview/llfloaterbuycurrency.cpp +++ b/linden/indra/newview/llfloaterbuycurrency.cpp @@ -46,7 +46,7 @@ #include "llwindow.h" #include "llappviewer.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" static const S32 STANDARD_BUY_AMOUNT = 2000; static const S32 MINIMUM_BALANCE_AMOUNT = 0; diff --git a/linden/indra/newview/llfloaterbuyland.cpp b/linden/indra/newview/llfloaterbuyland.cpp index 75630b2..8288c58 100644 --- a/linden/indra/newview/llfloaterbuyland.cpp +++ b/linden/indra/newview/llfloaterbuyland.cpp @@ -66,7 +66,7 @@ #include "llviewernetwork.h" #include "roles_constants.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // NOTE: This is duplicated in lldatamoney.cpp ... const F32 GROUP_LAND_BONUS_FACTOR = 1.1f; diff --git a/linden/indra/newview/llfloatergodtools.cpp b/linden/indra/newview/llfloatergodtools.cpp index 461dfe2..f918e8a 100644 --- a/linden/indra/newview/llfloatergodtools.cpp +++ b/linden/indra/newview/llfloatergodtools.cpp @@ -77,7 +77,7 @@ #include "lltransfertargetfile.h" #include "lltransfersourcefile.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" const F32 SECONDS_BETWEEN_UPDATE_REQUESTS = 5.0f; diff --git a/linden/indra/newview/llfloatergroups.cpp b/linden/indra/newview/llfloatergroups.cpp index 79e9e31..f735923 100644 --- a/linden/indra/newview/llfloatergroups.cpp +++ b/linden/indra/newview/llfloatergroups.cpp @@ -59,7 +59,7 @@ #include "llviewerwindow.h" #include "llimview.h" -#include "hippoLimits.h" +#include "hippolimits.h" // static std::map LLFloaterGroupPicker::sInstances; diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index 1ec964b..c89c2e2 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp @@ -54,7 +54,7 @@ #include "llviewerparcelmedia.h" #include "llcombobox.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) { diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp index 8142869..aa8a94f 100644 --- a/linden/indra/newview/llfloaterimagepreview.cpp +++ b/linden/indra/newview/llfloaterimagepreview.cpp @@ -60,7 +60,7 @@ #include "llstring.h" #include "llviewercontrol.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #ifdef LL_DARWIN #include "llwindowmacosx-objc.h" diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 42bc41c..cc3e385 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp @@ -77,7 +77,7 @@ #include "llviewercontrol.h" #include "roles_constants.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index 34b8dde..e63ea4b 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp @@ -44,7 +44,7 @@ #include "lluictrlfactory.h" #include "llfirstuse.h" #include "panelradar.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] diff --git a/linden/indra/newview/llfloaternamedesc.cpp b/linden/indra/newview/llfloaternamedesc.cpp index 9413611..9e8e94b 100644 --- a/linden/indra/newview/llfloaternamedesc.cpp +++ b/linden/indra/newview/llfloaternamedesc.cpp @@ -55,7 +55,7 @@ #include "llassetstorage.h" #include "llinventorytype.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" const S32 PREVIEW_LINE_HEIGHT = 19; const S32 PREVIEW_CLOSE_BOX_SIZE = 16; diff --git a/linden/indra/newview/llfloaterpostcard.cpp b/linden/indra/newview/llfloaterpostcard.cpp index aa9b2fb..8cd552e 100644 --- a/linden/indra/newview/llfloaterpostcard.cpp +++ b/linden/indra/newview/llfloaterpostcard.cpp @@ -66,7 +66,7 @@ #include //boost.regex lib -#include "hippoGridManager.h" +#include "hippogridmanager.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/linden/indra/newview/llfloaterproperties.cpp b/linden/indra/newview/llfloaterproperties.cpp index 40b293a..96e1642 100644 --- a/linden/indra/newview/llfloaterproperties.cpp +++ b/linden/indra/newview/llfloaterproperties.cpp @@ -59,7 +59,7 @@ #include "lluictrlfactory.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp index 9e6f323..8ae3fa2 100644 --- a/linden/indra/newview/llfloaterregioninfo.cpp +++ b/linden/indra/newview/llfloaterregioninfo.cpp @@ -80,7 +80,7 @@ #include "llviewertexteditor.h" #include "llviewerwindow.h" #include "llvlcomposition.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llfloatersellland.cpp b/linden/indra/newview/llfloatersellland.cpp index bf4a4c3..9b25708 100644 --- a/linden/indra/newview/llfloatersellland.cpp +++ b/linden/indra/newview/llfloatersellland.cpp @@ -46,7 +46,7 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // defined in llfloaterland.cpp void send_parcel_select_objects(S32 parcel_local_id, S32 return_type, diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index a58120d..e007680 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp @@ -77,7 +77,7 @@ #include "llvfile.h" #include "llvfs.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 2f02f1e..683ebd4 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -85,7 +85,7 @@ #include "llvotree.h" #include "lluictrlfactory.h" #include "qtoolalign.h" -#include "hippoLimits.h" +#include "hippolimits.h" // Globals LLFloaterTools *gFloaterTools = NULL; diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp index f3a124a..ac4a06b 100644 --- a/linden/indra/newview/llfloatertos.cpp +++ b/linden/indra/newview/llfloatertos.cpp @@ -52,7 +52,7 @@ #include "lluictrlfactory.h" #include "llvfile.h" #include "message.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // static diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp index 0a01ca7..47f3361 100644 --- a/linden/indra/newview/llfloaterworldmap.cpp +++ b/linden/indra/newview/llfloaterworldmap.cpp @@ -70,7 +70,7 @@ #include "llglheaders.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llgivemoney.cpp b/linden/indra/newview/llgivemoney.cpp index 6c69334..ee2bf63 100644 --- a/linden/indra/newview/llgivemoney.cpp +++ b/linden/indra/newview/llgivemoney.cpp @@ -52,7 +52,7 @@ #include "lltransactiontypes.h" #include "lluictrlfactory.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp index c7136bc..10d27cd 100644 --- a/linden/indra/newview/llhoverview.cpp +++ b/linden/indra/newview/llhoverview.cpp @@ -73,7 +73,7 @@ #include "llhudmanager.h" // For testing effects #include "llhudeffect.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp index fa7e85f..268e431 100644 --- a/linden/indra/newview/llmanipscale.cpp +++ b/linden/indra/newview/llmanipscale.cpp @@ -63,7 +63,7 @@ #include "v2math.h" #include "llvoavatar.h" -#include "hippoLimits.h" +#include "hippolimits.h" const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f; diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index cc14b27..8484c4e 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp @@ -66,7 +66,7 @@ #include "llui.h" #include "pipeline.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index dc4456a..b9dc482 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp @@ -71,7 +71,7 @@ #include "llglheaders.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp index b0f5f91..891707b 100644 --- a/linden/indra/newview/llnotify.cpp +++ b/linden/indra/newview/llnotify.cpp @@ -55,7 +55,7 @@ #include "lloverlaybar.h" // for gOverlayBar #include "lluictrlfactory.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] - Version: 1.23.4 #include "rlvhandler.h" diff --git a/linden/indra/newview/llpanelaudioprefs.cpp b/linden/indra/newview/llpanelaudioprefs.cpp index d4c8e9f..1acfcbb 100644 --- a/linden/indra/newview/llpanelaudioprefs.cpp +++ b/linden/indra/newview/llpanelaudioprefs.cpp @@ -62,7 +62,7 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // // Static functions diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index d3230c8..99b6cf6 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp @@ -70,7 +70,7 @@ #include "llviewerwindow.h" // for window width, height #include "llappviewer.h" // abortQuit() -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llpaneldirfind.cpp b/linden/indra/newview/llpaneldirfind.cpp index 14c4a90..342ffec 100644 --- a/linden/indra/newview/llpaneldirfind.cpp +++ b/linden/indra/newview/llpaneldirfind.cpp @@ -73,7 +73,7 @@ #include "boost/lexical_cast.hpp" #endif -#include "hippoGridManager.h" +#include "hippogridmanager.h" //--------------------------------------------------------------------------- // LLPanelDirFindAll - Google search appliance based search diff --git a/linden/indra/newview/llpaneldirland.cpp b/linden/indra/newview/llpaneldirland.cpp index c702931..3fdf37e 100644 --- a/linden/indra/newview/llpaneldirland.cpp +++ b/linden/indra/newview/llpaneldirland.cpp @@ -52,7 +52,7 @@ #include "llviewercontrol.h" #include "llviewermessage.h" #include "llnotify.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" //----------------------------------------------------------------------------- // Constants diff --git a/linden/indra/newview/llpanelgroupgeneral.cpp b/linden/indra/newview/llpanelgroupgeneral.cpp index e0d6376..6878f84 100644 --- a/linden/indra/newview/llpanelgroupgeneral.cpp +++ b/linden/indra/newview/llpanelgroupgeneral.cpp @@ -34,7 +34,7 @@ #include "llpanelgroupgeneral.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "lluictrlfactory.h" #include "llagent.h" diff --git a/linden/indra/newview/llpanelgrouplandmoney.cpp b/linden/indra/newview/llpanelgrouplandmoney.cpp index bded59c..3f128fe 100644 --- a/linden/indra/newview/llpanelgrouplandmoney.cpp +++ b/linden/indra/newview/llpanelgrouplandmoney.cpp @@ -55,7 +55,7 @@ #include "llfloaterworldmap.h" #include "llviewermessage.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" //////////////////////////////////////////////////////////////////////////// diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 41ba513..9cd2759 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp @@ -82,7 +82,7 @@ #include "llviewerwindow.h" #include "llwearable.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llpanelland.cpp b/linden/indra/newview/llpanelland.cpp index ea6a557..d1eee80 100644 --- a/linden/indra/newview/llpanelland.cpp +++ b/linden/indra/newview/llpanelland.cpp @@ -49,7 +49,7 @@ #include "lluictrlfactory.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llpanellandmedia.cpp b/linden/indra/newview/llpanellandmedia.cpp index 11f491c..b7df164 100644 --- a/linden/indra/newview/llpanellandmedia.cpp +++ b/linden/indra/newview/llpanellandmedia.cpp @@ -55,7 +55,7 @@ #include "lltexturectrl.h" #include "roles_constants.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" //--------------------------------------------------------------------------- // LLPanelLandMedia diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 2a8c20f..6464f0b 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -36,8 +36,8 @@ #include "llpanelgeneral.h" -#include "hippoGridManager.h" -#include "hippoLimits.h" +#include "hippogridmanager.h" +#include "hippolimits.h" #include "floatergridmanager.h" #include "indra_constants.h" // for key and mask constants diff --git a/linden/indra/newview/llpanelmsgs.cpp b/linden/indra/newview/llpanelmsgs.cpp index 3ea7aa5..9e04070 100644 --- a/linden/indra/newview/llpanelmsgs.cpp +++ b/linden/indra/newview/llpanelmsgs.cpp @@ -40,7 +40,7 @@ #include "lluictrlfactory.h" #include "llfirstuse.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" //----------------------------------------------------------------------------- LLPanelMsgs::LLPanelMsgs() : diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index 706f98e..cc89e24 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp @@ -76,7 +76,7 @@ #include "lldrawpool.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp index 5131d2c..6b7bc1b 100644 --- a/linden/indra/newview/llpanelpermissions.cpp +++ b/linden/indra/newview/llpanelpermissions.cpp @@ -68,7 +68,7 @@ #include "lluictrlfactory.h" #include "roles_constants.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llpanelplace.cpp b/linden/indra/newview/llpanelplace.cpp index eb3d17d..fe88c13 100644 --- a/linden/indra/newview/llpanelplace.cpp +++ b/linden/indra/newview/llpanelplace.cpp @@ -58,7 +58,7 @@ #include "llweb.h" #include "llsdutil.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" //static std::list LLPanelPlace::sAllPanels; diff --git a/linden/indra/newview/llpanelweb.cpp b/linden/indra/newview/llpanelweb.cpp index 14df239..6f9bd7a 100644 --- a/linden/indra/newview/llpanelweb.cpp +++ b/linden/indra/newview/llpanelweb.cpp @@ -37,7 +37,7 @@ // project includes #include "llcheckboxctrl.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" #include "llviewermedia.h" diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index e915bd2..9e86cd3 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp @@ -49,7 +49,7 @@ #include "lldirpicker.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 49446c7..b744961 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -210,8 +210,8 @@ #include "floaterao.h" -#include "hippoGridManager.h" -#include "hippoLimits.h" +#include "hippogridmanager.h" +#include "hippolimits.h" #include "lggautocorrect.h" // diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp index 4579100..3370f7f 100644 --- a/linden/indra/newview/llstatusbar.cpp +++ b/linden/indra/newview/llstatusbar.cpp @@ -83,7 +83,7 @@ #include "llstring.h" #include "message.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "viewertime.h" // diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp index f63deb8..f93a574 100644 --- a/linden/indra/newview/lltexturefetch.cpp +++ b/linden/indra/newview/lltexturefetch.cpp @@ -2275,7 +2275,7 @@ void LLTextureFetch::dump() // // *TODO: This is a *HACK and may not work if the grid is heterogenous. // Remove it once OpenSim versions in the wild are > 0.7.0.2! -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include //static bool LLTextureFetch::hasBuggyHTTPRange() diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index 4e133de..18c4917 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp @@ -75,7 +75,7 @@ // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] -#include "hippoLimits.h" +#include "hippolimits.h" // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp index 9b6d6f7..10b0431 100644 --- a/linden/indra/newview/lltoolgrab.cpp +++ b/linden/indra/newview/lltoolgrab.cpp @@ -64,7 +64,7 @@ #include "llvoavatar.h" #include "llworld.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 4167464..59a87d5 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -82,7 +82,7 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" -#include "hippoLimits.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index ace0bcb..a663e60 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -228,8 +228,8 @@ #include "jcfloater_animation_list.h" #include "llfloaterassetbrowser.h" -#include "hippoGridManager.h" -#include "hippoLimits.h" +#include "hippogridmanager.h" +#include "hippolimits.h" #include "llfloaterteleporthistory.h" diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 743e0d9..5f333e9 100755 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -150,8 +150,8 @@ #include #include // Boost Reg Expresions -#include "hippoGridManager.h" -#include "hippoLimits.h" +#include "hippogridmanager.h" +#include "hippolimits.h" #include "wlsettingsmanager.h" #if LL_WINDOWS // For Windows specific error handler diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp index c1d5013..1cfe665 100644 --- a/linden/indra/newview/llviewernetwork.cpp +++ b/linden/indra/newview/llviewernetwork.cpp @@ -37,7 +37,7 @@ #include "llviewercontrol.h" #include "llstartup.h" - #include "hippoGridManager.h" + #include "hippogridmanager.h" unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp index 5326049..b589f2e 100644 --- a/linden/indra/newview/llviewerparcelmgr.cpp +++ b/linden/indra/newview/llviewerparcelmgr.cpp @@ -70,7 +70,7 @@ #include "roles_constants.h" #include "llweb.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index c4a4dee..54aed54 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -94,7 +94,7 @@ #else #include "boost/lexical_cast.hpp" #endif -#include "hippoLimits.h"// getMaxPrimScale +#include "hippolimits.h"// getMaxPrimScale #include "llstartup.h" // [RLVa:KB] #include "rlvhandler.h" diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp index c484462..7866bf8 100644 --- a/linden/indra/newview/llworld.cpp +++ b/linden/indra/newview/llworld.cpp @@ -60,7 +60,7 @@ #include "pipeline.h" #include "llappviewer.h" // for do_disconnect() -#include "hippoLimits.h" +#include "hippolimits.h" #include #include diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp index 43d7426..3ada36f 100644 --- a/linden/indra/newview/llworldmap.cpp +++ b/linden/indra/newview/llworldmap.cpp @@ -47,7 +47,7 @@ #include "llviewerimagelist.h" #include "llviewerregion.h" #include "llregionflags.h" - #include "hippoGridManager.h" + #include "hippogridmanager.h" bool LLWorldMap::sGotMapURL = false; const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes diff --git a/linden/indra/newview/llxmlrpctransaction.cpp b/linden/indra/newview/llxmlrpctransaction.cpp index b993c99..058946e 100644 --- a/linden/indra/newview/llxmlrpctransaction.cpp +++ b/linden/indra/newview/llxmlrpctransaction.cpp @@ -35,7 +35,7 @@ #include "llxmlrpctransaction.h" #include "llcurl.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "llviewercontrol.h" // Have to include these last to avoid queue redefinition! diff --git a/linden/indra/newview/primbackup.cpp b/linden/indra/newview/primbackup.cpp index 63043f0..7f050a0 100644 --- a/linden/indra/newview/primbackup.cpp +++ b/linden/indra/newview/primbackup.cpp @@ -54,7 +54,7 @@ #include "llappviewer.h" #include "lltransactiontypes.h" -#include "hippoGridManager.h" +#include "hippogridmanager.h" #include "primbackup.h" diff --git a/linden/indra/newview/windlightsettingsupdate.cpp b/linden/indra/newview/windlightsettingsupdate.cpp index a5f9cb7..ad6e7c9 100644 --- a/linden/indra/newview/windlightsettingsupdate.cpp +++ b/linden/indra/newview/windlightsettingsupdate.cpp @@ -27,7 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llhttpnode.h" -#include "hippoLimits.h" +#include "hippolimits.h" #include "llfloatertools.h" #include "llviewercontrol.h" #include "llagent.h" diff --git a/linden/indra/newview/wlfloatermanager.cpp b/linden/indra/newview/wlfloatermanager.cpp index 1946807..63abe14 100644 --- a/linden/indra/newview/wlfloatermanager.cpp +++ b/linden/indra/newview/wlfloatermanager.cpp @@ -64,7 +64,7 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" -#include "hippoLimits.h" +#include "hippolimits.h" #include "wlfloatermanager.h" #include "llviewerregion.h" #include "llviewerparcelmgr.h" diff --git a/linden/indra/newview/wlfloaterwindlightsend.cpp b/linden/indra/newview/wlfloaterwindlightsend.cpp index 5244bcd..e6148ed 100644 --- a/linden/indra/newview/wlfloaterwindlightsend.cpp +++ b/linden/indra/newview/wlfloaterwindlightsend.cpp @@ -64,7 +64,7 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" -#include "hippoLimits.h" +#include "hippolimits.h" #include "wlfloaterwindlightsend.h" #include "llviewerregion.h" diff --git a/linden/indra/newview/wlretrievesettings.cpp b/linden/indra/newview/wlretrievesettings.cpp index ca91ba2..afa84f2 100644 --- a/linden/indra/newview/wlretrievesettings.cpp +++ b/linden/indra/newview/wlretrievesettings.cpp @@ -64,7 +64,7 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" -#include "hippoLimits.h" +#include "hippolimits.h" #include "wlfloaterwindlightsend.h" #include "llviewerregion.h" #include "wlsettingsmanager.h" diff --git a/linden/indra/newview/wlsettingsmanager.cpp b/linden/indra/newview/wlsettingsmanager.cpp index 853d14f..c0a07e1 100644 --- a/linden/indra/newview/wlsettingsmanager.cpp +++ b/linden/indra/newview/wlsettingsmanager.cpp @@ -64,7 +64,7 @@ #include "llwlparammanager.h" #include "llwaterparammanager.h" #include "llpostprocess.h" -#include "hippoLimits.h" +#include "hippolimits.h" #include "wlfloaterwindlightsend.h" #include "llviewerregion.h" #include "wlsettingsmanager.h" -- cgit v1.1 From e868c08a10b32aaced171182de10dae077238af5 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 3 Nov 2010 21:32:14 +0100 Subject: Center the "loading..." text on the login page. The loading.html page is no longer used. Instead embedded html found in panel_login.xml is used. I couldn't get it to show an image, but at least the "loading..." text is now centralized and I changed the background color from black to imprudence-purple. --- .../skins/default/html/en-us/loading/loading.html | 9 ------- .../skins/default/xui/en-us/panel_login.xml | 28 ++++++++++++++++------ 2 files changed, 21 insertions(+), 16 deletions(-) delete mode 100644 linden/indra/newview/skins/default/html/en-us/loading/loading.html (limited to 'linden') diff --git a/linden/indra/newview/skins/default/html/en-us/loading/loading.html b/linden/indra/newview/skins/default/html/en-us/loading/loading.html deleted file mode 100644 index 97174b0..0000000 --- a/linden/indra/newview/skins/default/html/en-us/loading/loading.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -
-
   loading... -
- diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml index 96f3f77..048005d 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -1,13 +1,27 @@ - - + bottom="0" left="0" height="600" width="800" + follows="left|top|right|bottom" mouse_opaque="true" > + + http://secondlife.com/app/login/ -- cgit v1.1 From b22f87ec754ce300bec038fd24277d7fb65f9f93 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 5 Nov 2010 14:33:52 +0100 Subject: IMP-592: Extend login screen menu bar till the top of the window. Basically, this Linden code is just horribly broken. I spend already too much time on this (two days) for dead code, so I settled for a minimal fix for this particular case that works, instead of fixing their code properly. The problem is that without specifying "bottom" the code adds 4 pixels (VPAD) between whatever widget that is added and it's parents top (in LLView::createRect). In order to be sure that bottom is exactly minus the height, I had to specify the height too; hopefully this value is the same for everyone cause theorectically it depends on the font size (4 + fontheight + 4). The default height of the Linden code is only 4 + fontheight (they leave off the VPAD). --- linden/doc/contributions.txt | 1 + linden/indra/newview/skins/default/xui/en-us/menu_login.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'linden') diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index f518911..a54424c 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt @@ -80,6 +80,7 @@ Aleric Inglewood IMP-578 IMP-579 IMP-581 + IMP-592 IMP-595 IMP-660 IMP-661 diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_login.xml b/linden/indra/newview/skins/default/xui/en-us/menu_login.xml index d9a9c4c..18fb8e6 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_login.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_login.xml @@ -1,5 +1,5 @@ - + -- cgit v1.1 From e8e2de0cf70dd56e8a6c41bf5a83bb71bf6d27e5 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 5 Nov 2010 21:04:35 +0100 Subject: Update of gtk-etc prebuilt for linux 32bit. libpangocairo-1.0.so* was missing. I did a complete new rebuild of the package with, as usual, debian Lenny (stable) package. This tar ball contains the following debian packages: libatk1.0-0_1.22.0-1_i386.deb libatk1.0-dev_1.22.0-1_i386.deb libcairo2_1.6.4-7_i386.deb libcairo2-dev_1.6.4-7_i386.deb libpango1.0-common_1.20.5-6_all.deb libpango1.0-0_1.20.5-6_i386.deb libpango1.0-dev_1.20.5-6_i386.deb libgtk2.0-0_2.12.12-1~lenny2_i386.deb libgtk2.0-dev_2.12.12-1~lenny2_i386.deb libpixman-1-0_0.10.0-2_i386.deb libpixman-1-dev_0.10.0-2_i386.deb But only the 'copyright' file from doc/*, only the include/* files and only the lib*.so files. Most notably, not pkgconfig, resources, configuration files and modules... (those are absent in the previous prebuilts too). --- linden/install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linden') diff --git a/linden/install.xml b/linden/install.xml index a6a4670..d9bea67 100755 --- a/linden/install.xml +++ b/linden/install.xml @@ -700,9 +700,9 @@ cairo: Copyright © 2002 University of Southern California, Copyright © 2005 Re linux md5sum - 57ec243cf8e05e4fb7c737846a287498 + 31c9ddf859411c4890f1b31564b2fa91 url - http://imprudenceviewer.org/download/libs/gtk-etc-linux32-dbg-20100604.tar.bz2 + http://github.com/downloads/AlericInglewood/imprudence/gtk-etc-linux-20101105.tar.bz2 linux64 -- cgit v1.1