Inventory Link auto-detection
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
#include "llsd.h"
|
#include "llsd.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include <boost/tokenizer.hpp>
|
#include <boost/tokenizer.hpp>
|
||||||
|
#include "../newview/hippogridmanager.h"
|
||||||
|
|
||||||
#include "llsdutil.h"
|
#include "llsdutil.h"
|
||||||
|
|
||||||
@@ -553,6 +554,10 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32
|
|||||||
S8 type;
|
S8 type;
|
||||||
msg->getS8Fast(block, _PREHASH_Type, type, block_num);
|
msg->getS8Fast(block, _PREHASH_Type, type, block_num);
|
||||||
mType = static_cast<LLAssetType::EType>(type);
|
mType = static_cast<LLAssetType::EType>(type);
|
||||||
|
if (mType == LLAssetType::AT_LINK || mType == LLAssetType::AT_LINK_FOLDER)
|
||||||
|
{
|
||||||
|
gHippoGridManager->getConnectedGrid()->setSupportsInvLinks(true);
|
||||||
|
}
|
||||||
msg->getS8(block, "InvType", type, block_num);
|
msg->getS8(block, "InvType", type, block_num);
|
||||||
mInventoryType = static_cast<LLInventoryType::EType>(type);
|
mInventoryType = static_cast<LLInventoryType::EType>(type);
|
||||||
mPermissions.initMasks(mInventoryType);
|
mPermissions.initMasks(mInventoryType);
|
||||||
@@ -1122,6 +1127,11 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
|
|||||||
S8 type = (U8)sd[w].asInteger();
|
S8 type = (U8)sd[w].asInteger();
|
||||||
mType = static_cast<LLAssetType::EType>(type);
|
mType = static_cast<LLAssetType::EType>(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mType == LLAssetType::AT_LINK || mType == LLAssetType::AT_LINK_FOLDER)
|
||||||
|
{
|
||||||
|
gHippoGridManager->getConnectedGrid()->setSupportsInvLinks(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
w = INV_INVENTORY_TYPE_LABEL;
|
w = INV_INVENTORY_TYPE_LABEL;
|
||||||
if (sd.has(w))
|
if (sd.has(w))
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ HippoGridInfo::HippoGridInfo(const std::string& gridNick) :
|
|||||||
mXmlState(XML_VOID),
|
mXmlState(XML_VOID),
|
||||||
mVoiceConnector("SLVoice"),
|
mVoiceConnector("SLVoice"),
|
||||||
mRenderCompat(true),
|
mRenderCompat(true),
|
||||||
|
mInvLinks(false),
|
||||||
mMaxAgentGroups(-1),
|
mMaxAgentGroups(-1),
|
||||||
mCurrencySymbol("OS$"),
|
mCurrencySymbol("OS$"),
|
||||||
mRealCurrencySymbol("US$"),
|
mRealCurrencySymbol("US$"),
|
||||||
@@ -612,10 +613,16 @@ void HippoGridInfo::initFallback()
|
|||||||
bool HippoGridInfo::supportsInvLinks(){
|
bool HippoGridInfo::supportsInvLinks(){
|
||||||
if(isSecondLife())
|
if(isSecondLife())
|
||||||
return true;
|
return true;
|
||||||
else if(mLoginUri.find("avination.")!=std::string::npos)
|
|
||||||
return true;
|
|
||||||
else
|
else
|
||||||
return false;
|
return mInvLinks;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HippoGridInfo::setSupportsInvLinks(bool b) {
|
||||||
|
if (b == true && mInvLinks == false)
|
||||||
|
{
|
||||||
|
llinfos << "Inventory Link support detected" << llendl;
|
||||||
|
}
|
||||||
|
mInvLinks = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
@@ -927,6 +934,7 @@ void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer)
|
|||||||
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
|
if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]);
|
||||||
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]);
|
||||||
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]);
|
||||||
|
if (gridMap.has("inventory_links")) grid->setSupportsInvLinks(gridMap["inventory_links"]);
|
||||||
// if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
|
// if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]);
|
||||||
// if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
|
// if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]);
|
||||||
// if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
|
// if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]);
|
||||||
@@ -967,6 +975,7 @@ void HippoGridManager::saveFile()
|
|||||||
|
|
||||||
gridInfo[i]["search"] = grid->getSearchUrl();
|
gridInfo[i]["search"] = grid->getSearchUrl();
|
||||||
gridInfo[i]["render_compat"] = grid->isRenderCompat();
|
gridInfo[i]["render_compat"] = grid->isRenderCompat();
|
||||||
|
gridInfo[i]["inventory_links"] = grid->supportsInvLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
// write client grid info file
|
// write client grid info file
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public:
|
|||||||
void setRealCurrencySymbol(const std::string& sym);
|
void setRealCurrencySymbol(const std::string& sym);
|
||||||
void setDirectoryFee(int fee);
|
void setDirectoryFee(int fee);
|
||||||
bool supportsInvLinks();
|
bool supportsInvLinks();
|
||||||
|
void setSupportsInvLinks(bool b);
|
||||||
|
|
||||||
bool retrieveGridInfo();
|
bool retrieveGridInfo();
|
||||||
|
|
||||||
@@ -113,6 +114,7 @@ private:
|
|||||||
std::string mLastName;
|
std::string mLastName;
|
||||||
std::string mAvatarPassword;
|
std::string mAvatarPassword;
|
||||||
bool mRenderCompat;
|
bool mRenderCompat;
|
||||||
|
bool mInvLinks;
|
||||||
int mMaxAgentGroups;
|
int mMaxAgentGroups;
|
||||||
|
|
||||||
std::string mCurrencySymbol;
|
std::string mCurrencySymbol;
|
||||||
|
|||||||
Reference in New Issue
Block a user