Removed some old rlva code that was breaking serverside baking. Also merge some other minor inventory/appearance related changes from v3.

This commit is contained in:
Shyotl
2016-06-15 00:02:18 -05:00
parent f47395531f
commit 2065e45011
3 changed files with 96 additions and 94 deletions

View File

@@ -3795,69 +3795,6 @@ void RequestAgentUpdateAppearanceResponder::sendRequest()
gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version;
}
LLSD LLAppearanceMgr::dumpCOF() const
{
LLSD links = LLSD::emptyArray();
LLMD5 md5;
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
gInventory.collectDescendents(getCOF(),cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
for (U32 i=0; i<item_array.size(); i++)
{
const LLViewerInventoryItem* inv_item = item_array.at(i).get();
LLSD item;
LLUUID item_id(inv_item->getUUID());
md5.update((unsigned char*)item_id.mData, 16);
item["description"] = inv_item->getActualDescription();
md5.update(inv_item->getActualDescription());
item["asset_type"] = inv_item->getActualType();
LLUUID linked_id(inv_item->getLinkedUUID());
item["linked_id"] = linked_id;
md5.update((unsigned char*)linked_id.mData, 16);
if (LLAssetType::AT_LINK == inv_item->getActualType())
{
const LLViewerInventoryItem* linked_item = inv_item->getLinkedItem();
if (NULL == linked_item)
{
LL_WARNS() << "Broken link for item '" << inv_item->getName()
<< "' (" << inv_item->getUUID()
<< ") during requestServerAppearanceUpdate" << LL_ENDL;
continue;
}
// Some assets may be 'hidden' and show up as null in the viewer.
//if (linked_item->getAssetUUID().isNull())
//{
// LL_WARNS() << "Broken link (null asset) for item '" << inv_item->getName()
// << "' (" << inv_item->getUUID()
// << ") during requestServerAppearanceUpdate" << LL_ENDL;
// continue;
//}
LLUUID linked_asset_id(linked_item->getAssetUUID());
md5.update((unsigned char*)linked_asset_id.mData, 16);
U32 flags = linked_item->getFlags();
md5.update(boost::lexical_cast<std::string>(flags));
}
else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType())
{
LL_WARNS() << "Non-link item '" << inv_item->getName()
<< "' (" << inv_item->getUUID()
<< ") type " << (S32) inv_item->getActualType()
<< " during requestServerAppearanceUpdate" << LL_ENDL;
continue;
}
links.append(item);
}
LLSD result = LLSD::emptyMap();
result["cof_contents"] = links;
char cof_md5sum[MD5HEX_STR_SIZE];
md5.finalize();
md5.hex_digest(cof_md5sum);
result["cof_md5sum"] = std::string(cof_md5sum);
return result;
}
void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content)
{
LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger()
@@ -4002,6 +3939,68 @@ void RequestAgentUpdateAppearanceResponder::onFailure()
}
LLSD LLAppearanceMgr::dumpCOF() const
{
LLSD links = LLSD::emptyArray();
LLMD5 md5;
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
gInventory.collectDescendents(getCOF(),cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
for (U32 i=0; i<item_array.size(); i++)
{
const LLViewerInventoryItem* inv_item = item_array.at(i).get();
LLSD item;
LLUUID item_id(inv_item->getUUID());
md5.update((unsigned char*)item_id.mData, 16);
item["description"] = inv_item->getActualDescription();
md5.update(inv_item->getActualDescription());
item["asset_type"] = inv_item->getActualType();
LLUUID linked_id(inv_item->getLinkedUUID());
item["linked_id"] = linked_id;
md5.update((unsigned char*)linked_id.mData, 16);
if (LLAssetType::AT_LINK == inv_item->getActualType())
{
const LLViewerInventoryItem* linked_item = inv_item->getLinkedItem();
if (NULL == linked_item)
{
LL_WARNS() << "Broken link for item '" << inv_item->getName()
<< "' (" << inv_item->getUUID()
<< ") during requestServerAppearanceUpdate" << LL_ENDL;
continue;
}
// Some assets may be 'hidden' and show up as null in the viewer.
//if (linked_item->getAssetUUID().isNull())
//{
// LL_WARNS() << "Broken link (null asset) for item '" << inv_item->getName()
// << "' (" << inv_item->getUUID()
// << ") during requestServerAppearanceUpdate" << LL_ENDL;
// continue;
//}
LLUUID linked_asset_id(linked_item->getAssetUUID());
md5.update((unsigned char*)linked_asset_id.mData, 16);
U32 flags = linked_item->getFlags();
md5.update(boost::lexical_cast<std::string>(flags));
}
else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType())
{
LL_WARNS() << "Non-link item '" << inv_item->getName()
<< "' (" << inv_item->getUUID()
<< ") type " << (S32) inv_item->getActualType()
<< " during requestServerAppearanceUpdate" << LL_ENDL;
continue;
}
links.append(item);
}
LLSD result = LLSD::emptyMap();
result["cof_contents"] = links;
char cof_md5sum[MD5HEX_STR_SIZE];
md5.finalize();
md5.hex_digest(cof_md5sum);
result["cof_md5sum"] = std::string(cof_md5sum);
return result;
}
void LLAppearanceMgr::requestServerAppearanceUpdate()
{
@@ -4124,7 +4123,21 @@ LLUUID LLAppearanceMgr::makeNewOutfitCore(const std::string& new_folder_name, bo
// First, make a folder in the My Outfits directory.
const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
if (AISCommand::isAPIAvailable())
{
// cap-based category creation was buggy until recently. use
// existence of AIS as an indicator the fix is present. Does
// not actually use AIS to create the category.
inventory_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel);
LLUUID folder_id = gInventory.createNewCategory(
parent_id,
LLFolderType::FT_OUTFIT,
new_folder_name,
func);
return folder_id;
}
else
{
LLUUID folder_id = gInventory.createNewCategory(
parent_id,
LLFolderType::FT_OUTFIT,

View File

@@ -1118,7 +1118,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU
// an existing item with the matching id, or it will add the category.
void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 mask)
{
if(cat->getUUID().isNull())
if(!cat || cat->getUUID().isNull())
{
return;
}
@@ -1175,8 +1175,8 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32
}
// make space in the tree for this category's children.
llassert_always(mCategoryLock[LLUUID(new_cat->getUUID())] == false);
llassert_always(mItemLock[LLUUID(new_cat->getUUID())] == false);
llassert_always(mCategoryLock[new_cat->getUUID()] == false);
llassert_always(mItemLock[new_cat->getUUID()] == false);
cat_array_t* catsp = new cat_array_t;
item_array_t* itemsp = new item_array_t;
mParentChildCategoryTree[new_cat->getUUID()] = catsp;

View File

@@ -1346,21 +1346,10 @@ void update_inventory_item(
const LLSD& updates,
LLPointer<LLInventoryCallback> cb)
{
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id);
LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL;
LLPointer<LLViewerInventoryItem> new_item = NULL;
if (obj)
{
new_item = new LLViewerInventoryItem(obj);
new_item->fromLLSD(updates,false);
LLInventoryModel::LLCategoryUpdate up(new_item->getParentUUID(), 0);
gInventory.accountForUpdate(up);
gInventory.updateItem(new_item);
}
// [/SL:KB]
//Singu Note:
// There was some rlva-specific code here, however it adversely affected serverside
// baking when using AISv3. Its omission looks likeley to be inconsequental, but if that's incorrect
// any bugs introduced by its removal are minor compared to non-functional serverside baking.
bool ais_ran = false;
if (AISCommand::isAPIAvailable())
@@ -1368,20 +1357,19 @@ void update_inventory_item(
boost::intrusive_ptr<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb);
ais_ran = cmd_ptr->run_command();
}
if (!ais_ran)
{
// LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id);
// LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL;
// if(obj)
// {
// LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem);
// new_item->copyViewerItem(obj);
// new_item->fromLLSD(updates,false);
LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id);
LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL;
LLPointer<LLViewerInventoryItem> new_item = NULL;
// [SL:KB] - Patch: Appearance-AISFilter | Checked: 2015-03-01 (Catznip-3.7)
if (new_item)
if(obj)
{
// [/SL:KB]
LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem);
new_item->copyViewerItem(obj);
new_item->fromLLSD(updates,false);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_UpdateInventoryItem);
msg->nextBlockFast(_PREHASH_AgentData);
@@ -1393,9 +1381,10 @@ void update_inventory_item(
new_item->packMessage(msg);
gAgent.sendReliableMessage();
// LLInventoryModel::LLCategoryUpdate up(new_item->getParentUUID(), 0);
// gInventory.accountForUpdate(up);
// gInventory.updateItem(new_item);
LLInventoryModel::LLCategoryUpdate up(new_item->getParentUUID(), 0);
gInventory.accountForUpdate(up);
gInventory.updateItem(new_item);
if (cb)
{
cb->fire(item_id);