diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcommon/llerror.cpp | 16 | ||||
-rwxr-xr-x | indra/newview/llattachmentsmgr.cpp | 56 | ||||
-rwxr-xr-x | indra/newview/llattachmentsmgr.h | 4 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 2 |
4 files changed, 42 insertions, 36 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 22cd861c72..bf57e47756 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -119,6 +119,7 @@ namespace { LL_INFOS() << "Error setting log file to " << filename << LL_ENDL; } mWantsTime = true; + mWantsTags = true; } ~RecordToFile() @@ -558,7 +559,7 @@ namespace LLError mFunctionString += std::string(mFunction) + ":"; for (size_t i = 0; i < mTagCount; i++) { - mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " "); + mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : ","); } } @@ -931,14 +932,19 @@ namespace } if (show_level && r->wantsLevel()) - { - message_stream << site.mLevelString << " "; - } + { + message_stream << site.mLevelString; + } if (show_tags && r->wantsTags()) { - message_stream << site.mTagString << " "; + message_stream << site.mTagString; } + if ((show_level && r->wantsLevel())|| + (show_tags && r->wantsTags())) + { + message_stream << " "; + } if (show_function && r->wantsFunctionName()) { diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index bbfcb6b955..39c21a195a 100755 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -117,7 +117,6 @@ void LLAttachmentsMgr::requestPendingAttachments() if (mPendingAttachments.size()) { requestAttachments(mPendingAttachments); - mPendingAttachments.clear(); } } @@ -125,7 +124,7 @@ void LLAttachmentsMgr::requestPendingAttachments() // request at most 40 attachments and the rest will be // ignored. Currently the max attachments per avatar is 38, so the 40 // limit should not be hit in practice. -void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_requests) +void LLAttachmentsMgr::requestAttachments(attachments_vec_t& attachment_requests) { // Make sure we got a region before trying anything else if( !gAgent.getRegion() ) @@ -133,7 +132,8 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re return; } - S32 obj_count = attachment_requests.size(); + const S32 max_objects_per_request = 5; + S32 obj_count = llmin((S32)attachment_requests.size(),max_objects_per_request); if (obj_count == 0) { return; @@ -145,7 +145,7 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re const S32 MAX_OBJECTS_TO_SEND = MAX_PACKETS_TO_SEND * OBJECTS_PER_PACKET; if( obj_count > MAX_OBJECTS_TO_SEND ) { - LL_WARNS() << "ATT Too many attachments requested: " << attachment_requests.size() + LL_WARNS() << "ATT Too many attachments requested: " << obj_count << " exceeds limit of " << MAX_OBJECTS_TO_SEND << LL_ENDL; LL_WARNS() << "ATT Excess requests will be ignored" << LL_ENDL; @@ -159,12 +159,10 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re compound_msg_id.generate(); LLMessageSystem* msg = gMessageSystem; - - S32 i = 0; - for (attachments_vec_t::const_iterator iter = attachment_requests.begin(); - iter != attachment_requests.end(); - ++iter) - { + // by construction, obj_count <= attachment_requests.size(), so no + // check against empty() is needed here. + for (S32 i=0; i<obj_count; i++) + { if( 0 == (i % OBJECTS_PER_PACKET) ) { // Start a new message chunk @@ -178,33 +176,35 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re msg->addBOOLFast(_PREHASH_FirstDetachAll, false ); } - const AttachmentsInfo &attachment = (*iter); + const AttachmentsInfo& attachment = attachment_requests.front(); LLViewerInventoryItem* item = gInventory.getItem(attachment.mItemID); - if (!item) + if (item) + { + LL_DEBUGS("Avatar") << "ATT requesting from attachment_requests " << item->getName() + << " " << item->getLinkedUUID() << LL_ENDL; + S32 attachment_pt = attachment.mAttachmentPt; + if (attachment.mAdd) + attachment_pt |= ATTACHMENT_ADD; + + msg->nextBlockFast(_PREHASH_ObjectData ); + msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); + msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); + msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); + pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); + msg->addStringFast(_PREHASH_Name, item->getName()); + msg->addStringFast(_PREHASH_Description, item->getDescription()); + } + else { - LL_INFOS() << "Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL; - continue; + LL_INFOS("Avatar") << "ATT Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL; } - LL_DEBUGS("Avatar") << "ATT requesting from attachment_requests " << item->getName() - << " " << item->getLinkedUUID() << LL_ENDL; - S32 attachment_pt = attachment.mAttachmentPt; - if (attachment.mAdd) - attachment_pt |= ATTACHMENT_ADD; - - msg->nextBlockFast(_PREHASH_ObjectData ); - msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); - msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); - msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt); - pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); - msg->addStringFast(_PREHASH_Name, item->getName()); - msg->addStringFast(_PREHASH_Description, item->getDescription()); if( (i+1 == obj_count) || ((OBJECTS_PER_PACKET-1) == (i % OBJECTS_PER_PACKET)) ) { // End of message chunk msg->sendReliable( gAgent.getRegion()->getHost() ); } - i++; + attachment_requests.pop_front(); } } diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index f9d321398f..d56d6eb27b 100755 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -70,7 +70,7 @@ public: U8 mAttachmentPt; BOOL mAdd; }; - typedef std::vector<AttachmentsInfo> attachments_vec_t; + typedef std::deque<AttachmentsInfo> attachments_vec_t; LLAttachmentsMgr(); virtual ~LLAttachmentsMgr(); @@ -79,7 +79,7 @@ public: const U8 attachment_pt, const BOOL add); void onAttachmentRequested(const LLUUID& item_id); - void requestAttachments(const attachments_vec_t& attachment_requests); + void requestAttachments(attachments_vec_t& attachment_requests); static void onIdle(void *); void onAttachmentArrived(const LLUUID& inv_item_id); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ff9e021f8e..0a578fc0b3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -732,7 +732,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); - LL_DEBUGS("Avatar") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; + LL_DEBUGS("Avatar","Message") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; mPelvisp = NULL; |