aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs6
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs18
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs186
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs11
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs21
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs3
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs16
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs8
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs2
16 files changed, 266 insertions, 32 deletions
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index b3a4d61..86e7aa0 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Capabilities.Handlers
68 ret["content_type"] = "text/plain"; 68 ret["content_type"] = "text/plain";
69 ret["keepalive"] = false; 69 ret["keepalive"] = false;
70 ret["reusecontext"] = false; 70 ret["reusecontext"] = false;
71 71 ret["int_bytes"] = 0;
72 string textureStr = (string)request["texture_id"]; 72 string textureStr = (string)request["texture_id"];
73 string format = (string)request["format"]; 73 string format = (string)request["format"];
74 74
@@ -223,6 +223,7 @@ namespace OpenSim.Capabilities.Handlers
223 { 223 {
224 response["int_response_code"] = (int)System.Net.HttpStatusCode.OK; 224 response["int_response_code"] = (int)System.Net.HttpStatusCode.OK;
225 response["bin_response_data"] = texture.Data; 225 response["bin_response_data"] = texture.Data;
226 response["int_bytes"] = texture.Data.Length;
226 } 227 }
227 else 228 else
228 { 229 {
@@ -232,6 +233,7 @@ namespace OpenSim.Capabilities.Handlers
232 byte[] d = new byte[len]; 233 byte[] d = new byte[len];
233 Array.Copy(texture.Data, start, d, 0, len); 234 Array.Copy(texture.Data, start, d, 0, len);
234 response["bin_response_data"] = d; 235 response["bin_response_data"] = d;
236 response["int_bytes"] = len;
235 } 237 }
236// response.Body.Write(texture.Data, start, len); 238// response.Body.Write(texture.Data, start, len);
237 } 239 }
@@ -252,6 +254,8 @@ namespace OpenSim.Capabilities.Handlers
252 response["content_type"] = "image/" + format; 254 response["content_type"] = "image/" + format;
253 255
254 response["bin_response_data"] = texture.Data; 256 response["bin_response_data"] = texture.Data;
257 response["int_bytes"] = texture.Data.Length;
258
255// response.Body.Write(texture.Data, 0, texture.Data.Length); 259// response.Body.Write(texture.Data, 0, texture.Data.Length);
256 } 260 }
257 261
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index e718aa6..8c32734 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -312,6 +312,7 @@ namespace OpenSim.Framework
312 public AgentGroupData[] Groups; 312 public AgentGroupData[] Groups;
313 public Animation[] Anims; 313 public Animation[] Anims;
314 public Animation DefaultAnim = null; 314 public Animation DefaultAnim = null;
315 public Animation AnimState = null;
315 316
316 public UUID GranterID; 317 public UUID GranterID;
317 public UUID ParentPart; 318 public UUID ParentPart;
@@ -403,6 +404,11 @@ namespace OpenSim.Framework
403 args["default_animation"] = DefaultAnim.PackUpdateMessage(); 404 args["default_animation"] = DefaultAnim.PackUpdateMessage();
404 } 405 }
405 406
407 if (AnimState != null)
408 {
409 args["animation_state"] = AnimState.PackUpdateMessage();
410 }
411
406 if (Appearance != null) 412 if (Appearance != null)
407 args["packed_appearance"] = Appearance.Pack(); 413 args["packed_appearance"] = Appearance.Pack();
408 414
@@ -612,6 +618,18 @@ namespace OpenSim.Framework
612 } 618 }
613 } 619 }
614 620
621 if (args["animation_state"] != null)
622 {
623 try
624 {
625 AnimState = new Animation((OSDMap)args["animation_state"]);
626 }
627 catch
628 {
629 AnimState = null;
630 }
631 }
632
615 //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) 633 //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
616 //{ 634 //{
617 // OSDArray textures = (OSDArray)(args["agent_textures"]); 635 // OSDArray textures = (OSDArray)(args["agent_textures"]);
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 5909ce1..e31c7f6 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1038,7 +1038,7 @@ namespace OpenSim.Framework
1038 event MuteListEntryRemove OnRemoveMuteListEntry; 1038 event MuteListEntryRemove OnRemoveMuteListEntry;
1039 event GodlikeMessage onGodlikeMessage; 1039 event GodlikeMessage onGodlikeMessage;
1040 event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 1040 event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
1041 1041 event GenericCall2 OnUpdateThrottles;
1042 /// <summary> 1042 /// <summary>
1043 /// Set the debug level at which packet output should be printed to console. 1043 /// Set the debug level at which packet output should be printed to console.
1044 /// </summary> 1044 /// </summary>
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index d1a1583..8cba6c8 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -61,6 +61,13 @@ namespace OpenSim.Region.ClientStack.Linden
61 public Hashtable request; 61 public Hashtable request;
62 } 62 }
63 63
64 public class aPollResponse
65 {
66 public Hashtable response;
67 public int bytes;
68 }
69
70
64 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 71 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
65 72
66 private Scene m_scene; 73 private Scene m_scene;
@@ -75,6 +82,8 @@ namespace OpenSim.Region.ClientStack.Linden
75 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue = 82 private static OpenMetaverse.BlockingQueue<aPollRequest> m_queue =
76 new OpenMetaverse.BlockingQueue<aPollRequest>(); 83 new OpenMetaverse.BlockingQueue<aPollRequest>();
77 84
85 private Dictionary<UUID,PollServiceTextureEventArgs> m_pollservices = new Dictionary<UUID,PollServiceTextureEventArgs>();
86
78 #region ISharedRegionModule Members 87 #region ISharedRegionModule Members
79 88
80 public void Initialise(IConfigSource source) 89 public void Initialise(IConfigSource source)
@@ -91,6 +100,7 @@ namespace OpenSim.Region.ClientStack.Linden
91 { 100 {
92 m_scene.EventManager.OnRegisterCaps -= RegisterCaps; 101 m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
93 m_scene.EventManager.OnDeregisterCaps -= DeregisterCaps; 102 m_scene.EventManager.OnDeregisterCaps -= DeregisterCaps;
103 m_scene.EventManager.OnThrottleUpdate -= ThrottleUpdate;
94 m_scene = null; 104 m_scene = null;
95 } 105 }
96 106
@@ -101,6 +111,7 @@ namespace OpenSim.Region.ClientStack.Linden
101 111
102 m_scene.EventManager.OnRegisterCaps += RegisterCaps; 112 m_scene.EventManager.OnRegisterCaps += RegisterCaps;
103 m_scene.EventManager.OnDeregisterCaps += DeregisterCaps; 113 m_scene.EventManager.OnDeregisterCaps += DeregisterCaps;
114 m_scene.EventManager.OnThrottleUpdate += ThrottleUpdate;
104 115
105 if (m_workerThreads == null) 116 if (m_workerThreads == null)
106 { 117 {
@@ -118,6 +129,56 @@ namespace OpenSim.Region.ClientStack.Linden
118 } 129 }
119 } 130 }
120 } 131 }
132 private int ExtractImageThrottle(byte[] pthrottles)
133 {
134
135 byte[] adjData;
136 int pos = 0;
137
138 if (!BitConverter.IsLittleEndian)
139 {
140 byte[] newData = new byte[7 * 4];
141 Buffer.BlockCopy(pthrottles, 0, newData, 0, 7 * 4);
142
143 for (int i = 0; i < 7; i++)
144 Array.Reverse(newData, i * 4, 4);
145
146 adjData = newData;
147 }
148 else
149 {
150 adjData = pthrottles;
151 }
152
153 // 0.125f converts from bits to bytes
154 //int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
155 //pos += 4;
156 // int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
157 //pos += 4;
158 // int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
159 // pos += 4;
160 // int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
161 // pos += 4;
162 // int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
163 // pos += 4;
164 pos = pos + 20;
165 int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); //pos += 4;
166 //int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
167 return texture;
168 }
169
170 // Now we know when the throttle is changed by the client in the case of a root agent or by a neighbor region in the case of a child agent.
171 public void ThrottleUpdate(ScenePresence p)
172 {
173 byte[] throttles = p.ControllingClient.GetThrottlesPacked(1);
174 UUID user = p.UUID;
175 int imagethrottle = ExtractImageThrottle(throttles);
176 PollServiceTextureEventArgs args;
177 if (m_pollservices.TryGetValue(user,out args))
178 {
179 args.UpdateThrottle(imagethrottle);
180 }
181 }
121 182
122 public void PostInitialise() 183 public void PostInitialise()
123 { 184 {
@@ -145,20 +206,25 @@ namespace OpenSim.Region.ClientStack.Linden
145 { 206 {
146 private List<Hashtable> requests = 207 private List<Hashtable> requests =
147 new List<Hashtable>(); 208 new List<Hashtable>();
148 private Dictionary<UUID, Hashtable> responses = 209 private Dictionary<UUID, aPollResponse> responses =
149 new Dictionary<UUID, Hashtable>(); 210 new Dictionary<UUID, aPollResponse>();
150 211
151 private Scene m_scene; 212 private Scene m_scene;
152 213 private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000);
153 public PollServiceTextureEventArgs(UUID pId, Scene scene) : 214 public PollServiceTextureEventArgs(UUID pId, Scene scene) :
154 base(null, null, null, null, pId, int.MaxValue) 215 base(null, null, null, null, pId, int.MaxValue)
155 { 216 {
156 m_scene = scene; 217 m_scene = scene;
157 218 // x is request id, y is userid
158 HasEvents = (x, y) => 219 HasEvents = (x, y) =>
159 { 220 {
160 lock (responses) 221 lock (responses)
161 return responses.ContainsKey(x); 222 {
223 bool ret = m_throttler.hasEvents(x, responses);
224 m_throttler.ProcessTime();
225 return ret;
226
227 }
162 }; 228 };
163 GetEvents = (x, y) => 229 GetEvents = (x, y) =>
164 { 230 {
@@ -166,7 +232,7 @@ namespace OpenSim.Region.ClientStack.Linden
166 { 232 {
167 try 233 try
168 { 234 {
169 return responses[x]; 235 return responses[x].response;
170 } 236 }
171 finally 237 finally
172 { 238 {
@@ -174,14 +240,14 @@ namespace OpenSim.Region.ClientStack.Linden
174 } 240 }
175 } 241 }
176 }; 242 };
177 243 // x is request id, y is request data hashtable
178 Request = (x, y) => 244 Request = (x, y) =>
179 { 245 {
180 aPollRequest reqinfo = new aPollRequest(); 246 aPollRequest reqinfo = new aPollRequest();
181 reqinfo.thepoll = this; 247 reqinfo.thepoll = this;
182 reqinfo.reqID = x; 248 reqinfo.reqID = x;
183 reqinfo.request = y; 249 reqinfo.request = y;
184 250
185 m_queue.Enqueue(reqinfo); 251 m_queue.Enqueue(reqinfo);
186 }; 252 };
187 253
@@ -223,16 +289,29 @@ namespace OpenSim.Region.ClientStack.Linden
223 response["content_type"] = "text/plain"; 289 response["content_type"] = "text/plain";
224 response["keepalive"] = false; 290 response["keepalive"] = false;
225 response["reusecontext"] = false; 291 response["reusecontext"] = false;
226 292
227 lock (responses) 293 lock (responses)
228 responses[requestID] = response; 294 responses[requestID] = new aPollResponse() {bytes = 0, response = response};
229 295
230 return; 296 return;
231 } 297 }
232 298
233 response = m_getTextureHandler.Handle(requestinfo.request); 299 response = m_getTextureHandler.Handle(requestinfo.request);
234 lock (responses) 300 lock (responses)
235 responses[requestID] = response; 301 {
302 responses[requestID] = new aPollResponse()
303 {
304 bytes = (int) response["int_bytes"],
305 response = response
306 };
307
308 }
309 m_throttler.ProcessTime();
310 }
311
312 internal void UpdateThrottle(int pimagethrottle)
313 {
314 m_throttler.ThrottleBytes = pimagethrottle;
236 } 315 }
237 } 316 }
238 317
@@ -257,19 +336,23 @@ namespace OpenSim.Region.ClientStack.Linden
257 protocol = "https"; 336 protocol = "https";
258 } 337 }
259 caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); 338 caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl));
260 339 m_pollservices.Add(agentID, args);
261 m_capsDict[agentID] = capUrl; 340 m_capsDict[agentID] = capUrl;
262 } 341 }
263 342
264 private void DeregisterCaps(UUID agentID, Caps caps) 343 private void DeregisterCaps(UUID agentID, Caps caps)
265 { 344 {
266 string capUrl; 345 string capUrl;
267 346 PollServiceTextureEventArgs args;
268 if (m_capsDict.TryGetValue(agentID, out capUrl)) 347 if (m_capsDict.TryGetValue(agentID, out capUrl))
269 { 348 {
270 MainServer.Instance.RemoveHTTPHandler("", capUrl); 349 MainServer.Instance.RemoveHTTPHandler("", capUrl);
271 m_capsDict.Remove(agentID); 350 m_capsDict.Remove(agentID);
272 } 351 }
352 if (m_pollservices.TryGetValue(agentID, out args))
353 {
354 m_pollservices.Remove(agentID);
355 }
273 } 356 }
274 357
275 private void DoTextureRequests() 358 private void DoTextureRequests()
@@ -282,4 +365,79 @@ namespace OpenSim.Region.ClientStack.Linden
282 } 365 }
283 } 366 }
284 } 367 }
368
369 internal sealed class CapsDataThrottler
370 {
371
372 private volatile int currenttime = 0;
373 private volatile int lastTimeElapsed = 0;
374 private volatile int BytesSent = 0;
375 private int oversizedImages = 0;
376 public CapsDataThrottler(int pBytes, int max, int min)
377 {
378 ThrottleBytes = pBytes;
379 lastTimeElapsed = Util.EnvironmentTickCount();
380 }
381 public bool hasEvents(UUID key, Dictionary<UUID, GetTextureModule.aPollResponse> responses)
382 {
383 PassTime();
384 // Note, this is called IN LOCK
385 bool haskey = responses.ContainsKey(key);
386 if (!haskey)
387 {
388 return false;
389 }
390 GetTextureModule.aPollResponse response;
391 if (responses.TryGetValue(key,out response))
392 {
393
394 // Normal
395 if (BytesSent + response.bytes <= ThrottleBytes)
396 {
397 BytesSent += response.bytes;
398 //TimeBasedAction timeBasedAction = new TimeBasedAction { byteRemoval = response.bytes, requestId = key, timeMS = currenttime + 1000, unlockyn = false };
399 //m_actions.Add(timeBasedAction);
400 return true;
401 }
402 // Big textures
403 else if (response.bytes > ThrottleBytes && oversizedImages <= ((ThrottleBytes%50000) + 1))
404 {
405 Interlocked.Increment(ref oversizedImages);
406 BytesSent += response.bytes;
407 //TimeBasedAction timeBasedAction = new TimeBasedAction { byteRemoval = response.bytes, requestId = key, timeMS = currenttime + (((response.bytes % ThrottleBytes)+1)*1000) , unlockyn = false };
408 //m_actions.Add(timeBasedAction);
409 return true;
410 }
411 else
412 {
413 return false;
414 }
415 }
416
417 return haskey;
418 }
419 public void ProcessTime()
420 {
421 PassTime();
422 }
423
424
425 private void PassTime()
426 {
427 currenttime = Util.EnvironmentTickCount();
428 int timeElapsed = Util.EnvironmentTickCountSubtract(currenttime, lastTimeElapsed);
429 //processTimeBasedActions(responses);
430 if (Util.EnvironmentTickCountSubtract(currenttime, timeElapsed) >= 1000)
431 {
432 lastTimeElapsed = Util.EnvironmentTickCount();
433 BytesSent -= ThrottleBytes;
434 if (BytesSent < 0) BytesSent = 0;
435 if (BytesSent < ThrottleBytes)
436 {
437 oversizedImages = 0;
438 }
439 }
440 }
441 public int ThrottleBytes;
442 }
285} 443}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index ee28914..ae9ed7f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -295,6 +295,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
295 public event MuteListEntryRemove OnRemoveMuteListEntry; 295 public event MuteListEntryRemove OnRemoveMuteListEntry;
296 public event GodlikeMessage onGodlikeMessage; 296 public event GodlikeMessage onGodlikeMessage;
297 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 297 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
298 public event GenericCall2 OnUpdateThrottles;
298 299
299 #endregion Events 300 #endregion Events
300 301
@@ -6729,6 +6730,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6729 #endregion 6730 #endregion
6730 6731
6731 m_udpClient.SetThrottles(atpack.Throttle.Throttles); 6732 m_udpClient.SetThrottles(atpack.Throttle.Throttles);
6733 GenericCall2 handler = OnUpdateThrottles;
6734 if (handler != null)
6735 {
6736 handler();
6737 }
6732 return true; 6738 return true;
6733 } 6739 }
6734 6740
@@ -11870,6 +11876,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11870 public void SetChildAgentThrottle(byte[] throttles) 11876 public void SetChildAgentThrottle(byte[] throttles)
11871 { 11877 {
11872 m_udpClient.SetThrottles(throttles); 11878 m_udpClient.SetThrottles(throttles);
11879 GenericCall2 handler = OnUpdateThrottles;
11880 if (handler != null)
11881 {
11882 handler();
11883 }
11873 } 11884 }
11874 11885
11875 /// <summary> 11886 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index c14cb17..8176989 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -409,16 +409,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
409 "received inventory" + reason, false); 409 "received inventory" + reason, false);
410 } 410 }
411 411
412 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); 412 if (im.dialog == (byte)InstantMessageDialog.InventoryDeclined)
413
414 if (user != null) // Local
415 {
416 user.ControllingClient.SendInstantMessage(im);
417 }
418 else
419 { 413 {
420 if (m_TransferModule != null) 414 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
421 m_TransferModule.SendInstantMessage(im, delegate(bool success) {}); 415
416 if (user != null) // Local
417 {
418 user.ControllingClient.SendInstantMessage(im);
419 }
420 else
421 {
422 if (m_TransferModule != null)
423 m_TransferModule.SendInstantMessage(im, delegate(bool success) { });
424 }
422 } 425 }
423 } 426 }
424 } 427 }
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
index f49641f..f524490 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -153,6 +153,9 @@ namespace OpenSim.Region.CoreModules.World.LightShare
153 153
154 public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) 154 public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
155 { 155 {
156 if (client == null)
157 return;
158
156 if (m_enableWindlight) 159 if (m_enableWindlight)
157 { 160 {
158 if (m_scene.RegionInfo.WindlightSettings.valid) 161 if (m_scene.RegionInfo.WindlightSettings.valid)
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
index ed71a95..a76ffde 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Collections.Generic;
30using OpenMetaverse; 31using OpenMetaverse;
31 32
32namespace OpenSim.Region.Framework.Interfaces 33namespace OpenSim.Region.Framework.Interfaces
@@ -70,6 +71,7 @@ namespace OpenSim.Region.Framework.Interfaces
70 /// For constants 71 /// For constants
71 void RegisterConstant(string cname, object value); 72 void RegisterConstant(string cname, object value);
72 object LookupModConstant(string cname); 73 object LookupModConstant(string cname);
74 Dictionary<string, object> GetConstants();
73 75
74 // For use ONLY by the script API 76 // For use ONLY by the script API
75 void RaiseEvent(UUID script, string id, string module, string command, string key); 77 void RaiseEvent(UUID script, string id, string module, string command, string key);
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 7916c42..4a19c3b 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -376,6 +376,10 @@ namespace OpenSim.Region.Framework.Scenes
376 public event ParcelPrimCountTainted OnParcelPrimCountTainted; 376 public event ParcelPrimCountTainted OnParcelPrimCountTainted;
377 public event GetScriptRunning OnGetScriptRunning; 377 public event GetScriptRunning OnGetScriptRunning;
378 378
379 public delegate void ThrottleUpdate(ScenePresence scenePresence);
380
381 public event ThrottleUpdate OnThrottleUpdate;
382
379 /// <summary> 383 /// <summary>
380 /// RegisterCapsEvent is called by Scene after the Caps object 384 /// RegisterCapsEvent is called by Scene after the Caps object
381 /// has been instantiated and before it is return to the 385 /// has been instantiated and before it is return to the
@@ -2641,5 +2645,14 @@ namespace OpenSim.Region.Framework.Scenes
2641 } 2645 }
2642 } 2646 }
2643 } 2647 }
2648
2649 public void TriggerThrottleUpdate(ScenePresence scenePresence)
2650 {
2651 ThrottleUpdate handler = OnThrottleUpdate;
2652 if (handler != null)
2653 {
2654 handler(scenePresence);
2655 }
2656 }
2644 } 2657 }
2645} 2658}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 49b771f..165dd85 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -813,7 +813,7 @@ namespace OpenSim.Region.Framework.Scenes
813 actor.Orientation = GetWorldRotation(); 813 actor.Orientation = GetWorldRotation();
814 814
815 // Tell the physics engines that this prim changed. 815 // Tell the physics engines that this prim changed.
816 if (ParentGroup.Scene != null) 816 if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
817 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); 817 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
818 } 818 }
819 819
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a8aa551..2b9665c 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -793,6 +793,7 @@ namespace OpenSim.Region.Framework.Scenes
793 ControllingClient.OnChangeAnim += avnHandleChangeAnim; 793 ControllingClient.OnChangeAnim += avnHandleChangeAnim;
794 ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; 794 ControllingClient.OnForceReleaseControls += HandleForceReleaseControls;
795 ControllingClient.OnAutoPilotGo += MoveToTarget; 795 ControllingClient.OnAutoPilotGo += MoveToTarget;
796 ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles;
796 797
797 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 798 // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
798 // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 799 // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -3166,6 +3167,10 @@ namespace OpenSim.Region.Framework.Scenes
3166 } 3167 }
3167 3168
3168 private static Vector3 marker = new Vector3(-1f, -1f, -1f); 3169 private static Vector3 marker = new Vector3(-1f, -1f, -1f);
3170 private void RaiseUpdateThrottles()
3171 {
3172 m_scene.EventManager.TriggerThrottleUpdate(this);
3173 }
3169 /// <summary> 3174 /// <summary>
3170 /// This updates important decision making data about a child agent 3175 /// This updates important decision making data about a child agent
3171 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region 3176 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index a484300..28b8293 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -873,6 +873,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
873 public event MuteListEntryRemove OnRemoveMuteListEntry; 873 public event MuteListEntryRemove OnRemoveMuteListEntry;
874 public event GodlikeMessage onGodlikeMessage; 874 public event GodlikeMessage onGodlikeMessage;
875 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 875 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
876 public event GenericCall2 OnUpdateThrottles;
876 877
877#pragma warning restore 67 878#pragma warning restore 67
878 879
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
index 705a847..c5c96a9 100644
--- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -302,6 +302,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms
302 return null; 302 return null;
303 } 303 }
304 304
305 /// <summary>
306 /// Get all registered constants
307 /// </summary>
308 public Dictionary<string, object> GetConstants()
309 {
310 Dictionary<string, object> ret = new Dictionary<string, object>();
311
312 lock (m_constants)
313 {
314 foreach (KeyValuePair<string, object> kvp in m_constants)
315 ret[kvp.Key] = kvp.Value;
316 }
317
318 return ret;
319 }
320
305#endregion 321#endregion
306 322
307 } 323 }
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 7c693b6..6c8e2fc 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -473,7 +473,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
473 public event MuteListEntryRemove OnRemoveMuteListEntry; 473 public event MuteListEntryRemove OnRemoveMuteListEntry;
474 public event GodlikeMessage onGodlikeMessage; 474 public event GodlikeMessage onGodlikeMessage;
475 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 475 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
476 476 public event GenericCall2 OnUpdateThrottles;
477#pragma warning restore 67 477#pragma warning restore 67
478 478
479 #endregion 479 #endregion
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
index 7429293..7688e0f 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
@@ -153,9 +153,9 @@ namespace OpenSim.Services.Connectors
153 } 153 }
154 catch (Exception e) 154 catch (Exception e)
155 { 155 {
156 m_log.WarnFormat( 156// m_log.WarnFormat(
157 "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", 157// "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}",
158 thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); 158// thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace);
159 159
160 return false; 160 return false;
161 } 161 }
@@ -202,4 +202,4 @@ namespace OpenSim.Services.Connectors
202 return true; 202 return true;
203 } 203 }
204 } 204 }
205} \ No newline at end of file 205}
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 49a8d26..78bb18e 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -320,7 +320,7 @@ namespace OpenSim.Tests.Common.Mock
320 public event MuteListEntryRemove OnRemoveMuteListEntry; 320 public event MuteListEntryRemove OnRemoveMuteListEntry;
321 public event GodlikeMessage onGodlikeMessage; 321 public event GodlikeMessage onGodlikeMessage;
322 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 322 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
323 323 public event GenericCall2 OnUpdateThrottles;
324#pragma warning restore 67 324#pragma warning restore 67
325 325
326 /// <value> 326 /// <value>