aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-23 02:28:27 +0000
committerJustin Clark-Casey (justincc)2013-01-23 02:36:43 +0000
commitcf168194e5968c1fab33266bdbb57465f303860b (patch)
tree7fbf7f668bd48a9831df7eefdf47c09baa47a522 /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
parentAdd co-op termination regression test for infinite recursive manual call on e... (diff)
downloadopensim-SC-cf168194e5968c1fab33266bdbb57465f303860b.zip
opensim-SC-cf168194e5968c1fab33266bdbb57465f303860b.tar.gz
opensim-SC-cf168194e5968c1fab33266bdbb57465f303860b.tar.bz2
opensim-SC-cf168194e5968c1fab33266bdbb57465f303860b.tar.xz
If ScriptStopStrategy hasn't been set to co-op in [XEngine] config, then continue to generate C# that is functionality identical to historical generation
This is to eliminate disruption until co-op termination has been well-tested. In non co-op mode, XEngine will continue to load DLLs of the existing Script class and the new XEngineScript class. Moving to co-op mode still requires existing script DLL deletion to force recompilation, either manually or by setting DeleteScriptsOnStartup = true for one run. This change also means that scripts which fail to initialize do not still show up as running scripts.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs26
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index c1f9271..604924b 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -46,13 +46,14 @@ using OpenSim.Framework;
46using OpenSim.Framework.Console; 46using OpenSim.Framework.Console;
47using OpenSim.Region.Framework.Scenes; 47using OpenSim.Region.Framework.Scenes;
48using OpenSim.Region.Framework.Interfaces; 48using OpenSim.Region.Framework.Interfaces;
49using OpenSim.Region.ScriptEngine.Interfaces;
49using OpenSim.Region.ScriptEngine.Shared; 50using OpenSim.Region.ScriptEngine.Shared;
50using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 51using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
51using OpenSim.Region.ScriptEngine.Shared.CodeTools; 52using OpenSim.Region.ScriptEngine.Shared.CodeTools;
52using OpenSim.Region.ScriptEngine.Shared.Instance; 53using OpenSim.Region.ScriptEngine.Shared.Instance;
53using OpenSim.Region.ScriptEngine.Shared.Api; 54using OpenSim.Region.ScriptEngine.Shared.Api;
54using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; 55using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
55using OpenSim.Region.ScriptEngine.Interfaces; 56using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
56using OpenSim.Region.ScriptEngine.XEngine.ScriptBase; 57using OpenSim.Region.ScriptEngine.XEngine.ScriptBase;
57using Timer = OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer; 58using Timer = OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer;
58 59
@@ -177,6 +178,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
177 get { return "XEngine"; } 178 get { return "XEngine"; }
178 } 179 }
179 180
181 public string ScriptClassName { get; private set; }
182
180 public string ScriptBaseClassName { get; private set; } 183 public string ScriptBaseClassName { get; private set; }
181 184
182 public ParameterInfo[] ScriptBaseClassParameters { get; private set; } 185 public ParameterInfo[] ScriptBaseClassParameters { get; private set; }
@@ -238,9 +241,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
238 m_ScriptConfig = configSource.Configs["XEngine"]; 241 m_ScriptConfig = configSource.Configs["XEngine"];
239 m_ConfigSource = configSource; 242 m_ConfigSource = configSource;
240 243
241 ScriptBaseClassName = typeof(XEngineScriptBase).FullName; 244 if (m_ScriptConfig.GetString("ScriptStopStrategy", "abort") == "co-op")
242 ScriptBaseClassParameters = typeof(XEngineScriptBase).GetConstructor(new Type[] { typeof(WaitHandle) }).GetParameters(); 245 {
243 ScriptReferencedAssemblies = new string[] { Path.GetFileName(typeof(XEngineScriptBase).Assembly.Location) }; 246 ScriptClassName = "XEngineScript";
247 ScriptBaseClassName = typeof(XEngineScriptBase).FullName;
248 ScriptBaseClassParameters = typeof(XEngineScriptBase).GetConstructor(new Type[] { typeof(WaitHandle) }).GetParameters();
249 ScriptReferencedAssemblies = new string[] { Path.GetFileName(typeof(XEngineScriptBase).Assembly.Location) };
250 }
251 else
252 {
253 ScriptClassName = "Script";
254 ScriptBaseClassName = typeof(ScriptBaseClass).FullName;
255 }
244 256
245// Console.WriteLine("ASSEMBLY NAME: {0}", ScriptReferencedAssemblies[0]); 257// Console.WriteLine("ASSEMBLY NAME: {0}", ScriptReferencedAssemblies[0]);
246 } 258 }
@@ -1122,7 +1134,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1122 } 1134 }
1123 1135
1124 m_log.DebugFormat( 1136 m_log.DebugFormat(
1125 "[XEngine] Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}", 1137 "[XEngine]: Loading script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}",
1126 part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID, 1138 part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID,
1127 part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); 1139 part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName);
1128 1140
@@ -1143,6 +1155,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1143 lock (m_AddingAssemblies) 1155 lock (m_AddingAssemblies)
1144 { 1156 {
1145 m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assembly, out linemap); 1157 m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assembly, out linemap);
1158
1146 if (!m_AddingAssemblies.ContainsKey(assembly)) { 1159 if (!m_AddingAssemblies.ContainsKey(assembly)) {
1147 m_AddingAssemblies[assembly] = 1; 1160 m_AddingAssemblies[assembly] = 1;
1148 } else { 1161 } else {
@@ -1303,7 +1316,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1303 startParam, postOnRez, 1316 startParam, postOnRez,
1304 m_MaxScriptQueue); 1317 m_MaxScriptQueue);
1305 1318
1306 instance.Load(m_AppDomains[appDomain], assembly, stateSource); 1319 if (!instance.Load(m_AppDomains[appDomain], assembly, stateSource))
1320 return false;
1307 1321
1308// if (DebugLevel >= 1) 1322// if (DebugLevel >= 1)
1309// m_log.DebugFormat( 1323// m_log.DebugFormat(