250 lines
6.3 KiB
C#
250 lines
6.3 KiB
C#
using Mono.Addins;
|
|
using Nini.Config;
|
|
using OpenMetaverse;
|
|
using OpenSim.Region.Framework.Interfaces;
|
|
using OpenSim.Region.Framework.Scenes;
|
|
using OpenSim.Region.ScriptEngine.Interfaces;
|
|
using OpenSim.Region.ScriptEngine.Shared;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
[assembly: Addin("LUAEngine", "0.1")]
|
|
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
|
namespace OpenSim.Region.ScriptEngine.Lua
|
|
{
|
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LUAEngine")]
|
|
class LUAEngine : INonSharedRegionModule, IScriptModule, IScriptEngine
|
|
{
|
|
private IConfigSource m_config = null;
|
|
|
|
private Scene m_scene = null;
|
|
|
|
private bool m_enable = true;
|
|
private bool m_sandbox = true;
|
|
|
|
public event ScriptRemoved OnScriptRemoved;
|
|
public event ObjectRemoved OnObjectRemoved;
|
|
|
|
#region INonSharedRegionModule
|
|
public string Name
|
|
{
|
|
get { return "LUAEngine"; }
|
|
}
|
|
|
|
public Type ReplaceableInterface
|
|
{
|
|
get { return null; }
|
|
}
|
|
|
|
public void Initialise(IConfigSource source)
|
|
{
|
|
if (source.Configs["LUA"] == null)
|
|
return;
|
|
|
|
m_config = source;
|
|
|
|
m_enable = source.Configs["LUA"].GetBoolean("Enable", m_enable);
|
|
m_sandbox = source.Configs["LUA"].GetBoolean("Sandbox", m_sandbox);
|
|
}
|
|
|
|
public void AddRegion(Scene scene)
|
|
{
|
|
if (m_scene == null)
|
|
m_scene = scene;
|
|
}
|
|
|
|
public void RemoveRegion(Scene scene)
|
|
{
|
|
m_scene = null;
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
m_scene = null;
|
|
}
|
|
|
|
public void RegionLoaded(Scene scene)
|
|
{
|
|
if (m_scene == null)
|
|
m_scene = scene;
|
|
}
|
|
#endregion
|
|
|
|
#region IScriptModule
|
|
public string ScriptEngineName
|
|
{
|
|
get { return "LUAEngine"; }
|
|
}
|
|
|
|
public Dictionary<uint, float> GetObjectScriptsExecutionTimes()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public ArrayList GetScriptErrors(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public float GetScriptExecutionTime(List<UUID> itemIDs)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool GetScriptState(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public string GetXMLState(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool HasScript(UUID itemID, out bool running)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
|
|
public bool PostObjectEvent(UUID itemID, string name, object[] args)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool PostScriptEvent(UUID itemID, string name, object[] args)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool ResumeScript(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SaveAllState()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool SetXMLState(UUID itemID, string xml)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void StartProcessing()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool SuspendScript(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
#endregion
|
|
|
|
#region IScriptEngine
|
|
public Scene World
|
|
{
|
|
get { return m_scene; }
|
|
}
|
|
|
|
public IScriptModule ScriptModule => throw new NotImplementedException();
|
|
|
|
public IConfig Config
|
|
{
|
|
get { return m_config.Configs["LUA"]; }
|
|
}
|
|
|
|
public IConfigSource ConfigSource
|
|
{
|
|
get { return m_config; }
|
|
}
|
|
|
|
public string ScriptEnginePath
|
|
{
|
|
get { return "./LUAScriptEngine"; }
|
|
}
|
|
|
|
public string ScriptClassName => throw new NotImplementedException();
|
|
|
|
public string ScriptBaseClassName => throw new NotImplementedException();
|
|
|
|
public string[] ScriptReferencedAssemblies => throw new NotImplementedException();
|
|
|
|
public ParameterInfo[] ScriptBaseClassParameters => throw new NotImplementedException();
|
|
|
|
public void ApiResetScript(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void CancelScriptEvent(UUID itemID, string eventName)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public IScriptApi GetApi(UUID itemID, string name)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public DetectParams GetDetectParams(UUID item, int number)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public int GetStartParameter(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool PostObjectEvent(uint localID, EventParams parms)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool PostScriptEvent(UUID itemID, EventParams parms)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public IScriptWorkItem QueueEventHandler(object parms)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void ResetScript(UUID itemID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SetMinEventDelay(UUID itemID, double delay)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SetScriptState(UUID itemID, bool state, bool self)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SetState(UUID itemID, string newState)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SleepScript(UUID itemID, int delay)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|