Initial AISv3 merge. New HTTP messages not plugged in yet.
This commit is contained in:
@@ -40,7 +40,7 @@ class LLWearable;
|
||||
class LLWearableHoldingPattern;
|
||||
class LLInventoryCallback;
|
||||
class LLOutfitUnLockTimer;
|
||||
class LLCallAfterInventoryLinkMgr;
|
||||
class RequestAgentUpdateAppearanceResponder;
|
||||
|
||||
class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
|
||||
{
|
||||
@@ -52,9 +52,11 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
|
||||
public:
|
||||
typedef std::vector<LLInventoryModel::item_array_t> wearables_by_type_t;
|
||||
|
||||
void updateAppearanceFromCOF(bool update_base_outfit_ordering = false);
|
||||
void updateAppearanceFromCOF(bool enforce_item_restrictions = true,
|
||||
bool enforce_ordering = true,
|
||||
nullary_func_t post_update_func = no_op);
|
||||
// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-3.0.0a) | Added: Catznip-2.0.0a
|
||||
void updateAppearanceFromInitialWearables(LLInventoryModel::item_array_t& initial_items);
|
||||
void updateAppearanceFromInitialWearables(LLInventoryObject::const_object_list_t& initial_items);
|
||||
// [/SL:KB]
|
||||
bool needToSaveCOF();
|
||||
void updateCOF(const LLUUID& category, bool append = false);
|
||||
@@ -74,18 +76,24 @@ public:
|
||||
void addCategoryToCurrentOutfit(const LLUUID& cat_id);
|
||||
S32 findExcessOrDuplicateItems(const LLUUID& cat_id,
|
||||
LLAssetType::EType type,
|
||||
S32 max_items,
|
||||
LLInventoryModel::item_array_t& items_to_kill);
|
||||
void enforceItemRestrictions();
|
||||
S32 max_items_per_type,
|
||||
S32 max_items_total,
|
||||
LLInventoryObject::object_list_t& items_to_kill);
|
||||
void findAllExcessOrDuplicateItems(const LLUUID& cat_id,
|
||||
LLInventoryObject::object_list_t& items_to_kill);
|
||||
void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb);
|
||||
|
||||
S32 getActiveCopyOperations() const;
|
||||
|
||||
// Replace category contents with copied links via the slam_inventory_folder
|
||||
// command (single inventory operation where supported)
|
||||
void slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id,
|
||||
bool include_folder_links, LLPointer<LLInventoryCallback> cb);
|
||||
|
||||
// Copy all items and the src category itself.
|
||||
void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id,
|
||||
LLPointer<LLInventoryCallback> cb);
|
||||
|
||||
void copyItems(const LLUUID& dst_id, LLInventoryModel::item_array_t* items, LLPointer<LLInventoryCallback> cb);
|
||||
|
||||
// Return whether this folder contains minimal contents suitable for making a full outfit.
|
||||
BOOL getCanMakeFolderIntoOutfit(const LLUUID& folder_id);
|
||||
|
||||
@@ -101,21 +109,20 @@ public:
|
||||
// Determine whether we can replace current outfit with the given one.
|
||||
bool getCanReplaceCOF(const LLUUID& outfit_cat_id);
|
||||
|
||||
// Can we add all referenced items to the avatar?
|
||||
bool canAddWearables(const uuid_vec_t& item_ids);
|
||||
|
||||
// Copy all items in a category.
|
||||
void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
|
||||
LLPointer<LLInventoryCallback> cb);
|
||||
void copyItems(const LLUUID& dst_id, LLInventoryModel::item_array_t* items, LLPointer<LLInventoryCallback> cb);
|
||||
|
||||
// Find the Current Outfit folder.
|
||||
const LLUUID getCOF() const;
|
||||
S32 getCOFVersion() const;
|
||||
|
||||
S32 mLastUpdateRequestCOFVersion;
|
||||
S32 getLastUpdateRequestCOFVersion() const;
|
||||
|
||||
// COF version of last appearance message received for self av.
|
||||
S32 mLastAppearanceUpdateCOFVersion;
|
||||
S32 getLastAppearanceUpdateCOFVersion() const;
|
||||
void setLastAppearanceUpdateCOFVersion(S32 new_val);
|
||||
// Debugging - get truncated LLSD summary of COF contents.
|
||||
LLSD dumpCOF() const;
|
||||
|
||||
// Finds the folder link to the currently worn outfit
|
||||
const LLViewerInventoryItem *getBaseOutfitLink();
|
||||
@@ -124,17 +131,24 @@ public:
|
||||
// find the UUID of the currently worn outfit (Base Outfit)
|
||||
const LLUUID getBaseOutfitUUID();
|
||||
|
||||
void wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear,
|
||||
bool do_update,
|
||||
bool replace,
|
||||
LLPointer<LLInventoryCallback> cb = NULL);
|
||||
|
||||
// Wear/attach an item (from a user's inventory) on the agent
|
||||
bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update = true, bool replace = false, LLPointer<LLInventoryCallback> cb = NULL);
|
||||
void wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false,
|
||||
LLPointer<LLInventoryCallback> cb = NULL);
|
||||
|
||||
// Update the displayed outfit name in UI.
|
||||
void updatePanelOutfitName(const std::string& name);
|
||||
|
||||
void purgeBaseOutfitLink(const LLUUID& category);
|
||||
void purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb = NULL);
|
||||
void createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter);
|
||||
|
||||
void updateAgentWearables(LLWearableHoldingPattern* holder, bool append);
|
||||
void updateAgentWearables(LLWearableHoldingPattern* holder);
|
||||
|
||||
S32 countActiveHoldingPatterns();
|
||||
// For debugging - could be moved elsewhere.
|
||||
void dumpCat(const LLUUID& cat_id, const std::string& msg);
|
||||
void dumpItemArray(const LLInventoryModel::item_array_t& items, const std::string& msg);
|
||||
@@ -144,25 +158,23 @@ public:
|
||||
void registerAttachment(const LLUUID& item_id);
|
||||
void setAttachmentInvLinkEnable(bool val);
|
||||
|
||||
// utility function for bulk linking.
|
||||
void linkAll(const LLUUID& category,
|
||||
LLInventoryModel::item_array_t& items,
|
||||
LLPointer<LLInventoryCallback> cb);
|
||||
|
||||
// Add COF link to individual item.
|
||||
void addCOFItemLink(const LLUUID& item_id, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
|
||||
void addCOFItemLink(const LLInventoryItem *item, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
|
||||
void addCOFItemLink(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
|
||||
void addCOFItemLink(const LLInventoryItem *item, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
|
||||
|
||||
// Find COF entries referencing the given item.
|
||||
LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id);
|
||||
bool isLinkedInCOF(const LLUUID& item_id);
|
||||
|
||||
|
||||
// Remove COF entries
|
||||
void removeCOFItemLinks(const LLUUID& item_id);
|
||||
void removeCOFLinksOfType(LLWearableType::EType type);
|
||||
void removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL);
|
||||
void removeCOFLinksOfType(LLWearableType::EType type, LLPointer<LLInventoryCallback> cb = NULL);
|
||||
void removeAllClothesFromAvatar();
|
||||
void removeAllAttachmentsFromAvatar();
|
||||
|
||||
// Special handling of temp attachments, which are not in the COF
|
||||
bool shouldRemoveTempAttachment(const LLUUID& item_id);
|
||||
|
||||
//has the current outfit changed since it was loaded?
|
||||
bool isOutfitDirty() { return mOutfitIsDirty; }
|
||||
|
||||
@@ -173,12 +185,11 @@ public:
|
||||
// should only be necessary to do on initial login.
|
||||
void updateIsDirty();
|
||||
|
||||
void setOutfitLocked(bool locked);
|
||||
|
||||
// Called when self avatar is first fully visible.
|
||||
void onFirstFullyVisible();
|
||||
|
||||
// Create initial outfits from library.
|
||||
void autopopulateOutfits();
|
||||
|
||||
// Copy initial gestures from library.
|
||||
void copyLibraryGestures();
|
||||
|
||||
@@ -192,6 +203,10 @@ public:
|
||||
void removeItemsFromAvatar(const uuid_vec_t& item_ids);
|
||||
void removeItemFromAvatar(const LLUUID& item_id);
|
||||
|
||||
|
||||
void onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel);
|
||||
void onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel);
|
||||
|
||||
private:
|
||||
LLUUID makeNewOutfitCore(const std::string& new_folder_name, bool show_panel/*=true*/, LLInventoryModel::item_array_t* items = NULL);
|
||||
public:
|
||||
@@ -206,15 +221,29 @@ public:
|
||||
//Divvy items into arrays by wearable type
|
||||
static void divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type);
|
||||
|
||||
typedef std::map<LLUUID,std::string> desc_map_t;
|
||||
|
||||
void getWearableOrderingDescUpdates(LLInventoryModel::item_array_t& wear_items, desc_map_t& desc_map);
|
||||
|
||||
//Check ordering information on wearables stored in links' descriptions and update if it is invalid
|
||||
// COF is processed if cat_id is not specified
|
||||
void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, bool update_base_outfit_ordering = false);
|
||||
bool validateClothingOrderingInfo(LLUUID cat_id = LLUUID::null);
|
||||
|
||||
void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null,
|
||||
LLPointer<LLInventoryCallback> cb = NULL);
|
||||
|
||||
bool isOutfitLocked() { return mOutfitLocked; }
|
||||
|
||||
bool isInUpdateAppearanceFromCOF() { return mIsInUpdateAppearanceFromCOF; }
|
||||
|
||||
void requestServerAppearanceUpdate(LLHTTPClient::ResponderPtr responder_ptr = NULL);
|
||||
void requestServerAppearanceUpdate();
|
||||
|
||||
void incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr = NULL);
|
||||
|
||||
U32 getNumAttachmentsInCOF();
|
||||
|
||||
// *HACK Remove this after server side texture baking is deployed on all sims.
|
||||
void incrementCofVersionLegacy();
|
||||
|
||||
void setAppearanceServiceURL(const std::string& url) { mAppearanceServiceURL = url; }
|
||||
std::string getAppearanceServiceURL() const;
|
||||
@@ -229,51 +258,47 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type);
|
||||
void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total);
|
||||
|
||||
void getDescendentsOfAssetType(const LLUUID& category,
|
||||
LLInventoryModel::item_array_t& items,
|
||||
LLAssetType::EType type,
|
||||
bool follow_folder_links);
|
||||
bool follow_folder_links = false);
|
||||
|
||||
void getUserDescendents(const LLUUID& category,
|
||||
LLInventoryModel::item_array_t& wear_items,
|
||||
LLInventoryModel::item_array_t& obj_items,
|
||||
LLInventoryModel::item_array_t& gest_items,
|
||||
bool follow_folder_links);
|
||||
bool follow_folder_links = false);
|
||||
|
||||
void purgeCategory(const LLUUID& category, bool keep_outfit_links);
|
||||
|
||||
static void onOutfitRename(const LLSD& notification, const LLSD& response);
|
||||
|
||||
void setOutfitLocked(bool locked);
|
||||
|
||||
// [SL:KB] - Checked: 2010-04-24 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
|
||||
void purgeItems(const LLInventoryModel::item_array_t& items);
|
||||
void purgeItemsOfType(LLAssetType::EType asset_type);
|
||||
void syncCOF(const LLInventoryModel::item_array_t& items,
|
||||
LLInventoryModel::item_array_t& items_to_add, LLInventoryModel::item_array_t& items_to_remove);
|
||||
// [/SL:KB]
|
||||
|
||||
bool mAttachmentInvLinkEnabled;
|
||||
bool mOutfitIsDirty;
|
||||
bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls.
|
||||
|
||||
boost::intrusive_ptr<RequestAgentUpdateAppearanceResponder> mAppearanceResponder;
|
||||
|
||||
/**
|
||||
* Lock for blocking operations on outfit until server reply or timeout exceed
|
||||
* to avoid unsynchronized outfit state or performing duplicate operations.
|
||||
*/
|
||||
bool mOutfitLocked;
|
||||
|
||||
boost::scoped_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
|
||||
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-3.0.0a) | Modified: Catznip-2.1.2e
|
||||
public:
|
||||
void linkPendingAttachments();
|
||||
void onRegisterAttachmentComplete(const LLUUID& idItem);
|
||||
private:
|
||||
uuid_vec_t mPendingAttachLinks;
|
||||
// [/SL:KB]
|
||||
// Set of temp attachment UUIDs that should be removed
|
||||
typedef std::set<LLUUID> doomed_temp_attachments_t;
|
||||
doomed_temp_attachments_t mDoomedTempAttachmentIDs;
|
||||
|
||||
void addDoomedTempAttachment(const LLUUID& id_to_remove);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// Item-specific convenience functions
|
||||
@@ -292,27 +317,31 @@ public:
|
||||
class LLUpdateAppearanceOnDestroy: public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false);
|
||||
LLUpdateAppearanceOnDestroy(bool enforce_item_restrictions = true,
|
||||
bool enforce_ordering = true,
|
||||
nullary_func_t post_update_func = no_op);
|
||||
virtual ~LLUpdateAppearanceOnDestroy();
|
||||
/* virtual */ void fire(const LLUUID& inv_item);
|
||||
|
||||
private:
|
||||
U32 mFireCount;
|
||||
bool mUpdateBaseOrder;
|
||||
bool mEnforceItemRestrictions;
|
||||
bool mEnforceOrdering;
|
||||
nullary_func_t mPostUpdateFunc;
|
||||
};
|
||||
|
||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-3.0.0a) | Added: Catznip-2.1.2a
|
||||
class LLRegisterAttachmentCallback : public LLInventoryCallback
|
||||
class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
/*virtual*/ void fire(const LLUUID& idItem)
|
||||
{
|
||||
LLAppearanceMgr::instance().onRegisterAttachmentComplete(idItem);
|
||||
}
|
||||
};
|
||||
// [/SL:KB]
|
||||
LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id);
|
||||
|
||||
#define SUPPORT_ENSEMBLES 0
|
||||
/* virtual */ void fire(const LLUUID& item_id) {}
|
||||
|
||||
~LLUpdateAppearanceAndEditWearableOnDestroy();
|
||||
|
||||
private:
|
||||
LLUUID mItemID;
|
||||
};
|
||||
|
||||
LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user