Add a new ViewObjectInventory permission to decouple viewing from

+MOD status
avinationmerge
Melanie 2011-01-14 18:26:41 +01:00
parent 8074c6ace1
commit 76f39d326e
1 changed files with 17 additions and 0 deletions

View File

@ -49,6 +49,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition);
public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene);
public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
public delegate bool ViewObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene);
public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene);
public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene); public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene);
@ -116,6 +117,7 @@ namespace OpenSim.Region.Framework.Scenes
public event DuplicateObjectHandler OnDuplicateObject; public event DuplicateObjectHandler OnDuplicateObject;
public event EditObjectHandler OnEditObject; public event EditObjectHandler OnEditObject;
public event EditObjectInventoryHandler OnEditObjectInventory; public event EditObjectInventoryHandler OnEditObjectInventory;
public event ViewObjectInventoryHandler OnViewObjectInventory;
public event MoveObjectHandler OnMoveObject; public event MoveObjectHandler OnMoveObject;
public event ObjectEntryHandler OnObjectEntry; public event ObjectEntryHandler OnObjectEntry;
public event ReturnObjectsHandler OnReturnObjects; public event ReturnObjectsHandler OnReturnObjects;
@ -401,6 +403,21 @@ namespace OpenSim.Region.Framework.Scenes
return true; return true;
} }
public bool CanViewObjectInventory(UUID objectID, UUID editorID)
{
ViewObjectInventoryHandler handler = OnViewObjectInventory;
if (handler != null)
{
Delegate[] list = handler.GetInvocationList();
foreach (ViewObjectInventoryHandler h in list)
{
if (h(objectID, editorID, m_scene) == false)
return false;
}
}
return true;
}
#endregion #endregion
#region MOVE OBJECT #region MOVE OBJECT