aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-23 20:06:23 +0000
committerJustin Clarke Casey2008-10-23 20:06:23 +0000
commit5c2d4002352324d138979f0700d01a86a727a6be (patch)
tree7da7ee6bd9e41a0991322cd18866922e760bdcd9 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parent* Reenable assert for the add circuit test (diff)
downloadopensim-SC-5c2d4002352324d138979f0700d01a86a727a6be.zip
opensim-SC-5c2d4002352324d138979f0700d01a86a727a6be.tar.gz
opensim-SC-5c2d4002352324d138979f0700d01a86a727a6be.tar.bz2
opensim-SC-5c2d4002352324d138979f0700d01a86a727a6be.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2459
* Implements the rest of llGetAgentInfo() with the exception of AGENT_BUSY. * Thanks nlin
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
1 files changed, 35 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 060fde2..1462922 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4628,10 +4628,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4628 4628
4629 /// <summary> 4629 /// <summary>
4630 /// Not fully implemented yet. Still to do:- 4630 /// Not fully implemented yet. Still to do:-
4631 /// AGENT_SITTING
4632 /// AGENT_ON_OBJECT
4633 /// AGENT_IN_AIR
4634 /// AGENT_CROUCHING
4635 /// AGENT_BUSY 4631 /// AGENT_BUSY
4636 /// Remove as they are done 4632 /// Remove as they are done
4637 /// </summary> 4633 /// </summary>
@@ -4639,8 +4635,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4639 { 4635 {
4640 m_host.AddScriptLPS(1); 4636 m_host.AddScriptLPS(1);
4641 4637
4642 // This is partial implementation.
4643
4644 UUID key = new UUID(); 4638 UUID key = new UUID();
4645 if (!UUID.TryParse(id, out key)) 4639 if (!UUID.TryParse(id, out key))
4646 { 4640 {
@@ -4655,6 +4649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4655 return 0; 4649 return 0;
4656 } 4650 }
4657 4651
4652 // note: in OpenSim, sitting seems to cancel AGENT_ALWAYS_RUN, unlike SL
4658 if (agent.SetAlwaysRun) 4653 if (agent.SetAlwaysRun)
4659 { 4654 {
4660 flags |= ScriptBaseClass.AGENT_ALWAYS_RUN; 4655 flags |= ScriptBaseClass.AGENT_ALWAYS_RUN;
@@ -4670,6 +4665,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4670 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0) 4665 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0)
4671 { 4666 {
4672 flags |= ScriptBaseClass.AGENT_FLYING; 4667 flags |= ScriptBaseClass.AGENT_FLYING;
4668 flags |= ScriptBaseClass.AGENT_IN_AIR; // flying always implies in-air, even if colliding with e.g. a wall
4673 } 4669 }
4674 4670
4675 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AWAY) != 0) 4671 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AWAY) != 0)
@@ -4677,6 +4673,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4677 flags |= ScriptBaseClass.AGENT_AWAY; 4673 flags |= ScriptBaseClass.AGENT_AWAY;
4678 } 4674 }
4679 4675
4676 // seems to get unset, even if in mouselook, when avatar is sitting on a prim???
4680 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0) 4677 if ((agent.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
4681 { 4678 {
4682 flags |= ScriptBaseClass.AGENT_MOUSELOOK; 4679 flags |= ScriptBaseClass.AGENT_MOUSELOOK;
@@ -4688,12 +4685,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4688 } 4685 }
4689 4686
4690 string agentMovementAnimation = agent.GetMovementAnimation(); 4687 string agentMovementAnimation = agent.GetMovementAnimation();
4688
4689 if (agentMovementAnimation == "CROUCH")
4690 {
4691 flags |= ScriptBaseClass.AGENT_CROUCHING;
4692 }
4693
4691 if (agentMovementAnimation == "WALK" || agentMovementAnimation == "CROUCHWALK") 4694 if (agentMovementAnimation == "WALK" || agentMovementAnimation == "CROUCHWALK")
4692 { 4695 {
4693 flags |= ScriptBaseClass.AGENT_WALKING; 4696 flags |= ScriptBaseClass.AGENT_WALKING;
4694 } 4697 }
4695 4698
4696 //NotImplemented("llGetAgentInfo"); 4699 // not colliding implies in air. Note: flying also implies in-air, even if colliding (see above)
4700
4701 // note: AGENT_IN_AIR and AGENT_WALKING seem to be mutually exclusive states in SL.
4702
4703 // note: this may need some tweaking when walking downhill. you "fall down" for a brief instant
4704 // and don't collide when walking downhill, which instantly registers as in-air, briefly. should
4705 // there be some minimum non-collision threshold time before claiming the avatar is in-air?
4706 if ((flags & ScriptBaseClass.AGENT_WALKING) == 0 &&
4707 agent.PhysicsActor != null &&
4708 !agent.PhysicsActor.IsColliding)
4709 {
4710 flags |= ScriptBaseClass.AGENT_IN_AIR;
4711 }
4712
4713 if (agent.ParentID != 0)
4714 {
4715 flags |= ScriptBaseClass.AGENT_ON_OBJECT;
4716 flags |= ScriptBaseClass.AGENT_SITTING;
4717 }
4718
4719 if (agent.Animations.DefaultAnimation.AnimID == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"])
4720 {
4721 flags |= ScriptBaseClass.AGENT_SITTING;
4722 }
4723
4724 //NotImplemented("llGetAgentInfo");
4697 4725
4698 return flags; 4726 return flags;
4699 } 4727 }