diff options
author | Justin Clark-Casey (justincc) | 2010-07-13 23:19:45 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-13 23:19:45 +0100 |
commit | 6f644f5322ee0c5ffe6c654387981f1c13f7112d (patch) | |
tree | 818903820f1af3a1760e89ec470d4bf36388f918 /OpenSim/Region/Framework | |
parent | discard an object media update message if it tries to set more media textures... (diff) | |
download | opensim-SC-6f644f5322ee0c5ffe6c654387981f1c13f7112d.zip opensim-SC-6f644f5322ee0c5ffe6c654387981f1c13f7112d.tar.gz opensim-SC-6f644f5322ee0c5ffe6c654387981f1c13f7112d.tar.bz2 opensim-SC-6f644f5322ee0c5ffe6c654387981f1c13f7112d.tar.xz |
implement prim media control permissions serverside in order to stop bad clients
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 7dab04f..70af978 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -81,6 +81,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
81 | public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); | 81 | public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); |
82 | public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); | 82 | public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); |
83 | public delegate bool TeleportHandler(UUID userID, Scene scene); | 83 | public delegate bool TeleportHandler(UUID userID, Scene scene); |
84 | public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face); | ||
84 | #endregion | 85 | #endregion |
85 | 86 | ||
86 | public class ScenePermissions | 87 | public class ScenePermissions |
@@ -139,6 +140,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
139 | public event CopyUserInventoryHandler OnCopyUserInventory; | 140 | public event CopyUserInventoryHandler OnCopyUserInventory; |
140 | public event DeleteUserInventoryHandler OnDeleteUserInventory; | 141 | public event DeleteUserInventoryHandler OnDeleteUserInventory; |
141 | public event TeleportHandler OnTeleport; | 142 | public event TeleportHandler OnTeleport; |
143 | public event ControlPrimMediaHandler OnControlPrimMedia; | ||
142 | #endregion | 144 | #endregion |
143 | 145 | ||
144 | #region Object Permission Checks | 146 | #region Object Permission Checks |
@@ -947,5 +949,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
947 | } | 949 | } |
948 | return true; | 950 | return true; |
949 | } | 951 | } |
952 | |||
953 | public bool CanControlPrimMedia(UUID userID, UUID primID, int face) | ||
954 | { | ||
955 | ControlPrimMediaHandler handler = OnControlPrimMedia; | ||
956 | if (handler != null) | ||
957 | { | ||
958 | Delegate[] list = handler.GetInvocationList(); | ||
959 | foreach (ControlPrimMediaHandler h in list) | ||
960 | { | ||
961 | if (h(userID, primID, face) == false) | ||
962 | return false; | ||
963 | } | ||
964 | } | ||
965 | return true; | ||
966 | } | ||
950 | } | 967 | } |
951 | } | 968 | } \ No newline at end of file |