29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Reflection;
34 using OpenSim.Framework;
35 using OpenSim.Region.Framework.Interfaces;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Region.ScriptEngine.Interfaces;
38 using OpenSim.Region.ScriptEngine.Shared;
40 namespace OpenSim.Tests.Common
44 public IConfigSource ConfigSource {
get;
private set; }
46 public IConfig Config {
get;
private set; }
48 private Scene m_scene;
53 public Dictionary<UUID, List<EventParams>> PostedEvents {
get;
private set; }
65 ConfigSource = source;
68 Config =
new IniConfig(
"MockScriptEngine", ConfigSource);
70 PostedEvents =
new Dictionary<UUID, List<EventParams>>();
92 public string Name {
get {
return "Mock Script Engine"; } }
93 public string ScriptEngineName {
get {
return Name; } }
95 public Type ReplaceableInterface {
get {
return null; } }
97 #pragma warning disable 0067
100 #pragma warning restore 0067
104 throw new System.NotImplementedException ();
109 throw new System.NotImplementedException ();
116 return PostScriptEvent(itemID,
new EventParams(name, args, null));
121 List<EventParams> eventsForItem;
123 if (!PostedEvents.ContainsKey(itemID))
125 eventsForItem =
new List<EventParams>();
126 PostedEvents.Add(itemID, eventsForItem);
130 eventsForItem = PostedEvents[itemID];
133 eventsForItem.Add(evParams);
135 if (PostEventHook != null)
136 PostEventHook(itemID, evParams);
143 return PostObjectEvent(m_scene.GetSceneObjectPart(localID), evParams);
148 return PostObjectEvent(m_scene.GetSceneObjectPart(itemID),
new EventParams(name, args, null));
154 PostScriptEvent(item.
ItemID, evParams);
161 throw new System.NotImplementedException ();
166 throw new System.NotImplementedException ();
171 throw new System.NotImplementedException ();
176 throw new System.NotImplementedException ();
181 throw new System.NotImplementedException ();
186 throw new System.NotImplementedException ();
191 throw new System.NotImplementedException ();
196 throw new System.NotImplementedException ();
201 throw new System.NotImplementedException ();
206 throw new System.NotImplementedException ();
211 throw new System.NotImplementedException ();
216 throw new System.NotImplementedException ();
221 throw new System.NotImplementedException ();
226 throw new System.NotImplementedException ();
231 throw new System.NotImplementedException ();
236 throw new System.NotImplementedException ();
241 throw new System.NotImplementedException ();
246 throw new System.NotImplementedException ();
253 public string ScriptEnginePath {
get {
throw new System.NotImplementedException (); }}
255 public string ScriptClassName {
get {
throw new System.NotImplementedException (); } }
257 public string ScriptBaseClassName {
get {
throw new System.NotImplementedException (); } }
259 public string[] ScriptReferencedAssemblies {
get {
throw new System.NotImplementedException (); } }
261 public ParameterInfo[] ScriptBaseClassParameters {
get {
throw new System.NotImplementedException (); } }
265 PostedEvents.Clear();
void SetMinEventDelay(UUID itemID, double delay)
void ResumeScript(UUID itemID)
Resumes a script.
void SetScriptState(UUID itemID, bool state)
IEntityInventory Inventory
This part's inventory
IScriptWorkItem QueueEventHandler(object parms)
Queue an event for execution
bool HasScript(UUID itemID, out bool running)
bool GetScriptState(UUID itemID)
Returns true if a script is running.
bool PostScriptEvent(UUID itemID, EventParams evParams)
Post an event to a single script
void SuspendScript(UUID itemID)
Suspends a script.
DetectParams GetDetectParams(UUID item, int number)
Represents an item in a task inventory
bool PostObjectEvent(uint localID, EventParams evParams)
Post event to an entire prim
ArrayList GetScriptErrors(UUID itemID)
float GetScriptExecutionTime(List< UUID > itemIDs)
Get the execution times of all scripts in the given array if they are currently running.
An interface for a script API module to communicate with the engine it's running under ...
bool PostObjectEvent(UUID itemID, string name, object[] args)
bool SetXMLState(UUID itemID, string xml)
delegate void ObjectRemoved(UUID prim)
List< TaskInventoryItem > GetInventoryItems()
Get all inventory items.
void SetState(UUID itemID, string newState)
Action< UUID, EventParams > PostEventHook
A very primitive way of hooking text cose to a posed event.
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
void StartProcessing()
Starts the processing threads.
ObjectRemoved OnObjectRemoved
bool PostScriptEvent(UUID itemID, string name, object[] args)
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
Dictionary< uint, float > GetObjectScriptsExecutionTimes()
Get the execution times of all scripts in each object.
int GetStartParameter(UUID itemID)
string GetXMLState(UUID itemID)
delegate void ScriptRemoved(UUID script)
void ApiResetScript(UUID itemID)
Holds all the data required to execute a scripting event.
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
void ResetScript(UUID itemID)
IScriptApi GetApi(UUID itemID, string name)
void SleepScript(UUID itemID, int delay)
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
ScriptRemoved OnScriptRemoved