aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs33
3 files changed, 49 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index f5623bd..14ae287 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -278,6 +278,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
278 return "FALLDOWN"; 278 return "FALLDOWN";
279 } 279 }
280 280
281 // Check if the user has stopped walking just now
282 if (CurrentMovementAnimation == "WALK" && (move == Vector3.Zero))
283 return "STAND";
284
281 return CurrentMovementAnimation; 285 return CurrentMovementAnimation;
282 } 286 }
283 287
@@ -402,13 +406,16 @@ namespace OpenSim.Region.Framework.Scenes.Animation
402 /// </summary> 406 /// </summary>
403 public void UpdateMovementAnimations() 407 public void UpdateMovementAnimations()
404 { 408 {
405 CurrentMovementAnimation = DetermineMovementAnimation(); 409 lock (m_animations)
410 {
411 CurrentMovementAnimation = DetermineMovementAnimation();
406 412
407// m_log.DebugFormat( 413// m_log.DebugFormat(
408// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", 414// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
409// CurrentMovementAnimation, m_scenePresence.Name); 415// CurrentMovementAnimation, m_scenePresence.Name);
410 416
411 TrySetMovementAnimation(CurrentMovementAnimation); 417 TrySetMovementAnimation(CurrentMovementAnimation);
418 }
412 } 419 }
413 420
414 public UUID[] GetAnimationArray() 421 public UUID[] GetAnimationArray()
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index e1fedf4..535d87a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -67,6 +67,7 @@ namespace OpenSim.Region.Framework.Scenes
67 public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); 67 public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene);
68 public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); 68 public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand);
69 public delegate bool IsGodHandler(UUID user, Scene requestFromScene); 69 public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
70 public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene);
70 public delegate bool IsAdministratorHandler(UUID user); 71 public delegate bool IsAdministratorHandler(UUID user);
71 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); 72 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
72 public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene); 73 public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
@@ -134,6 +135,7 @@ namespace OpenSim.Region.Framework.Scenes
134 public event RunConsoleCommandHandler OnRunConsoleCommand; 135 public event RunConsoleCommandHandler OnRunConsoleCommand;
135 public event IssueEstateCommandHandler OnIssueEstateCommand; 136 public event IssueEstateCommandHandler OnIssueEstateCommand;
136 public event IsGodHandler OnIsGod; 137 public event IsGodHandler OnIsGod;
138 public event IsGridGodHandler OnIsGridGod;
137 public event IsAdministratorHandler OnIsAdministrator; 139 public event IsAdministratorHandler OnIsAdministrator;
138// public event EditParcelHandler OnEditParcel; 140// public event EditParcelHandler OnEditParcel;
139 public event EditParcelPropertiesHandler OnEditParcelProperties; 141 public event EditParcelPropertiesHandler OnEditParcelProperties;
@@ -728,6 +730,21 @@ namespace OpenSim.Region.Framework.Scenes
728 return true; 730 return true;
729 } 731 }
730 732
733 public bool IsGridGod(UUID user)
734 {
735 IsGridGodHandler handler = OnIsGridGod;
736 if (handler != null)
737 {
738 Delegate[] list = handler.GetInvocationList();
739 foreach (IsGridGodHandler h in list)
740 {
741 if (h(user, m_scene) == false)
742 return false;
743 }
744 }
745 return true;
746 }
747
731 public bool IsAdministrator(UUID user) 748 public bool IsAdministrator(UUID user)
732 { 749 {
733 IsAdministratorHandler handler = OnIsAdministrator; 750 IsAdministratorHandler handler = OnIsAdministrator;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e0d5055..311ba6a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -45,6 +45,7 @@ using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags;
45 45
46namespace OpenSim.Region.Framework.Scenes 46namespace OpenSim.Region.Framework.Scenes
47{ 47{
48 [Flags]
48 enum ScriptControlled : uint 49 enum ScriptControlled : uint
49 { 50 {
50 CONTROL_ZERO = 0, 51 CONTROL_ZERO = 0,
@@ -1295,7 +1296,7 @@ namespace OpenSim.Region.Framework.Scenes
1295 { 1296 {
1296// m_log.DebugFormat( 1297// m_log.DebugFormat(
1297// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}", 1298// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}",
1298// Scene.RegionInfo.RegionName, remoteClient.Name, agentData.ControlFlags); 1299// Scene.RegionInfo.RegionName, remoteClient.Name, (AgentManager.ControlFlags)agentData.ControlFlags);
1299 1300
1300 if (IsChildAgent) 1301 if (IsChildAgent)
1301 { 1302 {
@@ -1405,14 +1406,8 @@ namespace OpenSim.Region.Framework.Scenes
1405 } 1406 }
1406 } 1407 }
1407 1408
1408 lock (scriptedcontrols) 1409 uint flagsForScripts = (uint)flags;
1409 { 1410 flags = RemoveIgnoredControls(flags, IgnoredControls);
1410 if (scriptedcontrols.Count > 0)
1411 {
1412 SendControlToScripts((uint)flags);
1413 flags = RemoveIgnoredControls(flags, IgnoredControls);
1414 }
1415 }
1416 1411
1417 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0) 1412 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0)
1418 HandleAgentSitOnGround(); 1413 HandleAgentSitOnGround();
@@ -1505,7 +1500,7 @@ namespace OpenSim.Region.Framework.Scenes
1505 MovementFlag |= (byte)nudgehack; 1500 MovementFlag |= (byte)nudgehack;
1506 } 1501 }
1507 1502
1508// m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF); 1503 //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with {1}", Name, DCF);
1509 MovementFlag += (byte)(uint)DCF; 1504 MovementFlag += (byte)(uint)DCF;
1510 update_movementflag = true; 1505 update_movementflag = true;
1511 } 1506 }
@@ -1518,7 +1513,7 @@ namespace OpenSim.Region.Framework.Scenes
1518 && ((MovementFlag & (byte)nudgehack) == nudgehack)) 1513 && ((MovementFlag & (byte)nudgehack) == nudgehack))
1519 ) // This or is for Nudge forward 1514 ) // This or is for Nudge forward
1520 { 1515 {
1521// m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with lack of {1}", Name, DCF); 1516 //m_log.DebugFormat("[SCENE PRESENCE]: Updating MovementFlag for {0} with lack of {1}", Name, DCF);
1522 MovementFlag -= ((byte)(uint)DCF); 1517 MovementFlag -= ((byte)(uint)DCF);
1523 update_movementflag = true; 1518 update_movementflag = true;
1524 1519
@@ -1599,8 +1594,18 @@ namespace OpenSim.Region.Framework.Scenes
1599// } 1594// }
1600// } 1595// }
1601 1596
1602// if (update_movementflag && ParentID == 0) 1597 if (update_movementflag && ParentID == 0)
1603// Animator.UpdateMovementAnimations(); 1598 Animator.UpdateMovementAnimations();
1599
1600 lock (scriptedcontrols)
1601 {
1602 if (scriptedcontrols.Count > 0)
1603 {
1604 // Notify the scripts only after calling UpdateMovementAnimations(), so that if a script
1605 // (e.g., a walking script) checks which animation is active it will be the correct animation.
1606 SendControlToScripts(flagsForScripts);
1607 }
1608 }
1604 } 1609 }
1605 1610
1606 m_scene.EventManager.TriggerOnClientMovement(this); 1611 m_scene.EventManager.TriggerOnClientMovement(this);