aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-01-12 14:30:22 +0000
committerTedd Hansen2008-01-12 14:30:22 +0000
commitbacbade369a5244f9bcc611488b59f3bd4c8a564 (patch)
tree2cd909eff401066a69dba96615cbf736fdd73be5 /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
parent* Trying something to see if it helps teleports and border crossings (diff)
downloadopensim-SC_OLD-bacbade369a5244f9bcc611488b59f3bd4c8a564.zip
opensim-SC_OLD-bacbade369a5244f9bcc611488b59f3bd4c8a564.tar.gz
opensim-SC_OLD-bacbade369a5244f9bcc611488b59f3bd4c8a564.tar.bz2
opensim-SC_OLD-bacbade369a5244f9bcc611488b59f3bd4c8a564.tar.xz
Major reorganizing of DotNetEngine. Moved common script engine parts to ScriptEngine.Common, only .Net-specific code in DotNetEngine. AppDomains, event handling, event execution queue and multithreading, script load/unload queue, etc has been moved to ScriptEngine.Common.
Loads of things has been put into interfaces instead of the specific class. We are now one step closer to ScriptServer, and its very easy to implement new script languages. Just a few lines required to make them a OpenSim script module with all its glory.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs86
1 files changed, 8 insertions, 78 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index c3cb34d..191d3b2 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -32,93 +32,23 @@ using OpenSim.Framework.Console;
32using OpenSim.Region.Environment.Interfaces; 32using OpenSim.Region.Environment.Interfaces;
33using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
34using OpenSim.Region.ScriptEngine.Common; 34using OpenSim.Region.ScriptEngine.Common;
35using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
36using EventManager=OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.EventManager;
35 37
36namespace OpenSim.Region.ScriptEngine.DotNetEngine 38namespace OpenSim.Region.ScriptEngine.DotNetEngine
37{ 39{
38 /// <summary>
39 /// This is the root object for ScriptEngine. Objects access each other trough this class.
40 /// </summary>
41 ///
42 [Serializable] 40 [Serializable]
43 public class ScriptEngine : IRegionModule, OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.ScriptEngine 41 public class ScriptEngine : OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptEngine
44 { 42 {
45 public Scene World; 43 // We need to override a few things for our DotNetEngine
46 public EventManager m_EventManager; // Handles and queues incoming events from OpenSim 44 public override void Initialise(Scene scene, IConfigSource config)
47 internal EventQueueManager m_EventQueueManager; // Executes events
48 public ScriptManager m_ScriptManager; // Load, unload and execute scripts
49 internal AppDomainManager m_AppDomainManager;
50 internal LSLLongCmdHandler m_LSLLongCmdHandler;
51
52 private LogBase m_log;
53
54 public ScriptEngine()
55 {
56 //Common.SendToDebug("ScriptEngine Object Initialized");
57 Common.mySE = this;
58 }
59
60 public LogBase Log
61 {
62 get { return m_log; }
63 }
64
65 public void InitializeEngine(Scene Sceneworld, LogBase logger, bool HookUpToServer)
66 {
67 World = Sceneworld;
68 m_log = logger;
69
70 Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing");
71
72 //m_logger.Status("ScriptEngine", "InitializeEngine");
73
74 // Create all objects we'll be using
75 m_EventQueueManager = new EventQueueManager(this);
76 m_EventManager = new EventManager(this, HookUpToServer);
77 m_ScriptManager = new ScriptManager(this);
78 m_AppDomainManager = new AppDomainManager();
79 m_LSLLongCmdHandler = new LSLLongCmdHandler(this);
80
81 // Should we iterate the region for scripts that needs starting?
82 // Or can we assume we are loaded before anything else so we can use proper events?
83 }
84
85 public void Shutdown()
86 {
87 // We are shutting down
88 }
89
90 ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ScriptEngine.EventManager()
91 {
92 return this.m_EventManager;
93 }
94
95
96 #region IRegionModule
97
98 public void Initialise(Scene scene, IConfigSource config)
99 {
100 InitializeEngine(scene, MainLog.Instance, true);
101 }
102
103 public void PostInitialise()
104 { 45 {
46 InitializeEngine(scene, MainLog.Instance, true, GetScriptManager());
105 } 47 }
106 48
107 public void Close() 49 public override OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager _GetScriptManager()
108 { 50 {
51 return new ScriptManager(this);
109 } 52 }
110
111 public string Name
112 {
113 get { return "DotNetEngine"; }
114 }
115
116 public bool IsSharedModule
117 {
118 get { return false; }
119 }
120
121 #endregion
122
123 } 53 }
124} \ No newline at end of file 54} \ No newline at end of file