aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorteravus2013-01-21 21:34:49 -0500
committerteravus2013-01-21 21:34:49 -0500
commit6007eae00ff2b1cb451609f5c3da4f85521520c9 (patch)
treede5ccef834b283872959d56257dc9f061c3da099 /OpenSim
parent* The fallthrough of FetchTexture was no longer resulting in a 404 response o... (diff)
parentAdd accessors to allow serializing rot and position targets (diff)
downloadopensim-SC-6007eae00ff2b1cb451609f5c3da4f85521520c9.zip
opensim-SC-6007eae00ff2b1cb451609f5c3da4f85521520c9.tar.gz
opensim-SC-6007eae00ff2b1cb451609f5c3da4f85521520c9.tar.bz2
opensim-SC-6007eae00ff2b1cb451609f5c3da4f85521520c9.tar.xz
Merge remote-tracking branch 'remotes/origin/avination' into teravuswork
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs27
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs257
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
7 files changed, 82 insertions, 309 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 9550b5a..fd82db7 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -897,32 +897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
897 msg.MessageBlock.Message = Util.StringToBytes1024(im.message); 897 msg.MessageBlock.Message = Util.StringToBytes1024(im.message);
898 msg.MessageBlock.BinaryBucket = im.binaryBucket; 898 msg.MessageBlock.BinaryBucket = im.binaryBucket;
899 899
900 if (im.message.StartsWith("[grouptest]")) 900 OutPacket(msg, ThrottleOutPacketType.Task);
901 { // this block is test code for implementing group IM - delete when group IM is finished
902 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
903 if (eq != null)
904 {
905 im.dialog = 17;
906
907 //eq.ChatterboxInvitation(
908 // new UUID("00000000-68f9-1111-024e-222222111123"),
909 // "OpenSimulator Testing", im.fromAgentID, im.message, im.toAgentID, im.fromAgentName, im.dialog, 0,
910 // false, 0, new Vector3(), 1, im.imSessionID, im.fromGroup, im.binaryBucket);
911
912 eq.ChatterboxInvitation(
913 new UUID("00000000-68f9-1111-024e-222222111123"),
914 "OpenSimulator Testing", new UUID(im.fromAgentID), im.message, new UUID(im.toAgentID), im.fromAgentName, im.dialog, 0,
915 false, 0, new Vector3(), 1, new UUID(im.imSessionID), im.fromGroup, Util.StringToBytes256("OpenSimulator Testing"));
916
917 eq.ChatterBoxSessionAgentListUpdates(
918 new UUID("00000000-68f9-1111-024e-222222111123"),
919 new UUID(im.fromAgentID), new UUID(im.toAgentID), false, false, false);
920 }
921
922 Console.WriteLine("SendInstantMessage: " + msg);
923 }
924 else
925 OutPacket(msg, ThrottleOutPacketType.Task);
926 } 901 }
927 } 902 }
928 903
diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
deleted file mode 100644
index af54c1a..0000000
--- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
+++ /dev/null
@@ -1,257 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using Nini.Config;
33using OpenMetaverse;
34using OpenSim.Framework;
35using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes;
37
38using Mono.Addins;
39
40namespace OpenSim.Region.CoreModules.Avatar.Groups
41{
42 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")]
43 public class GroupsModule : ISharedRegionModule
44 {
45 private static readonly ILog m_log =
46 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 private Dictionary<UUID, GroupMembershipData> m_GroupMap =
49 new Dictionary<UUID, GroupMembershipData>();
50
51 private Dictionary<UUID, IClientAPI> m_ClientMap =
52 new Dictionary<UUID, IClientAPI>();
53
54 private UUID opensimulatorGroupID =
55 new UUID("00000000-68f9-1111-024e-222222111123");
56
57 private List<Scene> m_SceneList = new List<Scene>();
58
59 private static GroupMembershipData osGroup =
60 new GroupMembershipData();
61
62 private bool m_Enabled = false;
63
64 #region ISharedRegionModule Members
65
66 public void Initialise(IConfigSource config)
67 {
68 IConfig groupsConfig = config.Configs["Groups"];
69
70 if (groupsConfig == null)
71 {
72 m_log.Info("[GROUPS]: No configuration found. Using defaults");
73 }
74 else
75 {
76 m_Enabled = groupsConfig.GetBoolean("Enabled", false);
77 if (!m_Enabled)
78 {
79 m_log.Info("[GROUPS]: Groups disabled in configuration");
80 return;
81 }
82
83 if (groupsConfig.GetString("Module", "Default") != "Default")
84 return;
85 }
86
87 }
88
89 public void AddRegion(Scene scene)
90 {
91 if (!m_Enabled)
92 return;
93
94 lock (m_SceneList)
95 {
96 if (!m_SceneList.Contains(scene))
97 {
98 if (m_SceneList.Count == 0)
99 {
100 osGroup.GroupID = opensimulatorGroupID;
101 osGroup.GroupName = "OpenSimulator Testing";
102 osGroup.GroupPowers =
103 (uint)(GroupPowers.AllowLandmark |
104 GroupPowers.AllowSetHome);
105 m_GroupMap[opensimulatorGroupID] = osGroup;
106 }
107 m_SceneList.Add(scene);
108 }
109 }
110
111 scene.EventManager.OnNewClient += OnNewClient;
112 scene.EventManager.OnClientClosed += OnClientClosed;
113 // scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
114 }
115
116 public void RemoveRegion(Scene scene)
117 {
118 if (!m_Enabled)
119 return;
120
121 lock (m_SceneList)
122 {
123 if (m_SceneList.Contains(scene))
124 m_SceneList.Remove(scene);
125 }
126
127 scene.EventManager.OnNewClient -= OnNewClient;
128 scene.EventManager.OnClientClosed -= OnClientClosed;
129 }
130
131 public void RegionLoaded(Scene scene)
132 {
133 }
134
135 public void PostInitialise()
136 {
137 }
138
139 public void Close()
140 {
141 if (!m_Enabled)
142 return;
143
144// m_log.Debug("[GROUPS]: Shutting down group module.");
145
146 lock (m_ClientMap)
147 {
148 m_ClientMap.Clear();
149 }
150
151 lock (m_GroupMap)
152 {
153 m_GroupMap.Clear();
154 }
155 }
156
157 public string Name
158 {
159 get { return "GroupsModule"; }
160 }
161
162 public Type ReplaceableInterface
163 {
164 get { return null; }
165 }
166
167 #endregion
168
169 private void OnNewClient(IClientAPI client)
170 {
171 // Subscribe to instant messages
172// client.OnInstantMessage += OnInstantMessage;
173 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
174 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
175 lock (m_ClientMap)
176 {
177 if (!m_ClientMap.ContainsKey(client.AgentId))
178 {
179 m_ClientMap.Add(client.AgentId, client);
180 }
181 }
182
183 GroupMembershipData[] updateGroups = new GroupMembershipData[1];
184 updateGroups[0] = osGroup;
185
186 client.SendGroupMembership(updateGroups);
187 }
188
189 private void OnAgentDataUpdateRequest(IClientAPI remoteClient,
190 UUID AgentID, UUID SessionID)
191 {
192 UUID ActiveGroupID;
193 string ActiveGroupName;
194 ulong ActiveGroupPowers;
195
196 string firstname = remoteClient.FirstName;
197 string lastname = remoteClient.LastName;
198
199 string ActiveGroupTitle = "I IZ N0T";
200
201 ActiveGroupID = osGroup.GroupID;
202 ActiveGroupName = osGroup.GroupName;
203 ActiveGroupPowers = osGroup.GroupPowers;
204
205 remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname,
206 lastname, ActiveGroupPowers, ActiveGroupName,
207 ActiveGroupTitle);
208 }
209
210// private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
211// {
212// }
213
214// private void OnGridInstantMessage(GridInstantMessage msg)
215// {
216// // Trigger the above event handler
217// OnInstantMessage(null, msg);
218// }
219
220 private void HandleUUIDGroupNameRequest(UUID id,IClientAPI remote_client)
221 {
222 string groupnamereply = "Unknown";
223 UUID groupUUID = UUID.Zero;
224
225 lock (m_GroupMap)
226 {
227 if (m_GroupMap.ContainsKey(id))
228 {
229 GroupMembershipData grp = m_GroupMap[id];
230 groupnamereply = grp.GroupName;
231 groupUUID = grp.GroupID;
232 }
233 }
234 remote_client.SendGroupNameReply(groupUUID, groupnamereply);
235 }
236
237 private void OnClientClosed(UUID agentID, Scene scene)
238 {
239 lock (m_ClientMap)
240 {
241 if (m_ClientMap.ContainsKey(agentID))
242 {
243// IClientAPI cli = m_ClientMap[agentID];
244// if (cli != null)
245// {
246// //m_log.Info("[GROUPS]: Removing all reference to groups for " + cli.Name);
247// }
248// else
249// {
250// //m_log.Info("[GROUPS]: Removing all reference to groups for " + agentID.ToString());
251// }
252 m_ClientMap.Remove(agentID);
253 }
254 }
255 }
256 }
257}
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 7e72d47..0c8a2b1 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -150,6 +150,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
150 { 150 {
151 client.OnTeleportHomeRequest += TriggerTeleportHome; 151 client.OnTeleportHomeRequest += TriggerTeleportHome;
152 client.OnTeleportLandmarkRequest += RequestTeleportLandmark; 152 client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
153 client.OnTeleportCancel += TeleportCancel;
153 } 154 }
154 155
155 public virtual void Close() {} 156 public virtual void Close() {}
@@ -993,6 +994,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
993 return neighbourRegion; 994 return neighbourRegion;
994 } 995 }
995 996
997 private void TeleportCancel(IClientAPI remoteClient)
998 {
999 m_entityTransferStateMachine.ResetFromTransit(remoteClient.AgentId);
1000 }
1001
996 public bool Cross(ScenePresence agent, bool isFlying) 1002 public bool Cross(ScenePresence agent, bool isFlying)
997 { 1003 {
998 uint x; 1004 uint x;
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index a0ae203..708b99d 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -42,6 +42,7 @@ using OpenSim.Framework.Servers.HttpServer;
42using OpenSim.Region.Framework.Interfaces; 42using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.Framework.Scenes; 43using OpenSim.Region.Framework.Scenes;
44using Mono.Addins; 44using Mono.Addins;
45using Amib.Threading;
45 46
46/***************************************************** 47/*****************************************************
47 * 48 *
@@ -102,6 +103,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
102 private Dictionary<UUID, HttpRequestClass> m_pendingRequests; 103 private Dictionary<UUID, HttpRequestClass> m_pendingRequests;
103 private Scene m_scene; 104 private Scene m_scene;
104 // private Queue<HttpRequestClass> rpcQueue = new Queue<HttpRequestClass>(); 105 // private Queue<HttpRequestClass> rpcQueue = new Queue<HttpRequestClass>();
106 public static SmartThreadPool ThreadPool = null;
105 107
106 public HttpRequestModule() 108 public HttpRequestModule()
107 { 109 {
@@ -279,7 +281,30 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
279 m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); 281 m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
280 m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); 282 m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
281 283
284 int maxThreads = 50;
285
286 IConfig httpConfig = config.Configs["HttpRequestModule"];
287 if (httpConfig != null)
288 {
289 maxThreads = httpConfig.GetInt("MaxPoolThreads", maxThreads);
290 }
291
282 m_pendingRequests = new Dictionary<UUID, HttpRequestClass>(); 292 m_pendingRequests = new Dictionary<UUID, HttpRequestClass>();
293
294 // First instance sets this up for all sims
295 if (ThreadPool == null)
296 {
297 STPStartInfo startInfo = new STPStartInfo();
298 startInfo.IdleTimeout = 20000;
299 startInfo.MaxWorkerThreads = maxThreads;
300 startInfo.MinWorkerThreads = 5;
301 startInfo.ThreadPriority = ThreadPriority.BelowNormal;
302 startInfo.StartSuspended = true;
303
304 ThreadPool = new SmartThreadPool(startInfo);
305
306 ThreadPool.Start();
307 }
283 } 308 }
284 309
285 public void AddRegion(Scene scene) 310 public void AddRegion(Scene scene)
@@ -340,7 +365,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
340 public string HttpMIMEType = "text/plain;charset=utf-8"; 365 public string HttpMIMEType = "text/plain;charset=utf-8";
341 public int HttpTimeout; 366 public int HttpTimeout;
342 public bool HttpVerifyCert = true; 367 public bool HttpVerifyCert = true;
343 private Thread httpThread; 368 public IWorkItemResult WorkItem = null;
344 369
345 // Request info 370 // Request info
346 private UUID _itemID; 371 private UUID _itemID;
@@ -374,12 +399,16 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
374 399
375 public void Process() 400 public void Process()
376 { 401 {
377 httpThread = new Thread(SendRequest);
378 httpThread.Name = "HttpRequestThread";
379 httpThread.Priority = ThreadPriority.BelowNormal;
380 httpThread.IsBackground = true;
381 _finished = false; 402 _finished = false;
382 httpThread.Start(); 403
404 lock (HttpRequestModule.ThreadPool)
405 WorkItem = HttpRequestModule.ThreadPool.QueueWorkItem(new WorkItemCallback(StpSendWrapper), null);
406 }
407
408 private object StpSendWrapper(object o)
409 {
410 SendRequest();
411 return null;
383 } 412 }
384 413
385 /* 414 /*
@@ -409,13 +438,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
409 { 438 {
410 // We could hijack Connection Group Name to identify 439 // We could hijack Connection Group Name to identify
411 // a desired security exception. But at the moment we'll use a dummy header instead. 440 // a desired security exception. But at the moment we'll use a dummy header instead.
412// Request.ConnectionGroupName = "NoVerify";
413 Request.Headers.Add("NoVerifyCert", "true"); 441 Request.Headers.Add("NoVerifyCert", "true");
414 } 442 }
415// else
416// {
417// Request.ConnectionGroupName="Verify";
418// }
419 if (proxyurl != null && proxyurl.Length > 0) 443 if (proxyurl != null && proxyurl.Length > 0)
420 { 444 {
421 if (proxyexcepts != null && proxyexcepts.Length > 0) 445 if (proxyexcepts != null && proxyexcepts.Length > 0)
@@ -485,9 +509,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
485 509
486 ResponseBody = sb.ToString().Replace("\r", ""); 510 ResponseBody = sb.ToString().Replace("\r", "");
487 } 511 }
488 catch (Exception e) 512 catch (WebException e)
489 { 513 {
490 if (e is WebException && ((WebException)e).Status == WebExceptionStatus.ProtocolError) 514 if (e.Status == WebExceptionStatus.ProtocolError)
491 { 515 {
492 HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response; 516 HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
493 Status = (int)webRsp.StatusCode; 517 Status = (int)webRsp.StatusCode;
@@ -512,6 +536,10 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
512 _finished = true; 536 _finished = true;
513 return; 537 return;
514 } 538 }
539 catch (Exception e)
540 {
541 // Don't crash on anything else
542 }
515 finally 543 finally
516 { 544 {
517 if (response != null) 545 if (response != null)
@@ -525,7 +553,10 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
525 { 553 {
526 try 554 try
527 { 555 {
528 httpThread.Abort(); 556 if (!WorkItem.Cancel())
557 {
558 WorkItem.Abort();
559 }
529 } 560 }
530 catch (Exception) 561 catch (Exception)
531 { 562 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 23006f2..9d07537 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes
282 private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing 282 private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing
283 private volatile bool m_backingup; 283 private volatile bool m_backingup;
284 private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>(); 284 private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>();
285 private Dictionary<UUID, SceneObjectGroup> m_groupsWithTargets = new Dictionary<UUID, SceneObjectGroup>(); 285 private Dictionary<UUID, int> m_groupsWithTargets = new Dictionary<UUID, int>();
286 286
287 private bool m_physics_enabled = true; 287 private bool m_physics_enabled = true;
288 private bool m_scripts_enabled = true; 288 private bool m_scripts_enabled = true;
@@ -1736,7 +1736,7 @@ namespace OpenSim.Region.Framework.Scenes
1736 public void AddGroupTarget(SceneObjectGroup grp) 1736 public void AddGroupTarget(SceneObjectGroup grp)
1737 { 1737 {
1738 lock (m_groupsWithTargets) 1738 lock (m_groupsWithTargets)
1739 m_groupsWithTargets[grp.UUID] = grp; 1739 m_groupsWithTargets[grp.UUID] = 0;
1740 } 1740 }
1741 1741
1742 public void RemoveGroupTarget(SceneObjectGroup grp) 1742 public void RemoveGroupTarget(SceneObjectGroup grp)
@@ -1747,18 +1747,24 @@ namespace OpenSim.Region.Framework.Scenes
1747 1747
1748 private void CheckAtTargets() 1748 private void CheckAtTargets()
1749 { 1749 {
1750 List<SceneObjectGroup> objs = null; 1750 List<UUID> objs = null;
1751 1751
1752 lock (m_groupsWithTargets) 1752 lock (m_groupsWithTargets)
1753 { 1753 {
1754 if (m_groupsWithTargets.Count != 0) 1754 if (m_groupsWithTargets.Count != 0)
1755 objs = new List<SceneObjectGroup>(m_groupsWithTargets.Values); 1755 objs = new List<UUID>(m_groupsWithTargets.Keys);
1756 } 1756 }
1757 1757
1758 if (objs != null) 1758 if (objs != null)
1759 { 1759 {
1760 foreach (SceneObjectGroup entry in objs) 1760 foreach (UUID entry in objs)
1761 entry.checkAtTargets(); 1761 {
1762 SceneObjectGroup grp = GetSceneObjectGroup(entry);
1763 if (grp == null)
1764 m_groupsWithTargets.Remove(entry);
1765 else
1766 grp.checkAtTargets();
1767 }
1762 } 1768 }
1763 } 1769 }
1764 1770
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b474979..ed1bbd8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -79,14 +79,14 @@ namespace OpenSim.Region.Framework.Scenes
79 object_rez = 4194304 79 object_rez = 4194304
80 } 80 }
81 81
82 struct scriptPosTarget 82 public struct scriptPosTarget
83 { 83 {
84 public Vector3 targetPos; 84 public Vector3 targetPos;
85 public float tolerance; 85 public float tolerance;
86 public uint handle; 86 public uint handle;
87 } 87 }
88 88
89 struct scriptRotTarget 89 public struct scriptRotTarget
90 { 90 {
91 public Quaternion targetRot; 91 public Quaternion targetRot;
92 public float tolerance; 92 public float tolerance;
@@ -320,8 +320,18 @@ namespace OpenSim.Region.Framework.Scenes
320 protected SceneObjectPart m_rootPart; 320 protected SceneObjectPart m_rootPart;
321 // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); 321 // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>();
322 322
323 private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>(); 323 private SortedDictionary<uint, scriptPosTarget> m_targets = new SortedDictionary<uint, scriptPosTarget>();
324 private Dictionary<uint, scriptRotTarget> m_rotTargets = new Dictionary<uint, scriptRotTarget>(); 324 private SortedDictionary<uint, scriptRotTarget> m_rotTargets = new SortedDictionary<uint, scriptRotTarget>();
325
326 public SortedDictionary<uint, scriptPosTarget> AtTargets
327 {
328 get { return m_targets; }
329 }
330
331 public SortedDictionary<uint, scriptRotTarget> RotTargets
332 {
333 get { return m_rotTargets; }
334 }
325 335
326 private bool m_scriptListens_atTarget; 336 private bool m_scriptListens_atTarget;
327 private bool m_scriptListens_notAtTarget; 337 private bool m_scriptListens_notAtTarget;
@@ -4112,6 +4122,8 @@ namespace OpenSim.Region.Framework.Scenes
4112 waypoint.handle = handle; 4122 waypoint.handle = handle;
4113 lock (m_rotTargets) 4123 lock (m_rotTargets)
4114 { 4124 {
4125 if (m_rotTargets.Count >= 8)
4126 m_rotTargets.Remove(m_rotTargets.ElementAt(0).Key);
4115 m_rotTargets.Add(handle, waypoint); 4127 m_rotTargets.Add(handle, waypoint);
4116 } 4128 }
4117 m_scene.AddGroupTarget(this); 4129 m_scene.AddGroupTarget(this);
@@ -4137,6 +4149,8 @@ namespace OpenSim.Region.Framework.Scenes
4137 waypoint.handle = handle; 4149 waypoint.handle = handle;
4138 lock (m_targets) 4150 lock (m_targets)
4139 { 4151 {
4152 if (m_targets.Count >= 8)
4153 m_targets.Remove(m_targets.ElementAt(0).Key);
4140 m_targets.Add(handle, waypoint); 4154 m_targets.Add(handle, waypoint);
4141 } 4155 }
4142 m_scene.AddGroupTarget(this); 4156 m_scene.AddGroupTarget(this);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 617f382..fcb68b2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7782,8 +7782,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7782 m_host.AddScriptLPS(1); 7782 m_host.AddScriptLPS(1);
7783 7783
7784 setLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParamsFast"); 7784 setLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParamsFast");
7785
7786 ScriptSleep(200);
7787 } 7785 }
7788 7786
7789 private void setLinkPrimParams(int linknumber, LSL_List rules, string originFunc) 7787 private void setLinkPrimParams(int linknumber, LSL_List rules, string originFunc)