* More LSL related fun

afrisby
Adam Frisby 2007-07-17 23:14:19 +00:00
parent c287ee17ad
commit 9fc72755ce
5 changed files with 23 additions and 7 deletions

View File

@ -12,8 +12,10 @@ namespace OpenSim.Region.Scripting.LSL
ScriptInfo scriptInfo; ScriptInfo scriptInfo;
LSL.Engine lindenScriptEngine; LSL.Engine lindenScriptEngine;
public LSLScript(string filename) public LSLScript(string filename, libsecondlife.LLUUID taskObject)
{ {
scriptInfo.CreateTaskAPI(taskObject);
lindenScriptEngine = new Engine(); lindenScriptEngine = new Engine();
lindenScriptEngine.Start(filename); lindenScriptEngine.Start(filename);
} }

View File

@ -16,7 +16,7 @@ namespace OpenSim.Region.Scripting
public Dictionary<string, IScript> compile(string filename) 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>(); Dictionary<string, IScript> returns = new Dictionary<string, IScript>();
returns.Add(filename, script); returns.Add(filename, script);

View File

@ -18,10 +18,10 @@ namespace OpenSim.Region.Scripting
Scene scene; Scene scene;
ScriptInterpretedAPI interpretedAPI; ScriptInterpretedAPI interpretedAPI;
public ScriptAPI(Scene world) public ScriptAPI(Scene world, Key taskID)
{ {
scene = world; scene = world;
interpretedAPI = new ScriptInterpretedAPI(); interpretedAPI = new ScriptInterpretedAPI(world, taskID);
} }
public Object CallMethod(String method, Object[] args) public Object CallMethod(String method, Object[] args)

View File

@ -52,7 +52,12 @@ namespace OpenSim.Region.Scripting
world = scene; world = scene;
events = world.EventManager; events = world.EventManager;
logger = MainLog.Instance; 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);
} }
} }
} }

View File

@ -51,7 +51,7 @@ namespace OpenSim.Region.Scripting
/// <param name="member">The specific member being 'occupied' by the script</param> /// <param name="member">The specific member being 'occupied' by the script</param>
public ScriptInterpretedAPI(Scene world, libsecondlife.LLUUID member) public ScriptInterpretedAPI(Scene world, libsecondlife.LLUUID member)
{ {
m_object = world; m_scene = world;
m_object = member; m_object = member;
} }
@ -76,7 +76,7 @@ namespace OpenSim.Region.Scripting
int parcelID = 0; int parcelID = 0;
Vector myPosition = Task.Pos; 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)"); OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
return; return;
@ -135,6 +135,15 @@ namespace OpenSim.Region.Scripting
[Obsolete("Unimplemented")] [Obsolete("Unimplemented")]
public Key osAvatarOnSitTarget() 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; return Key.Zero;
} }