* Added hacked support for 'anyone can move' and 'anyone can copy'.
* BACKUP YOUR PRIM BEFORE UPDATING TO THIS and then double check the prim permissions after applying it with a different avatar (then the master avatar or the prim owner avatar). * Also, beware that any objects created under the old permission scheme may react oddly. They may automatically allow anyone to modify them, (which you'll then have to un-set). * It's hacked support because when 'anyone can move is set', any avatar can modify the prim (texture, shape, scale, etc)afrisby
parent
6abe37e71d
commit
57f666497b
|
@ -234,7 +234,7 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public delegate void GenericCall5(IClientAPI remoteClient, bool status);
|
public delegate void GenericCall5(IClientAPI remoteClient, bool status);
|
||||||
|
|
||||||
public delegate void GenericCall7(uint localID, string message);
|
public delegate void GenericCall7(IClientAPI remoteClient, uint localID, string message);
|
||||||
|
|
||||||
public delegate void UpdateShape(LLUUID agentID, uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
|
public delegate void UpdateShape(LLUUID agentID, uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
|
||||||
|
|
||||||
|
|
|
@ -1092,11 +1092,13 @@ namespace OpenSim.Region.ClientStack
|
||||||
descend.ItemData[i].SaleType = 0;
|
descend.ItemData[i].SaleType = 0;
|
||||||
descend.ItemData[i].Type = (sbyte) item.assetType;
|
descend.ItemData[i].Type = (sbyte) item.assetType;
|
||||||
descend.ItemData[i].CRC =
|
descend.ItemData[i].CRC =
|
||||||
Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type,
|
|
||||||
descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100,
|
Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType,
|
||||||
|
descend.ItemData[i].InvType, descend.ItemData[i].Type,
|
||||||
|
descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, descend.ItemData[i].SalePrice,
|
||||||
descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID,
|
descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID,
|
||||||
descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS,
|
descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, descend.ItemData[i].EveryoneMask,
|
||||||
1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
|
descend.ItemData[i].Flags, descend.ItemData[i].OwnerMask, descend.ItemData[i].GroupMask, item.inventoryCurrentPermissions);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
count++;
|
count++;
|
||||||
|
@ -1168,13 +1170,15 @@ namespace OpenSim.Region.ClientStack
|
||||||
inventoryReply.InventoryData[0].SaleType = 0;
|
inventoryReply.InventoryData[0].SaleType = 0;
|
||||||
inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
|
inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
|
||||||
inventoryReply.InventoryData[0].CRC =
|
inventoryReply.InventoryData[0].CRC =
|
||||||
Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType,
|
Helpers.InventoryCRC(inventoryReply.InventoryData[0].CreationDate, inventoryReply.InventoryData[0].SaleType,
|
||||||
|
inventoryReply.InventoryData[0].InvType,
|
||||||
inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
|
inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
|
||||||
inventoryReply.InventoryData[0].GroupID, 100,
|
inventoryReply.InventoryData[0].GroupID, inventoryReply.InventoryData[0].SalePrice,
|
||||||
inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
|
inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
|
||||||
inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
|
inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
|
||||||
FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
|
inventoryReply.InventoryData[0].EveryoneMask, inventoryReply.InventoryData[0].Flags,
|
||||||
FULL_MASK_PERMISSIONS);
|
inventoryReply.InventoryData[0].NextOwnerMask, inventoryReply.InventoryData[0].GroupMask,
|
||||||
|
inventoryReply.InventoryData[0].OwnerMask);
|
||||||
|
|
||||||
OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
|
OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
|
||||||
}
|
}
|
||||||
|
@ -1209,13 +1213,16 @@ namespace OpenSim.Region.ClientStack
|
||||||
InventoryReply.InventoryData[0].SaleType = 0;
|
InventoryReply.InventoryData[0].SaleType = 0;
|
||||||
InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
|
InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
|
||||||
InventoryReply.InventoryData[0].CRC =
|
InventoryReply.InventoryData[0].CRC =
|
||||||
Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
|
Helpers.InventoryCRC(InventoryReply.InventoryData[0].CreationDate, InventoryReply.InventoryData[0].SaleType,
|
||||||
|
InventoryReply.InventoryData[0].InvType,
|
||||||
InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
|
InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
|
||||||
InventoryReply.InventoryData[0].GroupID, 100,
|
InventoryReply.InventoryData[0].GroupID, InventoryReply.InventoryData[0].SalePrice,
|
||||||
InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
|
InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
|
||||||
InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
|
InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
|
||||||
FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
|
InventoryReply.InventoryData[0].EveryoneMask, InventoryReply.InventoryData[0].Flags,
|
||||||
FULL_MASK_PERMISSIONS);
|
InventoryReply.InventoryData[0].NextOwnerMask, InventoryReply.InventoryData[0].GroupMask,
|
||||||
|
InventoryReply.InventoryData[0].OwnerMask);
|
||||||
|
|
||||||
|
|
||||||
OutPacket(InventoryReply, ThrottleOutPacketType.Asset);
|
OutPacket(InventoryReply, ThrottleOutPacketType.Asset);
|
||||||
}
|
}
|
||||||
|
@ -1596,6 +1603,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
//outPacket.ObjectData[0].Flags = 0;
|
//outPacket.ObjectData[0].Flags = 0;
|
||||||
outPacket.ObjectData[0].Radius = 20;
|
outPacket.ObjectData[0].Radius = 20;
|
||||||
|
|
||||||
|
|
||||||
byte[] pb = pos.GetBytes();
|
byte[] pb = pos.GetBytes();
|
||||||
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
|
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
|
||||||
|
|
||||||
|
@ -2039,7 +2047,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
|
for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
|
||||||
{
|
{
|
||||||
if (tScene.PermissionsMngr.CanEditObject(simClient.AgentId, tScene.GetSceneObjectPart(multipleupdate.ObjectData[i].ObjectLocalID).UUID))
|
if (tScene.PermissionsMngr.CanEditObjectPosition(simClient.AgentId, tScene.GetSceneObjectPart(multipleupdate.ObjectData[i].ObjectLocalID).UUID))
|
||||||
{
|
{
|
||||||
#region position
|
#region position
|
||||||
|
|
||||||
|
@ -2896,7 +2904,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
if (OnObjectDescription != null)
|
if (OnObjectDescription != null)
|
||||||
{
|
{
|
||||||
OnObjectDescription(objDes.ObjectData[i].LocalID,
|
OnObjectDescription(this,objDes.ObjectData[i].LocalID,
|
||||||
enc.GetString(objDes.ObjectData[i].Description));
|
enc.GetString(objDes.ObjectData[i].Description));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2907,7 +2915,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
if (OnObjectName != null)
|
if (OnObjectName != null)
|
||||||
{
|
{
|
||||||
OnObjectName(objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name));
|
OnObjectName(this,objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -36,6 +36,12 @@ namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
protected Scene m_scene;
|
protected Scene m_scene;
|
||||||
|
|
||||||
|
// These are here for testing. They will be taken out
|
||||||
|
private uint PERM_ALL = (uint)2147483647;
|
||||||
|
private uint PERM_COPY = (uint)32768;
|
||||||
|
private uint PERM_MODIFY = (uint)16384;
|
||||||
|
private uint PERM_MOVE = (uint)524288;
|
||||||
|
private uint PERM_TRANS = (uint)8192;
|
||||||
// Bypasses the permissions engine (always returns OK)
|
// Bypasses the permissions engine (always returns OK)
|
||||||
// disable in any production environment
|
// disable in any production environment
|
||||||
// TODO: Change this to false when permissions are a desired default
|
// TODO: Change this to false when permissions are a desired default
|
||||||
|
@ -136,112 +142,7 @@ namespace OpenSim.Region.Environment
|
||||||
#region Object Permissions
|
#region Object Permissions
|
||||||
|
|
||||||
|
|
||||||
public virtual bool AnyoneCanCopyPermission(LLUUID user, LLUUID objId)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Default: deny
|
|
||||||
bool permission = false;
|
|
||||||
|
|
||||||
if (!m_scene.Entities.ContainsKey(objId))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it's not an object, we cant edit it.
|
|
||||||
if (!(m_scene.Entities[objId] is SceneObjectGroup))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId];
|
|
||||||
LLUUID taskOwner = null;
|
|
||||||
// Added this because at this point in time it wouldn't be wise for
|
|
||||||
// the administrator object permissions to take effect.
|
|
||||||
LLUUID objectOwner = task.OwnerID;
|
|
||||||
uint objectflags = task.RootPart.EveryoneMask;
|
|
||||||
|
|
||||||
// Object owners should be able to edit their own content
|
|
||||||
if (user == objectOwner)
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// If the 'anybody can move' flag is set then allow anyone to copy it
|
|
||||||
if ((objectflags & (uint)LLObject.ObjectFlags.ObjectCopy ) != 0)
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// Users should be able to edit what is over their land.
|
|
||||||
if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
|
|
||||||
user)
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// Estate users should be able to edit anything in the sim
|
|
||||||
if (IsEstateManager(user))
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// Admin objects should not be editable by the above
|
|
||||||
if (IsAdministrator(taskOwner))
|
|
||||||
permission = false;
|
|
||||||
|
|
||||||
// Admin should be able to edit anything in the sim (including admin objects)
|
|
||||||
if (IsAdministrator(user))
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
return permission;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public virtual bool AnyoneCanMovePermission(LLUUID user, LLUUID objId)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Default: deny
|
|
||||||
bool permission = false;
|
|
||||||
|
|
||||||
if (!m_scene.Entities.ContainsKey(objId))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it's not an object, we cant edit it.
|
|
||||||
if (!(m_scene.Entities[objId] is SceneObjectGroup))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objId];
|
|
||||||
LLUUID taskOwner = null;
|
|
||||||
// Added this because at this point in time it wouldn't be wise for
|
|
||||||
// the administrator object permissions to take effect.
|
|
||||||
LLUUID objectOwner = task.OwnerID;
|
|
||||||
uint objectflags = task.RootPart.EveryoneMask;
|
|
||||||
|
|
||||||
// Object owners should be able to edit their own content
|
|
||||||
if (user == objectOwner)
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// If the 'anybody can move' flag is set then allow anyone to move it
|
|
||||||
if ((objectflags & (uint)LLObject.ObjectFlags.ObjectMove) != 0)
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// Users should be able to edit what is over their land.
|
|
||||||
if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
|
|
||||||
user)
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// Estate users should be able to edit anything in the sim
|
|
||||||
if (IsEstateManager(user))
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
// Admin objects should not be editable by the above
|
|
||||||
if (IsAdministrator(taskOwner))
|
|
||||||
permission = false;
|
|
||||||
|
|
||||||
// Admin should be able to edit anything in the sim (including admin objects)
|
|
||||||
if (IsAdministrator(user))
|
|
||||||
permission = true;
|
|
||||||
|
|
||||||
return permission;
|
|
||||||
|
|
||||||
}
|
|
||||||
public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID)
|
public virtual uint GenerateClientFlags(LLUUID user, LLUUID objID)
|
||||||
{
|
{
|
||||||
if (!m_scene.Entities.ContainsKey(objID))
|
if (!m_scene.Entities.ContainsKey(objID))
|
||||||
|
@ -260,6 +161,9 @@ namespace OpenSim.Region.Environment
|
||||||
// Added this because at this point in time it wouldn't be wise for
|
// Added this because at this point in time it wouldn't be wise for
|
||||||
// the administrator object permissions to take effect.
|
// the administrator object permissions to take effect.
|
||||||
LLUUID objectOwner = task.OwnerID;
|
LLUUID objectOwner = task.OwnerID;
|
||||||
|
|
||||||
|
//return task.RootPart.ObjectFlags;task.RootPart.ObjectFlags |
|
||||||
|
|
||||||
uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask;
|
uint OwnerMask = task.RootPart.ObjectFlags | task.RootPart.OwnerMask;
|
||||||
uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask;
|
uint GroupMask = task.RootPart.ObjectFlags | task.RootPart.GroupMask;
|
||||||
uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask;
|
uint EveryoneMask = task.RootPart.ObjectFlags | task.RootPart.EveryoneMask;
|
||||||
|
@ -288,7 +192,20 @@ namespace OpenSim.Region.Environment
|
||||||
if (IsAdministrator(user))
|
if (IsAdministrator(user))
|
||||||
return OwnerMask;
|
return OwnerMask;
|
||||||
|
|
||||||
return 0;
|
if (((EveryoneMask & PERM_MOVE) != 0) || ((EveryoneMask & PERM_COPY) != 0))
|
||||||
|
{
|
||||||
|
if ((EveryoneMask & PERM_MOVE) != 0)
|
||||||
|
OwnerMask &= ~PERM_MOVE;
|
||||||
|
|
||||||
|
if ((EveryoneMask & PERM_COPY) != 0)
|
||||||
|
OwnerMask &= ~PERM_COPY;
|
||||||
|
|
||||||
|
OwnerMask &= ~PERM_MODIFY;
|
||||||
|
OwnerMask &= ~PERM_TRANS;
|
||||||
|
|
||||||
|
return OwnerMask;
|
||||||
|
}
|
||||||
|
return EveryoneMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)
|
protected virtual bool GenericObjectPermission(LLUUID user, LLUUID objId)
|
||||||
|
@ -353,17 +270,63 @@ namespace OpenSim.Region.Environment
|
||||||
return GenericObjectPermission(user, obj);
|
return GenericObjectPermission(user, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool CanEditObjectPosition(LLUUID user, LLUUID obj)
|
||||||
|
{
|
||||||
|
bool permission = GenericObjectPermission(user,obj);
|
||||||
|
if (!permission)
|
||||||
|
{
|
||||||
|
if (!m_scene.Entities.ContainsKey(obj))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's not an object, we cant edit it.
|
||||||
|
if (!(m_scene.Entities[obj] is SceneObjectGroup))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj];
|
||||||
|
LLUUID taskOwner = null;
|
||||||
|
// Added this because at this point in time it wouldn't be wise for
|
||||||
|
// the administrator object permissions to take effect.
|
||||||
|
LLUUID objectOwner = task.OwnerID;
|
||||||
|
if ((task.RootPart.EveryoneMask & PERM_MOVE) != 0)
|
||||||
|
permission = true;
|
||||||
|
}
|
||||||
|
return permission;
|
||||||
|
}
|
||||||
|
public virtual bool CanCopyObject(LLUUID user, LLUUID obj)
|
||||||
|
{
|
||||||
|
bool permission = GenericObjectPermission(user, obj);
|
||||||
|
if (!permission)
|
||||||
|
{
|
||||||
|
if (!m_scene.Entities.ContainsKey(obj))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's not an object, we cant edit it.
|
||||||
|
if (!(m_scene.Entities[obj] is SceneObjectGroup))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[obj];
|
||||||
|
LLUUID taskOwner = null;
|
||||||
|
// Added this because at this point in time it wouldn't be wise for
|
||||||
|
// the administrator object permissions to take effect.
|
||||||
|
LLUUID objectOwner = task.OwnerID;
|
||||||
|
if ((task.RootPart.EveryoneMask & PERM_COPY) != 0)
|
||||||
|
permission = true;
|
||||||
|
}
|
||||||
|
return permission;
|
||||||
|
}
|
||||||
public virtual bool CanReturnObject(LLUUID user, LLUUID obj)
|
public virtual bool CanReturnObject(LLUUID user, LLUUID obj)
|
||||||
{
|
{
|
||||||
return GenericObjectPermission(user, obj);
|
return GenericObjectPermission(user, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool CanCopyObject(LLUUID user, LLUUID obj)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
// return GenericObjectPermission(user, obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Communication Permissions
|
#region Communication Permissions
|
||||||
|
|
|
@ -443,8 +443,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.Resize(scale, localID);
|
group.Resize(scale, localID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This handles the nifty little tool tip that you get when you drag your mouse over an object
|
/// This handles the nifty little tool tip that you get when you drag your mouse over an object
|
||||||
|
@ -473,8 +478,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateSingleRotation(rot, localID);
|
group.UpdateSingleRotation(rot, localID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -486,8 +496,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateGroupRotation(rot);
|
group.UpdateGroupRotation(rot);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -500,15 +515,25 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateGroupRotation(pos, rot);
|
group.UpdateGroupRotation(pos, rot);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
|
public void UpdatePrimSinglePosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateSinglePosition(pos, localID);
|
group.UpdateSinglePosition(pos, localID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -520,8 +545,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateGroupPosition(pos);
|
group.UpdateGroupPosition(pos);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -533,8 +563,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateTextureEntry(localID, texture);
|
group.UpdateTextureEntry(localID, texture);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -546,30 +581,25 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
|
group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
|
||||||
//System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
|
public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
|
||||||
{
|
|
||||||
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, objectID) || PermissionsMngr.AnyoneCanMovePermission(remoteClient.AgentId, objectID))
|
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(objectID);
|
SceneObjectGroup group = GetGroupByPrim(objectID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.GrabMovement(offset, pos, remoteClient);
|
group.GrabMovement(offset, pos, remoteClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="primLocalID"></param>
|
|
||||||
/// <param name="description"></param>
|
|
||||||
public void PrimName(uint primLocalID, string name)
|
|
||||||
{
|
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
|
||||||
if (group != null)
|
|
||||||
group.SetPartName(name, primLocalID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -577,23 +607,49 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="primLocalID"></param>
|
/// <param name="primLocalID"></param>
|
||||||
/// <param name="description"></param>
|
/// <param name="description"></param>
|
||||||
public void PrimDescription(uint primLocalID, string description)
|
public void PrimName(IClientAPI remoteClient, uint primLocalID, string name)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
|
group.SetPartName(name, primLocalID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="primLocalID"></param>
|
||||||
|
/// <param name="description"></param>
|
||||||
|
public void PrimDescription(IClientAPI remoteClient, uint primLocalID, string description)
|
||||||
|
{
|
||||||
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID))
|
||||||
|
{
|
||||||
group.SetPartDescription(description, primLocalID);
|
group.SetPartDescription(description, primLocalID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
|
public void UpdateExtraParam(LLUUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
if (this.m_parentScene.PermissionsMngr.CanEditObject(agentID, group.GetPartsFullID(primLocalID)))
|
|
||||||
{
|
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObject(agentID, group.UUID))
|
||||||
|
{
|
||||||
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -602,12 +658,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void UpdatePrimShape(LLUUID agentID, uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
|
public void UpdatePrimShape(LLUUID agentID, uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||||
if (this.m_parentScene.PermissionsMngr.CanEditObject(agentID, group.GetPartsFullID(primLocalID)))
|
|
||||||
{
|
|
||||||
if (group != null)
|
if (group != null)
|
||||||
|
{
|
||||||
|
if (PermissionsMngr.CanEditObjectPosition(agentID, group.GetPartsFullID(primLocalID)))
|
||||||
|
{
|
||||||
|
|
||||||
group.UpdateShape(shapeBlock, primLocalID);
|
group.UpdateShape(shapeBlock, primLocalID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -724,7 +783,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (originPrim != null)
|
if (originPrim != null)
|
||||||
{
|
{
|
||||||
if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID) || PermissionsMngr.AnyoneCanCopyPermission(AgentID, originPrim.UUID))
|
if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID))
|
||||||
{
|
{
|
||||||
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
|
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
|
||||||
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
||||||
|
|
|
@ -448,6 +448,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
item.parentFolderID = DeRezPacket.AgentBlock.DestinationID;
|
item.parentFolderID = DeRezPacket.AgentBlock.DestinationID;
|
||||||
item.inventoryCurrentPermissions = 2147483647;
|
item.inventoryCurrentPermissions = 2147483647;
|
||||||
item.inventoryNextPermissions = 2147483647;
|
item.inventoryNextPermissions = 2147483647;
|
||||||
|
item.inventoryEveryOnePermissions = ((SceneObjectGroup)selectedEnt).RootPart.EveryoneMask;
|
||||||
|
item.inventoryBasePermissions = ((SceneObjectGroup)selectedEnt).RootPart.BaseMask;
|
||||||
|
item.inventoryCurrentPermissions = ((SceneObjectGroup)selectedEnt).RootPart.OwnerMask;
|
||||||
|
|
||||||
userInfo.AddItem(remoteClient.AgentId, item);
|
userInfo.AddItem(remoteClient.AgentId, item);
|
||||||
remoteClient.SendInventoryItemCreateUpdate(item);
|
remoteClient.SendInventoryItemCreateUpdate(item);
|
||||||
|
|
|
@ -851,7 +851,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_flags |= flag;
|
m_flags |= flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
uint currflag = (uint)m_flags;
|
//uint currflag = (uint)m_flags;
|
||||||
//System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
|
//System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
|
||||||
//ScheduleFullUpdate();
|
//ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
@ -1295,7 +1295,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//EveryoneMask |= (uint)57344;
|
//EveryoneMask |= (uint)57344;
|
||||||
|
|
||||||
}
|
}
|
||||||
ScheduleFullUpdate();
|
//ScheduleFullUpdate();
|
||||||
|
SendFullUpdateToAllClients();
|
||||||
}
|
}
|
||||||
//Field 16 = NextownerMask
|
//Field 16 = NextownerMask
|
||||||
if (field == (byte)16)
|
if (field == (byte)16)
|
||||||
|
@ -1308,7 +1309,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
NextOwnerMask |= mask;
|
NextOwnerMask |= mask;
|
||||||
}
|
}
|
||||||
ScheduleFullUpdate();
|
SendFullUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue