* More LSL related fun
parent
c287ee17ad
commit
9fc72755ce
|
@ -12,8 +12,10 @@ namespace OpenSim.Region.Scripting.LSL
|
|||
ScriptInfo scriptInfo;
|
||||
LSL.Engine lindenScriptEngine;
|
||||
|
||||
public LSLScript(string filename)
|
||||
public LSLScript(string filename, libsecondlife.LLUUID taskObject)
|
||||
{
|
||||
scriptInfo.CreateTaskAPI(taskObject);
|
||||
|
||||
lindenScriptEngine = new Engine();
|
||||
lindenScriptEngine.Start(filename);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace OpenSim.Region.Scripting
|
|||
|
||||
public Dictionary<string, IScript> compile(string filename)
|
||||
{
|
||||
LSLScript script = new LSLScript(filename);
|
||||
LSLScript script = new LSLScript(filename, libsecondlife.LLUUID.Zero);
|
||||
Dictionary<string, IScript> returns = new Dictionary<string, IScript>();
|
||||
|
||||
returns.Add(filename, script);
|
||||
|
|
|
@ -18,10 +18,10 @@ namespace OpenSim.Region.Scripting
|
|||
Scene scene;
|
||||
ScriptInterpretedAPI interpretedAPI;
|
||||
|
||||
public ScriptAPI(Scene world)
|
||||
public ScriptAPI(Scene world, Key taskID)
|
||||
{
|
||||
scene = world;
|
||||
interpretedAPI = new ScriptInterpretedAPI();
|
||||
interpretedAPI = new ScriptInterpretedAPI(world, taskID);
|
||||
}
|
||||
|
||||
public Object CallMethod(String method, Object[] args)
|
||||
|
|
|
@ -52,7 +52,12 @@ namespace OpenSim.Region.Scripting
|
|||
world = scene;
|
||||
events = world.EventManager;
|
||||
logger = MainLog.Instance;
|
||||
api = new ScriptAPI(scene);
|
||||
api = new ScriptAPI(world, libsecondlife.LLUUID.Zero);
|
||||
}
|
||||
|
||||
public void CreateTaskAPI(libsecondlife.LLUUID task)
|
||||
{
|
||||
api = new ScriptAPI(world, task);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace OpenSim.Region.Scripting
|
|||
/// <param name="member">The specific member being 'occupied' by the script</param>
|
||||
public ScriptInterpretedAPI(Scene world, libsecondlife.LLUUID member)
|
||||
{
|
||||
m_object = world;
|
||||
m_scene = world;
|
||||
m_object = member;
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ namespace OpenSim.Region.Scripting
|
|||
int parcelID = 0;
|
||||
|
||||
Vector myPosition = Task.Pos;
|
||||
Land myParcel = World.LandManager.getLandObject(myPosition.X, myPosition.Y, myPosition.Z);
|
||||
Land myParcel = World.LandManager.getLandObject(myPosition.X, myPosition.Y);
|
||||
|
||||
OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
|
||||
return;
|
||||
|
@ -135,6 +135,15 @@ namespace OpenSim.Region.Scripting
|
|||
[Obsolete("Unimplemented")]
|
||||
public Key osAvatarOnSitTarget()
|
||||
{
|
||||
//TODO: Follow this as Children is chanced to be of type entity to support ScenePresences
|
||||
foreach (KeyValuePair<Key, Primitive> Child in Task.Children)
|
||||
{
|
||||
if (Child.Value is ScenePresence)
|
||||
{
|
||||
return Child.Value.uuid;
|
||||
}
|
||||
}
|
||||
|
||||
return Key.Zero;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue