diff options
author | Alan Webb | 2009-08-03 23:07:12 -0400 |
---|---|---|
committer | dr scofield (aka dirk husemann) | 2009-08-04 11:44:22 +0200 |
commit | 068f54725ba5cc658257b5e0f4b9d7c51638c376 (patch) | |
tree | 5eacde581adab1eeed28f7925a9bed32c3189ba5 /OpenSim/Region/ScriptEngine/Shared/Instance | |
parent | This change adds support for the attach event in scripts. (diff) | |
download | opensim-SC_OLD-068f54725ba5cc658257b5e0f4b9d7c51638c376.zip opensim-SC_OLD-068f54725ba5cc658257b5e0f4b9d7c51638c376.tar.gz opensim-SC_OLD-068f54725ba5cc658257b5e0f4b9d7c51638c376.tar.bz2 opensim-SC_OLD-068f54725ba5cc658257b5e0f4b9d7c51638c376.tar.xz |
Slight change to state management for attach scheduling.
Signed-off-by: dr scofield (aka dirk husemann) <drscofield@xyzzyxyzzy.net>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 586f926..8168300 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -89,8 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
89 | private long m_eventDelayTicks = 0; | 89 | private long m_eventDelayTicks = 0; |
90 | private long m_nextEventTimeTicks = 0; | 90 | private long m_nextEventTimeTicks = 0; |
91 | private bool m_startOnInit = true; | 91 | private bool m_startOnInit = true; |
92 | private bool m_isAttachment = false; | 92 | private UUID m_AttachedAvatar = UUID.Zero; |
93 | private UUID m_attachedAvatar = UUID.Zero; | ||
94 | private StateSource m_stateSource; | 93 | private StateSource m_stateSource; |
95 | private bool m_postOnRez; | 94 | private bool m_postOnRez; |
96 | private bool m_startedFromSavedState = false; | 95 | private bool m_startedFromSavedState = false; |
@@ -234,8 +233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
234 | m_MaxScriptQueue = maxScriptQueue; | 233 | m_MaxScriptQueue = maxScriptQueue; |
235 | m_stateSource = stateSource; | 234 | m_stateSource = stateSource; |
236 | m_postOnRez = postOnRez; | 235 | m_postOnRez = postOnRez; |
237 | m_isAttachment = part.IsAttachment; | 236 | m_AttachedAvatar = part.AttachedAvatar; |
238 | m_attachedAvatar = part.AttachedAvatar; | ||
239 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; | 237 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; |
240 | 238 | ||
241 | if (part != null) | 239 | if (part != null) |
@@ -383,13 +381,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
383 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); | 381 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); |
384 | } | 382 | } |
385 | 383 | ||
386 | if (m_isAttachment) | 384 | if (m_stateSource == StateSource.AttachedRez) |
387 | { | 385 | { |
388 | PostEvent(new EventParams("attach", | 386 | PostEvent(new EventParams("attach", |
389 | new object[] { new LSL_Types.LSLString(m_attachedAvatar.ToString()) }, new DetectParams[0])); | 387 | new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); |
390 | } | 388 | } |
391 | 389 | else if (m_stateSource == StateSource.NewRez) | |
392 | if (m_stateSource == StateSource.NewRez) | ||
393 | { | 390 | { |
394 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); | 391 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); |
395 | PostEvent(new EventParams("changed", | 392 | PostEvent(new EventParams("changed", |
@@ -413,10 +410,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
413 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); | 410 | new Object[] {new LSL_Types.LSLInteger(m_StartParam)}, new DetectParams[0])); |
414 | } | 411 | } |
415 | 412 | ||
416 | if (m_isAttachment) | 413 | if (m_stateSource == StateSource.AttachedRez) |
417 | { | 414 | { |
418 | PostEvent(new EventParams("attach", | 415 | PostEvent(new EventParams("attach", |
419 | new object[] { new LSL_Types.LSLString(m_attachedAvatar.ToString()) }, new DetectParams[0])); | 416 | new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); |
420 | } | 417 | } |
421 | 418 | ||
422 | } | 419 | } |