aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Api/Runtime/XEngineScriptBase.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineBasicTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs14
-rwxr-xr-xOpenSim/Region/ScriptEngine/XEngine/XEngine.cs82
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs2
7 files changed, 57 insertions, 57 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Api/Runtime/XEngineScriptBase.cs b/OpenSim/Region/ScriptEngine/XEngine/Api/Runtime/XEngineScriptBase.cs
index f4211c8..80d9e2a 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Api/Runtime/XEngineScriptBase.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Api/Runtime/XEngineScriptBase.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.ScriptBase
44 /// <summary> 44 /// <summary>
45 /// Used for script sleeps when we are using co-operative script termination. 45 /// Used for script sleeps when we are using co-operative script termination.
46 /// </summary> 46 /// </summary>
47 /// <remarks>null if co-operative script termination is not active</remarks> 47 /// <remarks>null if co-operative script termination is not active</remarks>
48 WaitHandle m_coopSleepHandle; 48 WaitHandle m_coopSleepHandle;
49 49
50 public XEngineScriptBase(WaitHandle coopSleepHandle) : base() 50 public XEngineScriptBase(WaitHandle coopSleepHandle) : base()
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index 301eada..55a77bc 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
79 } 79 }
80 80
81 /// <summary> 81 /// <summary>
82 /// When an object gets paid by an avatar and generates the paid event, 82 /// When an object gets paid by an avatar and generates the paid event,
83 /// this will pipe it to the script engine 83 /// this will pipe it to the script engine
84 /// </summary> 84 /// </summary>
85 /// <param name="objectID">Object ID that got paid</param> 85 /// <param name="objectID">Object ID that got paid</param>
@@ -413,7 +413,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
413 return; 413 return;
414 414
415 foreach(SceneObjectPart part in grp.Parts) 415 foreach(SceneObjectPart part in grp.Parts)
416 { 416 {
417 myScriptEngine.PostObjectEvent(part.LocalId, new EventParams( 417 myScriptEngine.PostObjectEvent(part.LocalId, new EventParams(
418 "attach",new object[] { 418 "attach",new object[] {
419 new LSL_Types.LSLString(avatar.ToString()) }, 419 new LSL_Types.LSLString(avatar.ToString()) },
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs
index a2b030d..b3fedcb 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs
@@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices; 3using System.Runtime.InteropServices;
4using Mono.Addins; 4using Mono.Addins;
5 5
6// General Information about an assembly is controlled through the following 6// General Information about an assembly is controlled through the following
7// set of attributes. Change these attribute values to modify the information 7// set of attributes. Change these attribute values to modify the information
8// associated with an assembly. 8// associated with an assembly.
9[assembly: AssemblyTitle("OpenSim.Region.ScriptEngine.XEngine")] 9[assembly: AssemblyTitle("OpenSim.Region.ScriptEngine.XEngine")]
@@ -15,8 +15,8 @@ using Mono.Addins;
15[assembly: AssemblyTrademark("")] 15[assembly: AssemblyTrademark("")]
16[assembly: AssemblyCulture("")] 16[assembly: AssemblyCulture("")]
17 17
18// Setting ComVisible to false makes the types in this assembly not visible 18// Setting ComVisible to false makes the types in this assembly not visible
19// to COM components. If you need to access a type in this assembly from 19// to COM components. If you need to access a type in this assembly from
20// COM, set the ComVisible attribute to true on that type. 20// COM, set the ComVisible attribute to true on that type.
21[assembly: ComVisible(false)] 21[assembly: ComVisible(false)]
22 22
@@ -26,7 +26,7 @@ using Mono.Addins;
26// Version information for an assembly consists of the following four values: 26// Version information for an assembly consists of the following four values:
27// 27//
28// Major Version 28// Major Version
29// Minor Version 29// Minor Version
30// Build Number 30// Build Number
31// Revision 31// Revision
32// 32//
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineBasicTests.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineBasicTests.cs
index 878e571..71ef0ac 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineBasicTests.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineBasicTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
58 m_xEngine = new XEngine(); 58 m_xEngine = new XEngine();
59 59
60 IniConfigSource configSource = new IniConfigSource(); 60 IniConfigSource configSource = new IniConfigSource();
61 61
62 IConfig startupConfig = configSource.AddConfig("Startup"); 62 IConfig startupConfig = configSource.AddConfig("Startup");
63 startupConfig.Set("DefaultScriptEngine", "XEngine"); 63 startupConfig.Set("DefaultScriptEngine", "XEngine");
64 64
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs
index c977285..477059f 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineCrossingTests.cs
@@ -126,11 +126,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
126 OSChatMessage messageReceived = null; 126 OSChatMessage messageReceived = null;
127 sceneA.EventManager.OnChatFromWorld += (s, m) => { messageReceived = m; chatEvent.Set(); }; 127 sceneA.EventManager.OnChatFromWorld += (s, m) => { messageReceived = m; chatEvent.Set(); };
128 128
129 sceneA.RezNewScript(userId, scriptItemSceneA, 129 sceneA.RezNewScript(userId, scriptItemSceneA,
130@"integer c = 0; 130@"integer c = 0;
131 131
132default 132default
133{ 133{
134 state_entry() 134 state_entry()
135 { 135 {
136 llSay(0, ""Script running""); 136 llSay(0, ""Script running"");
@@ -143,7 +143,7 @@ default
143 143
144 touch_start(integer n) 144 touch_start(integer n)
145 { 145 {
146 c = c + 1; 146 c = c + 1;
147 llSay(0, (string)c); 147 llSay(0, (string)c);
148 } 148 }
149}"); 149}");
@@ -151,7 +151,7 @@ default
151 chatEvent.WaitOne(60000); 151 chatEvent.WaitOne(60000);
152 152
153 Assert.That(messageReceived, Is.Not.Null, "No chat message received."); 153 Assert.That(messageReceived, Is.Not.Null, "No chat message received.");
154 Assert.That(messageReceived.Message, Is.EqualTo("Script running")); 154 Assert.That(messageReceived.Message, Is.EqualTo("Script running"));
155 155
156 { 156 {
157 // XXX: Should not be doing this so directly. Should call some variant of EventManager.touch() instead. 157 // XXX: Should not be doing this so directly. Should call some variant of EventManager.touch() instead.
@@ -167,7 +167,7 @@ default
167 xEngineA.PostObjectEvent(soSceneA.LocalId, ep); 167 xEngineA.PostObjectEvent(soSceneA.LocalId, ep);
168 chatEvent.WaitOne(60000); 168 chatEvent.WaitOne(60000);
169 169
170 Assert.That(messageReceived.Message, Is.EqualTo("1")); 170 Assert.That(messageReceived.Message, Is.EqualTo("1"));
171 } 171 }
172 172
173 AutoResetEvent chatEventB = new AutoResetEvent(false); 173 AutoResetEvent chatEventB = new AutoResetEvent(false);
@@ -181,7 +181,7 @@ default
181 chatEventB.WaitOne(60000); 181 chatEventB.WaitOne(60000);
182 Assert.That(messageReceived, Is.Not.Null, "No Changed message received."); 182 Assert.That(messageReceived, Is.Not.Null, "No Changed message received.");
183 Assert.That(messageReceived.Message, Is.Not.Null, "Changed message without content"); 183 Assert.That(messageReceived.Message, Is.Not.Null, "Changed message without content");
184 Assert.That(messageReceived.Message, Is.EqualTo("Changed")); 184 Assert.That(messageReceived.Message, Is.EqualTo("Changed"));
185 185
186 // TEST sending event to moved prim and output 186 // TEST sending event to moved prim and output
187 { 187 {
@@ -202,7 +202,7 @@ default
202 xEngineB.PostObjectEvent(soSceneB.LocalId, ep); 202 xEngineB.PostObjectEvent(soSceneB.LocalId, ep);
203 chatEventB.WaitOne(60000); 203 chatEventB.WaitOne(60000);
204 204
205 Assert.That(messageReceived.Message, Is.EqualTo("2")); 205 Assert.That(messageReceived.Message, Is.EqualTo("2"));
206 } 206 }
207 } 207 }
208 } 208 }
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 7822df9..cd5308d 100755
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -131,9 +131,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
131 /// It appears that if a script thread is aborted whilst it is holding ReaderWriterLockSlim (possibly the write 131 /// It appears that if a script thread is aborted whilst it is holding ReaderWriterLockSlim (possibly the write
132 /// lock) then the lock is not properly released. This causes mono 2.6, 2.10 and possibly 132 /// lock) then the lock is not properly released. This causes mono 2.6, 2.10 and possibly
133 /// later to crash, sometimes with symptoms such as a leap to 100% script usage and a vm thead dump showing 133 /// later to crash, sometimes with symptoms such as a leap to 100% script usage and a vm thead dump showing
134 /// all threads waiting on release of ReaderWriterLockSlim write thread which none of the threads listed 134 /// all threads waiting on release of ReaderWriterLockSlim write thread which none of the threads listed
135 /// actually hold. 135 /// actually hold.
136 /// 136 ///
137 /// Pausing for event completion reduces the risk of this happening. However, it may be that aborting threads 137 /// Pausing for event completion reduces the risk of this happening. However, it may be that aborting threads
138 /// is not a mono issue per se but rather a risky activity in itself in an AppDomain that is not immediately 138 /// is not a mono issue per se but rather a risky activity in itself in an AppDomain that is not immediately
139 /// shutting down. 139 /// shutting down.
@@ -307,7 +307,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
307 m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); 307 m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30);
308 m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); 308 m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false);
309 m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; 309 m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000;
310 m_WaitForEventCompletionOnScriptStop 310 m_WaitForEventCompletionOnScriptStop
311 = m_ScriptConfig.GetInt("WaitForEventCompletionOnScriptStop", m_WaitForEventCompletionOnScriptStop); 311 = m_ScriptConfig.GetInt("WaitForEventCompletionOnScriptStop", m_WaitForEventCompletionOnScriptStop);
312 312
313 m_ScriptEnginesPath = m_ScriptConfig.GetString("ScriptEnginesPath", "ScriptEngines"); 313 m_ScriptEnginesPath = m_ScriptConfig.GetString("ScriptEnginesPath", "ScriptEngines");
@@ -507,7 +507,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
507 { 507 {
508 string rawItemId; 508 string rawItemId;
509 UUID itemId = UUID.Zero; 509 UUID itemId = UUID.Zero;
510 510
511 if (cmdparams.Length == 2) 511 if (cmdparams.Length == 2)
512 { 512 {
513 IEnumerable<IScriptInstance> scripts = m_Scripts.Values; 513 IEnumerable<IScriptInstance> scripts = m_Scripts.Values;
@@ -520,17 +520,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
520 520
521 return; 521 return;
522 } 522 }
523 523
524 for (int i = 2; i < cmdparams.Length; i++) 524 for (int i = 2; i < cmdparams.Length; i++)
525 { 525 {
526 rawItemId = cmdparams[i]; 526 rawItemId = cmdparams[i];
527 527
528 if (!UUID.TryParse(rawItemId, out itemId)) 528 if (!UUID.TryParse(rawItemId, out itemId))
529 { 529 {
530 MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId); 530 MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid UUID", rawItemId);
531 continue; 531 continue;
532 } 532 }
533 533
534 if (itemId != UUID.Zero) 534 if (itemId != UUID.Zero)
535 { 535 {
536 IScriptInstance instance = GetInstance(itemId); 536 IScriptInstance instance = GetInstance(itemId);
@@ -816,7 +816,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
816 { 816 {
817 if (!m_Enabled) 817 if (!m_Enabled)
818 return; 818 return;
819 819
820 lock (m_ScriptEngines) 820 lock (m_ScriptEngines)
821 { 821 {
822 if (m_ScriptEngines.Contains(this)) 822 if (m_ScriptEngines.Contains(this))
@@ -978,14 +978,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
978 SceneObjectPart part = 978 SceneObjectPart part =
979 m_Scene.GetSceneObjectPart( 979 m_Scene.GetSceneObjectPart(
980 localID); 980 localID);
981 981
982 TaskInventoryItem item = 982 TaskInventoryItem item =
983 part.Inventory.GetInventoryItem(itemID); 983 part.Inventory.GetInventoryItem(itemID);
984 984
985 ScenePresence presence = 985 ScenePresence presence =
986 m_Scene.GetScenePresence( 986 m_Scene.GetScenePresence(
987 item.OwnerID); 987 item.OwnerID);
988 988
989 if (presence != null) 989 if (presence != null)
990 { 990 {
991 presence.ControllingClient.SendAgentAlertMessage( 991 presence.ControllingClient.SendAgentAlertMessage(
@@ -1073,8 +1073,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1073 { 1073 {
1074 m_log.Error( 1074 m_log.Error(
1075 string.Format( 1075 string.Format(
1076 "[XEngine]: Failure in DoOnRezScriptQueue() for item {0} in {1}. Continuing. Exception ", 1076 "[XEngine]: Failure in DoOnRezScriptQueue() for item {0} in {1}. Continuing. Exception ",
1077 o[1], m_Scene.Name), 1077 o[1], m_Scene.Name),
1078 e); 1078 e);
1079 } 1079 }
1080 } 1080 }
@@ -1091,7 +1091,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1091 } 1091 }
1092 finally 1092 finally
1093 { 1093 {
1094 // FIXME: On failure we must trigger this even if the compile queue is not actually empty so that the 1094 // FIXME: On failure we must trigger this even if the compile queue is not actually empty so that the
1095 // RegionReadyModule is not forever waiting. This event really needs a different name. 1095 // RegionReadyModule is not forever waiting. This event really needs a different name.
1096 m_Scene.EventManager.TriggerEmptyScriptCompileQueue(m_ScriptFailCount, 1096 m_Scene.EventManager.TriggerEmptyScriptCompileQueue(m_ScriptFailCount,
1097 m_ScriptErrorMessage); 1097 m_ScriptErrorMessage);
@@ -1108,8 +1108,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1108 { 1108 {
1109 m_CurrentCompile = null; 1109 m_CurrentCompile = null;
1110 1110
1111 // This is to avoid a situation where the m_CompileQueue while loop above could complete but 1111 // This is to avoid a situation where the m_CompileQueue while loop above could complete but
1112 // OnRezScript() place a new script on the queue and check m_CurrentCompile = null before we hit 1112 // OnRezScript() place a new script on the queue and check m_CurrentCompile = null before we hit
1113 // this section. 1113 // this section.
1114 if (m_CompileQueue.Count > 0) 1114 if (m_CompileQueue.Count > 0)
1115 m_CurrentCompile = m_ThreadPool.QueueWorkItem(DoOnRezScriptQueue, null); 1115 m_CurrentCompile = m_ThreadPool.QueueWorkItem(DoOnRezScriptQueue, null);
@@ -1186,7 +1186,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1186 m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assemblyPath, out linemap); 1186 m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assemblyPath, out linemap);
1187 1187
1188// m_log.DebugFormat( 1188// m_log.DebugFormat(
1189// "[XENGINE]: Found assembly path {0} onrez {1} in {2}", 1189// "[XENGINE]: Found assembly path {0} onrez {1} in {2}",
1190// assemblyPath, item.ItemID, World.Name); 1190// assemblyPath, item.ItemID, World.Name);
1191 1191
1192 if (!m_AddingAssemblies.ContainsKey(assemblyPath)) { 1192 if (!m_AddingAssemblies.ContainsKey(assemblyPath)) {
@@ -1239,7 +1239,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1239 catch (Exception e) 1239 catch (Exception e)
1240 { 1240 {
1241// m_log.ErrorFormat( 1241// m_log.ErrorFormat(
1242// "[XEngine]: Exception when rezzing script with item ID {0}, {1}{2}", 1242// "[XEngine]: Exception when rezzing script with item ID {0}, {1}{2}",
1243// itemID, e.Message, e.StackTrace); 1243// itemID, e.Message, e.StackTrace);
1244 1244
1245 // try 1245 // try
@@ -1280,7 +1280,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1280 } 1280 }
1281 1281
1282 // optionaly do not load a assembly on top of a lot of to release memory 1282 // optionaly do not load a assembly on top of a lot of to release memory
1283 // only if logins disable since causes a lot of rubber banding 1283 // only if logins disable since causes a lot of rubber banding
1284 if(m_CompactMemOnLoad && !m_Scene.LoginsEnabled) 1284 if(m_CompactMemOnLoad && !m_Scene.LoginsEnabled)
1285 GC.Collect(2); 1285 GC.Collect(2);
1286 1286
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1323 { 1323 {
1324 sandbox = AppDomain.CurrentDomain; 1324 sandbox = AppDomain.CurrentDomain;
1325 } 1325 }
1326 1326
1327 //PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel(); 1327 //PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
1328 //AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition(); 1328 //AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
1329 //PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet"); 1329 //PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
@@ -1331,7 +1331,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1331 //CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement); 1331 //CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
1332 //sandboxPolicy.RootCodeGroup = sandboxCodeGroup; 1332 //sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
1333 //sandbox.SetAppDomainPolicy(sandboxPolicy); 1333 //sandbox.SetAppDomainPolicy(sandboxPolicy);
1334 1334
1335 m_AppDomains[appDomain] = sandbox; 1335 m_AppDomains[appDomain] = sandbox;
1336 1336
1337 m_DomainScripts[appDomain] = new List<UUID>(); 1337 m_DomainScripts[appDomain] = new List<UUID>();
@@ -1341,7 +1341,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1341 m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString()); 1341 m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
1342 m_ScriptErrorMessage += "Exception creating app domain:\n"; 1342 m_ScriptErrorMessage += "Exception creating app domain:\n";
1343 m_ScriptFailCount++; 1343 m_ScriptFailCount++;
1344 lock (m_AddingAssemblies) 1344 lock (m_AddingAssemblies)
1345 { 1345 {
1346 m_AddingAssemblies[assemblyPath]--; 1346 m_AddingAssemblies[assemblyPath]--;
1347 } 1347 }
@@ -1364,14 +1364,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1364 { 1364 {
1365 coopSleepHandle = new XEngineEventWaitHandle(false, EventResetMode.AutoReset); 1365 coopSleepHandle = new XEngineEventWaitHandle(false, EventResetMode.AutoReset);
1366 1366
1367 scriptObj 1367 scriptObj
1368 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap( 1368 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap(
1369 assemblyName.FullName, 1369 assemblyName.FullName,
1370 "SecondLife.XEngineScript", 1370 "SecondLife.XEngineScript",
1371 false, 1371 false,
1372 BindingFlags.Default, 1372 BindingFlags.Default,
1373 null, 1373 null,
1374 new object[] { coopSleepHandle }, 1374 new object[] { coopSleepHandle },
1375 null, 1375 null,
1376 null); 1376 null);
1377 1377
@@ -1383,7 +1383,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1383 1383
1384 try 1384 try
1385 { 1385 {
1386 scriptObj 1386 scriptObj
1387 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap( 1387 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap(
1388 assemblyName.FullName, 1388 assemblyName.FullName,
1389 "SecondLife.Script", 1389 "SecondLife.Script",
@@ -1398,7 +1398,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1398 { 1398 {
1399 m_log.Error( 1399 m_log.Error(
1400 string.Format( 1400 string.Format(
1401 "[XENGINE]: Could not load previous SecondLife.Script from assembly {0} in {1}. Not starting. Exception ", 1401 "[XENGINE]: Could not load previous SecondLife.Script from assembly {0} in {1}. Not starting. Exception ",
1402 assemblyName.FullName, World.Name), 1402 assemblyName.FullName, World.Name),
1403 e2); 1403 e2);
1404 1404
@@ -1412,7 +1412,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1412 { 1412 {
1413 try 1413 try
1414 { 1414 {
1415 scriptObj 1415 scriptObj
1416 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap( 1416 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap(
1417 assemblyName.FullName, 1417 assemblyName.FullName,
1418 "SecondLife.Script", 1418 "SecondLife.Script",
@@ -1432,7 +1432,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1432 1432
1433 try 1433 try
1434 { 1434 {
1435 scriptObj 1435 scriptObj
1436 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap( 1436 = (IScript)m_AppDomains[appDomain].CreateInstanceAndUnwrap(
1437 assemblyName.FullName, 1437 assemblyName.FullName,
1438 "SecondLife.XEngineScript", 1438 "SecondLife.XEngineScript",
@@ -1447,7 +1447,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1447 { 1447 {
1448 m_log.Error( 1448 m_log.Error(
1449 string.Format( 1449 string.Format(
1450 "[XENGINE]: Could not load previous SecondLife.XEngineScript from assembly {0} in {1}. Not starting. Exception ", 1450 "[XENGINE]: Could not load previous SecondLife.XEngineScript from assembly {0} in {1}. Not starting. Exception ",
1451 assemblyName.FullName, World.Name), 1451 assemblyName.FullName, World.Name),
1452 e2); 1452 e2);
1453 1453
@@ -1509,7 +1509,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1509 } 1509 }
1510 1510
1511 1511
1512 lock (m_AddingAssemblies) 1512 lock (m_AddingAssemblies)
1513 { 1513 {
1514 if (!m_Assemblies.ContainsKey(assetID)) 1514 if (!m_Assemblies.ContainsKey(assetID))
1515 m_Assemblies[assetID] = assemblyPath; 1515 m_Assemblies[assetID] = assemblyPath;
@@ -1517,7 +1517,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1517 m_AddingAssemblies[assemblyPath]--; 1517 m_AddingAssemblies[assemblyPath]--;
1518 } 1518 }
1519 1519
1520 if (instance != null) 1520 if (instance != null)
1521 instance.Init(); 1521 instance.Init();
1522 1522
1523 bool runIt; 1523 bool runIt;
@@ -1570,7 +1570,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1570 } 1570 }
1571 1571
1572 if (instance.StatePersistedHere) 1572 if (instance.StatePersistedHere)
1573 instance.RemoveState(); 1573 instance.RemoveState();
1574 1574
1575 instance.DestroyScriptInstance(); 1575 instance.DestroyScriptInstance();
1576 1576
@@ -1622,20 +1622,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1622 // Do not remove assembly files if another instance of the script 1622 // Do not remove assembly files if another instance of the script
1623 // is currently initialising 1623 // is currently initialising
1624 if (!m_AddingAssemblies.ContainsKey(m_Assemblies[assetID]) 1624 if (!m_AddingAssemblies.ContainsKey(m_Assemblies[assetID])
1625 || m_AddingAssemblies[m_Assemblies[assetID]] == 0) 1625 || m_AddingAssemblies[m_Assemblies[assetID]] == 0)
1626 { 1626 {
1627// m_log.DebugFormat("[XEngine] Removing unreferenced assembly {0}", m_Assemblies[assetID]); 1627// m_log.DebugFormat("[XEngine] Removing unreferenced assembly {0}", m_Assemblies[assetID]);
1628 try 1628 try
1629 { 1629 {
1630 if (File.Exists(m_Assemblies[assetID])) 1630 if (File.Exists(m_Assemblies[assetID]))
1631 File.Delete(m_Assemblies[assetID]); 1631 File.Delete(m_Assemblies[assetID]);
1632 1632
1633 if (File.Exists(m_Assemblies[assetID]+".text")) 1633 if (File.Exists(m_Assemblies[assetID]+".text"))
1634 File.Delete(m_Assemblies[assetID]+".text"); 1634 File.Delete(m_Assemblies[assetID]+".text");
1635 1635
1636 if (File.Exists(m_Assemblies[assetID]+".mdb")) 1636 if (File.Exists(m_Assemblies[assetID]+".mdb"))
1637 File.Delete(m_Assemblies[assetID]+".mdb"); 1637 File.Delete(m_Assemblies[assetID]+".mdb");
1638 1638
1639 if (File.Exists(m_Assemblies[assetID]+".map")) 1639 if (File.Exists(m_Assemblies[assetID]+".map"))
1640 File.Delete(m_Assemblies[assetID]+".map"); 1640 File.Delete(m_Assemblies[assetID]+".map");
1641 } 1641 }
@@ -1692,7 +1692,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1692 new WorkItemCallback(this.ProcessEventHandler), 1692 new WorkItemCallback(this.ProcessEventHandler),
1693 parms)); 1693 parms));
1694 } 1694 }
1695 1695
1696 /// <summary> 1696 /// <summary>
1697 /// Process a previously posted script event. 1697 /// Process a previously posted script event.
1698 /// </summary> 1698 /// </summary>
@@ -1703,7 +1703,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1703 Culture.SetCurrentCulture(); 1703 Culture.SetCurrentCulture();
1704 1704
1705 IScriptInstance instance = (ScriptInstance) parms; 1705 IScriptInstance instance = (ScriptInstance) parms;
1706 1706
1707// m_log.DebugFormat("[XEngine]: Processing event for {0}", instance); 1707// m_log.DebugFormat("[XEngine]: Processing event for {0}", instance);
1708 1708
1709 return instance.EventProcessor(); 1709 return instance.EventProcessor();
@@ -1736,7 +1736,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1736 instance = m_Scripts[itemID]; 1736 instance = m_Scripts[itemID];
1737 } 1737 }
1738 catch { /* ignore race conditions */ } 1738 catch { /* ignore race conditions */ }
1739 1739
1740 if (instance != null) 1740 if (instance != null)
1741 { 1741 {
1742 instance.PostEvent(p); 1742 instance.PostEvent(p);
@@ -1744,7 +1744,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1744 } 1744 }
1745 } 1745 }
1746 } 1746 }
1747 1747
1748 return result; 1748 return result;
1749 } 1749 }
1750 1750
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
index 9d9dee1..ede8ef3 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
60 public bool Wait(int t) 60 public bool Wait(int t)
61 { 61 {
62 // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the 62 // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the
63 // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an 63 // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an
64 // int (32-bit) we can end up with bad values. This occurs on Windows though curiously not on Mono 2.10.8 64 // int (32-bit) we can end up with bad values. This occurs on Windows though curiously not on Mono 2.10.8
65 // (or very likely other versions of Mono at least up until 3.0.3). 65 // (or very likely other versions of Mono at least up until 3.0.3).
66 return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false); 66 return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false);