OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IScriptInstance.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using System.Collections;
30 using System.Collections.Generic;
31 using System.Threading;
32 using System.Diagnostics;
33 using OpenMetaverse;
34 using log4net;
35 using OpenSim.Framework;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Region.ScriptEngine.Shared;
38 using OpenSim.Region.ScriptEngine.Interfaces;
39 
40 namespace OpenSim.Region.ScriptEngine.Interfaces
41 {
42  public enum StateSource
43  {
44  RegionStart = 0,
45  NewRez = 1,
46  PrimCrossing = 2,
47  ScriptedRez = 3,
48  AttachedRez = 4,
49  Teleporting = 5
50  }
51 
52  public interface IScriptWorkItem
53  {
54  bool Cancel();
55  bool Abort();
56 
61  bool Wait(int t);
62  }
63 
67  public interface IScriptInstance
68  {
79  int DebugLevel { get; set; }
80 
84  bool Running { get; set; }
85 
89  bool Suspended { get; set; }
90 
94  bool ShuttingDown { get; set; }
95 
99  bool StayStopped { get; set; }
100 
104  string State { get; set; }
105 
110  bool StatePersistedHere { get; }
111 
115  DateTime TimeStarted { get; }
116 
120  MetricsCollectorTime ExecutionTime { get; }
121 
125  SceneObjectPart Part { get; }
126 
127  IScriptEngine Engine { get; }
128  UUID AppDomain { get; set; }
129  string PrimName { get; }
130  string ScriptName { get; }
131  UUID ItemID { get; }
132  UUID ObjectID { get; }
133 
137  UUID RootObjectID { get; }
138 
142  uint RootLocalID { get; }
143 
144  uint LocalID { get; }
145  UUID AssetID { get; }
146 
150  TaskInventoryItem ScriptTask { get; }
151 
152  Queue EventQueue { get; }
153 
157  long EventsQueued { get; }
158 
162  long EventsProcessed { get; }
163 
164  void ClearQueue();
165  int StartParam { get; set; }
166 
167  WaitHandle CoopWaitHandle { get; }
168  Stopwatch ExecutionTimer { get; }
169 
170  void RemoveState();
171 
172  void Init();
173  void Start();
174 
187  bool Stop(int timeout, bool clearEventQueue = false);
188 
189  void SetState(string state);
190 
195  void PostEvent(EventParams data);
196 
197  void Suspend();
198  void Resume();
199 
204  object EventProcessor();
205 
206  int EventTime();
207 
220  void ResetScript(int timeout);
221 
230  void ApiResetScript();
231 
232  Dictionary<string, object> GetVars();
233  void SetVars(Dictionary<string, object> vars);
234  DetectParams GetDetectParams(int idx);
235  UUID GetDetectID(int idx);
236  void SaveState();
237  void DestroyScriptInstance();
238 
239  IScriptApi GetApi(string name);
240 
241  Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> LineMap
242  { get; set; }
243 
244  string GetAssemblyName();
245  string GetXMLState();
246  double MinEventDelay { set; }
247  UUID RegionID { get; }
248  }
249 }
Represents an item in a task inventory
A MetricsCollector for time spans.
An interface for a script API module to communicate with the engine it's running under ...
Interface for interaction with a particular script instance
Holds all the data required to execute a scripting event.
Definition: Helpers.cs:281