diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 1c59d45..3797683 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -121,6 +121,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
121 | 121 | ||
122 | public bool Running { get; set; } | 122 | public bool Running { get; set; } |
123 | 123 | ||
124 | public bool Run { get; set; } | ||
125 | |||
124 | public bool Suspended | 126 | public bool Suspended |
125 | { | 127 | { |
126 | get { return m_Suspended; } | 128 | get { return m_Suspended; } |
@@ -216,6 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
216 | m_postOnRez = postOnRez; | 218 | m_postOnRez = postOnRez; |
217 | m_AttachedAvatar = part.ParentGroup.AttachedAvatar; | 219 | m_AttachedAvatar = part.ParentGroup.AttachedAvatar; |
218 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; | 220 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; |
221 | Run = true; | ||
219 | 222 | ||
220 | if (part != null) | 223 | if (part != null) |
221 | { | 224 | { |
@@ -330,16 +333,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
330 | } | 333 | } |
331 | else | 334 | else |
332 | { | 335 | { |
333 | m_log.ErrorFormat( | 336 | m_log.WarnFormat( |
334 | "[SCRIPT INSTANCE]: Unable to load script state from assembly {0}: Memory limit exceeded", | 337 | "[SCRIPT INSTANCE]: Unable to load script state file {0} for script {1} {2} in {3} {4} (assembly {5}). Memory limit exceeded", |
335 | assembly); | 338 | savedState, ScriptName, ItemID, PrimName, ObjectID, assembly); |
336 | } | 339 | } |
337 | } | 340 | } |
338 | catch (Exception e) | 341 | catch (Exception e) |
339 | { | 342 | { |
340 | m_log.ErrorFormat( | 343 | m_log.ErrorFormat( |
341 | "[SCRIPT INSTANCE]: Unable to load script state from assembly {0}. XML is {1}. Exception {2}{3}", | 344 | "[SCRIPT INSTANCE]: Unable to load script state file {0} for script {1} {2} in {3} {4} (assembly {5}). XML is {6}. Exception {7}{8}", |
342 | assembly, xml, e.Message, e.StackTrace); | 345 | savedState, ScriptName, ItemID, PrimName, ObjectID, assembly, xml, e.Message, e.StackTrace); |
343 | } | 346 | } |
344 | } | 347 | } |
345 | // else | 348 | // else |
@@ -354,10 +357,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
354 | 357 | ||
355 | public void Init() | 358 | public void Init() |
356 | { | 359 | { |
357 | if (!m_startOnInit) return; | 360 | if (!m_startOnInit) |
361 | return; | ||
358 | 362 | ||
359 | if (m_startedFromSavedState) | 363 | if (m_startedFromSavedState) |
360 | { | 364 | { |
365 | if (!Run) | ||
366 | return; | ||
367 | |||
361 | Start(); | 368 | Start(); |
362 | if (m_postOnRez) | 369 | if (m_postOnRez) |
363 | { | 370 | { |
@@ -390,6 +397,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
390 | } | 397 | } |
391 | else | 398 | else |
392 | { | 399 | { |
400 | if (!Run) | ||
401 | return; | ||
402 | |||
393 | Start(); | 403 | Start(); |
394 | PostEvent(new EventParams("state_entry", | 404 | PostEvent(new EventParams("state_entry", |
395 | new Object[0], new DetectParams[0])); | 405 | new Object[0], new DetectParams[0])); |