From 8d841565518a29c7081212684c392bd1917dbe3e Mon Sep 17 00:00:00 2001 From: mingchen Date: Thu, 20 Dec 2007 03:24:34 +0000 Subject: *Added event called after any movement is handled (OnClientMovement) - will be used for parcel banning goodness --- OpenSim/Region/Environment/LandManagement/LandManager.cs | 7 ++++++- OpenSim/Region/Environment/Scenes/SceneEvents.cs | 11 +++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index 5e243d1..72c449b 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs @@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.LandManagement m_regInfo = reginfo; landIDList.Initialize(); scene.EventManager.OnAvatarEnteringNewParcel += new EventManager.AvatarEnteringNewParcel(handleAvatarChangingParcel); - + scene.EventManager.OnClientMovement += new EventManager.ClientMovement(this.handleAnyClientMovement); } @@ -660,6 +660,11 @@ namespace OpenSim.Region.Environment.LandManagement } } + public void handleAnyClientMovement(ScenePresence avatar) //Like handleSignificantClientMovement, but called with an AgentUpdate regardless of distance. + { + + } + public void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client) { diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index 694c548..9c8c62b 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs @@ -42,6 +42,10 @@ namespace OpenSim.Region.Environment.Scenes public event OnFrameDelegate OnFrame; + public delegate void ClientMovement(ScenePresence client); + + public event ClientMovement OnClientMovement; + public delegate void OnBackupDelegate(IRegionDataStore datastore); public event OnBackupDelegate OnBackup; @@ -110,6 +114,13 @@ namespace OpenSim.Region.Environment.Scenes public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; + + public void TriggerOnClientMovement(ScenePresence avatar) + { + if(OnClientMovement != null) + OnClientMovement(avatar); + } + public void TriggerPermissionError(LLUUID user, string reason) { if (OnPermissionError != null) diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 2f074d0..62abefc 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -583,6 +583,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdatePacket agentData) { + //if (m_isChildAgent) //{ // // Console.WriteLine("DEBUG: HandleAgentUpdate: child agent"); @@ -689,6 +690,8 @@ namespace OpenSim.Region.Environment.Scenes UpdateMovementAnimations(update_movementflag); } } + + m_scene.EventManager.TriggerOnClientMovement(this); } /// -- cgit v1.1