mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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
This commit is contained in:
@@ -42,10 +42,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||
/// An interface for a script API module to communicate with
|
||||
/// the engine it's running under
|
||||
/// </summary>
|
||||
|
||||
public delegate void ScriptRemoved(UUID script);
|
||||
public delegate void ObjectRemoved(UUID prim);
|
||||
|
||||
public interface IScriptEngine
|
||||
{
|
||||
/// <summary>
|
||||
@@ -57,9 +53,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||
|
||||
IScriptModule ScriptModule { get; }
|
||||
|
||||
event ScriptRemoved OnScriptRemoved;
|
||||
event ObjectRemoved OnObjectRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Post an event to a single script
|
||||
/// </summary>
|
||||
|
||||
@@ -140,11 +140,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_TransferModule =
|
||||
m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
|
||||
m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
|
||||
if (m_UrlModule != null)
|
||||
{
|
||||
m_ScriptEngine.OnScriptRemoved += m_UrlModule.ScriptRemoved;
|
||||
m_ScriptEngine.OnObjectRemoved += m_UrlModule.ObjectRemoved;
|
||||
}
|
||||
|
||||
AsyncCommands = new AsyncCommandManager(ScriptEngine);
|
||||
}
|
||||
@@ -3063,6 +3058,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// we need to convert from a vector describing
|
||||
// the angles of rotation in radians into rotation value
|
||||
|
||||
<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
|
||||
LSL_Types.Quaternion rot = llEuler2Rot(angle);
|
||||
|
||||
// This would only work if your physics system contains an APID controller:
|
||||
@@ -3095,10 +3091,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSL_Vector ae = new LSL_Vector(0.0f, terot, 0.0f);
|
||||
LSL_Types.Quaternion spin = llEuler2Rot(az);
|
||||
LSL_Types.Quaternion rot = llEuler2Rot(ae) * spin;
|
||||
=======
|
||||
LSL_Rotation rot = llEuler2Rot(angle);
|
||||
|
||||
// Per discussion with Melanie, for non-physical objects llLookAt appears to simply
|
||||
// set the rotation of the object, copy that behavior
|
||||
if (strength == 0 || m_host.PhysActor == null || !m_host.PhysActor.IsPhysical)
|
||||
{
|
||||
>>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
|
||||
llSetRot(rot);
|
||||
}
|
||||
else
|
||||
{
|
||||
<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
|
||||
// Physical, send the target vector to RotLookAt method inside a 'rotation', the .w -99.9 value indicates it is really a LookAt.
|
||||
Quaternion q = new Quaternion((float)target.x, (float)target.y, (float)target.z, -99.9f);
|
||||
m_host.RotLookAt(q, (float)strength, (float)damping);
|
||||
@@ -3112,6 +3117,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// NotImplemented("llRotLookAt");
|
||||
m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping);
|
||||
|
||||
=======
|
||||
m_host.StartLookAt(Rot2Quaternion(rot), (float)strength, (float)damping);
|
||||
}
|
||||
>>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
|
||||
}
|
||||
|
||||
public void llStopLookAt()
|
||||
@@ -3534,6 +3543,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
|
||||
=======
|
||||
public void llRotLookAt(LSL_Rotation target, double strength, double damping)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
// Per discussion with Melanie, for non-physical objects llLookAt appears to simply
|
||||
// set the rotation of the object, copy that behavior
|
||||
if (strength == 0 || m_host.PhysActor == null || !m_host.PhysActor.IsPhysical)
|
||||
{
|
||||
llSetLocalRot(target);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping);
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> master:OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
|
||||
public LSL_Integer llStringLength(string str)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
@@ -341,11 +341,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"scripts", false, "scripts show", "scripts show", "Show script information",
|
||||
"Show information on all scripts known to the script engine", HandleShowScripts);
|
||||
"scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information",
|
||||
"Show information on all scripts known to the script engine."
|
||||
+ "If a <script-item-uuid> is given then only information on that script will be shown.",
|
||||
HandleShowScripts);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"scripts", false, "show scripts", "show scripts", "Show script information",
|
||||
"scripts", false, "show scripts", "show scripts [<script-item-uuid>]", "Show script information",
|
||||
"Synonym for scripts show command", HandleShowScripts);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
@@ -376,43 +378,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
(module, cmdparams) => HandleScriptsAction(cmdparams, HandleStartScript));
|
||||
}
|
||||
|
||||
public void HandleShowScripts(string module, string[] cmdparams)
|
||||
{
|
||||
lock (m_Scripts)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName);
|
||||
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
{
|
||||
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
|
||||
string status;
|
||||
|
||||
if (instance.ShuttingDown)
|
||||
{
|
||||
status = "shutting down";
|
||||
}
|
||||
else if (instance.Suspended)
|
||||
{
|
||||
status = "suspended";
|
||||
}
|
||||
else if (!instance.Running)
|
||||
{
|
||||
status = "stopped";
|
||||
}
|
||||
else
|
||||
{
|
||||
status = "running";
|
||||
}
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})",
|
||||
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID,
|
||||
sop.AbsolutePosition, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse the raw item id into a script instance from the command params if it's present.
|
||||
/// </summary>
|
||||
@@ -462,6 +427,48 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleShowScripts(string module, string[] cmdparams)
|
||||
{
|
||||
if (cmdparams.Length == 2)
|
||||
{
|
||||
lock (m_Scripts)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Showing {0} scripts in {1}", m_Scripts.Count, m_Scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
HandleScriptsAction(cmdparams, HandleShowScript);
|
||||
}
|
||||
|
||||
private void HandleShowScript(IScriptInstance instance)
|
||||
{
|
||||
SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
|
||||
string status;
|
||||
|
||||
if (instance.ShuttingDown)
|
||||
{
|
||||
status = "shutting down";
|
||||
}
|
||||
else if (instance.Suspended)
|
||||
{
|
||||
status = "suspended";
|
||||
}
|
||||
else if (!instance.Running)
|
||||
{
|
||||
status = "stopped";
|
||||
}
|
||||
else
|
||||
{
|
||||
status = "running";
|
||||
}
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"{0}.{1}, item UUID {2}, prim UUID {3} @ {4} ({5})",
|
||||
instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID,
|
||||
sop.AbsolutePosition, status);
|
||||
}
|
||||
|
||||
private void HandleSuspendScript(IScriptInstance instance)
|
||||
{
|
||||
if (!instance.Suspended)
|
||||
|
||||
Reference in New Issue
Block a user