diff options
Diffstat (limited to '')
11 files changed, 149 insertions, 3 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 2be78da..c1bd078 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -70,6 +70,8 @@ namespace OpenSim.Framework | |||
70 | 70 | ||
71 | public delegate void StopAnim(IClientAPI remoteClient, UUID animID); | 71 | public delegate void StopAnim(IClientAPI remoteClient, UUID animID); |
72 | 72 | ||
73 | public delegate void ChangeAnim(UUID animID, bool addOrRemove, bool sendPack); | ||
74 | |||
73 | public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children); | 75 | public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children); |
74 | 76 | ||
75 | public delegate void DelinkObjects(List<uint> primIds, IClientAPI client); | 77 | public delegate void DelinkObjects(List<uint> primIds, IClientAPI client); |
@@ -791,6 +793,7 @@ namespace OpenSim.Framework | |||
791 | event ObjectDrop OnObjectDrop; | 793 | event ObjectDrop OnObjectDrop; |
792 | event StartAnim OnStartAnim; | 794 | event StartAnim OnStartAnim; |
793 | event StopAnim OnStopAnim; | 795 | event StopAnim OnStopAnim; |
796 | event ChangeAnim OnChangeAnim; | ||
794 | event LinkObjects OnLinkObjects; | 797 | event LinkObjects OnLinkObjects; |
795 | event DelinkObjects OnDelinkObjects; | 798 | event DelinkObjects OnDelinkObjects; |
796 | event RequestMapBlocks OnRequestMapBlocks; | 799 | event RequestMapBlocks OnRequestMapBlocks; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index bb76717..7db6014 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -98,6 +98,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
98 | public event AvatarPickerRequest OnAvatarPickerRequest; | 98 | public event AvatarPickerRequest OnAvatarPickerRequest; |
99 | public event StartAnim OnStartAnim; | 99 | public event StartAnim OnStartAnim; |
100 | public event StopAnim OnStopAnim; | 100 | public event StopAnim OnStopAnim; |
101 | public event ChangeAnim OnChangeAnim; | ||
101 | public event Action<IClientAPI> OnRequestAvatarsData; | 102 | public event Action<IClientAPI> OnRequestAvatarsData; |
102 | public event LinkObjects OnLinkObjects; | 103 | public event LinkObjects OnLinkObjects; |
103 | public event DelinkObjects OnDelinkObjects; | 104 | public event DelinkObjects OnDelinkObjects; |
@@ -6386,7 +6387,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6386 | return true; | 6387 | return true; |
6387 | } | 6388 | } |
6388 | #endregion | 6389 | #endregion |
6389 | 6390 | /* | |
6390 | StartAnim handlerStartAnim = null; | 6391 | StartAnim handlerStartAnim = null; |
6391 | StopAnim handlerStopAnim = null; | 6392 | StopAnim handlerStopAnim = null; |
6392 | 6393 | ||
@@ -6410,6 +6411,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6410 | } | 6411 | } |
6411 | } | 6412 | } |
6412 | return true; | 6413 | return true; |
6414 | */ | ||
6415 | ChangeAnim handlerChangeAnim = null; | ||
6416 | |||
6417 | for (int i = 0; i < AgentAni.AnimationList.Length; i++) | ||
6418 | { | ||
6419 | handlerChangeAnim = OnChangeAnim; | ||
6420 | if (handlerChangeAnim != null) | ||
6421 | { | ||
6422 | handlerChangeAnim(AgentAni.AnimationList[i].AnimID, AgentAni.AnimationList[i].StartAnim, false); | ||
6423 | } | ||
6424 | } | ||
6425 | |||
6426 | handlerChangeAnim = OnChangeAnim; | ||
6427 | if (handlerChangeAnim != null) | ||
6428 | { | ||
6429 | handlerChangeAnim(UUID.Zero, false, true); | ||
6430 | } | ||
6431 | |||
6432 | return true; | ||
6413 | } | 6433 | } |
6414 | 6434 | ||
6415 | private bool HandleAgentRequestSit(IClientAPI sender, Packet Pack) | 6435 | private bool HandleAgentRequestSit(IClientAPI sender, Packet Pack) |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index f5623bd..e577958 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -79,13 +79,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
79 | m_scenePresence = sp; | 79 | m_scenePresence = sp; |
80 | CurrentMovementAnimation = "CROUCH"; | 80 | CurrentMovementAnimation = "CROUCH"; |
81 | } | 81 | } |
82 | 82 | ||
83 | public void AddAnimation(UUID animID, UUID objectID) | 83 | public void AddAnimation(UUID animID, UUID objectID) |
84 | { | 84 | { |
85 | if (m_scenePresence.IsChildAgent) | 85 | if (m_scenePresence.IsChildAgent) |
86 | return; | 86 | return; |
87 | 87 | ||
88 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); | 88 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); |
89 | 89 | ||
90 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) | 90 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) |
91 | SendAnimPack(); | 91 | SendAnimPack(); |
@@ -117,6 +117,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
117 | SendAnimPack(); | 117 | SendAnimPack(); |
118 | } | 118 | } |
119 | 119 | ||
120 | public void avnChangeAnim(UUID animID, bool addRemove, bool sendPack) | ||
121 | { | ||
122 | if (m_scenePresence.IsChildAgent) | ||
123 | return; | ||
124 | |||
125 | if (animID != UUID.Zero) | ||
126 | { | ||
127 | if (addRemove) | ||
128 | m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero); | ||
129 | else | ||
130 | m_animations.Remove(animID); | ||
131 | } | ||
132 | if(sendPack) | ||
133 | SendAnimPack(); | ||
134 | } | ||
135 | |||
120 | // Called from scripts | 136 | // Called from scripts |
121 | public void RemoveAnimation(string name) | 137 | public void RemoveAnimation(string name) |
122 | { | 138 | { |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 212720e..ba0ed95 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -781,6 +781,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
781 | ControllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; | 781 | ControllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; |
782 | ControllingClient.OnStartAnim += HandleStartAnim; | 782 | ControllingClient.OnStartAnim += HandleStartAnim; |
783 | ControllingClient.OnStopAnim += HandleStopAnim; | 783 | ControllingClient.OnStopAnim += HandleStopAnim; |
784 | ControllingClient.OnChangeAnim += avnHandleChangeAnim; | ||
784 | ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; | 785 | ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; |
785 | ControllingClient.OnAutoPilotGo += MoveToTarget; | 786 | ControllingClient.OnAutoPilotGo += MoveToTarget; |
786 | 787 | ||
@@ -2432,6 +2433,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2432 | Animator.RemoveAnimation(animID); | 2433 | Animator.RemoveAnimation(animID); |
2433 | } | 2434 | } |
2434 | 2435 | ||
2436 | public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack) | ||
2437 | { | ||
2438 | Animator.avnChangeAnim(animID, addRemove, sendPack); | ||
2439 | } | ||
2440 | |||
2441 | |||
2442 | |||
2435 | /// <summary> | 2443 | /// <summary> |
2436 | /// Rotate the avatar to the given rotation and apply a movement in the given relative vector | 2444 | /// Rotate the avatar to the given rotation and apply a movement in the given relative vector |
2437 | /// </summary> | 2445 | /// </summary> |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index a37e997..eac8e84 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -669,6 +669,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
669 | public event ObjectDrop OnObjectDrop; | 669 | public event ObjectDrop OnObjectDrop; |
670 | public event StartAnim OnStartAnim; | 670 | public event StartAnim OnStartAnim; |
671 | public event StopAnim OnStopAnim; | 671 | public event StopAnim OnStopAnim; |
672 | public event ChangeAnim OnChangeAnim; | ||
672 | public event LinkObjects OnLinkObjects; | 673 | public event LinkObjects OnLinkObjects; |
673 | public event DelinkObjects OnDelinkObjects; | 674 | public event DelinkObjects OnDelinkObjects; |
674 | public event RequestMapBlocks OnRequestMapBlocks; | 675 | public event RequestMapBlocks OnRequestMapBlocks; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index c3335f0..8996865 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -189,6 +189,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
189 | public event ObjectDrop OnObjectDrop; | 189 | public event ObjectDrop OnObjectDrop; |
190 | public event StartAnim OnStartAnim; | 190 | public event StartAnim OnStartAnim; |
191 | public event StopAnim OnStopAnim; | 191 | public event StopAnim OnStopAnim; |
192 | public event ChangeAnim OnChangeAnim; | ||
192 | public event LinkObjects OnLinkObjects; | 193 | public event LinkObjects OnLinkObjects; |
193 | public event DelinkObjects OnDelinkObjects; | 194 | public event DelinkObjects OnDelinkObjects; |
194 | public event RequestMapBlocks OnRequestMapBlocks; | 195 | public event RequestMapBlocks OnRequestMapBlocks; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 0c28bf5..6523c2d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6132,6 +6132,91 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6132 | m_host.AddScriptLPS(1); | 6132 | m_host.AddScriptLPS(1); |
6133 | return "en-us"; | 6133 | return "en-us"; |
6134 | } | 6134 | } |
6135 | /// <summary> | ||
6136 | /// http://wiki.secondlife.com/wiki/LlGetAgentList | ||
6137 | /// The list of options is currently not used in SL | ||
6138 | /// scope is one of:- | ||
6139 | /// AGENT_LIST_REGION - all in the region | ||
6140 | /// AGENT_LIST_PARCEL - all in the same parcel as the scripted object | ||
6141 | /// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the | ||
6142 | /// current parcel. | ||
6143 | /// </summary> | ||
6144 | public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options) | ||
6145 | { | ||
6146 | m_host.AddScriptLPS(1); | ||
6147 | |||
6148 | // the constants are 1, 2 and 4 so bits are being set, but you | ||
6149 | // get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4 | ||
6150 | bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION; | ||
6151 | bool parcelOwned = scope == ScriptBaseClass.AGENT_LIST_PARCEL_OWNER; | ||
6152 | bool parcel = scope == ScriptBaseClass.AGENT_LIST_PARCEL; | ||
6153 | |||
6154 | LSL_List result = new LSL_List(); | ||
6155 | |||
6156 | if (!regionWide && !parcelOwned && !parcel) | ||
6157 | { | ||
6158 | result.Add("INVALID_SCOPE"); | ||
6159 | return result; | ||
6160 | } | ||
6161 | |||
6162 | ILandObject land; | ||
6163 | Vector3 pos; | ||
6164 | UUID id = UUID.Zero; | ||
6165 | if (parcel || parcelOwned) | ||
6166 | { | ||
6167 | pos = m_host.ParentGroup.RootPart.GetWorldPosition(); | ||
6168 | land = World.LandChannel.GetLandObject(pos.X, pos.Y); | ||
6169 | if (land == null) | ||
6170 | { | ||
6171 | id = UUID.Zero; | ||
6172 | } | ||
6173 | else | ||
6174 | { | ||
6175 | if (parcelOwned) | ||
6176 | { | ||
6177 | id = land.LandData.OwnerID; | ||
6178 | } | ||
6179 | else | ||
6180 | { | ||
6181 | id = land.LandData.GlobalID; | ||
6182 | } | ||
6183 | } | ||
6184 | } | ||
6185 | List<UUID> presenceIds = new List<UUID>(); | ||
6186 | |||
6187 | World.ForEachRootScenePresence( | ||
6188 | delegate (ScenePresence ssp) | ||
6189 | { | ||
6190 | // Gods are not listed in SL | ||
6191 | if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent) | ||
6192 | { | ||
6193 | if (!regionWide) | ||
6194 | { | ||
6195 | pos = ssp.AbsolutePosition; | ||
6196 | land = World.LandChannel.GetLandObject(pos.X, pos.Y); | ||
6197 | if (land != null) | ||
6198 | { | ||
6199 | if (parcelOwned && land.LandData.OwnerID == id || | ||
6200 | parcel && land.LandData.GlobalID == id) | ||
6201 | { | ||
6202 | result.Add(ssp.UUID.ToString()); | ||
6203 | } | ||
6204 | } | ||
6205 | } | ||
6206 | else | ||
6207 | { | ||
6208 | result.Add(ssp.UUID.ToString()); | ||
6209 | } | ||
6210 | } | ||
6211 | // Maximum of 100 results | ||
6212 | if (result.Length > 99) | ||
6213 | { | ||
6214 | return; | ||
6215 | } | ||
6216 | } | ||
6217 | ); | ||
6218 | return result; | ||
6219 | } | ||
6135 | 6220 | ||
6136 | public void llAdjustSoundVolume(double volume) | 6221 | public void llAdjustSoundVolume(double volume) |
6137 | { | 6222 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 5c528977..be5740e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -108,6 +108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
108 | LSL_Vector llGetAccel(); | 108 | LSL_Vector llGetAccel(); |
109 | LSL_Integer llGetAgentInfo(string id); | 109 | LSL_Integer llGetAgentInfo(string id); |
110 | LSL_String llGetAgentLanguage(string id); | 110 | LSL_String llGetAgentLanguage(string id); |
111 | LSL_List llGetAgentList(LSL_Integer scope, LSL_List options); | ||
111 | LSL_Vector llGetAgentSize(string id); | 112 | LSL_Vector llGetAgentSize(string id); |
112 | LSL_Float llGetAlpha(int face); | 113 | LSL_Float llGetAlpha(int face); |
113 | LSL_Float llGetAndResetTime(); | 114 | LSL_Float llGetAndResetTime(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 6246b57..278f74e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -500,6 +500,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
500 | public const int OBJECT_STREAMING_COST = 15; | 500 | public const int OBJECT_STREAMING_COST = 15; |
501 | public const int OBJECT_PHYSICS_COST = 16; | 501 | public const int OBJECT_PHYSICS_COST = 16; |
502 | 502 | ||
503 | // for llGetAgentList | ||
504 | public const int AGENT_LIST_PARCEL = 1; | ||
505 | public const int AGENT_LIST_PARCEL_OWNER = 2; | ||
506 | public const int AGENT_LIST_REGION = 4; | ||
507 | |||
503 | // Can not be public const? | 508 | // Can not be public const? |
504 | public static readonly vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); | 509 | public static readonly vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); |
505 | public static readonly rotation ZERO_ROTATION = new rotation(0.0, 0.0, 0.0, 1.0); | 510 | public static readonly rotation ZERO_ROTATION = new rotation(0.0, 0.0, 0.0, 1.0); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 70c5fcd..9ba9561 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -391,6 +391,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
391 | return m_LSL_Functions.llGetAgentLanguage(id); | 391 | return m_LSL_Functions.llGetAgentLanguage(id); |
392 | } | 392 | } |
393 | 393 | ||
394 | public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options) | ||
395 | { | ||
396 | return m_LSL_Functions.llGetAgentList(scope, options); | ||
397 | } | ||
398 | |||
394 | public LSL_Vector llGetAgentSize(string id) | 399 | public LSL_Vector llGetAgentSize(string id) |
395 | { | 400 | { |
396 | return m_LSL_Functions.llGetAgentSize(id); | 401 | return m_LSL_Functions.llGetAgentSize(id); |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6a7cb0a..b2c824c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -88,6 +88,7 @@ namespace OpenSim.Tests.Common.Mock | |||
88 | public event ObjectDrop OnObjectDrop; | 88 | public event ObjectDrop OnObjectDrop; |
89 | public event StartAnim OnStartAnim; | 89 | public event StartAnim OnStartAnim; |
90 | public event StopAnim OnStopAnim; | 90 | public event StopAnim OnStopAnim; |
91 | public event ChangeAnim OnChangeAnim; | ||
91 | public event LinkObjects OnLinkObjects; | 92 | public event LinkObjects OnLinkObjects; |
92 | public event DelinkObjects OnDelinkObjects; | 93 | public event DelinkObjects OnDelinkObjects; |
93 | public event RequestMapBlocks OnRequestMapBlocks; | 94 | public event RequestMapBlocks OnRequestMapBlocks; |