aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs20
1 files changed, 18 insertions, 2 deletions
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 {