aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
diff options
context:
space:
mode:
authorSean Dague2007-10-19 20:27:34 +0000
committerSean Dague2007-10-19 20:27:34 +0000
commit139994757c7dab04dd03801266525e8c53395a5e (patch)
tree003ec2557de6dd80dbe1e7bc78efe8958d02d5ae /OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
parent* Test thy commits! (oops, sorry!) (diff)
downloadopensim-SC_OLD-139994757c7dab04dd03801266525e8c53395a5e.zip
opensim-SC_OLD-139994757c7dab04dd03801266525e8c53395a5e.tar.gz
opensim-SC_OLD-139994757c7dab04dd03801266525e8c53395a5e.tar.bz2
opensim-SC_OLD-139994757c7dab04dd03801266525e8c53395a5e.tar.xz
changes to pass nini config object to the modules that get
loaded so that they may read out any bits they are interested in
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs265
1 files changed, 133 insertions, 132 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index d89a8ad..38bf746 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -1,132 +1,133 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 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 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 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 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. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
33using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
34using OpenSim.Region.Environment.Scenes.Scripting; 34using OpenSim.Region.Environment.Scenes.Scripting;
35using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
36using libsecondlife; 36using libsecondlife;
37 37using Nini.Config;
38namespace OpenSim.Region.ScriptEngine.DotNetEngine 38
39{ 39namespace OpenSim.Region.ScriptEngine.DotNetEngine
40 /// <summary> 40{
41 /// This is the root object for ScriptEngine 41 /// <summary>
42 /// </summary> 42 /// This is the root object for ScriptEngine
43 [Serializable] 43 /// </summary>
44 public class ScriptEngine :IRegionModule 44 [Serializable]
45 { 45 public class ScriptEngine :IRegionModule
46 46 {
47 internal OpenSim.Region.Environment.Scenes.Scene World; 47
48 internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim 48 internal OpenSim.Region.Environment.Scenes.Scene World;
49 internal EventQueueManager m_EventQueueManager; // Executes events 49 internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
50 internal ScriptManager m_ScriptManager; // Load, unload and execute scripts 50 internal EventQueueManager m_EventQueueManager; // Executes events
51 internal AppDomainManager m_AppDomainManager; 51 internal ScriptManager m_ScriptManager; // Load, unload and execute scripts
52 internal LSLLongCmdHandler m_LSLLongCmdHandler; 52 internal AppDomainManager m_AppDomainManager;
53 53 internal LSLLongCmdHandler m_LSLLongCmdHandler;
54 private OpenSim.Framework.Console.LogBase m_log; 54
55 55 private OpenSim.Framework.Console.LogBase m_log;
56 public ScriptEngine() 56
57 { 57 public ScriptEngine()
58 //Common.SendToDebug("ScriptEngine Object Initialized"); 58 {
59 Common.mySE = this; 59 //Common.SendToDebug("ScriptEngine Object Initialized");
60 } 60 Common.mySE = this;
61 61 }
62 public LogBase Log 62
63 { 63 public LogBase Log
64 get { return m_log; } 64 {
65 } 65 get { return m_log; }
66 66 }
67 public void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger) 67
68 { 68 public void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger)
69 69 {
70 World = Sceneworld; 70
71 m_log = logger; 71 World = Sceneworld;
72 72 m_log = logger;
73 Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); 73
74 74 Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing");
75 //m_logger.Status("ScriptEngine", "InitializeEngine"); 75
76 76 //m_logger.Status("ScriptEngine", "InitializeEngine");
77 // Create all objects we'll be using 77
78 m_EventQueueManager = new EventQueueManager(this); 78 // Create all objects we'll be using
79 m_EventManager = new EventManager(this); 79 m_EventQueueManager = new EventQueueManager(this);
80 m_ScriptManager = new ScriptManager(this); 80 m_EventManager = new EventManager(this);
81 m_AppDomainManager = new AppDomainManager(); 81 m_ScriptManager = new ScriptManager(this);
82 m_LSLLongCmdHandler = new LSLLongCmdHandler(this); 82 m_AppDomainManager = new AppDomainManager();
83 83 m_LSLLongCmdHandler = new LSLLongCmdHandler(this);
84 // Should we iterate the region for scripts that needs starting? 84
85 // Or can we assume we are loaded before anything else so we can use proper events? 85 // Should we iterate the region for scripts that needs starting?
86 86 // Or can we assume we are loaded before anything else so we can use proper events?
87 87
88 } 88
89 89 }
90 public void Shutdown() 90
91 { 91 public void Shutdown()
92 // We are shutting down 92 {
93 } 93 // We are shutting down
94 94 }
95 //// !!!FOR DEBUGGING ONLY!!! (for executing script directly from test app) 95
96 //[Obsolete("!!!FOR DEBUGGING ONLY!!!")] 96 //// !!!FOR DEBUGGING ONLY!!! (for executing script directly from test app)
97 //public void StartScript(string ScriptID, IScriptHost ObjectID) 97 //[Obsolete("!!!FOR DEBUGGING ONLY!!!")]
98 //{ 98 //public void StartScript(string ScriptID, IScriptHost ObjectID)
99 // this.myEventManager.TEMP_OBJECT_ID = ObjectID; 99 //{
100 // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID); 100 // this.myEventManager.TEMP_OBJECT_ID = ObjectID;
101 // myScriptManager.StartScript(ScriptID, ObjectID); 101 // Log.Status("ScriptEngine", "DEBUG FUNCTION: StartScript: " + ScriptID);
102 //} 102 // myScriptManager.StartScript(ScriptID, ObjectID);
103 103 //}
104 #region IRegionModule 104
105 105 #region IRegionModule
106 public void Initialise(Scene scene) 106
107 { 107 public void Initialise(Scene scene, IConfigSource config)
108 this.InitializeEngine(scene, MainLog.Instance); 108 {
109 } 109 this.InitializeEngine(scene, MainLog.Instance);
110 110 }
111 public void PostInitialise() 111
112 { 112 public void PostInitialise()
113 113 {
114 } 114
115 115 }
116 public void Close() 116
117 { 117 public void Close()
118 } 118 {
119 119 }
120 public string Name 120
121 { 121 public string Name
122 get { return "LSLScriptingModule"; } 122 {
123 } 123 get { return "LSLScriptingModule"; }
124 124 }
125 public bool IsSharedModule 125
126 { 126 public bool IsSharedModule
127 get { return false; } 127 {
128 } 128 get { return false; }
129 129 }
130 #endregion 130
131 } 131 #endregion
132} 132 }
133}