aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-07 19:41:03 +0000
committerTeravus Ovares2008-05-07 19:41:03 +0000
commit86669a1664310d16da0cbb8f3a8e034464f16d3a (patch)
treedd6f779548d7e12fd2261afad71b8ed1072c2452
parentcheck in a new approach to this (diff)
downloadopensim-SC_OLD-86669a1664310d16da0cbb8f3a8e034464f16d3a.zip
opensim-SC_OLD-86669a1664310d16da0cbb8f3a8e034464f16d3a.tar.gz
opensim-SC_OLD-86669a1664310d16da0cbb8f3a8e034464f16d3a.tar.bz2
opensim-SC_OLD-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.
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneEvents.cs13
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs20
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs1
6 files changed, 48 insertions, 4 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 7dbddff..8344196 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -530,6 +530,8 @@ namespace OpenSim.Framework
530 public delegate void ScriptAnswer(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, int answer); 530 public delegate void ScriptAnswer(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, int answer);
531 531
532 public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID); 532 public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID);
533
534 public delegate void ForceReleaseControls(IClientAPI remoteClient, LLUUID agentID);
533 535
534 //Estate Requests 536 //Estate Requests
535 public delegate void DetailedEstateDataRequest(IClientAPI remoteClient, LLUUID invoice); 537 public delegate void DetailedEstateDataRequest(IClientAPI remoteClient, LLUUID invoice);
@@ -702,6 +704,8 @@ namespace OpenSim.Framework
702 704
703 event AgentSit OnUndo; 705 event AgentSit OnUndo;
704 706
707 event ForceReleaseControls OnForceReleaseControls;
708
705 event DetailedEstateDataRequest OnDetailedEstateDataRequest; 709 event DetailedEstateDataRequest OnDetailedEstateDataRequest;
706 event SetEstateFlagsRequest OnSetEstateFlagsRequest; 710 event SetEstateFlagsRequest OnSetEstateFlagsRequest;
707 event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; 711 event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 28f8364..8078491 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -240,6 +240,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
240 private ObjectDeselect handlerObjectDetach = null; 240 private ObjectDeselect handlerObjectDetach = null;
241 private AgentSit handlerOnUndo = null; 241 private AgentSit handlerOnUndo = null;
242 242
243 private ForceReleaseControls handlerForceReleaseControls = null;
244
243 /* Properties */ 245 /* Properties */
244 246
245 public LLUUID SecureSessionId 247 public LLUUID SecureSessionId
@@ -802,6 +804,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
802 public event RequestPayPrice OnRequestPayPrice; 804 public event RequestPayPrice OnRequestPayPrice;
803 public event AgentSit OnUndo; 805 public event AgentSit OnUndo;
804 806
807 public event ForceReleaseControls OnForceReleaseControls;
808
805 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 809 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
806 public event SetEstateFlagsRequest OnSetEstateFlagsRequest; 810 public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
807 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; 811 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
@@ -4004,6 +4008,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4004 4008
4005 break; 4009 break;
4006 4010
4011 case PacketType.ForceScriptControlRelease:
4012 handlerForceReleaseControls = OnForceReleaseControls;
4013 if (handlerForceReleaseControls != null)
4014 {
4015 handlerForceReleaseControls(this, AgentId);
4016 }
4017 break;
4018
4007 #endregion 4019 #endregion
4008 4020
4009 #region Objects/m_sceneObjects 4021 #region Objects/m_sceneObjects
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 {
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 010e65b..51bc0d8 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -172,6 +172,8 @@ namespace OpenSim.Region.Examples.SimpleModule
172 public event RequestPayPrice OnRequestPayPrice; 172 public event RequestPayPrice OnRequestPayPrice;
173 public event AgentSit OnUndo; 173 public event AgentSit OnUndo;
174 174
175 public event ForceReleaseControls OnForceReleaseControls;
176
175 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 177 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
176 public event SetEstateFlagsRequest OnSetEstateFlagsRequest; 178 public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
177 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; 179 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
index f8f38a1..ecf2a45 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
@@ -72,6 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
72 myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; 72 myScriptEngine.World.EventManager.OnScriptChangedEvent += changed;
73 myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; 73 myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target;
74 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; 74 myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target;
75 myScriptEngine.World.EventManager.OnScriptControlEvent += control;
75 76
76 // TODO: HOOK ALL EVENTS UP TO SERVER! 77 // TODO: HOOK ALL EVENTS UP TO SERVER!
77 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); 78 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>();