From ee6cd884c9732b492675e043fe318ffcdfecc45d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 13 Jul 2010 23:58:19 +0100 Subject: implement serverside checks for media texture navigation in order to stop naughty clients --- OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 70af978..0033900 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -82,6 +82,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); public delegate bool TeleportHandler(UUID userID, Scene scene); public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face); + public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face); #endregion public class ScenePermissions @@ -141,6 +142,7 @@ namespace OpenSim.Region.Framework.Scenes public event DeleteUserInventoryHandler OnDeleteUserInventory; public event TeleportHandler OnTeleport; public event ControlPrimMediaHandler OnControlPrimMedia; + public event InteractWithPrimMediaHandler OnInteractWithPrimMedia; #endregion #region Object Permission Checks @@ -963,6 +965,21 @@ namespace OpenSim.Region.Framework.Scenes } } return true; - } + } + + public bool CanInteractWithPrimMedia(UUID userID, UUID primID, int face) + { + InteractWithPrimMediaHandler handler = OnInteractWithPrimMedia; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (InteractWithPrimMediaHandler h in list) + { + if (h(userID, primID, face) == false) + return false; + } + } + return true; + } } } \ No newline at end of file -- cgit v1.1