diff options
author | lcc | 2010-04-10 23:52:10 +0200 |
---|---|---|
committer | lcc | 2010-04-10 23:52:10 +0200 |
commit | 7ecd9b3f1ac4556125a35ab384224b2ca0401a11 (patch) | |
tree | 63151eb7e3693485af9db8947f2004f586062ca5 /OpenSim | |
parent | Adding ColdStart event (diff) | |
parent | guarantee that a script engine's GetScriptErrors() will not be called (diff) | |
download | opensim-SC_OLD-7ecd9b3f1ac4556125a35ab384224b2ca0401a11.zip opensim-SC_OLD-7ecd9b3f1ac4556125a35ab384224b2ca0401a11.tar.gz opensim-SC_OLD-7ecd9b3f1ac4556125a35ab384224b2ca0401a11.tar.bz2 opensim-SC_OLD-7ecd9b3f1ac4556125a35ab384224b2ca0401a11.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
resolved
Conflicts:
OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
Diffstat (limited to 'OpenSim')
11 files changed, 201 insertions, 78 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ebcdd62..b0e3655 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -5200,7 +5200,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5200 | args.Channel = ch; | 5200 | args.Channel = ch; |
5201 | args.From = String.Empty; | 5201 | args.From = String.Empty; |
5202 | args.Message = Utils.BytesToString(msg); | 5202 | args.Message = Utils.BytesToString(msg); |
5203 | args.Type = ChatTypeEnum.Shout; | 5203 | args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance |
5204 | args.Position = new Vector3(); | 5204 | args.Position = new Vector3(); |
5205 | args.Scene = Scene; | 5205 | args.Scene = Scene; |
5206 | args.Sender = this; | 5206 | args.Sender = this; |
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index f58904f..16ca3f9 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -73,8 +73,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
73 | /// </summary> | 73 | /// </summary> |
74 | void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); | 74 | void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); |
75 | 75 | ||
76 | ArrayList GetScriptErrors(UUID itemID); | ||
77 | |||
78 | /// <summary> | 76 | /// <summary> |
79 | /// Stop all the scripts in this entity. | 77 | /// Stop all the scripts in this entity. |
80 | /// </summary> | 78 | /// </summary> |
@@ -104,6 +102,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
104 | /// <param name="stateSource"></param> | 102 | /// <param name="stateSource"></param> |
105 | void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource); | 103 | void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource); |
106 | 104 | ||
105 | ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource); | ||
106 | |||
107 | /// <summary> | 107 | /// <summary> |
108 | /// Stop a script which is in this prim's inventory. | 108 | /// Stop a script which is in this prim's inventory. |
109 | /// </summary> | 109 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index b04871e..6c57d18 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -271,8 +271,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
271 | { | 271 | { |
272 | // Needs to determine which engine was running it and use that | 272 | // Needs to determine which engine was running it and use that |
273 | // | 273 | // |
274 | part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0); | 274 | errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0); |
275 | errors = part.Inventory.GetScriptErrors(item.ItemID); | ||
276 | } | 275 | } |
277 | else | 276 | else |
278 | { | 277 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 55f4550..db073e8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -158,6 +158,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
158 | 158 | ||
159 | public IXfer XferManager; | 159 | public IXfer XferManager; |
160 | 160 | ||
161 | protected ISnmpModule m_snmpService = null; | ||
162 | public ISnmpModule SnmpService | ||
163 | { | ||
164 | get | ||
165 | { | ||
166 | if (m_snmpService == null) | ||
167 | { | ||
168 | m_snmpService = RequestModuleInterface<ISnmpModule>(); | ||
169 | } | ||
170 | |||
171 | return m_snmpService; | ||
172 | } | ||
173 | } | ||
174 | |||
161 | protected IAssetService m_AssetService; | 175 | protected IAssetService m_AssetService; |
162 | protected IAuthorizationService m_AuthorizationService; | 176 | protected IAuthorizationService m_AuthorizationService; |
163 | 177 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 5f84252..04626d3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -1032,7 +1032,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1032 | 1032 | ||
1033 | public bool WaitForCallback(UUID id) | 1033 | public bool WaitForCallback(UUID id) |
1034 | { | 1034 | { |
1035 | int count = 200; | 1035 | int count = 400; |
1036 | while (m_agentsInTransit.Contains(id) && count-- > 0) | 1036 | while (m_agentsInTransit.Contains(id) && count-- > 0) |
1037 | { | 1037 | { |
1038 | //m_log.Debug(" >>> Waiting... " + count); | 1038 | //m_log.Debug(" >>> Waiting... " + count); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 5d00917..d03b464 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -46,6 +46,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
46 | 46 | ||
47 | private string m_inventoryFileName = String.Empty; | 47 | private string m_inventoryFileName = String.Empty; |
48 | private int m_inventoryFileNameSerial = 0; | 48 | private int m_inventoryFileNameSerial = 0; |
49 | |||
50 | private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>(); | ||
49 | 51 | ||
50 | /// <value> | 52 | /// <value> |
51 | /// The part to which the inventory belongs. | 53 | /// The part to which the inventory belongs. |
@@ -211,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
211 | } | 213 | } |
212 | } | 214 | } |
213 | 215 | ||
214 | public ArrayList GetScriptErrors(UUID itemID) | 216 | private ArrayList GetScriptErrors(UUID itemID) |
215 | { | 217 | { |
216 | ArrayList ret = new ArrayList(); | 218 | ArrayList ret = new ArrayList(); |
217 | 219 | ||
@@ -270,7 +272,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
270 | // item.Name, item.ItemID, Name, UUID); | 272 | // item.Name, item.ItemID, Name, UUID); |
271 | 273 | ||
272 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 274 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) |
275 | { | ||
276 | StoreScriptError(item.ItemID, "no permission"); | ||
273 | return; | 277 | return; |
278 | } | ||
274 | 279 | ||
275 | m_part.AddFlag(PrimFlags.Scripted); | 280 | m_part.AddFlag(PrimFlags.Scripted); |
276 | 281 | ||
@@ -285,6 +290,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
285 | m_items.LockItemsForWrite(false); | 290 | m_items.LockItemsForWrite(false); |
286 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | 291 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( |
287 | m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource); | 292 | m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource); |
293 | StoreScriptErrors(item.ItemID, GetScriptErrors(item.ItemID)); | ||
288 | m_part.ParentGroup.AddActiveScriptCount(1); | 294 | m_part.ParentGroup.AddActiveScriptCount(1); |
289 | m_part.ScheduleFullUpdate(); | 295 | m_part.ScheduleFullUpdate(); |
290 | return; | 296 | return; |
@@ -294,11 +300,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
294 | { | 300 | { |
295 | if (null == asset) | 301 | if (null == asset) |
296 | { | 302 | { |
303 | string msg = String.Format("asset ID {0} could not be found", item.AssetID); | ||
304 | StoreScriptError(item.ItemID, msg); | ||
297 | m_log.ErrorFormat( | 305 | m_log.ErrorFormat( |
298 | "[PRIM INVENTORY]: " + | 306 | "[PRIM INVENTORY]: " + |
299 | "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", | 307 | "Couldn't start script {0}, {1} at {2} in {3} since {4}", |
300 | item.Name, item.ItemID, m_part.AbsolutePosition, | 308 | item.Name, item.ItemID, m_part.AbsolutePosition, |
301 | m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); | 309 | m_part.ParentGroup.Scene.RegionInfo.RegionName, msg); |
302 | } | 310 | } |
303 | else | 311 | else |
304 | { | 312 | { |
@@ -311,11 +319,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
311 | string script = Utils.BytesToString(asset.Data); | 319 | string script = Utils.BytesToString(asset.Data); |
312 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | 320 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( |
313 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | 321 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); |
322 | StoreScriptErrors(item.ItemID, GetScriptErrors(item.ItemID)); | ||
314 | m_part.ParentGroup.AddActiveScriptCount(1); | 323 | m_part.ParentGroup.AddActiveScriptCount(1); |
315 | m_part.ScheduleFullUpdate(); | 324 | m_part.ScheduleFullUpdate(); |
316 | } | 325 | } |
317 | }); | 326 | }); |
318 | } | 327 | } |
328 | else | ||
329 | { | ||
330 | StoreScriptError(item.ItemID, "scripts disabled"); | ||
331 | } | ||
319 | } | 332 | } |
320 | 333 | ||
321 | private void RestoreSavedScriptState(UUID oldID, UUID newID) | 334 | private void RestoreSavedScriptState(UUID oldID, UUID newID) |
@@ -392,24 +405,71 @@ namespace OpenSim.Region.Framework.Scenes | |||
392 | else | 405 | else |
393 | { | 406 | { |
394 | m_items.LockItemsForRead(false); | 407 | m_items.LockItemsForRead(false); |
408 | string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID, | ||
409 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | ||
410 | StoreScriptError(itemId, msg); | ||
395 | m_log.ErrorFormat( | 411 | m_log.ErrorFormat( |
396 | "[PRIM INVENTORY]: " + | 412 | "[PRIM INVENTORY]: " + |
397 | "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", | 413 | "Couldn't start script with ID {0} since it {1}", itemId, msg); |
398 | itemId, m_part.Name, m_part.UUID, | ||
399 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | ||
400 | } | 414 | } |
401 | } | 415 | } |
402 | else | 416 | else |
403 | { | 417 | { |
404 | m_items.LockItemsForRead(false); | 418 | m_items.LockItemsForRead(false); |
419 | string msg = String.Format("couldn't be found for prim {0}, {1}", m_part.Name, m_part.UUID); | ||
420 | StoreScriptError(itemId, msg); | ||
405 | m_log.ErrorFormat( | 421 | m_log.ErrorFormat( |
406 | "[PRIM INVENTORY]: " + | 422 | "[PRIM INVENTORY]: " + |
407 | "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}", | 423 | "Couldn't start script with ID {0} since it {1}", itemId, msg); |
408 | itemId, m_part.Name, m_part.UUID); | ||
409 | } | 424 | } |
410 | 425 | ||
411 | } | 426 | } |
412 | 427 | ||
428 | public ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource) | ||
429 | { | ||
430 | ArrayList errors; | ||
431 | |||
432 | lock (m_scriptErrors) | ||
433 | { | ||
434 | m_scriptErrors.Remove(itemId); | ||
435 | } | ||
436 | CreateScriptInstance(itemId, startParam, postOnRez, engine, stateSource); | ||
437 | lock (m_scriptErrors) | ||
438 | { | ||
439 | while (!m_scriptErrors.TryGetValue(itemId, out errors)) | ||
440 | { | ||
441 | if (!System.Threading.Monitor.Wait(m_scriptErrors, 15000)) | ||
442 | { | ||
443 | m_log.ErrorFormat( | ||
444 | "[PRIM INVENTORY]: " + | ||
445 | "timedout waiting for script {0} errors", itemId); | ||
446 | if (!m_scriptErrors.TryGetValue(itemId, out errors)) | ||
447 | { | ||
448 | errors = new ArrayList(1); | ||
449 | errors.Add("timedout waiting for errors"); | ||
450 | } | ||
451 | break; | ||
452 | } | ||
453 | } | ||
454 | m_scriptErrors.Remove(itemId); | ||
455 | } | ||
456 | return errors; | ||
457 | } | ||
458 | private void StoreScriptErrors(UUID itemId, ArrayList errors) | ||
459 | { | ||
460 | lock (m_scriptErrors) | ||
461 | { | ||
462 | m_scriptErrors[itemId] = errors; | ||
463 | System.Threading.Monitor.PulseAll(m_scriptErrors); | ||
464 | } | ||
465 | } | ||
466 | private void StoreScriptError(UUID itemId, string message) | ||
467 | { | ||
468 | ArrayList errors = new ArrayList(1); | ||
469 | errors.Add(message); | ||
470 | StoreScriptErrors(itemId, errors); | ||
471 | } | ||
472 | |||
413 | /// <summary> | 473 | /// <summary> |
414 | /// Stop a script which is in this prim's inventory. | 474 | /// Stop a script which is in this prim's inventory. |
415 | /// </summary> | 475 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs index 99973b4..9f829da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs | |||
@@ -86,6 +86,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
86 | } | 86 | } |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Like osGetAgents but returns enough info for a radar | ||
90 | /// </summary> | ||
91 | /// <returns>Strided list of the UUID, position and name of each avatar in the region</returns> | ||
92 | public LSL_List cmGetAvatarList() | ||
93 | { | ||
94 | LSL_List result = new LSL_List(); | ||
95 | foreach (ScenePresence avatar in World.GetAvatars()) | ||
96 | { | ||
97 | if (avatar.UUID != m_host.OwnerID) | ||
98 | { | ||
99 | if (avatar.IsChildAgent == false) | ||
100 | { | ||
101 | result.Add(avatar.UUID); | ||
102 | result.Add(avatar.PhysicsActor.Position); | ||
103 | result.Add(avatar.Name); | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | return result; | ||
108 | } | ||
109 | |||
110 | /// <summary> | ||
89 | /// Get the current Windlight scene | 111 | /// Get the current Windlight scene |
90 | /// </summary> | 112 | /// </summary> |
91 | /// <returns>List of windlight parameters</returns> | 113 | /// <returns>List of windlight parameters</returns> |
@@ -229,10 +251,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
229 | 251 | ||
230 | return values; | 252 | return values; |
231 | 253 | ||
232 | } | 254 | } |
233 | 255 | ||
234 | private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules) | 256 | private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules) |
235 | { | 257 | { |
236 | RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); | 258 | RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); |
237 | 259 | ||
238 | LSL_List values = new LSL_List(); | 260 | LSL_List values = new LSL_List(); |
@@ -244,9 +266,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
244 | LSL_Types.Vector3 iV; | 266 | LSL_Types.Vector3 iV; |
245 | switch (rule) | 267 | switch (rule) |
246 | { | 268 | { |
247 | case (int)ScriptBaseClass.WL_SUN_MOON_POSITION: | 269 | case (int)ScriptBaseClass.WL_SUN_MOON_POSITION: |
248 | idx++; | 270 | idx++; |
249 | wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx); | 271 | wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx); |
250 | break; | 272 | break; |
251 | case (int)ScriptBaseClass.WL_AMBIENT: | 273 | case (int)ScriptBaseClass.WL_AMBIENT: |
252 | idx++; | 274 | idx++; |
@@ -419,58 +441,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
419 | { | 441 | { |
420 | CMShoutError("Careminster functions are not enabled."); | 442 | CMShoutError("Careminster functions are not enabled."); |
421 | return 0; | 443 | return 0; |
422 | } | 444 | } |
423 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | 445 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) |
424 | { | 446 | { |
425 | CMShoutError("cmSetWindlightScene can only be used by estate managers or owners."); | 447 | CMShoutError("cmSetWindlightScene can only be used by estate managers or owners."); |
426 | return 0; | 448 | return 0; |
449 | } | ||
450 | int success = 0; | ||
451 | m_host.AddScriptLPS(1); | ||
452 | if (Meta7WindlightModule.EnableWindlight) | ||
453 | { | ||
454 | RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); | ||
455 | m_host.ParentGroup.Scene.StoreWindlightProfile(wl); | ||
456 | success = 1; | ||
457 | } | ||
458 | else | ||
459 | { | ||
460 | CMShoutError("Windlight module is disabled"); | ||
461 | return 0; | ||
462 | } | ||
463 | return success; | ||
464 | } | ||
465 | /// <summary> | ||
466 | /// Set the current Windlight scene to a target avatar | ||
467 | /// </summary> | ||
468 | /// <param name="rules"></param> | ||
469 | /// <returns>success: true or false</returns> | ||
470 | public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) | ||
471 | { | ||
472 | if (!m_CMFunctionsEnabled) | ||
473 | { | ||
474 | CMShoutError("Careminster functions are not enabled."); | ||
475 | return 0; | ||
476 | } | ||
477 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | ||
478 | { | ||
479 | CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners."); | ||
480 | return 0; | ||
427 | } | 481 | } |
428 | int success = 0; | 482 | int success = 0; |
429 | m_host.AddScriptLPS(1); | 483 | m_host.AddScriptLPS(1); |
430 | if (Meta7WindlightModule.EnableWindlight) | 484 | if (Meta7WindlightModule.EnableWindlight) |
431 | { | 485 | { |
432 | RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); | 486 | RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); |
433 | m_host.ParentGroup.Scene.StoreWindlightProfile(wl); | 487 | World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string)); |
434 | success = 1; | 488 | success = 1; |
435 | } | 489 | } |
436 | else | 490 | else |
437 | { | 491 | { |
438 | CMShoutError("Windlight module is disabled"); | 492 | CMShoutError("Windlight module is disabled"); |
439 | return 0; | 493 | return 0; |
440 | } | 494 | } |
441 | return success; | 495 | return success; |
442 | } | ||
443 | /// <summary> | ||
444 | /// Set the current Windlight scene to a target avatar | ||
445 | /// </summary> | ||
446 | /// <param name="rules"></param> | ||
447 | /// <returns>success: true or false</returns> | ||
448 | public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target) | ||
449 | { | ||
450 | if (!m_CMFunctionsEnabled) | ||
451 | { | ||
452 | CMShoutError("Careminster functions are not enabled."); | ||
453 | return 0; | ||
454 | } | ||
455 | if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) | ||
456 | { | ||
457 | CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners."); | ||
458 | return 0; | ||
459 | } | ||
460 | int success = 0; | ||
461 | m_host.AddScriptLPS(1); | ||
462 | if (Meta7WindlightModule.EnableWindlight) | ||
463 | { | ||
464 | RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules); | ||
465 | World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string)); | ||
466 | success = 1; | ||
467 | } | ||
468 | else | ||
469 | { | ||
470 | CMShoutError("Windlight module is disabled"); | ||
471 | return 0; | ||
472 | } | ||
473 | return success; | ||
474 | } | 496 | } |
475 | 497 | ||
476 | } | 498 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a76f386..75dd615 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2881,6 +2881,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2881 | 2881 | ||
2882 | public void llLookAt(LSL_Vector target, double strength, double damping) | 2882 | public void llLookAt(LSL_Vector target, double strength, double damping) |
2883 | { | 2883 | { |
2884 | /* | ||
2884 | m_host.AddScriptLPS(1); | 2885 | m_host.AddScriptLPS(1); |
2885 | // Determine where we are looking from | 2886 | // Determine where we are looking from |
2886 | LSL_Vector from = llGetPos(); | 2887 | LSL_Vector from = llGetPos(); |
@@ -2900,12 +2901,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2900 | // the angles of rotation in radians into rotation value | 2901 | // the angles of rotation in radians into rotation value |
2901 | 2902 | ||
2902 | LSL_Types.Quaternion rot = llEuler2Rot(angle); | 2903 | LSL_Types.Quaternion rot = llEuler2Rot(angle); |
2903 | /* | 2904 | |
2904 | Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); | 2905 | // This would only work if your physics system contains an APID controller: |
2905 | m_host.startLookAt(rotation, (float)damping, (float)strength); | 2906 | // Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); |
2906 | This would only work if your physics system contains an APID controller */ | 2907 | // m_host.startLookAt(rotation, (float)damping, (float)strength); |
2908 | |||
2907 | // Orient the object to the angle calculated | 2909 | // Orient the object to the angle calculated |
2908 | llSetRot(rot); | 2910 | llSetRot(rot); |
2911 | */ | ||
2912 | |||
2913 | //The above code, while nice, doesn't replicate the behaviour of SL and tends to "roll" the object. | ||
2914 | //There's probably a smarter way of doing this, my rotation math-fu is weak. | ||
2915 | // http://bugs.meta7.com/view.php?id=28 | ||
2916 | // - Tom | ||
2917 | |||
2918 | LSL_Rotation newrot = llGetRot() * llRotBetween(new LSL_Vector(1.0d, 0.0d, 0.0d) * llGetRot(), new LSL_Vector(0.0d, 0.0d, -1.0d)); | ||
2919 | llSetRot(newrot * llRotBetween(new LSL_Vector(0.0d,0.0d,1.0d) * newrot, target - llGetPos())); | ||
2920 | |||
2909 | } | 2921 | } |
2910 | 2922 | ||
2911 | public void llRotLookAt(LSL_Rotation target, double strength, double damping) | 2923 | public void llRotLookAt(LSL_Rotation target, double strength, double damping) |
@@ -6195,6 +6207,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6195 | tempf = (float)rules.GetLSLFloatItem(i + 1); | 6207 | tempf = (float)rules.GetLSLFloatItem(i + 1); |
6196 | prules.OuterAngle = (float)tempf; | 6208 | prules.OuterAngle = (float)tempf; |
6197 | break; | 6209 | break; |
6210 | |||
6211 | case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE: | ||
6212 | tempf = (float)rules.GetLSLFloatItem(i + 1); | ||
6213 | prules.InnerAngle = (float)tempf; | ||
6214 | break; | ||
6215 | |||
6216 | case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE: | ||
6217 | tempf = (float)rules.GetLSLFloatItem(i + 1); | ||
6218 | prules.OuterAngle = (float)tempf; | ||
6219 | break; | ||
6198 | } | 6220 | } |
6199 | 6221 | ||
6200 | } | 6222 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs index ef990a1..6239726 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs | |||
@@ -15,7 +15,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
15 | { | 15 | { |
16 | // Windlight Functions | 16 | // Windlight Functions |
17 | LSL_List cmGetWindlightScene(LSL_List rules); | 17 | LSL_List cmGetWindlightScene(LSL_List rules); |
18 | int cmSetWindlightScene(LSL_List rules); | 18 | int cmSetWindlightScene(LSL_List rules); |
19 | int cmSetWindlightSceneTargeted(LSL_List rules, key target); | 19 | int cmSetWindlightSceneTargeted(LSL_List rules, key target); |
20 | LSL_List cmGetAvatarList(); | ||
20 | } | 21 | } |
21 | } | 22 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs index 5bc3a88..aaffbe4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs | |||
@@ -66,11 +66,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
66 | public int cmSetWindlightScene(LSL_List rules) | 66 | public int cmSetWindlightScene(LSL_List rules) |
67 | { | 67 | { |
68 | return m_CM_Functions.cmSetWindlightScene(rules); | 68 | return m_CM_Functions.cmSetWindlightScene(rules); |
69 | } | 69 | } |
70 | 70 | ||
71 | public int cmSetWindlightSceneTargeted(LSL_List rules, key target) | 71 | public int cmSetWindlightSceneTargeted(LSL_List rules, key target) |
72 | { | 72 | { |
73 | return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); | 73 | return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); |
74 | } | ||
75 | public LSL_List cmGetAvatarList() | ||
76 | { | ||
77 | return m_CM_Functions.cmGetAvatarList(); | ||
74 | } | 78 | } |
75 | } | 79 | } |
76 | } | 80 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index ee35fa4..b3e4740 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -274,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
274 | public const int CHANGED_ALLOWED_DROP = 64; | 274 | public const int CHANGED_ALLOWED_DROP = 64; |
275 | public const int CHANGED_OWNER = 128; | 275 | public const int CHANGED_OWNER = 128; |
276 | public const int CHANGED_REGION_RESTART = 256; | 276 | public const int CHANGED_REGION_RESTART = 256; |
277 | public const int CHANGED_REGION_START = 256; //LL Changed the constant from CHANGED_REGION_RESTART | ||
277 | public const int CHANGED_REGION = 512; | 278 | public const int CHANGED_REGION = 512; |
278 | public const int CHANGED_TELEPORT = 1024; | 279 | public const int CHANGED_TELEPORT = 1024; |
279 | public const int CHANGED_ANIMATION = 16384; | 280 | public const int CHANGED_ANIMATION = 16384; |