aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs42
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs13
3 files changed, 31 insertions, 28 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 4cfcb75..5bc585e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -284,9 +284,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
284 else 284 else
285 { 285 {
286 m_log.ErrorFormat( 286 m_log.ErrorFormat(
287 "[SCRIPT INSTANCE]: You must remove all existing script DLLs before using enabling co-op termination" 287 "[SCRIPT INSTANCE]: Not starting script {0} (id {1}) in part {2} (id {3}) in object {4} in {5}. You must remove all existing {6}* script DLL files before using enabling co-op termination"
288 + ", either by setting DeleteScriptsOnStartup = true in [XEngine] for one run" 288 + ", either by setting DeleteScriptsOnStartup = true in [XEngine] for one run"
289 + " or by deleting all *.dll* files in the relevant bin/ScriptEngines/<region-id>/ directory"); 289 + " or by deleting these files manually.",
290 ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name, assembly);
290 291
291 return false; 292 return false;
292 } 293 }
@@ -324,8 +325,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
324 catch (Exception e) 325 catch (Exception e)
325 { 326 {
326 m_log.ErrorFormat( 327 m_log.ErrorFormat(
327 "[SCRIPT INSTANCE]: Error loading assembly {0}. Exception {1}{2}", 328 "[SCRIPT INSTANCE]: Not starting script {0} (id {1}) in part {2} (id {3}) in object {4} in {5}. Error loading assembly {6}. Exception {7}{8}",
328 assembly, e.Message, e.StackTrace); 329 ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name, assembly, e.Message, e.StackTrace);
329 330
330 return false; 331 return false;
331 } 332 }
@@ -345,8 +346,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
345 catch (Exception e) 346 catch (Exception e)
346 { 347 {
347 m_log.ErrorFormat( 348 m_log.ErrorFormat(
348 "[SCRIPT INSTANCE]: Error loading script instance from assembly {0}. Exception {1}{2}", 349 "[SCRIPT INSTANCE]: Not starting script {0} (id {1}) in part {2} (id {3}) in object {4} in {5}. Error initializing script instance. Exception {6}{7}",
349 assembly, e.Message, e.StackTrace); 350 ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name, e.Message, e.StackTrace);
350 351
351 return false; 352 return false;
352 } 353 }
@@ -401,15 +402,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
401 else 402 else
402 { 403 {
403 m_log.WarnFormat( 404 m_log.WarnFormat(
404 "[SCRIPT INSTANCE]: Unable to load script state file {0} for script {1} {2} in {3} {4} (assembly {5}). Memory limit exceeded", 405 "[SCRIPT INSTANCE]: Not starting script {0} (id {1}) in part {2} (id {3}) in object {4} in {5}. Unable to load script state file {6}. Memory limit exceeded.",
405 savedState, ScriptName, ItemID, PrimName, ObjectID, assembly); 406 ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name, savedState);
406 } 407 }
407 } 408 }
408 catch (Exception e) 409 catch (Exception e)
409 { 410 {
410 m_log.ErrorFormat( 411 m_log.ErrorFormat(
411 "[SCRIPT INSTANCE]: Unable to load script state file {0} for script {1} {2} in {3} {4} (assembly {5}). XML is {6}. Exception {7}{8}", 412 "[SCRIPT INSTANCE]: Not starting script {0} (id {1}) in part {2} (id {3}) in object {4} in {5}. Unable to load script state file {6}. XML is {7}. Exception {8}{9}",
412 savedState, ScriptName, ItemID, PrimName, ObjectID, assembly, xml, e.Message, e.StackTrace); 413 ScriptTask.Name, ScriptTask.ItemID, Part.Name, Part.UUID, Part.ParentGroup.Name, Engine.World.Name, savedState, xml, e.Message, e.StackTrace);
413 } 414 }
414 } 415 }
415// else 416// else
@@ -598,9 +599,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
598 } 599 }
599 else 600 else
600 { 601 {
601 m_log.DebugFormat( 602 if (DebugLevel >= 1)
602 "[SCRIPT INSTANCE]: Co-operatively stopping script {0} {1} in {2} {3}", 603 m_log.DebugFormat(
603 ScriptName, ItemID, PrimName, ObjectID); 604 "[SCRIPT INSTANCE]: Co-operatively stopping script {0} {1} in {2} {3}",
605 ScriptName, ItemID, PrimName, ObjectID);
604 606
605 // This will terminate the event on next handle check by the script. 607 // This will terminate the event on next handle check by the script.
606 m_coopSleepHandle.Set(); 608 m_coopSleepHandle.Set();
@@ -609,9 +611,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
609 // checking is implemented. May want to allow a shorter timeout option later. 611 // checking is implemented. May want to allow a shorter timeout option later.
610 if (workItem.Wait(TimeSpan.MaxValue)) 612 if (workItem.Wait(TimeSpan.MaxValue))
611 { 613 {
612 m_log.DebugFormat( 614 if (DebugLevel >= 1)
613 "[SCRIPT INSTANCE]: Co-operatively stopped script {0} {1} in {2} {3}", 615 m_log.DebugFormat(
614 ScriptName, ItemID, PrimName, ObjectID); 616 "[SCRIPT INSTANCE]: Co-operatively stopped script {0} {1} in {2} {3}",
617 ScriptName, ItemID, PrimName, ObjectID);
615 618
616 return true; 619 return true;
617 } 620 }
@@ -922,9 +925,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
922 } 925 }
923 else if ((e is TargetInvocationException) && (e.InnerException is ScriptCoopStopException)) 926 else if ((e is TargetInvocationException) && (e.InnerException is ScriptCoopStopException))
924 { 927 {
925 m_log.DebugFormat( 928 if (DebugLevel >= 1)
926 "[SCRIPT INSTANCE]: Script {0}.{1} in event {2}, state {3} stopped co-operatively.", 929 m_log.DebugFormat(
927 PrimName, ScriptName, data.EventName, State); 930 "[SCRIPT INSTANCE]: Script {0}.{1} in event {2}, state {3} stopped co-operatively.",
931 PrimName, ScriptName, data.EventName, State);
928 } 932 }
929 } 933 }
930 } 934 }
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
index 9405075..afde685 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
52 { 52 {
53 myScriptEngine = _ScriptEngine; 53 myScriptEngine = _ScriptEngine;
54 54
55 m_log.Info("[XEngine] Hooking up to server events"); 55// m_log.Info("[XEngine] Hooking up to server events");
56 myScriptEngine.World.EventManager.OnAttach += attach; 56 myScriptEngine.World.EventManager.OnAttach += attach;
57 myScriptEngine.World.EventManager.OnObjectGrab += touch_start; 57 myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
58 myScriptEngine.World.EventManager.OnObjectGrabbing += touch; 58 myScriptEngine.World.EventManager.OnObjectGrabbing += touch;
@@ -69,7 +69,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
69 myScriptEngine.World.EventManager.OnScriptLandColliderStart += land_collision_start; 69 myScriptEngine.World.EventManager.OnScriptLandColliderStart += land_collision_start;
70 myScriptEngine.World.EventManager.OnScriptLandColliding += land_collision; 70 myScriptEngine.World.EventManager.OnScriptLandColliding += land_collision;
71 myScriptEngine.World.EventManager.OnScriptLandColliderEnd += land_collision_end; 71 myScriptEngine.World.EventManager.OnScriptLandColliderEnd += land_collision_end;
72 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); 72 IMoneyModule money = myScriptEngine.World.RequestModuleInterface<IMoneyModule>();
73 if (money != null) 73 if (money != null)
74 { 74 {
75 money.OnObjectPaid+=HandleObjectPaid; 75 money.OnObjectPaid+=HandleObjectPaid;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 604924b..ad79a9b 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -241,7 +241,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
241 m_ScriptConfig = configSource.Configs["XEngine"]; 241 m_ScriptConfig = configSource.Configs["XEngine"];
242 m_ConfigSource = configSource; 242 m_ConfigSource = configSource;
243 243
244 if (m_ScriptConfig.GetString("ScriptStopStrategy", "abort") == "co-op") 244 string rawScriptStopStrategy = m_ScriptConfig.GetString("ScriptStopStrategy", "abort");
245
246 m_log.InfoFormat("[XEngine]: Script stop strategy is {0}", rawScriptStopStrategy);
247
248 if (rawScriptStopStrategy == "co-op")
245 { 249 {
246 ScriptClassName = "XEngineScript"; 250 ScriptClassName = "XEngineScript";
247 ScriptBaseClassName = typeof(XEngineScriptBase).FullName; 251 ScriptBaseClassName = typeof(XEngineScriptBase).FullName;
@@ -261,15 +265,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
261 { 265 {
262 if (m_ScriptConfig == null) 266 if (m_ScriptConfig == null)
263 return; 267 return;
268
264 m_ScriptFailCount = 0; 269 m_ScriptFailCount = 0;
265 m_ScriptErrorMessage = String.Empty; 270 m_ScriptErrorMessage = String.Empty;
266 271
267 if (m_ScriptConfig == null)
268 {
269// m_log.ErrorFormat("[XEngine] No script configuration found. Scripts disabled");
270 return;
271 }
272
273 m_Enabled = m_ScriptConfig.GetBoolean("Enabled", true); 272 m_Enabled = m_ScriptConfig.GetBoolean("Enabled", true);
274 273
275 if (!m_Enabled) 274 if (!m_Enabled)