aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMelanie2012-01-14 06:09:19 +0000
committerMelanie2012-01-14 06:09:19 +0000
commit43128c9016ea4482bdc38b1b099b67929e28a68b (patch)
treeeafe72f6235ac4d148d4778d67a131a5228ca2dd /OpenSim/Region/ScriptEngine
parentAllow SmtpClients and other SSL users to work with our cert handler installed (diff)
parentAllow SmtpClients and other SSL users to work with our cert handler installed (diff)
downloadopensim-SC_OLD-43128c9016ea4482bdc38b1b099b67929e28a68b.zip
opensim-SC_OLD-43128c9016ea4482bdc38b1b099b67929e28a68b.tar.gz
opensim-SC_OLD-43128c9016ea4482bdc38b1b099b67929e28a68b.tar.bz2
opensim-SC_OLD-43128c9016ea4482bdc38b1b099b67929e28a68b.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs38
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs87
3 files changed, 80 insertions, 52 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
index 581a9a9..17c2708 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
@@ -42,10 +42,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
42 /// An interface for a script API module to communicate with 42 /// An interface for a script API module to communicate with
43 /// the engine it's running under 43 /// the engine it's running under
44 /// </summary> 44 /// </summary>
45
46 public delegate void ScriptRemoved(UUID script);
47 public delegate void ObjectRemoved(UUID prim);
48
49 public interface IScriptEngine 45 public interface IScriptEngine
50 { 46 {
51 /// <summary> 47 /// <summary>
@@ -57,9 +53,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
57 53
58 IScriptModule ScriptModule { get; } 54 IScriptModule ScriptModule { get; }
59 55
60 event ScriptRemoved OnScriptRemoved;
61 event ObjectRemoved OnObjectRemoved;
62
63 /// <summary> 56 /// <summary>
64 /// Post an event to a single script 57 /// Post an event to a single script
65 /// </summary> 58 /// </summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 466e540..943f37d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -140,11 +140,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
140 m_TransferModule = 140 m_TransferModule =
141 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); 141 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
142 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); 142 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
143 if (m_UrlModule != null)
144 {
145 m_ScriptEngine.OnScriptRemoved += m_UrlModule.ScriptRemoved;
146 m_ScriptEngine.OnObjectRemoved += m_UrlModule.ObjectRemoved;
147 }
148 143
149 AsyncCommands = new AsyncCommandManager(ScriptEngine); 144 AsyncCommands = new AsyncCommandManager(ScriptEngine);
150 } 145 }
@@ -3063,6 +3058,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3063 // we need to convert from a vector describing 3058 // we need to convert from a vector describing
3064 // the angles of rotation in radians into rotation value 3059 // the angles of rotation in radians into rotation value
3065 3060
3061<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
3066 LSL_Types.Quaternion rot = llEuler2Rot(angle); 3062 LSL_Types.Quaternion rot = llEuler2Rot(angle);
3067 3063
3068 // This would only work if your physics system contains an APID controller: 3064 // This would only work if your physics system contains an APID controller:
@@ -3095,10 +3091,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3095 LSL_Vector ae = new LSL_Vector(0.0f, terot, 0.0f); 3091 LSL_Vector ae = new LSL_Vector(0.0f, terot, 0.0f);
3096 LSL_Types.Quaternion spin = llEuler2Rot(az); 3092 LSL_Types.Quaternion spin = llEuler2Rot(az);
3097 LSL_Types.Quaternion rot = llEuler2Rot(ae) * spin; 3093 LSL_Types.Quaternion rot = llEuler2Rot(ae) * spin;
3094=======
3095 LSL_Rotation rot = llEuler2Rot(angle);
3096
3097 // Per discussion with Melanie, for non-physical objects llLookAt appears to simply
3098 // set the rotation of the object, copy that behavior
3099 if (strength == 0 || m_host.PhysActor == null || !m_host.PhysActor.IsPhysical)
3100 {
3101>>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
3098 llSetRot(rot); 3102 llSetRot(rot);
3099 } 3103 }
3100 else 3104 else
3101 { 3105 {
3106<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
3102 // Physical, send the target vector to RotLookAt method inside a 'rotation', the .w -99.9 value indicates it is really a LookAt. 3107 // Physical, send the target vector to RotLookAt method inside a 'rotation', the .w -99.9 value indicates it is really a LookAt.
3103 Quaternion q = new Quaternion((float)target.x, (float)target.y, (float)target.z, -99.9f); 3108 Quaternion q = new Quaternion((float)target.x, (float)target.y, (float)target.z, -99.9f);
3104 m_host.RotLookAt(q, (float)strength, (float)damping); 3109 m_host.RotLookAt(q, (float)strength, (float)damping);
@@ -3112,6 +3117,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3112// NotImplemented("llRotLookAt"); 3117// NotImplemented("llRotLookAt");
3113 m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping); 3118 m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping);
3114 3119
3120=======
3121 m_host.StartLookAt(Rot2Quaternion(rot), (float)strength, (float)damping);
3122 }
3123>>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
3115 } 3124 }
3116 3125
3117 public void llStopLookAt() 3126 public void llStopLookAt()
@@ -3534,6 +3543,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3534 m_host.AddScriptLPS(1); 3543 m_host.AddScriptLPS(1);
3535 } 3544 }
3536 3545
3546<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
3547=======
3548 public void llRotLookAt(LSL_Rotation target, double strength, double damping)
3549 {
3550 m_host.AddScriptLPS(1);
3551
3552 // Per discussion with Melanie, for non-physical objects llLookAt appears to simply
3553 // set the rotation of the object, copy that behavior
3554 if (strength == 0 || m_host.PhysActor == null || !m_host.PhysActor.IsPhysical)
3555 {
3556 llSetLocalRot(target);
3557 }
3558 else
3559 {
3560 m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping);
3561 }
3562 }
3563
3564>>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
3537 public LSL_Integer llStringLength(string str) 3565 public LSL_Integer llStringLength(string str)
3538 { 3566 {
3539 m_host.AddScriptLPS(1); 3567 m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 65c7416..23531a9 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -341,11 +341,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
341 } 341 }
342 342
343 MainConsole.Instance.Commands.AddCommand( 343 MainConsole.Instance.Commands.AddCommand(
344 "scripts", false, "scripts show", "scripts show", "Show script information", 344 "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information",
345 "Show information on all scripts known to the script engine", HandleShowScripts); 345 "Show information on all scripts known to the script engine."
346 + "If a <script-item-uuid> is given then only information on that script will be shown.",
347 HandleShowScripts);
346 348
347 MainConsole.Instance.Commands.AddCommand( 349 MainConsole.Instance.Commands.AddCommand(
348 "scripts", false, "show scripts", "show scripts", "Show script information", 350 "scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information",
349 "Synonym for scripts show command", HandleShowScripts); 351 "Synonym for scripts show command", HandleShowScripts);
350 352
351 MainConsole.Instance.Commands.AddCommand( 353 MainConsole.Instance.Commands.AddCommand(
@@ -376,43 +378,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
376 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript)); 378 (module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript));
377 } 379 }
378 380
379 public void HandleShowScripts(string module, string[] cmdparams)
380 {
381 lock (m_Scripts)
382 {
383 MainConsole.Instance.OutputFormat(
384 "Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName);
385
386 foreach (IScriptInstance instance in m_Scripts.Values)
387 {
388 SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
389 string status;
390
391 if (instance.ShuttingDown)
392 {
393 status = "shutting down";
394 }
395 else if (instance.Suspended)
396 {
397 status = "suspended";
398 }
399 else if (!instance.Running)
400 {
401 status = "stopped";
402 }
403 else
404 {
405 status = "running";
406 }
407
408 MainConsole.Instance.OutputFormat(
409 "{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})",
410 instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID,
411 sop.AbsolutePosition, status);
412 }
413 }
414 }
415
416 /// <summary> 381 /// <summary>
417 /// Parse the raw item id into a script instance from the command params if it's present. 382 /// Parse the raw item id into a script instance from the command params if it's present.
418 /// </summary> 383 /// </summary>
@@ -462,6 +427,48 @@ namespace OpenSim.Region.ScriptEngine.XEngine
462 } 427 }
463 } 428 }
464 429
430 public void HandleShowScripts(string module, string[] cmdparams)
431 {
432 if (cmdparams.Length == 2)
433 {
434 lock (m_Scripts)
435 {
436 MainConsole.Instance.OutputFormat(
437 "Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName);
438 }
439 }
440
441 HandleScriptsAction(cmdparams, HandleShowScript);
442 }
443
444 private void HandleShowScript(IScriptInstance instance)
445 {
446 SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
447 string status;
448
449 if (instance.ShuttingDown)
450 {
451 status = "shutting down";
452 }
453 else if (instance.Suspended)
454 {
455 status = "suspended";
456 }
457 else if (!instance.Running)
458 {
459 status = "stopped";
460 }
461 else
462 {
463 status = "running";
464 }
465
466 MainConsole.Instance.OutputFormat(
467 "{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})",
468 instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID,
469 sop.AbsolutePosition, status);
470 }
471
465 private void HandleSuspendScript(IScriptInstance instance) 472 private void HandleSuspendScript(IScriptInstance instance)
466 { 473 {
467 if (!instance.Suspended) 474 if (!instance.Suspended)