Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
37048620
Commit
37048620
authored
11 years ago
by
simon
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-2879 : Viewer should revoke animation permissions with "Stop Animating Me"
Reviewed by Kelly
parent
c6a15ab0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/app_settings/settings.xml
+12
-1
12 additions, 1 deletion
indra/newview/app_settings/settings.xml
indra/newview/llagent.cpp
+39
-1
39 additions, 1 deletion
indra/newview/llagent.cpp
indra/newview/llagent.h
+1
-0
1 addition, 0 deletions
indra/newview/llagent.h
with
52 additions
and
2 deletions
indra/newview/app_settings/settings.xml
+
12
−
1
View file @
37048620
...
@@ -9697,7 +9697,18 @@
...
@@ -9697,7 +9697,18 @@
<key>
Value
</key>
<key>
Value
</key>
<integer>
1
</integer>
<integer>
1
</integer>
</map>
</map>
<key>
RotateRight
</key>
<key>
RevokePermsOnStopAnimation
</key>
<map>
<key>
Comment
</key>
<string>
Clear animation permssions when choosing "Stop Animating Me"
</string>
<key>
Persist
</key>
<integer>
1
</integer>
<key>
Type
</key>
<string>
Boolean
</string>
<key>
Value
</key>
<integer>
1
</integer>
</map>
<key>
RotateRight
</key>
<map>
<map>
<key>
Comment
</key>
<key>
Comment
</key>
<string>
Make the agent rotate to its right.
</string>
<string>
Make the agent rotate to its right.
</string>
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llagent.cpp
+
39
−
1
View file @
37048620
...
@@ -90,6 +90,7 @@
...
@@ -90,6 +90,7 @@
#include
"llwindow.h"
#include
"llwindow.h"
#include
"llworld.h"
#include
"llworld.h"
#include
"llworldmap.h"
#include
"llworldmap.h"
#include
"lscript_byteformat.h"
#include
"stringize.h"
#include
"stringize.h"
using
namespace
LLAvatarAppearanceDefines
;
using
namespace
LLAvatarAppearanceDefines
;
...
@@ -3072,6 +3073,31 @@ void LLAgent::sendAnimationStateReset()
...
@@ -3072,6 +3073,31 @@ void LLAgent::sendAnimationStateReset()
sendReliableMessage
();
sendReliableMessage
();
}
}
// Send a message to the region to revoke sepecified permissions on ALL scripts in the region
// If the target is an object in the region, permissions in scripts on that object are cleared.
// If it is the region ID, all scripts clear the permissions for this agent
void
LLAgent
::
sendRevokePermissions
(
const
LLUUID
&
target
,
U32
permissions
)
{
// Currently only the bits for SCRIPT_PERMISSION_TRIGGER_ANIMATION and SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS
// are supported by the server. Sending any other bits will cause the message to be dropped without changing permissions
if
(
gAgentID
.
notNull
()
&&
gMessageSystem
)
{
LLMessageSystem
*
msg
=
gMessageSystem
;
msg
->
newMessageFast
(
_PREHASH_RevokePermissions
);
msg
->
nextBlockFast
(
_PREHASH_AgentData
);
msg
->
addUUIDFast
(
_PREHASH_AgentID
,
getID
());
// Must be our ID
msg
->
addUUIDFast
(
_PREHASH_SessionID
,
getSessionID
());
msg
->
nextBlockFast
(
_PREHASH_Data
);
msg
->
addUUIDFast
(
_PREHASH_ObjectID
,
target
);
// Must be in the region
msg
->
addS32Fast
(
_PREHASH_ObjectPermissions
,
(
S32
)
permissions
);
sendReliableMessage
();
}
}
void
LLAgent
::
sendWalkRun
(
bool
running
)
void
LLAgent
::
sendWalkRun
(
bool
running
)
{
{
LLMessageSystem
*
msgsys
=
gMessageSystem
;
LLMessageSystem
*
msgsys
=
gMessageSystem
;
...
@@ -4175,9 +4201,21 @@ void LLAgent::stopCurrentAnimations()
...
@@ -4175,9 +4201,21 @@ void LLAgent::stopCurrentAnimations()
sendAnimationRequests
(
anim_ids
,
ANIM_REQUEST_STOP
);
sendAnimationRequests
(
anim_ids
,
ANIM_REQUEST_STOP
);
// Tell the region to clear any animation state overrides
.
// Tell the region to clear any animation state overrides
sendAnimationStateReset
();
sendAnimationStateReset
();
// Revoke all animation permissions
if
(
mRegionp
&&
gSavedSettings
.
getBOOL
(
"RevokePermsOnStopAnimation"
))
{
U32
permissions
=
LSCRIPTRunTimePermissionBits
[
SCRIPT_PERMISSION_TRIGGER_ANIMATION
]
|
LSCRIPTRunTimePermissionBits
[
SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS
];
sendRevokePermissions
(
mRegionp
->
getRegionID
(),
permissions
);
if
(
gAgentAvatarp
->
isSitting
())
{
// Also stand up, since auto-granted sit animation permission has been revoked
gAgent
.
standUp
();
}
}
// re-assert at least the default standing animation, because
// re-assert at least the default standing animation, because
// viewers get confused by avs with no associated anims.
// viewers get confused by avs with no associated anims.
sendAnimationRequest
(
ANIM_AGENT_STAND
,
sendAnimationRequest
(
ANIM_AGENT_STAND
,
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llagent.h
+
1
−
0
View file @
37048620
...
@@ -432,6 +432,7 @@ class LLAgent : public LLOldEvents::LLObservable
...
@@ -432,6 +432,7 @@ class LLAgent : public LLOldEvents::LLObservable
void
sendAnimationRequests
(
LLDynamicArray
<
LLUUID
>
&
anim_ids
,
EAnimRequest
request
);
void
sendAnimationRequests
(
LLDynamicArray
<
LLUUID
>
&
anim_ids
,
EAnimRequest
request
);
void
sendAnimationRequest
(
const
LLUUID
&
anim_id
,
EAnimRequest
request
);
void
sendAnimationRequest
(
const
LLUUID
&
anim_id
,
EAnimRequest
request
);
void
sendAnimationStateReset
();
void
sendAnimationStateReset
();
void
sendRevokePermissions
(
const
LLUUID
&
target
,
U32
permissions
);
void
endAnimationUpdateUI
();
void
endAnimationUpdateUI
();
void
unpauseAnimation
()
{
mPauseRequest
=
NULL
;
}
void
unpauseAnimation
()
{
mPauseRequest
=
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment