aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs326
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs279
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs51
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Properties/AssemblyInfo.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs25
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
12 files changed, 479 insertions, 293 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index 6879ebb..1e19032 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -37,6 +37,8 @@ using OpenSim.Region.ScriptEngine.Interfaces;
37using OpenSim.Region.ScriptEngine.Shared; 37using OpenSim.Region.ScriptEngine.Shared;
38using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; 38using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
39using Timer=OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer; 39using Timer=OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer;
40using System.Reflection;
41using log4net;
40 42
41namespace OpenSim.Region.ScriptEngine.Shared.Api 43namespace OpenSim.Region.ScriptEngine.Shared.Api
42{ 44{
@@ -45,15 +47,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
45 /// </summary> 47 /// </summary>
46 public class AsyncCommandManager 48 public class AsyncCommandManager
47 { 49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51
48 private static Thread cmdHandlerThread; 52 private static Thread cmdHandlerThread;
49 private static int cmdHandlerThreadCycleSleepms; 53 private static int cmdHandlerThreadCycleSleepms;
50 54
51 private static List<IScene> m_Scenes = new List<IScene>(); 55 /// <summary>
56 /// Lock for reading/writing static components of AsyncCommandManager.
57 /// </summary>
58 /// <remarks>
59 /// This lock exists so that multiple threads from different engines and/or different copies of the same engine
60 /// are prevented from running non-thread safe code (e.g. read/write of lists) concurrently.
61 /// </remarks>
62 private static object staticLock = new object();
63
52 private static List<IScriptEngine> m_ScriptEngines = 64 private static List<IScriptEngine> m_ScriptEngines =
53 new List<IScriptEngine>(); 65 new List<IScriptEngine>();
54 66
55 public IScriptEngine m_ScriptEngine; 67 public IScriptEngine m_ScriptEngine;
56 private IScene m_Scene;
57 68
58 private static Dictionary<IScriptEngine, Dataserver> m_Dataserver = 69 private static Dictionary<IScriptEngine, Dataserver> m_Dataserver =
59 new Dictionary<IScriptEngine, Dataserver>(); 70 new Dictionary<IScriptEngine, Dataserver>();
@@ -70,67 +81,99 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
70 81
71 public Dataserver DataserverPlugin 82 public Dataserver DataserverPlugin
72 { 83 {
73 get { return m_Dataserver[m_ScriptEngine]; } 84 get
85 {
86 lock (staticLock)
87 return m_Dataserver[m_ScriptEngine];
88 }
74 } 89 }
75 90
76 public Timer TimerPlugin 91 public Timer TimerPlugin
77 { 92 {
78 get { return m_Timer[m_ScriptEngine]; } 93 get
94 {
95 lock (staticLock)
96 return m_Timer[m_ScriptEngine];
97 }
79 } 98 }
80 99
81 public HttpRequest HttpRequestPlugin 100 public HttpRequest HttpRequestPlugin
82 { 101 {
83 get { return m_HttpRequest[m_ScriptEngine]; } 102 get
103 {
104 lock (staticLock)
105 return m_HttpRequest[m_ScriptEngine];
106 }
84 } 107 }
85 108
86 public Listener ListenerPlugin 109 public Listener ListenerPlugin
87 { 110 {
88 get { return m_Listener[m_ScriptEngine]; } 111 get
112 {
113 lock (staticLock)
114 return m_Listener[m_ScriptEngine];
115 }
89 } 116 }
90 117
91 public SensorRepeat SensorRepeatPlugin 118 public SensorRepeat SensorRepeatPlugin
92 { 119 {
93 get { return m_SensorRepeat[m_ScriptEngine]; } 120 get
121 {
122 lock (staticLock)
123 return m_SensorRepeat[m_ScriptEngine];
124 }
94 } 125 }
95 126
96 public XmlRequest XmlRequestPlugin 127 public XmlRequest XmlRequestPlugin
97 { 128 {
98 get { return m_XmlRequest[m_ScriptEngine]; } 129 get
130 {
131 lock (staticLock)
132 return m_XmlRequest[m_ScriptEngine];
133 }
99 } 134 }
100 135
101 public IScriptEngine[] ScriptEngines 136 public IScriptEngine[] ScriptEngines
102 { 137 {
103 get { return m_ScriptEngines.ToArray(); } 138 get
139 {
140 lock (staticLock)
141 return m_ScriptEngines.ToArray();
142 }
104 } 143 }
105 144
106 public AsyncCommandManager(IScriptEngine _ScriptEngine) 145 public AsyncCommandManager(IScriptEngine _ScriptEngine)
107 { 146 {
108 m_ScriptEngine = _ScriptEngine; 147 m_ScriptEngine = _ScriptEngine;
109 m_Scene = m_ScriptEngine.World; 148
110 149 // If there is more than one scene in the simulator or multiple script engines are used on the same region
111 if (m_Scenes.Count == 0) 150 // then more than one thread could arrive at this block of code simultaneously. However, it cannot be
112 ReadConfig(); 151 // executed concurrently both because concurrent list operations are not thread-safe and because of other
113 152 // race conditions such as the later check of cmdHandlerThread == null.
114 if (!m_Scenes.Contains(m_Scene)) 153 lock (staticLock)
115 m_Scenes.Add(m_Scene); 154 {
116 if (!m_ScriptEngines.Contains(m_ScriptEngine)) 155 if (m_ScriptEngines.Count == 0)
117 m_ScriptEngines.Add(m_ScriptEngine); 156 ReadConfig();
118 157
119 // Create instances of all plugins 158 if (!m_ScriptEngines.Contains(m_ScriptEngine))
120 if (!m_Dataserver.ContainsKey(m_ScriptEngine)) 159 m_ScriptEngines.Add(m_ScriptEngine);
121 m_Dataserver[m_ScriptEngine] = new Dataserver(this); 160
122 if (!m_Timer.ContainsKey(m_ScriptEngine)) 161 // Create instances of all plugins
123 m_Timer[m_ScriptEngine] = new Timer(this); 162 if (!m_Dataserver.ContainsKey(m_ScriptEngine))
124 if (!m_HttpRequest.ContainsKey(m_ScriptEngine)) 163 m_Dataserver[m_ScriptEngine] = new Dataserver(this);
125 m_HttpRequest[m_ScriptEngine] = new HttpRequest(this); 164 if (!m_Timer.ContainsKey(m_ScriptEngine))
126 if (!m_Listener.ContainsKey(m_ScriptEngine)) 165 m_Timer[m_ScriptEngine] = new Timer(this);
127 m_Listener[m_ScriptEngine] = new Listener(this); 166 if (!m_HttpRequest.ContainsKey(m_ScriptEngine))
128 if (!m_SensorRepeat.ContainsKey(m_ScriptEngine)) 167 m_HttpRequest[m_ScriptEngine] = new HttpRequest(this);
129 m_SensorRepeat[m_ScriptEngine] = new SensorRepeat(this); 168 if (!m_Listener.ContainsKey(m_ScriptEngine))
130 if (!m_XmlRequest.ContainsKey(m_ScriptEngine)) 169 m_Listener[m_ScriptEngine] = new Listener(this);
131 m_XmlRequest[m_ScriptEngine] = new XmlRequest(this); 170 if (!m_SensorRepeat.ContainsKey(m_ScriptEngine))
132 171 m_SensorRepeat[m_ScriptEngine] = new SensorRepeat(this);
133 StartThread(); 172 if (!m_XmlRequest.ContainsKey(m_ScriptEngine))
173 m_XmlRequest[m_ScriptEngine] = new XmlRequest(this);
174
175 StartThread();
176 }
134 } 177 }
135 178
136 private static void StartThread() 179 private static void StartThread()
@@ -179,42 +222,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
179 { 222 {
180 try 223 try
181 { 224 {
182 while (true) 225 Thread.Sleep(cmdHandlerThreadCycleSleepms);
183 {
184 Thread.Sleep(cmdHandlerThreadCycleSleepms);
185 226
186 DoOneCmdHandlerPass(); 227 DoOneCmdHandlerPass();
187 228
188 Watchdog.UpdateThread(); 229 Watchdog.UpdateThread();
189 }
190 } 230 }
191 catch 231 catch (Exception e)
192 { 232 {
233 m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
193 } 234 }
194 } 235 }
195 } 236 }
196 237
197 private static void DoOneCmdHandlerPass() 238 private static void DoOneCmdHandlerPass()
198 { 239 {
199 // Check HttpRequests 240 lock (staticLock)
200 m_HttpRequest[m_ScriptEngines[0]].CheckHttpRequests(); 241 {
242 // Check HttpRequests
243 m_HttpRequest[m_ScriptEngines[0]].CheckHttpRequests();
201 244
202 // Check XMLRPCRequests 245 // Check XMLRPCRequests
203 m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); 246 m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests();
204 247
205 foreach (IScriptEngine s in m_ScriptEngines) 248 foreach (IScriptEngine s in m_ScriptEngines)
206 { 249 {
207 // Check Listeners 250 // Check Listeners
208 m_Listener[s].CheckListeners(); 251 m_Listener[s].CheckListeners();
209 252
210 // Check timers 253 // Check timers
211 m_Timer[s].CheckTimerEvents(); 254 m_Timer[s].CheckTimerEvents();
212 255
213 // Check Sensors 256 // Check Sensors
214 m_SensorRepeat[s].CheckSenseRepeaterEvents(); 257 m_SensorRepeat[s].CheckSenseRepeaterEvents();
215 258
216 // Check dataserver 259 // Check dataserver
217 m_Dataserver[s].ExpireRequests(); 260 m_Dataserver[s].ExpireRequests();
261 }
218 } 262 }
219 } 263 }
220 264
@@ -226,31 +270,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
226 public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID) 270 public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID)
227 { 271 {
228 // Remove a specific script 272 // Remove a specific script
273// m_log.DebugFormat("[ASYNC COMMAND MANAGER]: Removing facilities for script {0}", itemID);
229 274
230 // Remove dataserver events 275 lock (staticLock)
231 m_Dataserver[engine].RemoveEvents(localID, itemID); 276 {
277 // Remove dataserver events
278 m_Dataserver[engine].RemoveEvents(localID, itemID);
232 279
233 // Remove from: Timers 280 // Remove from: Timers
234 m_Timer[engine].UnSetTimerEvents(localID, itemID); 281 m_Timer[engine].UnSetTimerEvents(localID, itemID);
235 282
236 // Remove from: HttpRequest 283 // Remove from: HttpRequest
237 IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>(); 284 IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>();
238 if (iHttpReq != null) 285 if (iHttpReq != null)
239 iHttpReq.StopHttpRequest(localID, itemID); 286 iHttpReq.StopHttpRequest(localID, itemID);
240 287
241 IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); 288 IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>();
242 if (comms != null) 289 if (comms != null)
243 comms.DeleteListener(itemID); 290 comms.DeleteListener(itemID);
244 291
245 IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); 292 IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>();
246 if (xmlrpc != null) 293 if (xmlrpc != null)
247 { 294 {
248 xmlrpc.DeleteChannels(itemID); 295 xmlrpc.DeleteChannels(itemID);
249 xmlrpc.CancelSRDRequests(itemID); 296 xmlrpc.CancelSRDRequests(itemID);
250 } 297 }
251 298
252 // Remove Sensors 299 // Remove Sensors
253 m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); 300 m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
301 }
254 } 302 }
255 303
256 /// <summary> 304 /// <summary>
@@ -260,10 +308,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
260 /// <returns></returns> 308 /// <returns></returns>
261 public static SensorRepeat GetSensorRepeatPlugin(IScriptEngine engine) 309 public static SensorRepeat GetSensorRepeatPlugin(IScriptEngine engine)
262 { 310 {
263 if (m_SensorRepeat.ContainsKey(engine)) 311 lock (staticLock)
264 return m_SensorRepeat[engine]; 312 {
265 else 313 if (m_SensorRepeat.ContainsKey(engine))
266 return null; 314 return m_SensorRepeat[engine];
315 else
316 return null;
317 }
267 } 318 }
268 319
269 /// <summary> 320 /// <summary>
@@ -273,10 +324,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
273 /// <returns></returns> 324 /// <returns></returns>
274 public static Dataserver GetDataserverPlugin(IScriptEngine engine) 325 public static Dataserver GetDataserverPlugin(IScriptEngine engine)
275 { 326 {
276 if (m_Dataserver.ContainsKey(engine)) 327 lock (staticLock)
277 return m_Dataserver[engine]; 328 {
278 else 329 if (m_Dataserver.ContainsKey(engine))
279 return null; 330 return m_Dataserver[engine];
331 else
332 return null;
333 }
280 } 334 }
281 335
282 /// <summary> 336 /// <summary>
@@ -286,10 +340,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
286 /// <returns></returns> 340 /// <returns></returns>
287 public static Timer GetTimerPlugin(IScriptEngine engine) 341 public static Timer GetTimerPlugin(IScriptEngine engine)
288 { 342 {
289 if (m_Timer.ContainsKey(engine)) 343 lock (staticLock)
290 return m_Timer[engine]; 344 {
291 else 345 if (m_Timer.ContainsKey(engine))
292 return null; 346 return m_Timer[engine];
347 else
348 return null;
349 }
293 } 350 }
294 351
295 /// <summary> 352 /// <summary>
@@ -299,10 +356,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
299 /// <returns></returns> 356 /// <returns></returns>
300 public static Listener GetListenerPlugin(IScriptEngine engine) 357 public static Listener GetListenerPlugin(IScriptEngine engine)
301 { 358 {
302 if (m_Listener.ContainsKey(engine)) 359 lock (staticLock)
303 return m_Listener[engine]; 360 {
304 else 361 if (m_Listener.ContainsKey(engine))
305 return null; 362 return m_Listener[engine];
363 else
364 return null;
365 }
306 } 366 }
307 367
308 public static void StateChange(IScriptEngine engine, uint localID, UUID itemID) 368 public static void StateChange(IScriptEngine engine, uint localID, UUID itemID)
@@ -332,28 +392,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
332 { 392 {
333 List<Object> data = new List<Object>(); 393 List<Object> data = new List<Object>();
334 394
335 Object[] listeners = m_Listener[engine].GetSerializationData(itemID); 395 lock (staticLock)
336 if (listeners.Length > 0)
337 { 396 {
338 data.Add("listener"); 397 Object[] listeners = m_Listener[engine].GetSerializationData(itemID);
339 data.Add(listeners.Length); 398 if (listeners.Length > 0)
340 data.AddRange(listeners); 399 {
341 } 400 data.Add("listener");
401 data.Add(listeners.Length);
402 data.AddRange(listeners);
403 }
342 404
343 Object[] timers=m_Timer[engine].GetSerializationData(itemID); 405 Object[] timers=m_Timer[engine].GetSerializationData(itemID);
344 if (timers.Length > 0) 406 if (timers.Length > 0)
345 { 407 {
346 data.Add("timer"); 408 data.Add("timer");
347 data.Add(timers.Length); 409 data.Add(timers.Length);
348 data.AddRange(timers); 410 data.AddRange(timers);
349 } 411 }
350 412
351 Object[] sensors = m_SensorRepeat[engine].GetSerializationData(itemID); 413 Object[] sensors = m_SensorRepeat[engine].GetSerializationData(itemID);
352 if (sensors.Length > 0) 414 if (sensors.Length > 0)
353 { 415 {
354 data.Add("sensor"); 416 data.Add("sensor");
355 data.Add(sensors.Length); 417 data.Add(sensors.Length);
356 data.AddRange(sensors); 418 data.AddRange(sensors);
419 }
357 } 420 }
358 421
359 return data.ToArray(); 422 return data.ToArray();
@@ -378,41 +441,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
378 441
379 idx+=len; 442 idx+=len;
380 443
444 lock (staticLock)
445 {
381 switch (type) 446 switch (type)
382 { 447 {
383 case "listener": 448 case "listener":
384 m_Listener[engine].CreateFromData(localID, itemID, 449 m_Listener[engine].CreateFromData(localID, itemID,
385 hostID, item); 450 hostID, item);
386 break; 451 break;
387 case "timer": 452 case "timer":
388 m_Timer[engine].CreateFromData(localID, itemID, 453 m_Timer[engine].CreateFromData(localID, itemID,
389 hostID, item); 454 hostID, item);
390 break; 455 break;
391 case "sensor": 456 case "sensor":
392 m_SensorRepeat[engine].CreateFromData(localID, 457 m_SensorRepeat[engine].CreateFromData(localID,
393 itemID, hostID, item); 458 itemID, hostID, item);
394 break; 459 break;
460 }
395 } 461 }
396 } 462 }
397 } 463 }
398 } 464 }
399
400 #region Check llRemoteData channels
401
402 #endregion
403
404 #region Check llListeners
405
406 #endregion
407
408 /// <summary>
409 /// If set to true then threads and stuff should try to make a graceful exit
410 /// </summary>
411 public bool PleaseShutdown
412 {
413 get { return _PleaseShutdown; }
414 set { _PleaseShutdown = value; }
415 }
416 private bool _PleaseShutdown = false;
417 } 465 }
418} 466}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index e72b3dd..b569194 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1664,6 +1664,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1664 m_host.SetFaceColorAlpha(face, color, null); 1664 m_host.SetFaceColorAlpha(face, color, null);
1665 } 1665 }
1666 1666
1667 /*
1668 public void llSetContentType(LSL_Key id, LSL_Integer type)
1669 {
1670 m_host.AddScriptLPS(1);
1671
1672 if (m_UrlModule == null)
1673 return;
1674
1675 // Make sure the content type is text/plain to start with
1676 m_UrlModule.HttpContentType(new UUID(id), "text/plain");
1677
1678 // Is the object owner online and in the region
1679 ScenePresence agent = World.GetScenePresence(m_host.ParentGroup.OwnerID);
1680 if (agent == null || agent.IsChildAgent)
1681 return; // Fail if the owner is not in the same region
1682
1683 // Is it the embeded browser?
1684 string userAgent = m_UrlModule.GetHttpHeader(new UUID(id), "user-agent");
1685 if (userAgent.IndexOf("SecondLife") < 0)
1686 return; // Not the embedded browser. Is this check good enough?
1687
1688 // Use the IP address of the client and check against the request
1689 // seperate logins from the same IP will allow all of them to get non-text/plain as long
1690 // as the owner is in the region. Same as SL!
1691 string logonFromIPAddress = agent.ControllingClient.RemoteEndPoint.Address.ToString();
1692 string requestFromIPAddress = m_UrlModule.GetHttpHeader(new UUID(id), "remote_addr");
1693 //m_log.Debug("IP from header='" + requestFromIPAddress + "' IP from endpoint='" + logonFromIPAddress + "'");
1694 if (requestFromIPAddress == null || requestFromIPAddress.Trim() == "")
1695 return;
1696 if (logonFromIPAddress == null || logonFromIPAddress.Trim() == "")
1697 return;
1698
1699 // If the request isnt from the same IP address then the request cannot be from the owner
1700 if (!requestFromIPAddress.Trim().Equals(logonFromIPAddress.Trim()))
1701 return;
1702
1703 switch (type)
1704 {
1705 case ScriptBaseClass.CONTENT_TYPE_HTML:
1706 m_UrlModule.HttpContentType(new UUID(id), "text/html");
1707 break;
1708 case ScriptBaseClass.CONTENT_TYPE_XML:
1709 m_UrlModule.HttpContentType(new UUID(id), "application/xml");
1710 break;
1711 case ScriptBaseClass.CONTENT_TYPE_XHTML:
1712 m_UrlModule.HttpContentType(new UUID(id), "application/xhtml+xml");
1713 break;
1714 case ScriptBaseClass.CONTENT_TYPE_ATOM:
1715 m_UrlModule.HttpContentType(new UUID(id), "application/atom+xml");
1716 break;
1717 case ScriptBaseClass.CONTENT_TYPE_JSON:
1718 m_UrlModule.HttpContentType(new UUID(id), "application/json");
1719 break;
1720 case ScriptBaseClass.CONTENT_TYPE_LLSD:
1721 m_UrlModule.HttpContentType(new UUID(id), "application/llsd+xml");
1722 break;
1723 case ScriptBaseClass.CONTENT_TYPE_FORM:
1724 m_UrlModule.HttpContentType(new UUID(id), "application/x-www-form-urlencoded");
1725 break;
1726 case ScriptBaseClass.CONTENT_TYPE_RSS:
1727 m_UrlModule.HttpContentType(new UUID(id), "application/rss+xml");
1728 break;
1729 default:
1730 m_UrlModule.HttpContentType(new UUID(id), "text/plain");
1731 break;
1732 }
1733 }
1734 */
1735
1667 public void SetTexGen(SceneObjectPart part, int face,int style) 1736 public void SetTexGen(SceneObjectPart part, int face,int style)
1668 { 1737 {
1669 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) 1738 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
@@ -2772,9 +2841,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2772 // send the sound, once, to all clients in range 2841 // send the sound, once, to all clients in range
2773 if (m_SoundModule != null) 2842 if (m_SoundModule != null)
2774 { 2843 {
2775 m_SoundModule.SendSound(m_host.UUID, 2844 m_SoundModule.SendSound(
2776 ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0, 2845 m_host.UUID,
2777 0, false, false); 2846 ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound),
2847 volume, false, 0,
2848 0, false, false);
2778 } 2849 }
2779 } 2850 }
2780 2851
@@ -2784,7 +2855,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2784 if (m_SoundModule != null) 2855 if (m_SoundModule != null)
2785 { 2856 {
2786 m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), 2857 m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound),
2787 volume, 20, false); 2858 volume, 20, false,false);
2788 } 2859 }
2789 } 2860 }
2790 2861
@@ -2794,16 +2865,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2794 if (m_SoundModule != null) 2865 if (m_SoundModule != null)
2795 { 2866 {
2796 m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), 2867 m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound),
2797 volume, 20, true); 2868 volume, 20, true, false);
2798 } 2869 }
2799 } 2870 }
2800 2871
2801 public void llLoopSoundSlave(string sound, double volume) 2872 public void llLoopSoundSlave(string sound, double volume)
2802 { 2873 {
2803 m_host.AddScriptLPS(1); 2874 m_host.AddScriptLPS(1);
2804 lock (m_host.ParentGroup.LoopSoundSlavePrims) 2875 if (m_SoundModule != null)
2805 { 2876 {
2806 m_host.ParentGroup.LoopSoundSlavePrims.Add(m_host); 2877 m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound),
2878 volume, 20, false, true);
2807 } 2879 }
2808 } 2880 }
2809 2881
@@ -3176,46 +3248,41 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3176 // need the magnitude later 3248 // need the magnitude later
3177 // float velmag = (float)Util.GetMagnitude(llvel); 3249 // float velmag = (float)Util.GetMagnitude(llvel);
3178 3250
3179 SceneObjectGroup new_group = World.RezObject(m_host, item, pos, rot, vel, param); 3251 List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param);
3180 3252
3181 // If either of these are null, then there was an unknown error. 3253 // If either of these are null, then there was an unknown error.
3182 if (new_group == null) 3254 if (new_groups == null)
3183 return; 3255 return;
3184 3256
3185 // objects rezzed with this method are die_at_edge by default. 3257 foreach (SceneObjectGroup group in new_groups)
3186 new_group.RootPart.SetDieAtEdge(true); 3258 {
3187 3259 // objects rezzed with this method are die_at_edge by default.
3188 new_group.ResumeScripts(); 3260 group.RootPart.SetDieAtEdge(true);
3189 3261
3190 m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( 3262 group.ResumeScripts();
3191 "object_rez", new Object[] {
3192 new LSL_String(
3193 new_group.RootPart.UUID.ToString()) },
3194 new DetectParams[0]));
3195 3263
3196 // do recoil 3264 m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
3197 SceneObjectGroup hostgrp = m_host.ParentGroup; 3265 "object_rez", new Object[] {
3198 if (hostgrp == null) 3266 new LSL_String(
3199 return; 3267 group.RootPart.UUID.ToString()) },
3268 new DetectParams[0]));
3200 3269
3201 if (hostgrp.IsAttachment) // don't recoil avatars 3270 float groupmass = group.GetMass();
3202 return;
3203 3271
3204 PhysicsActor pa = new_group.RootPart.PhysActor; 3272 PhysicsActor pa = group.RootPart.PhysActor;
3205 3273
3206 //Recoil. 3274 //Recoil.
3207 if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero) 3275 if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
3208 {
3209 float groupmass = new_group.GetMass();
3210 Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
3211 if (recoil != Vector3.Zero)
3212 { 3276 {
3213 llApplyImpulse(recoil, 0); 3277 Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
3278 if (recoil != Vector3.Zero)
3279 {
3280 llApplyImpulse(recoil, 0);
3281 }
3214 } 3282 }
3283 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
3215 } 3284 }
3216 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
3217 return; 3285 return;
3218
3219 }); 3286 });
3220 3287
3221 //ScriptSleep((int)((groupmass * velmag) / 10)); 3288 //ScriptSleep((int)((groupmass * velmag) / 10));
@@ -4746,6 +4813,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4746 UUID av = new UUID(); 4813 UUID av = new UUID();
4747 if (!UUID.TryParse(agent,out av)) 4814 if (!UUID.TryParse(agent,out av))
4748 { 4815 {
4816 LSLError("First parameter to llTextBox needs to be a key");
4749 return; 4817 return;
4750 } 4818 }
4751 4819
@@ -5108,6 +5176,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5108 5176
5109 s = Math.Cos(angle * 0.5); 5177 s = Math.Cos(angle * 0.5);
5110 t = Math.Sin(angle * 0.5); // temp value to avoid 2 more sin() calcs 5178 t = Math.Sin(angle * 0.5); // temp value to avoid 2 more sin() calcs
5179 axis = LSL_Vector.Norm(axis);
5111 x = axis.x * t; 5180 x = axis.x * t;
5112 y = axis.y * t; 5181 y = axis.y * t;
5113 z = axis.z * t; 5182 z = axis.z * t;
@@ -5115,41 +5184,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5115 return new LSL_Rotation(x,y,z,s); 5184 return new LSL_Rotation(x,y,z,s);
5116 } 5185 }
5117 5186
5118 5187 /// <summary>
5119 // Xantor 29/apr/2008 5188 /// Returns the axis of rotation for a quaternion
5120 // converts a Quaternion to X,Y,Z axis rotations 5189 /// </summary>
5190 /// <returns></returns>
5191 /// <param name='rot'></param>
5121 public LSL_Vector llRot2Axis(LSL_Rotation rot) 5192 public LSL_Vector llRot2Axis(LSL_Rotation rot)
5122 { 5193 {
5123 m_host.AddScriptLPS(1); 5194 m_host.AddScriptLPS(1);
5124 double x,y,z;
5125
5126 if (rot.s > 1) // normalization needed
5127 {
5128 double length = Math.Sqrt(rot.x * rot.x + rot.y * rot.y +
5129 rot.z * rot.z + rot.s * rot.s);
5130 5195
5131 rot.x /= length; 5196 if (Math.Abs(rot.s) > 1) // normalization needed
5132 rot.y /= length; 5197 rot.Normalize();
5133 rot.z /= length;
5134 rot.s /= length;
5135 5198
5136 }
5137
5138 // double angle = 2 * Math.Acos(rot.s);
5139 double s = Math.Sqrt(1 - rot.s * rot.s); 5199 double s = Math.Sqrt(1 - rot.s * rot.s);
5140 if (s < 0.001) 5200 if (s < 0.001)
5141 { 5201 {
5142 x = 1; 5202 return new LSL_Vector(1, 0, 0);
5143 y = z = 0;
5144 } 5203 }
5145 else 5204 else
5146 { 5205 {
5147 x = rot.x / s; // normalise axis 5206 double invS = 1.0 / s;
5148 y = rot.y / s; 5207 if (rot.s < 0) invS = -invS;
5149 z = rot.z / s; 5208 return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS);
5150 } 5209 }
5151
5152 return new LSL_Vector(x,y,z);
5153 } 5210 }
5154 5211
5155 5212
@@ -5158,18 +5215,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5158 { 5215 {
5159 m_host.AddScriptLPS(1); 5216 m_host.AddScriptLPS(1);
5160 5217
5161 if (rot.s > 1) // normalization needed 5218 if (Math.Abs(rot.s) > 1) // normalization needed
5162 { 5219 rot.Normalize();
5163 double length = Math.Sqrt(rot.x * rot.x + rot.y * rot.y +
5164 rot.z * rot.z + rot.s * rot.s);
5165
5166 rot.x /= length;
5167 rot.y /= length;
5168 rot.z /= length;
5169 rot.s /= length;
5170 }
5171 5220
5172 double angle = 2 * Math.Acos(rot.s); 5221 double angle = 2 * Math.Acos(rot.s);
5222 if (angle > Math.PI)
5223 angle = 2 * Math.PI - angle;
5173 5224
5174 return angle; 5225 return angle;
5175 } 5226 }
@@ -6695,7 +6746,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6695 PSYS_SRC_TARGET_KEY = 20, 6746 PSYS_SRC_TARGET_KEY = 20,
6696 PSYS_SRC_OMEGA = 21, 6747 PSYS_SRC_OMEGA = 21,
6697 PSYS_SRC_ANGLE_BEGIN = 22, 6748 PSYS_SRC_ANGLE_BEGIN = 22,
6698 PSYS_SRC_ANGLE_END = 23 6749 PSYS_SRC_ANGLE_END = 23,
6750 PSYS_PART_BLEND_FUNC_SOURCE = 24,
6751 PSYS_PART_BLEND_FUNC_DEST = 25,
6752 PSYS_PART_START_GLOW = 26,
6753 PSYS_PART_END_GLOW = 27
6699 } 6754 }
6700 6755
6701 internal Primitive.ParticleSystem.ParticleDataFlags ConvertUINTtoFlags(uint flags) 6756 internal Primitive.ParticleSystem.ParticleDataFlags ConvertUINTtoFlags(uint flags)
@@ -6721,6 +6776,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6721 ps.BurstRate = 0.1f; 6776 ps.BurstRate = 0.1f;
6722 ps.PartMaxAge = 10.0f; 6777 ps.PartMaxAge = 10.0f;
6723 ps.BurstPartCount = 1; 6778 ps.BurstPartCount = 1;
6779 ps.BlendFuncSource = ScriptBaseClass.PSYS_PART_BF_SOURCE_ALPHA;
6780 ps.BlendFuncDest = ScriptBaseClass.PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA;
6781 ps.PartStartGlow = 0.0f;
6782 ps.PartEndGlow = 0.0f;
6783
6724 return ps; 6784 return ps;
6725 } 6785 }
6726 6786
@@ -6755,6 +6815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6755 LSL_Vector tempv = new LSL_Vector(); 6815 LSL_Vector tempv = new LSL_Vector();
6756 6816
6757 float tempf = 0; 6817 float tempf = 0;
6818 int tmpi = 0;
6758 6819
6759 for (int i = 0; i < rules.Length; i += 2) 6820 for (int i = 0; i < rules.Length; i += 2)
6760 { 6821 {
@@ -6813,7 +6874,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6813 break; 6874 break;
6814 6875
6815 case (int)ScriptBaseClass.PSYS_SRC_PATTERN: 6876 case (int)ScriptBaseClass.PSYS_SRC_PATTERN:
6816 int tmpi = (int)rules.GetLSLIntegerItem(i + 1); 6877 tmpi = (int)rules.GetLSLIntegerItem(i + 1);
6817 prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; 6878 prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
6818 break; 6879 break;
6819 6880
@@ -6833,6 +6894,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6833 prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off. 6894 prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
6834 break; 6895 break;
6835 6896
6897 case (int)ScriptBaseClass.PSYS_PART_BLEND_FUNC_SOURCE:
6898 tmpi = (int)rules.GetLSLIntegerItem(i + 1);
6899 prules.BlendFuncSource = (byte)tmpi;
6900 break;
6901
6902 case (int)ScriptBaseClass.PSYS_PART_BLEND_FUNC_DEST:
6903 tmpi = (int)rules.GetLSLIntegerItem(i + 1);
6904 prules.BlendFuncDest = (byte)tmpi;
6905 break;
6906
6907 case (int)ScriptBaseClass.PSYS_PART_START_GLOW:
6908 tempf = (float)rules.GetLSLFloatItem(i + 1);
6909 prules.PartStartGlow = (float)tempf;
6910 break;
6911
6912 case (int)ScriptBaseClass.PSYS_PART_END_GLOW:
6913 tempf = (float)rules.GetLSLFloatItem(i + 1);
6914 prules.PartEndGlow = (float)tempf;
6915 break;
6916
6836 case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: 6917 case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
6837 prules.Texture = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, rules.GetLSLStringItem(i + 1)); 6918 prules.Texture = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, rules.GetLSLStringItem(i + 1));
6838 break; 6919 break;
@@ -8263,7 +8344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8263 return null; 8344 return null;
8264 8345
8265 string ph = rules.Data[idx++].ToString(); 8346 string ph = rules.Data[idx++].ToString();
8266 parentgrp.ScriptSetPhantomStatus(ph.Equals("1")); 8347 part.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
8267 8348
8268 break; 8349 break;
8269 8350
@@ -8316,7 +8397,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8316 return null; 8397 return null;
8317 string temp = rules.Data[idx++].ToString(); 8398 string temp = rules.Data[idx++].ToString();
8318 8399
8319 parentgrp.ScriptSetTemporaryStatus(temp.Equals("1")); 8400 part.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
8320 8401
8321 break; 8402 break;
8322 8403
@@ -8854,8 +8935,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8854 int idx=0; 8935 int idx=0;
8855 while (idx < rules.Length) 8936 while (idx < rules.Length)
8856 { 8937 {
8857 int code=(int)rules.GetLSLIntegerItem(idx++); 8938 int code = (int)rules.GetLSLIntegerItem(idx++);
8858 int remain=rules.Length-idx; 8939 int remain = rules.Length - idx;
8859 8940
8860 switch (code) 8941 switch (code)
8861 { 8942 {
@@ -8928,7 +9009,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8928 break; 9009 break;
8929 9010
8930 case ScriptBaseClass.PRIM_TYPE_SCULPT: 9011 case ScriptBaseClass.PRIM_TYPE_SCULPT:
8931 res.Add(Shape.SculptTexture.ToString()); 9012 res.Add(new LSL_String(Shape.SculptTexture.ToString()));
8932 res.Add(new LSL_Integer(Shape.SculptType)); 9013 res.Add(new LSL_Integer(Shape.SculptType));
8933 break; 9014 break;
8934 9015
@@ -9270,7 +9351,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9270 )); 9351 ));
9271 break; 9352 break;
9272 case (int)ScriptBaseClass.PRIM_LINK_TARGET: 9353 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
9273 if(remain < 3) 9354
9355 // TODO: Should be issuing a runtime script warning in this case.
9356 if (remain < 2)
9274 return null; 9357 return null;
9275 9358
9276 return rules.GetSublist(idx, -1); 9359 return rules.GetSublist(idx, -1);
@@ -12681,6 +12764,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12681 public void llSetSoundQueueing(int queue) 12764 public void llSetSoundQueueing(int queue)
12682 { 12765 {
12683 m_host.AddScriptLPS(1); 12766 m_host.AddScriptLPS(1);
12767
12768 if (m_SoundModule != null)
12769 m_SoundModule.SetSoundQueueing(m_host.UUID, queue == ScriptBaseClass.TRUE.value);
12684 } 12770 }
12685 12771
12686 public void llCollisionSprite(string impact_sprite) 12772 public void llCollisionSprite(string impact_sprite)
@@ -12724,7 +12810,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12724 } 12810 }
12725 12811
12726 group.RootPart.AttachPoint = group.RootPart.Shape.State; 12812 group.RootPart.AttachPoint = group.RootPart.Shape.State;
12727 group.RootPart.AttachOffset = group.AbsolutePosition; 12813 group.RootPart.AttachedPos = group.AbsolutePosition;
12728 12814
12729 group.ResetIDs(); 12815 group.ResetIDs();
12730 12816
@@ -12992,21 +13078,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12992 LSL_Vector v; 13078 LSL_Vector v;
12993 v = rules.GetVector3Item(idx++); 13079 v = rules.GetVector3Item(idx++);
12994 13080
12995 SceneObjectPart part = World.GetSceneObjectPart(av.ParentID);
12996 if (part == null)
12997 break;
12998
12999 LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION;
13000 LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR;
13001 if (part.LinkNum > 1)
13002 {
13003 localRot = GetPartLocalRot(part);
13004 localPos = GetPartLocalPos(part);
13005 }
13006
13007 v -= localPos;
13008 v /= localRot;
13009
13010 LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); 13081 LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f);
13011 13082
13012 v = v + 2 * sitOffset; 13083 v = v + 2 * sitOffset;
@@ -13026,18 +13097,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13026 LSL_Rotation r; 13097 LSL_Rotation r;
13027 r = rules.GetQuaternionItem(idx++); 13098 r = rules.GetQuaternionItem(idx++);
13028 13099
13029 SceneObjectPart part = World.GetSceneObjectPart(av.ParentID); 13100 av.Rotation = r * llGetRootRotation();
13030 if (part == null)
13031 break;
13032
13033 LSL_Rotation localRot = ScriptBaseClass.ZERO_ROTATION;
13034 LSL_Vector localPos = ScriptBaseClass.ZERO_VECTOR;
13035
13036 if (part.LinkNum > 1)
13037 localRot = GetPartLocalRot(part);
13038
13039 r = r * llGetRootRotation() / localRot;
13040 av.Rotation = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s);
13041 av.SendAvatarDataToAllAgents(); 13101 av.SendAvatarDataToAllAgents();
13042 } 13102 }
13043 break; 13103 break;
@@ -13191,28 +13251,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13191 Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f); 13251 Vector3 sitOffset = (Zrot(avatar.Rotation)) * (avatar.Appearance.AvatarHeight * 0.02638f *2.0f);
13192 pos -= sitOffset; 13252 pos -= sitOffset;
13193 13253
13194 if( sitPart != null)
13195 pos = sitPart.GetWorldPosition() + pos * sitPart.GetWorldRotation();
13196
13197 res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z)); 13254 res.Add(new LSL_Vector(pos.X,pos.Y,pos.Z));
13198 break; 13255 break;
13199 13256
13200 case (int)ScriptBaseClass.PRIM_SIZE: 13257 case (int)ScriptBaseClass.PRIM_SIZE:
13201 // as in llGetAgentSize above
13202// res.Add(new LSL_Vector(0.45f, 0.6f, avatar.Appearance.AvatarHeight));
13203 Vector3 s = avatar.Appearance.AvatarSize; 13258 Vector3 s = avatar.Appearance.AvatarSize;
13204 res.Add(new LSL_Vector(s.X, s.Y, s.Z)); 13259 res.Add(new LSL_Vector(s.X, s.Y, s.Z));
13205 13260
13206 break; 13261 break;
13207 13262
13208 case (int)ScriptBaseClass.PRIM_ROTATION: 13263 case (int)ScriptBaseClass.PRIM_ROTATION:
13209 Quaternion rot = avatar.Rotation; 13264 LSL_Rotation rot = new LSL_Rotation(avatar.Rotation.X, avatar.Rotation.Y, avatar.Rotation.Z, avatar.Rotation.W) / llGetRootRotation();
13210 if (sitPart != null)
13211 {
13212 rot = sitPart.GetWorldRotation() * rot; // apply sit part world rotation
13213 }
13214 13265
13215 res.Add(new LSL_Rotation (rot.X, rot.Y, rot.Z, rot.W)); 13266 res.Add(rot);
13216 break; 13267 break;
13217 13268
13218 case (int)ScriptBaseClass.PRIM_TYPE: 13269 case (int)ScriptBaseClass.PRIM_TYPE:
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index 1d6cb6d..b13a5ae 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -434,6 +434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
434 } 434 }
435 return wl; 435 return wl;
436 } 436 }
437
437 /// <summary> 438 /// <summary>
438 /// Set the current Windlight scene 439 /// Set the current Windlight scene
439 /// </summary> 440 /// </summary>
@@ -446,13 +447,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
446 LSShoutError("LightShare functions are not enabled."); 447 LSShoutError("LightShare functions are not enabled.");
447 return 0; 448 return 0;
448 } 449 }
449 if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) 450
451 if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
450 { 452 {
451 LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); 453 ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
452 return 0; 454
455 if (sp == null || sp.GodLevel < 200)
456 {
457 LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
458 return 0;
459 }
453 } 460 }
461
454 int success = 0; 462 int success = 0;
455 m_host.AddScriptLPS(1); 463 m_host.AddScriptLPS(1);
464
456 if (LightShareModule.EnableWindlight) 465 if (LightShareModule.EnableWindlight)
457 { 466 {
458 RegionLightShareData wl = getWindlightProfileFromRules(rules); 467 RegionLightShareData wl = getWindlightProfileFromRules(rules);
@@ -465,8 +474,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
465 LSShoutError("Windlight module is disabled"); 474 LSShoutError("Windlight module is disabled");
466 return 0; 475 return 0;
467 } 476 }
477
468 return success; 478 return success;
469 } 479 }
480
470 public void lsClearWindlightScene() 481 public void lsClearWindlightScene()
471 { 482 {
472 if (!m_LSFunctionsEnabled) 483 if (!m_LSFunctionsEnabled)
@@ -474,17 +485,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
474 LSShoutError("LightShare functions are not enabled."); 485 LSShoutError("LightShare functions are not enabled.");
475 return; 486 return;
476 } 487 }
477 if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) 488
489 if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
478 { 490 {
479 LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); 491 ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
480 return; 492
493 if (sp == null || sp.GodLevel < 200)
494 {
495 LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
496 return;
497 }
481 } 498 }
482 499
483 m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; 500 m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
484 if (m_host.ParentGroup.Scene.SimulationDataService != null) 501 if (m_host.ParentGroup.Scene.SimulationDataService != null)
485 m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); 502 m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
503
486 m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); 504 m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile();
487 } 505 }
506
488 /// <summary> 507 /// <summary>
489 /// Set the current Windlight scene to a target avatar 508 /// Set the current Windlight scene to a target avatar
490 /// </summary> 509 /// </summary>
@@ -497,13 +516,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
497 LSShoutError("LightShare functions are not enabled."); 516 LSShoutError("LightShare functions are not enabled.");
498 return 0; 517 return 0;
499 } 518 }
500 if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) 519
520 if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
501 { 521 {
502 LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); 522 ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
503 return 0; 523
524 if (sp == null || sp.GodLevel < 200)
525 {
526 LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
527 return 0;
528 }
504 } 529 }
530
505 int success = 0; 531 int success = 0;
506 m_host.AddScriptLPS(1); 532 m_host.AddScriptLPS(1);
533
507 if (LightShareModule.EnableWindlight) 534 if (LightShareModule.EnableWindlight)
508 { 535 {
509 RegionLightShareData wl = getWindlightProfileFromRules(rules); 536 RegionLightShareData wl = getWindlightProfileFromRules(rules);
@@ -515,8 +542,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
515 LSShoutError("Windlight module is disabled"); 542 LSShoutError("Windlight module is disabled");
516 return 0; 543 return 0;
517 } 544 }
545
518 return success; 546 return success;
519 } 547 }
520
521 } 548 }
522} 549} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
index bd776b6..edcdfbc 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
@@ -319,7 +319,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
319 319
320 object[] convertedParms = new object[parms.Length]; 320 object[] convertedParms = new object[parms.Length];
321 for (int i = 0; i < parms.Length; i++) 321 for (int i = 0; i < parms.Length; i++)
322 convertedParms[i] = ConvertFromLSL(parms[i],signature[i], fname); 322 convertedParms[i] = ConvertFromLSL(parms[i], signature[i], fname);
323 323
324 // now call the function, the contract with the function is that it will always return 324 // now call the function, the contract with the function is that it will always return
325 // non-null but don't trust it completely 325 // non-null but don't trust it completely
@@ -448,7 +448,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
448 } 448 }
449 } 449 }
450 450
451 MODError(String.Format("{1}: parameter type mismatch; expecting {0}",type.Name, fname)); 451 MODError(String.Format("{0}: parameter type mismatch; expecting {1}, type(parm)={2}", fname, type.Name, lslparm.GetType()));
452 return null; 452 return null;
453 } 453 }
454 454
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 9c148d1..7081416 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3005,6 +3005,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3005 return ret; 3005 return ret;
3006 } 3006 }
3007 3007
3008 public LSL_Vector osGetRegionSize()
3009 {
3010 CheckThreatLevel(ThreatLevel.None, "osGetRegionSize");
3011 m_host.AddScriptLPS(1);
3012
3013 bool isMegaregion;
3014 IRegionCombinerModule rcMod = World.RequestModuleInterface<IRegionCombinerModule>();
3015 if (rcMod != null)
3016 isMegaregion = rcMod.IsRootForMegaregion(World.RegionInfo.RegionID);
3017 else
3018 isMegaregion = false;
3019
3020 if (isMegaregion)
3021 {
3022 Vector2 size = rcMod.GetSizeOfMegaregion(World.RegionInfo.RegionID);
3023 return new LSL_Vector(size.X, size.Y, Constants.RegionHeight);
3024 }
3025 else
3026 {
3027 return new LSL_Vector((float)Constants.RegionSize, (float)Constants.RegionSize, Constants.RegionHeight);
3028 }
3029 }
3030
3008 public int osGetSimulatorMemory() 3031 public int osGetSimulatorMemory()
3009 { 3032 {
3010 CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory"); 3033 CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");
@@ -3043,7 +3066,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3043 sp.ControllingClient.Kick(alert); 3066 sp.ControllingClient.Kick(alert);
3044 3067
3045 // ...and close on our side 3068 // ...and close on our side
3046 sp.Scene.IncomingCloseAgent(sp.UUID, false); 3069 sp.Scene.CloseAgent(sp.UUID, false);
3047 } 3070 }
3048 }); 3071 });
3049 } 3072 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index a47e452..7bfe27b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -353,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
353 // Position of a sensor in a child prim attached to an avatar 353 // Position of a sensor in a child prim attached to an avatar
354 // will be still wrong. 354 // will be still wrong.
355 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); 355 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
356
357 // Don't proceed if the avatar for this attachment has since been removed from the scene.
358 if (avatar == null)
359 return sensedEntities;
360
356 fromRegionPos = avatar.AbsolutePosition; 361 fromRegionPos = avatar.AbsolutePosition;
357 q = avatar.Rotation; 362 q = avatar.Rotation;
358 } 363 }
@@ -363,7 +368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
363 368
364 Vector3 ZeroVector = new Vector3(0, 0, 0); 369 Vector3 ZeroVector = new Vector3(0, 0, 0);
365 370
366 bool nameSearch = (ts.name != null && ts.name != ""); 371 bool nameSearch = !string.IsNullOrEmpty(ts.name);
367 372
368 foreach (EntityBase ent in Entities) 373 foreach (EntityBase ent in Entities)
369 { 374 {
@@ -483,6 +488,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
483 // Position of a sensor in a child prim attached to an avatar 488 // Position of a sensor in a child prim attached to an avatar
484 // will be still wrong. 489 // will be still wrong.
485 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); 490 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
491
492 // Don't proceed if the avatar for this attachment has since been removed from the scene.
486 if (avatar == null) 493 if (avatar == null)
487 return sensedEntities; 494 return sensedEntities;
488 fromRegionPos = avatar.AbsolutePosition; 495 fromRegionPos = avatar.AbsolutePosition;
@@ -542,7 +549,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
542 return; 549 return;
543 550
544 toRegionPos = presence.AbsolutePosition; 551 toRegionPos = presence.AbsolutePosition;
545 dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); 552 dis = Util.GetDistanceTo(toRegionPos, fromRegionPos);
553 if (presence.IsSatOnObject && presence.ParentPart != null &&
554 presence.ParentPart.ParentGroup != null &&
555 presence.ParentPart.ParentGroup.RootPart != null)
556 {
557 Vector3 rpos = presence.ParentPart.ParentGroup.RootPart.AbsolutePosition;
558 double dis2 = Util.GetDistanceTo(rpos, fromRegionPos);
559 if (dis > dis2)
560 dis = dis2;
561 }
546 562
547 // Disabled for now since all osNpc* methods check for appropriate ownership permission. 563 // Disabled for now since all osNpc* methods check for appropriate ownership permission.
548 // Perhaps could be re-enabled as an NPC setting at some point since being able to make NPCs not 564 // Perhaps could be re-enabled as an NPC setting at some point since being able to make NPCs not
@@ -601,7 +617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
601 return sensedEntities; 617 return sensedEntities;
602 senseEntity(sp); 618 senseEntity(sp);
603 } 619 }
604 else if (ts.name != null && ts.name != "") 620 else if (!string.IsNullOrEmpty(ts.name))
605 { 621 {
606 ScenePresence sp; 622 ScenePresence sp;
607 // Try lookup by name will return if/when found 623 // Try lookup by name will return if/when found
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Properties/AssemblyInfo.cs
index 6d218a6..9137c69 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.7.6.*")] 32[assembly: AssemblyVersion("0.8.0.*")]
33 33
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index daf89e5..d211a2b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -332,7 +332,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
332 void llSensorRemove(); 332 void llSensorRemove();
333 void llSensorRepeat(string name, string id, int type, double range, double arc, double rate); 333 void llSensorRepeat(string name, string id, int type, double range, double arc, double rate);
334 void llSetAlpha(double alpha, int face); 334 void llSetAlpha(double alpha, int face);
335 void llSetAngularVelocity(LSL_Vector angvelocity, int local);
336 void llSetBuoyancy(double buoyancy); 335 void llSetBuoyancy(double buoyancy);
337 void llSetCameraAtOffset(LSL_Vector offset); 336 void llSetCameraAtOffset(LSL_Vector offset);
338 void llSetCameraEyeOffset(LSL_Vector offset); 337 void llSetCameraEyeOffset(LSL_Vector offset);
@@ -340,9 +339,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
340 void llSetCameraParams(LSL_List rules); 339 void llSetCameraParams(LSL_List rules);
341 void llSetClickAction(int action); 340 void llSetClickAction(int action);
342 void llSetColor(LSL_Vector color, int face); 341 void llSetColor(LSL_Vector color, int face);
342 void llSetContentType(LSL_Key id, LSL_Integer type);
343 void llSetDamage(double damage); 343 void llSetDamage(double damage);
344 void llSetForce(LSL_Vector force, int local); 344 void llSetForce(LSL_Vector force, int local);
345 void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local); 345 void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local);
346 void llSetAngularVelocity(LSL_Vector angularVelocity, int local);
346 void llSetHoverHeight(double height, int water, double tau); 347 void llSetHoverHeight(double height, int water, double tau);
347 void llSetInventoryPermMask(string item, int mask, int value); 348 void llSetInventoryPermMask(string item, int mask, int value);
348 void llSetLinkAlpha(int linknumber, double alpha, int face); 349 void llSetLinkAlpha(int linknumber, double alpha, int face);
@@ -383,7 +384,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
383 void llSetVehicleRotationParam(int param, LSL_Rotation rot); 384 void llSetVehicleRotationParam(int param, LSL_Rotation rot);
384 void llSetVehicleType(int type); 385 void llSetVehicleType(int type);
385 void llSetVehicleVectorParam(int param, LSL_Vector vec); 386 void llSetVehicleVectorParam(int param, LSL_Vector vec);
386 void llSetVelocity(LSL_Vector velocity, int local);
387 void llShout(int channelID, string text); 387 void llShout(int channelID, string text);
388 LSL_Float llSin(double f); 388 LSL_Float llSin(double f);
389 void llSitTarget(LSL_Vector offset, LSL_Rotation rot); 389 void llSitTarget(LSL_Vector offset, LSL_Rotation rot);
@@ -434,6 +434,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
434 void llSetKeyframedMotion(LSL_List frames, LSL_List options); 434 void llSetKeyframedMotion(LSL_List frames, LSL_List options);
435 LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); 435 LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
436 LSL_List llGetPhysicsMaterial(); 436 LSL_List llGetPhysicsMaterial();
437 void llSetContentType(LSL_Key id, LSL_Integer content_type);
438 } 437 }
439} 438}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index a652cb8..d80d389 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -336,6 +336,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
336 key osGetMapTexture(); 336 key osGetMapTexture();
337 key osGetRegionMapTexture(string regionName); 337 key osGetRegionMapTexture(string regionName);
338 LSL_List osGetRegionStats(); 338 LSL_List osGetRegionStats();
339 vector osGetRegionSize();
339 340
340 int osGetSimulatorMemory(); 341 int osGetSimulatorMemory();
341 void osKickAvatar(string FirstName,string SurName,string alert); 342 void osKickAvatar(string FirstName,string SurName,string alert);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 6efa73f..e59c0be 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -107,6 +107,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
107 public const int PSYS_PART_TARGET_POS_MASK = 64; 107 public const int PSYS_PART_TARGET_POS_MASK = 64;
108 public const int PSYS_PART_TARGET_LINEAR_MASK = 128; 108 public const int PSYS_PART_TARGET_LINEAR_MASK = 128;
109 public const int PSYS_PART_EMISSIVE_MASK = 256; 109 public const int PSYS_PART_EMISSIVE_MASK = 256;
110 public const int PSYS_PART_RIBBON_MASK = 1024;
110 public const int PSYS_PART_FLAGS = 0; 111 public const int PSYS_PART_FLAGS = 0;
111 public const int PSYS_PART_START_COLOR = 1; 112 public const int PSYS_PART_START_COLOR = 1;
112 public const int PSYS_PART_START_ALPHA = 2; 113 public const int PSYS_PART_START_ALPHA = 2;
@@ -130,6 +131,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
130 public const int PSYS_SRC_OMEGA = 21; 131 public const int PSYS_SRC_OMEGA = 21;
131 public const int PSYS_SRC_ANGLE_BEGIN = 22; 132 public const int PSYS_SRC_ANGLE_BEGIN = 22;
132 public const int PSYS_SRC_ANGLE_END = 23; 133 public const int PSYS_SRC_ANGLE_END = 23;
134 public const int PSYS_PART_BLEND_FUNC_SOURCE = 24;
135 public const int PSYS_PART_BLEND_FUNC_DEST = 25;
136 public const int PSYS_PART_START_GLOW = 26;
137 public const int PSYS_PART_END_GLOW = 27;
138 public const int PSYS_PART_BF_ONE = 0;
139 public const int PSYS_PART_BF_ZERO = 1;
140 public const int PSYS_PART_BF_DEST_COLOR = 2;
141 public const int PSYS_PART_BF_SOURCE_COLOR = 3;
142 public const int PSYS_PART_BF_ONE_MINUS_DEST_COLOR = 4;
143 public const int PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR = 5;
144 public const int PSYS_PART_BF_SOURCE_ALPHA = 7;
145 public const int PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA = 9;
133 public const int PSYS_SRC_PATTERN_DROP = 1; 146 public const int PSYS_SRC_PATTERN_DROP = 1;
134 public const int PSYS_SRC_PATTERN_EXPLODE = 2; 147 public const int PSYS_SRC_PATTERN_EXPLODE = 2;
135 public const int PSYS_SRC_PATTERN_ANGLE = 4; 148 public const int PSYS_SRC_PATTERN_ANGLE = 4;
@@ -361,6 +374,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
361 public const int HTTP_CUSTOM_HEADER = 5; 374 public const int HTTP_CUSTOM_HEADER = 5;
362 public const int HTTP_PRAGMA_NO_CACHE = 6; 375 public const int HTTP_PRAGMA_NO_CACHE = 6;
363 376
377 // llSetContentType
378 public const int CONTENT_TYPE_TEXT = 0; //text/plain
379 public const int CONTENT_TYPE_HTML = 1; //text/html
380 public const int CONTENT_TYPE_XML = 2; //application/xml
381 public const int CONTENT_TYPE_XHTML = 3; //application/xhtml+xml
382 public const int CONTENT_TYPE_ATOM = 4; //application/atom+xml
383 public const int CONTENT_TYPE_JSON = 5; //application/json
384 public const int CONTENT_TYPE_LLSD = 6; //application/llsd+xml
385 public const int CONTENT_TYPE_FORM = 7; //application/x-www-form-urlencoded
386 public const int CONTENT_TYPE_RSS = 8; //application/rss+xml
387
364 public const int PRIM_MATERIAL = 2; 388 public const int PRIM_MATERIAL = 2;
365 public const int PRIM_PHYSICS = 3; 389 public const int PRIM_PHYSICS = 3;
366 public const int PRIM_TEMP_ON_REZ = 4; 390 public const int PRIM_TEMP_ON_REZ = 4;
@@ -772,8 +796,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
772 /// process message parameter as regex 796 /// process message parameter as regex
773 /// </summary> 797 /// </summary>
774 public const int OS_LISTEN_REGEX_MESSAGE = 0x2; 798 public const int OS_LISTEN_REGEX_MESSAGE = 0x2;
775
776 public const int CONTENT_TYPE_TEXT = 0;
777 public const int CONTENT_TYPE_HTML = 1;
778 } 799 }
779} 800}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 6f3677c..4fc8d65 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -1495,11 +1495,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1495 m_LSL_Functions.llSetAlpha(alpha, face); 1495 m_LSL_Functions.llSetAlpha(alpha, face);
1496 } 1496 }
1497 1497
1498 public void llSetAngularVelocity(LSL_Vector angvelocity, int local)
1499 {
1500 m_LSL_Functions.llSetAngularVelocity(angvelocity, local);
1501 }
1502
1503 public void llSetBuoyancy(double buoyancy) 1498 public void llSetBuoyancy(double buoyancy)
1504 { 1499 {
1505 m_LSL_Functions.llSetBuoyancy(buoyancy); 1500 m_LSL_Functions.llSetBuoyancy(buoyancy);
@@ -1535,6 +1530,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1535 m_LSL_Functions.llSetColor(color, face); 1530 m_LSL_Functions.llSetColor(color, face);
1536 } 1531 }
1537 1532
1533 public void llSetContentType(LSL_Key id, LSL_Integer type)
1534 {
1535 m_LSL_Functions.llSetContentType(id, type);
1536 }
1537
1538 public void llSetDamage(double damage) 1538 public void llSetDamage(double damage)
1539 { 1539 {
1540 m_LSL_Functions.llSetDamage(damage); 1540 m_LSL_Functions.llSetDamage(damage);
@@ -1550,6 +1550,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1550 m_LSL_Functions.llSetForceAndTorque(force, torque, local); 1550 m_LSL_Functions.llSetForceAndTorque(force, torque, local);
1551 } 1551 }
1552 1552
1553 public void llSetAngularVelocity(LSL_Vector force, int local)
1554 {
1555 m_LSL_Functions.llSetAngularVelocity(force, local);
1556 }
1557
1553 public void llSetHoverHeight(double height, int water, double tau) 1558 public void llSetHoverHeight(double height, int water, double tau)
1554 { 1559 {
1555 m_LSL_Functions.llSetHoverHeight(height, water, tau); 1560 m_LSL_Functions.llSetHoverHeight(height, water, tau);
@@ -1740,11 +1745,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1740 m_LSL_Functions.llSetVehicleVectorParam(param, vec); 1745 m_LSL_Functions.llSetVehicleVectorParam(param, vec);
1741 } 1746 }
1742 1747
1743 public void llSetVelocity(LSL_Vector velocity, int local)
1744 {
1745 m_LSL_Functions.llSetVelocity(velocity, local);
1746 }
1747
1748 public void llShout(int channelID, string text) 1748 public void llShout(int channelID, string text)
1749 { 1749 {
1750 m_LSL_Functions.llShout(channelID, text); 1750 m_LSL_Functions.llShout(channelID, text);
@@ -2014,10 +2014,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
2014 { 2014 {
2015 return m_LSL_Functions.llGetPhysicsMaterial(); 2015 return m_LSL_Functions.llGetPhysicsMaterial();
2016 } 2016 }
2017
2018 public void llSetContentType(LSL_Key id, LSL_Integer content_type)
2019 {
2020 m_LSL_Functions.llSetContentType(id, content_type);
2021 }
2022 } 2017 }
2023} 2018}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index b63773b..9cf7b35 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -858,6 +858,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
858 return m_OSSL_Functions.osGetRegionStats(); 858 return m_OSSL_Functions.osGetRegionStats();
859 } 859 }
860 860
861 public vector osGetRegionSize()
862 {
863 return m_OSSL_Functions.osGetRegionSize();
864 }
865
861 /// <summary> 866 /// <summary>
862 /// Returns the amount of memory in use by the Simulator Daemon. 867 /// Returns the amount of memory in use by the Simulator Daemon.
863 /// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware) 868 /// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)