From 31cec30aa0a589f622635c689b08c2e026898556 Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Fri, 30 Nov 2007 04:54:15 +0000
Subject: * Extended our semi-stupid implementation of in world object
permissions to show a user's client that it can't edit a prim if it doesn't
have permission. * Permissions is due for a big revamp. The current way it's
done is a hack at best.
---
OpenSim/Region/Environment/Scenes/Scene.cs | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 2d74913..cc0f3e1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -733,7 +733,7 @@ namespace OpenSim.Region.Environment.Scenes
///
/// Loads the World's objects
///
- public virtual void LoadPrimsFromStorage()
+ public virtual void LoadPrimsFromStorage(bool m_permissions)
{
MainLog.Instance.Verbose("Loading objects from datastore");
List PrimsFromDB = m_storageManager.DataStore.LoadObjects(m_regInfo.RegionID);
@@ -741,6 +741,20 @@ namespace OpenSim.Region.Environment.Scenes
{
AddEntityFromStorage(prim);
SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
+ if (m_permissions)
+ {
+ rootPart.EveryoneMask = rootPart.ObjectFlags;
+ rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectYouOwner;
+ rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectTransfer;
+ rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectModify;
+ rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectMove;
+ rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectAnyOwner;
+ rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectYouOfficer;
+ }
+ else
+ {
+ rootPart.EveryoneMask = rootPart.ObjectFlags;
+ }
bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim);
if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = PhysicsScene.AddPrimShape(
@@ -839,7 +853,8 @@ namespace OpenSim.Region.Environment.Scenes
// if grass or tree, make phantom
if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255))
{
- rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
+ rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
+ //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
}
// if not phantom, add to physics
bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim);
--
cgit v1.1