From 85a9834ed84f33d3610499914fa3168a8eebce6d Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Sun, 10 Feb 2008 10:55:57 +0000
Subject: * A lot of ugly permissions updates. ** Created
SendFullUpdateToAllClientsExcept(LLUUID) so that permission updates /appear/
to apply immediately ** Separated out the ObjectFlags and the Permission
Flags. They're related but not the same ** Added a hack routine to add
*back* the objectflags to the client flags because the client hates the way
we're doing object permissions ** Updated the clientflags routine to properly
tell the client when they can't edit admin objects (objects owned by the sim
administrator) even when they're an estate manager(why? >.< argh!) ** Fixed
a null sim administrator/estate manager/user from causing permissions to
return false even when it should return true. ** Re-added ObjectModify hack
to allow collaboration with the allow anyone to move checkbox until we get
group permissions done.
---
.../Region/Environment/Scenes/SceneObjectGroup.cs | 9 ++++
.../Region/Environment/Scenes/SceneObjectPart.cs | 60 ++++++++++++++++++++--
2 files changed, 64 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index c204389..a14d869 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -60,6 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
/// since the group's last persistent backup
///
public bool HasGroupChanged = false;
+ private bool m_locked = false;
private LLVector3 lastPhysGroupPos;
private LLQuaternion lastPhysGroupRot;
@@ -1217,7 +1218,15 @@ namespace OpenSim.Region.Environment.Scenes
part.UpdateExtraParam(type, inUse, data);
}
}
+ public bool GetLocked()
+ {
+ return m_locked;
+ }
+ public void SetLocked(bool val)
+ {
+ m_locked = val;
+ }
///
///
///
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0a9d21a..8c25dfa 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -44,7 +44,19 @@ namespace OpenSim.Region.Environment.Scenes
{
// I don't really know where to put this except here.
// Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants
-
+ [Flags]
+ public enum ExtraParamType
+ {
+ Something1 = 1,
+ Something2 = 2,
+ Something3 = 4,
+ Something4 = 8,
+ Flexible = 16,
+ Light = 32,
+ Sculpt = 48,
+ Something5 = 64,
+ Something6 = 128
+ }
[Flags]
public enum Changed : uint
{
@@ -1166,6 +1178,15 @@ namespace OpenSim.Region.Environment.Scenes
public void UpdatePrimFlags(ushort type, bool inUse, byte[] data)
{
+
+
+ //m_log.Info("TSomething1:" + ((type & (ushort)ExtraParamType.Something1) == (ushort)ExtraParamType.Something1));
+ //m_log.Info("TSomething2:" + ((type & (ushort)ExtraParamType.Something2) == (ushort)ExtraParamType.Something2));
+ //m_log.Info("TSomething3:" + ((type & (ushort)ExtraParamType.Something3) == (ushort)ExtraParamType.Something3));
+ //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4));
+ //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5));
+ //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6));
+
bool usePhysics = false;
bool IsTemporary = false;
bool IsPhantom = false;
@@ -1173,7 +1194,7 @@ namespace OpenSim.Region.Environment.Scenes
bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0);
//bool IsLocked = false;
int i = 0;
-
+
try
{
@@ -1579,7 +1600,7 @@ namespace OpenSim.Region.Environment.Scenes
//EveryoneMask |= (uint)57344;
}
//ScheduleFullUpdate();
- SendFullUpdateToAllClients();
+ SendFullUpdateToAllClientsExcept(AgentID);
}
//Field 16 = NextownerMask
if (field == (byte) 16)
@@ -1592,11 +1613,28 @@ namespace OpenSim.Region.Environment.Scenes
{
NextOwnerMask |= mask;
}
+ SendFullUpdateToAllClientsExcept(AgentID);
+ }
+
+ if (field == (byte)2)
+ {
+ if (addRemTF == (byte)0)
+ {
+ m_parentGroup.SetLocked(true);
+ //OwnerMask &= ~mask;
+ }
+ else
+ {
+ m_parentGroup.SetLocked(false);
+ //OwnerMask |= mask;
+ }
SendFullUpdateToAllClients();
+
}
+
}
}
-
+
#region Client Update Methods
public void AddFullUpdateToAllAvatars()
@@ -1607,7 +1645,19 @@ namespace OpenSim.Region.Environment.Scenes
avatars[i].QueuePartForUpdate(this);
}
}
-
+ public void SendFullUpdateToAllClientsExcept(LLUUID agentID)
+ {
+ List avatars = m_parentGroup.GetScenePresences();
+ for (int i = 0; i < avatars.Count; i++)
+ {
+ // Ugly reference :(
+ if (avatars[i].UUID != agentID)
+ {
+ m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this,
+ avatars[i].GenerateClientFlags(UUID));
+ }
+ }
+ }
public void AddFullUpdateToAvatar(ScenePresence presence)
{
presence.QueuePartForUpdate(this);
--
cgit v1.1