diff options
author | Tedd Hansen | 2007-10-05 19:56:44 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-10-05 19:56:44 +0000 |
commit | 6dd923b01d6864ffcb17030c9de17224f45b4c2a (patch) | |
tree | 83d00d90a13f6803b38988049096296caf9f4c17 /OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs | |
parent | Code from Illumious Beltran (IBM) implementing more LSL (diff) | |
download | opensim-SC-6dd923b01d6864ffcb17030c9de17224f45b4c2a.zip opensim-SC-6dd923b01d6864ffcb17030c9de17224f45b4c2a.tar.gz opensim-SC-6dd923b01d6864ffcb17030c9de17224f45b4c2a.tar.bz2 opensim-SC-6dd923b01d6864ffcb17030c9de17224f45b4c2a.tar.xz |
Some more work on new ScriptEngine.
Diffstat (limited to 'OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs')
-rw-r--r-- | OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs new file mode 100644 index 0000000..81a95c5 --- /dev/null +++ b/OpenSim/Grid/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -0,0 +1,132 @@ | |||
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 OpenSim 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 | /* Original code: Tedd Hansen */ | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | using OpenSim.Framework.Console; | ||
33 | using OpenSim.Region.Environment.Scenes; | ||
34 | using OpenSim.Region.Environment.Scenes.Scripting; | ||
35 | using OpenSim.Region.Environment.Interfaces; | ||
36 | using libsecondlife; | ||
37 | |||
38 | namespace OpenSim.Grid.ScriptEngine.DotNetEngine | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// This is the root object for ScriptEngine | ||
42 | /// </summary> | ||
43 | [Serializable] | ||
44 | public class ScriptEngine :IRegionModule | ||
45 | { | ||
46 | |||
47 | internal OpenSim.Region.Environment.Scenes.Scene World; | ||
48 | internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim | ||
49 | internal EventQueueManager m_EventQueueManager; // Executes events | ||
50 | internal ScriptManager m_ScriptManager; // Load, unload and execute scripts | ||
51 | internal AppDomainManager m_AppDomainManager; | ||
52 | internal LSLLongCmdHandler m_LSLLongCmdHandler; | ||
53 | |||
54 | private OpenSim.Framework.Console.LogBase m_log; | ||
55 | |||
56 | public ScriptEngine() | ||
57 | { | ||
58 | //Common.SendToDebug("ScriptEngine Object Initialized"); | ||
59 | Common.mySE = this; | ||
60 | } | ||
61 | |||
62 | public LogBase Log | ||
63 | { | ||
64 | get { return m_log; } | ||
65 | } | ||
66 | |||
67 | public void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger) | ||
68 | { | ||
69 | |||
70 | World = Sceneworld; | ||
71 | m_log = logger; | ||
72 | |||
73 | Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); | ||
74 | |||
75 | //m_logger.Status("ScriptEngine", "InitializeEngine"); | ||
76 | |||
77 | // Create all objects we'll be using | ||
78 | m_EventQueueManager = new EventQueueManager(this); | ||
79 | m_EventManager = new EventManager(this); | ||
80 | m_ScriptManager = new ScriptManager(this); | ||
81 | m_AppDomainManager = new AppDomainManager(); | ||
82 | m_LSLLongCmdHandler = new LSLLongCmdHandler(this); | ||
83 | |||
84 | // Should we iterate the region for scripts that needs starting? | ||
85 | // Or can we assume we are loaded before anything else so we can use proper events? | ||
86 | |||
87 | |||
88 | } | ||
89 | |||
90 | public void Shutdown() | ||
91 | { | ||
92 | // We are shutting down | ||
93 | } | ||
94 | |||
95 | //// !!!FOR DEBUGGING ONLY!!! (for executing script directly from test app) | ||
96 | //[Obsolete("!!!FOR DEBUGGING ONLY!!!")] | ||
97 | //public void StartScript(string ScriptID, IScriptHost ObjectID) | ||
98 | //{ | ||
99 | // this.myEventManager.TEMP_OBJECT_ID = ObjectID; | ||
100 | // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); | ||
101 | // myScriptManager.StartScript(ScriptID, ObjectID); | ||
102 | //} | ||
103 | |||
104 | #region IRegionModule | ||
105 | |||
106 | public void Initialise(Scene scene) | ||
107 | { | ||
108 | this.InitializeEngine(scene, MainLog.Instance); | ||
109 | } | ||
110 | |||
111 | public void PostInitialise() | ||
112 | { | ||
113 | |||
114 | } | ||
115 | |||
116 | public void CloseDown() | ||
117 | { | ||
118 | } | ||
119 | |||
120 | public string GetName() | ||
121 | { | ||
122 | return "LSLScriptingModule"; | ||
123 | } | ||
124 | |||
125 | public bool IsSharedModule() | ||
126 | { | ||
127 | return false; | ||
128 | } | ||
129 | |||
130 | #endregion | ||
131 | } | ||
132 | } | ||