SL-315 WIP - more call stack tracing, initial hooks for avatar reset skeleton option.

meow-7.2.2
Brad Payne (Vir Linden) 2016-03-07 11:24:48 -05:00
parent 9ca9a44acf
commit 88cb6814f0
10 changed files with 97 additions and 7 deletions

View File

@ -29,6 +29,7 @@
#include "llcommon.h"
#include "llcallstack.h"
#include "StackWalker.h"
#include "llthreadlocalstorage.h"
#if LL_WINDOWS
class LLCallStackImpl: public StackWalker
@ -88,6 +89,19 @@ LLCallStack::LLCallStack(S32 skip_count, bool verbose):
s_impl->getStack(m_strings, m_skipCount, m_verbose);
}
bool LLCallStack::contains(const std::string& str)
{
for (std::vector<std::string>::const_iterator it = m_strings.begin();
it != m_strings.end(); ++it)
{
if (it->find(str) != std::string::npos)
{
return true;
}
}
return false;
}
std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack)
{
std::vector<std::string>::const_iterator it;
@ -98,8 +112,6 @@ std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack)
return s;
}
#include "llthreadlocalstorage.h"
LLContextStrings::LLContextStrings()
{
}
@ -135,18 +147,40 @@ void LLContextStrings::removeContextString(const std::string& str)
}
}
// static
bool LLContextStrings::contains(const std::string& str)
{
const std::map<std::string,S32>& strings =
LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it)
{
if (it->first.find(str) != std::string::npos)
{
return true;
}
}
return false;
}
// static
void LLContextStrings::output(std::ostream& os)
{
const std::map<std::string,S32>& strings = LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
const std::map<std::string,S32>& strings =
LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it)
{
os << it->first << "[" << it->second << "]" << "\n";
}
}
// static
std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status)
{
LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->output(s);
return s;
}
bool LLContextStatus::contains(const std::string& str)
{
return LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->contains(str);
}

View File

@ -34,6 +34,7 @@ public:
LLCallStack(S32 skip_count=0, bool verbose=false);
std::vector<std::string> m_strings;
bool m_verbose;
bool contains(const std::string& str);
private:
static LLCallStackImpl *s_impl;
S32 m_skipCount;
@ -49,6 +50,7 @@ public:
static void removeContextString(const std::string& str);
static void output(std::ostream& os);
static LLContextStrings* getThreadLocalInstance();
static bool contains(const std::string& str);
private:
std::map<std::string,S32> m_contextStrings;
};
@ -69,10 +71,10 @@ private:
std::string m_str;
};
// This doesn't really have any state, just acts as class to hook the
// ostream override to.
// Mostly exists as a class to hook an ostream override to.
struct LLContextStatus
{
bool contains(const std::string& str);
};
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status);

View File

@ -4137,6 +4137,8 @@ void LLAgent::setTeleportState(ETeleportState state)
void LLAgent::stopCurrentAnimations()
{
LL_DEBUGS("Avatar") << "Stopping current animations" << LL_ENDL;
// This function stops all current overriding animations on this
// avatar, propagating this change back to the server.
if (isAgentAvatarValid())
@ -4154,6 +4156,7 @@ void LLAgent::stopCurrentAnimations()
// don't cancel a ground-sit anim, as viewers
// use this animation's status in
// determining whether we're sitting. ick.
LL_DEBUGS("Avatar") << "sit or do-not-disturb animation will not be stopped" << LL_ENDL;
}
else
{
@ -4183,8 +4186,7 @@ void LLAgent::stopCurrentAnimations()
// re-assert at least the default standing animation, because
// viewers get confused by avs with no associated anims.
sendAnimationRequest(ANIM_AGENT_STAND,
ANIM_REQUEST_START);
sendAnimationRequest(ANIM_AGENT_STAND, ANIM_REQUEST_START);
}
}

View File

@ -6031,6 +6031,18 @@ class LLAvatarToggleMyProfile : public view_listener_t
}
};
class LLAvatarResetSkeleton: public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
if(avatar)
{
avatar->resetSkeleton();
}
return true;
}
};
class LLAvatarAddContact : public view_listener_t
{
@ -9017,6 +9029,7 @@ void initialize_menus()
enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall));
view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse");
view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile");
view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton");
enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible));
commit.add("Avatar.OpenMarketplace", boost::bind(&LLWeb::loadURLExternal, gSavedSettings.getString("MarketplaceURL")));

View File

@ -1801,6 +1801,13 @@ void LLVOAvatar::buildCharacter()
mMeshValid = TRUE;
}
//-----------------------------------------------------------------------------
// resetSkeleton()
//-----------------------------------------------------------------------------
void LLVOAvatar::resetSkeleton()
{
LL_DEBUGS("Avatar") << avString() << LL_ENDL;
}
//-----------------------------------------------------------------------------
// releaseMeshData()

View File

@ -364,6 +364,7 @@ public:
/*virtual*/ BOOL loadSkeletonNode();
/*virtual*/ void buildCharacter();
void resetSkeleton();
LLVector3 mCurRootToHeadOffset;
LLVector3 mTargetRootToHeadOffset;

View File

@ -39,6 +39,15 @@
<menu_item_call.on_click
function="Avatar.InviteToGroup" />
</menu_item_call>
<menu_item_separator />
<menu_item_call label="Reset Skeleton"
layout="topleft"
name="Reset Skeleton">
<menu_item_call.on_click
function="Avatar.ResetSkeleton" />
</menu_item_call>
<menu_item_separator />
<menu_item_call
enabled="false"

View File

@ -99,6 +99,13 @@ name="Edit Outfit">
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
</menu_item_call>
<menu_item_call label="Reset Skeleton"
layout="topleft"
name="Reset Skeleton">
<menu_item_call.on_click
function="Avatar.ResetSkeleton" />
</menu_item_call>
<menu_item_call
label="My Friends"
layout="topleft"

View File

@ -40,6 +40,15 @@
function="Avatar.InviteToGroup" />
</menu_item_call>
<menu_item_separator />
<menu_item_call label="Reset Skeleton"
layout="topleft"
name="Reset Skeleton">
<menu_item_call.on_click
function="Avatar.ResetSkeleton" />
</menu_item_call>
<menu_item_separator />
<menu_item_call

View File

@ -237,6 +237,12 @@
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
</menu_item_call>
<menu_item_call label="Reset Skeleton"
layout="topleft"
name="Reset Skeleton">
<menu_item_call.on_click
function="Avatar.ResetSkeleton" />
</menu_item_call>
<menu_item_call
label="My Friends"
layout="topleft"