diff options
author | Teravus Ovares | 2008-05-07 19:41:03 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-07 19:41:03 +0000 |
commit | 86669a1664310d16da0cbb8f3a8e034464f16d3a (patch) | |
tree | dd6f779548d7e12fd2261afad71b8ed1072c2452 /OpenSim/Region/Environment | |
parent | check in a new approach to this (diff) | |
download | opensim-SC-86669a1664310d16da0cbb8f3a8e034464f16d3a.zip opensim-SC-86669a1664310d16da0cbb8f3a8e034464f16d3a.tar.gz opensim-SC-86669a1664310d16da0cbb8f3a8e034464f16d3a.tar.bz2 opensim-SC-86669a1664310d16da0cbb8f3a8e034464f16d3a.tar.xz |
* Other then the prim update experiments that are going on now, llTakeControls works now along with the 'release controls button'. llReleaseControls() works mostly :D.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneEvents.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 20 |
2 files changed, 29 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index d409f4e..65dca95 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs | |||
@@ -137,6 +137,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
137 | 137 | ||
138 | public event ScriptChangedEvent OnScriptChangedEvent; | 138 | public event ScriptChangedEvent OnScriptChangedEvent; |
139 | 139 | ||
140 | public delegate void ScriptControlEvent(uint localID, LLUUID item, LLUUID avatarID, uint held, uint changed); | ||
141 | |||
142 | public event ScriptControlEvent OnScriptControlEvent; | ||
143 | |||
140 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); | 144 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); |
141 | 145 | ||
142 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; | 146 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; |
@@ -274,6 +278,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
274 | private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps; | 278 | private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps; |
275 | private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null; | 279 | private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null; |
276 | private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight | 280 | private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight |
281 | private ScriptControlEvent handlerScriptControlEvent = null; | ||
277 | 282 | ||
278 | private LandBuy handlerLandBuy = null; | 283 | private LandBuy handlerLandBuy = null; |
279 | private LandBuy handlerValidateLandBuy = null; | 284 | private LandBuy handlerValidateLandBuy = null; |
@@ -603,9 +608,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
603 | } | 608 | } |
604 | } | 609 | } |
605 | 610 | ||
606 | internal void TriggerControlEvent(uint p, LLUUID scriptUUID, uint p_3, uint p_4) | 611 | internal void TriggerControlEvent(uint p, LLUUID scriptUUID, LLUUID avatarID, uint held, uint _changed) |
607 | { | 612 | { |
608 | throw new Exception("The method or operation is not implemented."); | 613 | handlerScriptControlEvent = OnScriptControlEvent; |
614 | if (handlerScriptControlEvent != null) | ||
615 | { | ||
616 | handlerScriptControlEvent(p, scriptUUID, avatarID, held, _changed); | ||
617 | } | ||
609 | } | 618 | } |
610 | } | 619 | } |
611 | } | 620 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index fdafd7f..9343ad3 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -443,6 +443,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
443 | m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; | 443 | m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; |
444 | m_controllingClient.OnStartAnim += HandleStartAnim; | 444 | m_controllingClient.OnStartAnim += HandleStartAnim; |
445 | m_controllingClient.OnStopAnim += HandleStopAnim; | 445 | m_controllingClient.OnStopAnim += HandleStopAnim; |
446 | m_controllingClient.OnForceReleaseControls += HandleForceReleaseControls; | ||
446 | 447 | ||
447 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); | 448 | // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); |
448 | // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); | 449 | // ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); |
@@ -2491,6 +2492,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
2491 | 2492 | ||
2492 | 2493 | ||
2493 | } | 2494 | } |
2495 | public void HandleForceReleaseControls(IClientAPI remoteClient, LLUUID agentID) | ||
2496 | { | ||
2497 | IgnoredControls = ScriptControlled.CONTROL_ZERO; | ||
2498 | lock (scriptedcontrols) | ||
2499 | { | ||
2500 | scriptedcontrols.Clear(); | ||
2501 | } | ||
2502 | ControllingClient.SendTakeControls(int.MaxValue, false, false); | ||
2503 | } | ||
2494 | 2504 | ||
2495 | public void UnRegisterControlEventsToScript(uint Obj_localID, LLUUID Script_item_LLUUID) | 2505 | public void UnRegisterControlEventsToScript(uint Obj_localID, LLUUID Script_item_LLUUID) |
2496 | { | 2506 | { |
@@ -2512,6 +2522,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2512 | { | 2522 | { |
2513 | 2523 | ||
2514 | ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; | 2524 | ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; |
2525 | |||
2515 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) | 2526 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) |
2516 | { | 2527 | { |
2517 | allflags |= ScriptControlled.CONTROL_FWD; | 2528 | allflags |= ScriptControlled.CONTROL_FWD; |
@@ -2552,6 +2563,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2552 | { | 2563 | { |
2553 | allflags |= ScriptControlled.CONTROL_LBUTTON; | 2564 | allflags |= ScriptControlled.CONTROL_LBUTTON; |
2554 | } | 2565 | } |
2566 | |||
2555 | ScriptControlled held = ScriptControlled.CONTROL_ZERO; | 2567 | ScriptControlled held = ScriptControlled.CONTROL_ZERO; |
2556 | ScriptControlled change = ScriptControlled.CONTROL_ZERO; | 2568 | ScriptControlled change = ScriptControlled.CONTROL_ZERO; |
2557 | 2569 | ||
@@ -2584,12 +2596,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
2584 | { | 2596 | { |
2585 | ScriptControllers scriptControlData = scriptedcontrols[scriptUUID]; | 2597 | ScriptControllers scriptControlData = scriptedcontrols[scriptUUID]; |
2586 | ScriptControlled localHeld = held & scriptControlData.eventControls; | 2598 | ScriptControlled localHeld = held & scriptControlData.eventControls; |
2599 | //if (localHeld != ScriptControlled.CONTROL_ZERO) | ||
2600 | //{ | ||
2601 | //int i = 1; | ||
2602 | //} | ||
2587 | ScriptControlled localChange = change & scriptControlData.eventControls; | 2603 | ScriptControlled localChange = change & scriptControlData.eventControls; |
2588 | m_scene.EventManager.TriggerControlEvent(scriptControlData.objID, scriptUUID, (uint)localHeld, (uint)localChange); | 2604 | m_scene.EventManager.TriggerControlEvent(scriptControlData.objID, scriptUUID, UUID, (uint)localHeld, (uint)localChange); |
2589 | } | 2605 | } |
2590 | } | 2606 | } |
2591 | LastCommands = allflags; | 2607 | LastCommands = allflags; |
2592 | //foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags))) | 2608 | |
2593 | } | 2609 | } |
2594 | internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored) | 2610 | internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored) |
2595 | { | 2611 | { |