diff options
author | Melanie | 2010-04-19 06:29:26 +0100 |
---|---|---|
committer | Melanie | 2010-04-19 06:29:26 +0100 |
commit | 21cad5d3ac68ceb4ac48346835ac087ecb107446 (patch) | |
tree | b413c2c0e42a38008bd61cdd8191787bccb45b13 /OpenSim/Region/ScriptEngine | |
parent | Slightly tweak README to account for the fact that first-time standalone user... (diff) | |
download | opensim-SC-21cad5d3ac68ceb4ac48346835ac087ecb107446.zip opensim-SC-21cad5d3ac68ceb4ac48346835ac087ecb107446.tar.gz opensim-SC-21cad5d3ac68ceb4ac48346835ac087ecb107446.tar.bz2 opensim-SC-21cad5d3ac68ceb4ac48346835ac087ecb107446.tar.xz |
All scripts are now created suspended and are only unsuspended when the object
is fully rezzed and all scripts in it are instantiated. This ensures that link
messages will not be lost on rez/region crossing and makes heavily scripted
objects reliable.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 35 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index ae148a9..9f6ea35 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -81,6 +81,9 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
81 | 81 | ||
82 | void PostEvent(EventParams data); | 82 | void PostEvent(EventParams data); |
83 | 83 | ||
84 | void Suspend(); | ||
85 | void Resume(); | ||
86 | |||
84 | /// <summary> | 87 | /// <summary> |
85 | /// Process the next event queued for this script | 88 | /// Process the next event queued for this script |
86 | /// </summary> | 89 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index d30d2dc..74f25aa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -95,6 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
95 | private bool m_startedFromSavedState; | 95 | private bool m_startedFromSavedState; |
96 | private UUID m_CurrentStateHash; | 96 | private UUID m_CurrentStateHash; |
97 | private UUID m_RegionID; | 97 | private UUID m_RegionID; |
98 | private bool m_Suspended = true; | ||
98 | 99 | ||
99 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> | 100 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> |
100 | m_LineMap; | 101 | m_LineMap; |
@@ -638,6 +639,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
638 | /// <returns></returns> | 639 | /// <returns></returns> |
639 | public object EventProcessor() | 640 | public object EventProcessor() |
640 | { | 641 | { |
642 | if (m_Suspended) | ||
643 | return 0; | ||
644 | |||
641 | lock (m_Script) | 645 | lock (m_Script) |
642 | { | 646 | { |
643 | EventParams data = null; | 647 | EventParams data = null; |
@@ -1011,5 +1015,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1011 | { | 1015 | { |
1012 | get { return m_RegionID; } | 1016 | get { return m_RegionID; } |
1013 | } | 1017 | } |
1018 | |||
1019 | public void Suspend() | ||
1020 | { | ||
1021 | m_Suspended = true; | ||
1022 | } | ||
1023 | |||
1024 | public void Resume() | ||
1025 | { | ||
1026 | m_Suspended = false; | ||
1027 | } | ||
1014 | } | 1028 | } |
1015 | } | 1029 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 98e77c0..54074ed 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1488,5 +1488,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1488 | return new ArrayList(); | 1488 | return new ArrayList(); |
1489 | } | 1489 | } |
1490 | } | 1490 | } |
1491 | |||
1492 | public void SuspendScript(UUID itemID) | ||
1493 | { | ||
1494 | IScriptInstance instance = GetInstance(itemID); | ||
1495 | if (instance == null) | ||
1496 | return; | ||
1497 | |||
1498 | instance.Suspend(); | ||
1499 | } | ||
1500 | |||
1501 | public void ResumeScript(UUID itemID) | ||
1502 | { | ||
1503 | IScriptInstance instance = GetInstance(itemID); | ||
1504 | if (instance == null) | ||
1505 | return; | ||
1506 | |||
1507 | instance.Resume(); | ||
1508 | } | ||
1491 | } | 1509 | } |
1492 | } | 1510 | } |