Skip to content

Commit

Permalink
More sl-20635 - moved new attachment data to AvatarAppearance message
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-linden committed Dec 8, 2023
1 parent ce75d0e commit 3777dbb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
3 changes: 3 additions & 0 deletions indra/llmessage/message.cpp
Expand Up @@ -307,12 +307,15 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure
LLTemplateTokenizer tokens(template_body);
LLTemplateParser parsed(tokens);
mMessageFileVersionNumber = parsed.getVersion();
S32 count = 0;
for(LLTemplateParser::message_iterator iter = parsed.getMessagesBegin();
iter != parsed.getMessagesEnd();
iter++)
{
addTemplate(*iter);
count++;
}
LL_INFOS("Messaging") << "Read " << count << " messages from " << filename << LL_ENDL;
}


Expand Down
21 changes: 19 additions & 2 deletions indra/newview/llvoavatar.cpp
Expand Up @@ -9266,7 +9266,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
//mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0);
}

// Parse the AppearanceData field, if any.
// Parse the AppearanceHover field, if any.
contents.mHoverOffsetWasSet = false;
if (mesgsys->has(_PREHASH_AppearanceHover))
{
Expand All @@ -9276,7 +9276,24 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
contents.mHoverOffset = hover;
contents.mHoverOffsetWasSet = true;
}


// Get attachment info, if sent
LLUUID attachment_id;
U8 attach_point;
S32 attach_count = mesgsys->getNumberOfBlocksFast(_PREHASH_AttachmentBlock);
LL_DEBUGS("AVAppearanceAttachments") << "Agent " << getID() << " has "
<< attach_count << " attachments" << LL_ENDL;

for (S32 attach_i = 0; attach_i < attach_count; attach_i++)
{
mesgsys->getUUIDFast(_PREHASH_AttachmentBlock, _PREHASH_ID, attachment_id, attach_i);
mesgsys->getU8Fast(_PREHASH_AttachmentBlock, _PREHASH_AttachmentPoint, attach_point, attach_i);
LL_DEBUGS("AVAppearanceAttachments") << "AV " << getID() << " has attachment " << attach_i << " "
<< (attachment_id.isNull() ? "pending" : attachment_id.asString())
<< " on point " << (S32)attach_point << LL_ENDL;
// To do - store and use this information as needed
}

// Parse visual params, if any.
S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam);
static LLCachedControl<bool> block_some_avatars(gSavedSettings, "BlockSomeAvatarAppearanceVisualParams");
Expand Down
5 changes: 5 additions & 0 deletions scripts/messages/message_template.msg
Expand Up @@ -3607,6 +3607,11 @@ version 2.0
AppearanceHover Variable
{ HoverHeight LLVector3 }
}
{
AttachmentBlock Variable
{ ID LLUUID }
{ AttachmentPoint U8 }
}
}

// AvatarSitResponse - response to a request to sit on an object
Expand Down
2 changes: 1 addition & 1 deletion scripts/messages/message_template.msg.sha1
@@ -1 +1 @@
e3bd0529a647d938ab6d48f26d21dd52c07ebc6e
d7915d67467e59287857630bd89bf9529d065199

0 comments on commit 3777dbb

Please sign in to comment.