diff options
author | Justin Clark-Casey (justincc) | 2010-07-13 23:19:45 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:20 +0100 |
commit | 51b208e96c881bd322b3769b843f0ebae3c09a84 (patch) | |
tree | 7acd05a16a5d667087c25b8f7936515343c5e885 /OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |
parent | discard an object media update message if it tries to set more media textures... (diff) | |
download | opensim-SC_OLD-51b208e96c881bd322b3769b843f0ebae3c09a84.zip opensim-SC_OLD-51b208e96c881bd322b3769b843f0ebae3c09a84.tar.gz opensim-SC_OLD-51b208e96c881bd322b3769b843f0ebae3c09a84.tar.bz2 opensim-SC_OLD-51b208e96c881bd322b3769b843f0ebae3c09a84.tar.xz |
implement prim media control permissions serverside in order to stop bad clients
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Permissions.cs')
-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 |