== UUID.Zero is slow

This commit is contained in:
UbitUmarov
2022-01-08 23:35:56 +00:00
parent cb98fb309c
commit 357f20eb14
73 changed files with 251 additions and 260 deletions

View File

@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
m_log.ErrorFormat("[ARCHIVER MODULE] default user must be in format \"First Last\"", defaultUser);
}
if (defaultUserUUID == UUID.Zero)
if (defaultUserUUID.IsZero())
{
m_log.ErrorFormat("[ARCHIVER MODULE] cannot find specified default user {0}", defaultUser);
return;

View File

@@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
public void SetEstateTerrainBaseTexture(IClientAPI remoteClient, int level, UUID texture)
{
if (texture == UUID.Zero)
if (texture.IsZero())
return;
switch (level)
@@ -1185,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void HandleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey, bool kick)
{
if (prey == UUID.Zero)
if (prey.IsZero())
return;
EstateTeleportOneUserHomeRequest evOverride = OnEstateTeleportOneUserHomeRequest;

View File

@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void OnEstateTeleportOneUserHomeRequest(IClientAPI client, UUID invoice, UUID senderID, UUID prey, bool kick)
{
if (prey == UUID.Zero)
if (prey.IsZero())
return;
if (!(client.Scene is Scene))

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// Disconnect the Telehub:
public void Disconnect()
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
return;
m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero;
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// Add a SpawnPoint to the Telehub
public void AddSpawnPoint(Vector3 point)
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
return;
SceneObjectGroup grp = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject);
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// Remove a SpawnPoint from the Telehub
public void RemoveSpawnPoint(int spawnpoint)
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
return;
m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint);

View File

@@ -1423,13 +1423,13 @@ namespace OpenSim.Region.CoreModules.World.Land
curByte = LandChannel.LAND_TYPE_OWNED_BY_GROUP;
}
else if (currentParcel.LandData.SalePrice > 0 &&
(currentParcel.LandData.AuthBuyerID == UUID.Zero ||
currentParcel.LandData.AuthBuyerID == remote_client.AgentId))
(currentParcel.LandData.AuthBuyerID.IsZero() ||
currentParcel.LandData.AuthBuyerID.Equals(remote_client.AgentId)))
{
//Sale type
curByte = LandChannel.LAND_TYPE_IS_FOR_SALE;
}
else if (currentParcel.LandData.OwnerID == UUID.Zero)
else if (currentParcel.LandData.OwnerID.IsZero())
{
//Public type
curByte = LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero
@@ -1790,7 +1790,7 @@ namespace OpenSim.Region.CoreModules.World.Land
bool landforsale = ((lob.LandData.Flags &
(uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0);
if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale)
if ((AuthorizedID.IsZero() || AuthorizedID.Equals(e.agentId)) && e.parcelPrice >= saleprice && landforsale)
{
// TODO I don't think we have to lock it here, no?
//lock (e)
@@ -2204,7 +2204,7 @@ namespace OpenSim.Region.CoreModules.World.Land
return;
}
//m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID == UUID.Zero ? args.ToString() :"");
//m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID.IsZero() ? args.ToString() :"");
osUTF8 sb = LLSDxmlEncode2.Start();
LLSDxmlEncode2.AddMap(sb);
LLSDxmlEncode2.AddElem("parcel_id", parcelID,sb);
@@ -2217,7 +2217,7 @@ namespace OpenSim.Region.CoreModules.World.Land
private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID)
{
if (parcelID == UUID.Zero)
if (parcelID.IsZero())
return;
if(!m_parcelInfoCache.TryGetValue(parcelID, 30000, out ExtendedLandData data))

View File

@@ -850,10 +850,10 @@ namespace OpenSim.Region.CoreModules.World.Land
UUID owner = npccli.Owner;
if(owner == UUID.Zero)
if(owner.IsZero())
return true;
if (owner == LandData.OwnerID)
if (owner.Equals(LandData.OwnerID))
return false;
return !IsInLandAccessList(owner);
@@ -1043,7 +1043,7 @@ namespace OpenSim.Region.CoreModules.World.Land
parcelAccessList.Remove(entry);
// a delete all command ?
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
if (entries.Count == 1 && entries[0].AgentID.IsZero())
{
LandData.ParcelAccessList = parcelAccessList;
if ((flags & (uint)AccessList.Access) != 0)
@@ -1839,11 +1839,10 @@ namespace OpenSim.Region.CoreModules.World.Land
{
if (obj.OwnerID != LandData.OwnerID &&
(obj.GroupID != LandData.GroupID ||
LandData.GroupID == UUID.Zero))
LandData.GroupID.IsZero()))
{
if (!returns.ContainsKey(obj.OwnerID))
returns[obj.OwnerID] =
new List<SceneObjectGroup>();
returns[obj.OwnerID] = new List<SceneObjectGroup>();
returns[obj.OwnerID].Add(obj);
}
}

View File

@@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
// return either the average color of the texture, or the defaultColor if the texturID is invalid
// or the texture couldn't be found
private Color computeAverageColor(UUID textureID, Color defaultColor) {
if (textureID == UUID.Zero) return defaultColor; // not set
if (textureID.IsZero()) return defaultColor; // not set
if (m_mapping.ContainsKey(textureID)) return m_mapping[textureID]; // one of the predefined textures
Color color;

View File

@@ -624,10 +624,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
/// <returns></returns>
protected bool IsAdministrator(UUID user)
{
if (user == UUID.Zero)
if (user.IsZero())
return false;
if (m_RegionOwnerIsAdmin && m_scene.RegionInfo.EstateSettings.EstateOwner == user)
if (m_RegionOwnerIsAdmin && m_scene.RegionInfo.EstateSettings.EstateOwner.Equals(user))
return true;
if (m_RegionManagerIsAdmin && IsEstateManager(user))
@@ -650,7 +650,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (user == UUID.Zero)
if (user.IsZero())
return false;
if (m_allowGridAdmins)
@@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (FriendsModule == null)
return false;
if (user == UUID.Zero)
if (user.IsZero())
return false;
int friendPerms = FriendsModule.GetRightsGrantedByFriend(user, objectOwner);
@@ -681,7 +681,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
protected bool IsEstateManager(UUID user)
{
if (user == UUID.Zero) return false;
if (user.IsZero())
return false;
return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user);
}
@@ -786,7 +787,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if(sp.IsGod)
{
// do locked on objects owned by admin
if(!unlocked && spID == taskOwnerID)
if(!unlocked && spID.Equals(taskOwnerID))
return objflags | LOCKED_GOD_FLAGS;
else
return objflags | GOD_FLAGS;
@@ -804,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
uint grpEffectiveOwnerPerms = grp.EffectiveOwnerPerms;
// owner
if (spID == taskOwnerID)
if (spID.Equals(taskOwnerID))
{
returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked);
returnMask |= EXTRAOWNERMASK;
@@ -817,13 +818,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (task.ParentGroup.IsAttachment)
{
returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
if (!taskOwnerID.IsZero())
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
UUID taskGroupID = task.GroupID;
bool notGroupdOwned = taskOwnerID != taskGroupID;
bool notGroupdOwned = taskOwnerID.NotEqual(taskGroupID);
if ((grpEffectiveOwnerPerms & (uint)PermissionMask.Transfer) == 0)
grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy;
@@ -841,13 +842,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// group owned or shared ?
IClientAPI client = sp.ControllingClient;
ulong powers = 0;
if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers))
if(!taskGroupID.IsZero() && GroupMemberPowers(taskGroupID, sp, ref powers))
{
if(notGroupdOwned)
{
// group sharing or everyone
returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
if (!taskOwnerID.IsZero())
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
@@ -875,7 +876,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// fallback is everyone rights
returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
if (!taskOwnerID.IsZero())
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
@@ -922,7 +923,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Object owners should be able to edit their own content
UUID objectOwner = obj.OwnerID;
if (user == objectOwner)
if (user.Equals(objectOwner))
return PermissionClass.Owner;
// Admin should be able to edit anything in the sim (including admin objects)
@@ -935,7 +936,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return PermissionClass.Owner;
// Group permissions
if (obj.GroupID != UUID.Zero && IsGroupMember(obj.GroupID, user, 0))
if (!obj.GroupID.IsZero() && IsGroupMember(obj.GroupID, user, 0))
return PermissionClass.Group;
}
@@ -958,7 +959,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsAdministrator(currentUser))
{
// do lock on admin owned objects
if(locked && currentUser == objectOwner)
if(locked && currentUser.Equals(objectOwner))
return (uint)(PermissionMask.AllEffective & ~(PermissionMask.Modify | PermissionMask.Move));
return (uint)PermissionMask.AllEffective;
}
@@ -969,7 +970,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
uint grpEffectiveOwnerPerms = group.EffectiveOwnerPerms & lockmask;
if (currentUser == objectOwner)
if (currentUser.Equals(objectOwner))
return grpEffectiveOwnerPerms & lockmask;
if (group.IsAttachment)
@@ -979,13 +980,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy;
UUID sogGroupID = group.GroupID;
bool notgroudOwned = sogGroupID != objectOwner;
bool notgroudOwned = sogGroupID.NotEqual(objectOwner);
if (notgroudOwned && IsFriendWithPerms(currentUser, objectOwner))
return grpEffectiveOwnerPerms & lockmask;
ulong powers = 0;
if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers))
if (!sogGroupID.IsZero() && GroupMemberPowers(sogGroupID, currentUser, ref powers))
{
if(notgroudOwned)
return group.EffectiveGroupOrEveryOnePerms & lockmask;
@@ -1016,7 +1017,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sp.IsGod)
{
if(locked && spID == objectOwner)
if(locked && spID.Equals(objectOwner))
return (uint)(PermissionMask.AllEffective & ~(PermissionMask.Modify | PermissionMask.Move));
return (uint)PermissionMask.AllEffective;
}
@@ -1026,7 +1027,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
lockmask &= ~(uint)(PermissionMask.Modify | PermissionMask.Move);
uint ownerperms = group.EffectiveOwnerPerms;
if (spID == objectOwner)
if (spID.Equals(objectOwner))
return ownerperms & lockmask;
if (group.IsAttachment)
@@ -1036,7 +1037,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
ownerperms &= ~(uint)PermissionMask.Copy;
UUID sogGroupID = group.GroupID;
bool notgroudOwned = sogGroupID != objectOwner;
bool notgroudOwned = sogGroupID.NotEqual(objectOwner);
if (notgroudOwned && IsFriendWithPerms(spID, objectOwner))
{
@@ -1044,7 +1045,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
}
ulong powers = 0;
if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers))
if (!sogGroupID.IsZero() && GroupMemberPowers(sogGroupID, sp, ref powers))
{
if(notgroudOwned)
return group.EffectiveGroupOrEveryOnePerms & lockmask;
@@ -1071,12 +1072,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return ti.CurrentPermissions;
UUID tiGroupID = ti.GroupID;
if(tiGroupID != UUID.Zero)
if(!tiGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(tiGroupID, userID, ref powers))
{
if(tiGroupID == ti.OwnerID)
if(tiGroupID.Equals(ti.OwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return ti.CurrentPermissions;
@@ -1093,7 +1094,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID tiOwnerID = ti.OwnerID;
UUID spID = sp.UUID;
if(tiOwnerID == spID)
if(tiOwnerID.Equals(spID))
return ti.CurrentPermissions;
// ??
@@ -1101,12 +1102,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return ti.CurrentPermissions;
UUID tiGroupID = ti.GroupID;
if(tiGroupID != UUID.Zero)
if(!tiGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(tiGroupID, spID, ref powers))
{
if(tiGroupID == ti.OwnerID)
if(tiGroupID.Equals(ti.OwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return ti.CurrentPermissions;
@@ -1162,7 +1163,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager)
{
if (parcel.LandData.OwnerID == user)
if (parcel.LandData.OwnerID.Equals(user))
return true;
if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
@@ -1200,13 +1201,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if(parcel.LandData.GroupID == UUID.Zero)
if(parcel.LandData.GroupID.IsZero())
return false;
if (IsAdministrator(user))
return true;
if (parcel.LandData.OwnerID != user) // Only the owner can deed!
if (parcel.LandData.OwnerID.NotEqual(user)) // Only the owner can deed!
return false;
ScenePresence sp = m_scene.GetScenePresence(user);
@@ -1225,11 +1226,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID == UUID.Zero)
if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID.IsZero())
return false;
// object has group already?
if(sog.GroupID != targetGroupID)
if(sog.GroupID.NotEqual(targetGroupID))
return false;
// is effectivelly shared?
@@ -1240,7 +1241,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
// owned by requester?
if(sog.OwnerID != sp.UUID)
if(sog.OwnerID.NotEqual(sp.UUID))
return false;
// owner can transfer?
@@ -1271,7 +1272,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if((perms & (uint)PermissionMask.Copy) == 0)
return false;
if(sog.OwnerID != sp.UUID && (perms & (uint)PermissionMask.Transfer) == 0)
if(sog.OwnerID.NotEqual(sp.UUID) && (perms & (uint)PermissionMask.Transfer) == 0)
return false;
//If they can rez, they can duplicate
@@ -1294,7 +1295,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogOwnerID = sog.OwnerID;
UUID spID = sp.UUID;
if(sogOwnerID == spID)
if(sogOwnerID.Equals(spID))
return true;
if (sp.IsGod)
@@ -1304,12 +1305,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
UUID sogGroupID = sog.GroupID;
if (sogGroupID != UUID.Zero)
if (!sogGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, sp, ref powers))
{
if(sogGroupID == sogOwnerID)
if(sogGroupID.Equals(sogOwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
@@ -1336,7 +1337,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogOwnerID = sog.OwnerID;
if(sogOwnerID == userID)
if(sogOwnerID.Equals(userID))
return true;
if (IsAdministrator(userID))
@@ -1346,12 +1347,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
UUID sogGroupID = sog.GroupID;
if (sogGroupID != UUID.Zero)
if (!sogGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, userID, ref powers))
{
if(sogGroupID == sogOwnerID)
if(sogGroupID.Equals(sogOwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
@@ -1399,11 +1400,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sog == null)
return false;
if(sog.OwnerID == userID || IsAdministrator(userID))
if(sog.OwnerID.Equals(userID) || IsAdministrator(userID))
return true;
UUID sogGroupID = sog.GroupID;
if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
if(sogGroupID.IsZero() || sogGroupID.NotEqual(sog.OwnerID))
return false;
uint perms = sog.EffectiveOwnerPerms;
@@ -1478,7 +1479,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (objectID == UUID.Zero) // User inventory
if (objectID.IsZero()) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(user, notecard);
@@ -1521,17 +1522,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (ti == null)
return false;
if (ti.OwnerID != user)
if (ti.OwnerID.NotEqual(user))
{
UUID tiGroupID = ti.GroupID;
if (tiGroupID == UUID.Zero)
if (tiGroupID.IsZero())
return false;
ulong powers = 0;
if(!GroupMemberPowers(tiGroupID, user, ref powers))
return false;
if(tiGroupID == ti.OwnerID && (powers & (ulong)GroupPowers.ObjectManipulate) != 0)
if(tiGroupID.Equals(ti.OwnerID) && (powers & (ulong)GroupPowers.ObjectManipulate) != 0)
{
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy)) ==
((uint)PermissionMask.Modify | (uint)PermissionMask.Copy))
@@ -1602,7 +1603,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (m_bypassPermissions)
{
if (sog.OwnerID != sp.UUID && sog.IsAttachment)
if (sog.OwnerID.NotEqual(sp.UUID) && sog.IsAttachment)
return false;
return m_bypassPermissionsValue;
}
@@ -1649,14 +1650,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID userID = sog.OwnerID;
LandData landdata = parcel.LandData;
if (landdata.OwnerID == userID)
if (landdata.OwnerID.Equals(userID))
return true;
if (IsAdministrator(userID))
return true;
UUID landGroupID = landdata.GroupID;
if (landGroupID != UUID.Zero)
if (!landGroupID.IsZero())
{
if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowGroupObjectEntry)) != 0)
return IsGroupMember(landGroupID, userID, 0);
@@ -1693,14 +1694,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID userID = sog.OwnerID;
LandData landdata = parcel.LandData;
if (landdata.OwnerID == userID)
if (landdata.OwnerID.Equals(userID))
return true;
if (IsAdministrator(userID))
return true;
UUID landGroupID = landdata.GroupID;
if (landGroupID != UUID.Zero)
if (!landGroupID.IsZero())
{
checkflags = (int)ParcelFlags.AllowGroupObjectEntry;
if(scripts)
@@ -1741,7 +1742,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
continue;
}
if (isPrivUser || g.OwnerID == userID)
if (isPrivUser || g.OwnerID.Equals(userID))
continue;
// This is a short cut for efficiency. If land is non-null,
@@ -1768,7 +1769,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
LandData ldata = l.LandData;
// If we own the land outright, then allow
//
if (ldata.OwnerID == userID)
if (ldata.OwnerID.Equals(userID))
continue;
// Group voodoo
@@ -1787,8 +1788,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Group deeded object?
//
if (g.OwnerID == lGroupID &&
(powers & (ulong)GroupPowers.ReturnGroupOwned) == 0)
if (g.OwnerID.Equals(lGroupID) && (powers & (ulong)GroupPowers.ReturnGroupOwned) == 0)
{
objects.Remove(g);
continue;
@@ -1796,8 +1796,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Group set object?
//
if (g.GroupID == lGroupID &&
(powers & (ulong)GroupPowers.ReturnGroupSet) == 0)
if (g.GroupID.Equals(lGroupID) && (powers & (ulong)GroupPowers.ReturnGroupSet) == 0)
{
objects.Remove(g);
continue;
@@ -1848,7 +1847,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if(IsAdministrator(userID))
return true;
if(landdata.GroupID != UUID.Zero)
if(!landdata.GroupID.IsZero())
{
if ((landdata.Flags & (uint)ParcelFlags.CreateGroupObjects) != 0)
return IsGroupMember(landdata.GroupID, userID, 0);
@@ -1899,7 +1898,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
if (((lflags & (uint)ParcelFlags.AllowGroupScripts) != 0)
&& (ldata.GroupID != UUID.Zero) && (ldata.GroupID == part.GroupID))
&& (!ldata.GroupID.IsZero()) && (ldata.GroupID.Equals(part.GroupID)))
return true;
return GenericEstatePermission(part.OwnerID);
@@ -1926,7 +1925,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (sog == null || sog.IsDeleted || userID == UUID.Zero)
if (sog == null || sog.IsDeleted || userID.IsZero())
return false;
// sell is not a attachment op
@@ -1946,12 +1945,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogOwnerID = sog.OwnerID;
if(sogOwnerID == userID)
if(sogOwnerID.Equals(userID))
return true;
// else only group owned can be sold by members with powers
UUID sogGroupID = sog.GroupID;
if(sog.OwnerID != sogGroupID || sogGroupID == UUID.Zero)
if(sogGroupID.IsZero() || sog.OwnerID.NotEqual(sogGroupID))
return false;
return IsGroupMember(sogGroupID, userID, (ulong)GroupPowers.ObjectSetForSale);
@@ -1980,15 +1979,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
(sogEffectiveOwnerPerms & (uint)PermissionMask.Copy) == 0)
return false;
UUID userID = sp.UUID;
UUID sogOwnerID = sog.OwnerID;
if(sogOwnerID == userID)
if(sog.OwnerID.Equals(sp.UUID))
return true;
// else only group owned can be sold by members with powers
UUID sogGroupID = sog.GroupID;
if(sog.OwnerID != sogGroupID || sogGroupID == UUID.Zero)
if(sogGroupID.IsZero() || sog.OwnerID.NotEqual(sogGroupID))
return false;
ulong powers = 0;
@@ -2015,9 +2011,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
UUID sogOwnerID = sog.OwnerID;
UUID spID = sp.UUID;
if(sogOwnerID == spID)
if(sogOwnerID.Equals(sp.UUID))
return true;
if (sp.IsGod)
@@ -2030,12 +2025,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
UUID sogGroupID = sog.GroupID;
if (sogGroupID != UUID.Zero)
if (!sogGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, sp, ref powers))
{
if(sogGroupID == sogOwnerID)
if(sogGroupID.Equals(sogOwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
@@ -2128,7 +2123,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsAdministrator(userID))
return true;
if (objectID == UUID.Zero) // User inventory
if (objectID.IsZero()) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(userID, script);
@@ -2221,7 +2216,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsAdministrator(userID))
return true;
if (objectID == UUID.Zero) // User inventory
if (objectID.IsZero()) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(userID, notecard);
@@ -2326,7 +2321,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sog == null)
return false;
if(sog.OwnerID == userID || IsAdministrator(userID))
if(sog.OwnerID.Equals(userID) || IsAdministrator(userID))
return true;
if(sog.IsAttachment)
@@ -2334,7 +2329,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogGroupID = sog.GroupID;
if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
if(sogGroupID.IsZero() || sogGroupID.NotEqual(sog.OwnerID))
return false;
TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
@@ -2388,7 +2383,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
}
bool notSameOwner = srcsog.OwnerID != destsog.OwnerID;
bool notSameOwner = srcsog.OwnerID.NotEqual(destsog.OwnerID);
if(notSameOwner)
{
@@ -2432,13 +2427,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID destOwner = destsog.OwnerID;
UUID spID = sp.UUID;
bool spNotOwner = spID != destOwner;
bool spNotOwner = spID.NotEqual(destOwner);
// scripts can't be droped
if(spNotOwner && item.InvType == (int)InventoryType.LSL)
return false;
if(spNotOwner || item.Owner != destOwner)
if(spNotOwner || item.Owner.NotEqual(destOwner))
{
// no copy item will be moved if it has transfer
uint itperms = item.CurrentPermissions;

View File

@@ -236,8 +236,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
public virtual void PreloadSound(UUID objectID, UUID soundID)
{
SceneObjectPart part;
if (soundID == UUID.Zero
|| !m_scene.TryGetSceneObjectPart(objectID, out part))
if (soundID.IsZero() || !m_scene.TryGetSceneObjectPart(objectID, out part))
{
return;
}
@@ -295,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
bool triggered, byte flags, bool useMaster,
bool isMaster)
{
if (soundID == UUID.Zero)
if (soundID.IsZero())
return;
SceneObjectPart part;
@@ -327,7 +326,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
public void TriggerSoundLimited(UUID objectID, UUID sound,
double volume, Vector3 min, Vector3 max)
{
if (sound == UUID.Zero)
if (sound.IsZero())
return;
SceneObjectPart part;

View File

@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
// Swap empty terrain textureIDs with default IDs
for(int i = 0; i < textureIDs.Length; i++)
{
if(textureIDs[i] == UUID.Zero)
if(textureIDs[i].IsZero())
textureIDs[i] = DEFAULT_TERRAIN_DETAIL[i];
}

View File

@@ -687,7 +687,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
int color;
Color4 ctmp = Color4.White;
if (face.TextureID == UUID.Zero)
if (face.TextureID.IsZero())
return warp_Color.White;
if (!m_colors.TryGetValue(face.TextureID, out color))
@@ -788,7 +788,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
private warp_Texture GetTexture(UUID id, SceneObjectPart sop)
{
warp_Texture ret = null;
if (id == UUID.Zero)
if (id.IsZero())
return ret;
if (m_warpTextures.TryGetValue(id, out ret))
return ret;

View File

@@ -647,7 +647,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
ScenePresence av = null;
MapRequestState st = o as MapRequestState;
if (st == null || st.agentID == UUID.Zero)
if (st == null || st.agentID.IsZero())
return;
if (m_blacklistedregions.ContainsKey(st.regionhandle))
@@ -765,7 +765,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
UUID agentID = requestState.agentID;
if (agentID == UUID.Zero || !m_scene.TryGetScenePresence(agentID, out ScenePresence sp))
if (agentID.IsZero() || !m_scene.TryGetScenePresence(agentID, out ScenePresence sp))
{
m_cachedRegionMapItemsResponses.Remove(regionhandle);
Interlocked.Decrement(ref nAsyncRequests);
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
public void OnHTTPGetMapImage(IOSHttpRequest request, IOSHttpResponse response)
{
response.KeepAlive = false;
if (request.HttpMethod != "GET" || m_scene.RegionInfo.RegionSettings.TerrainImageID == UUID.Zero)
if (request.HttpMethod != "GET" || m_scene.RegionInfo.RegionSettings.TerrainImageID.IsZero())
{
response.StatusCode = (int)HttpStatusCode.NotFound;
return;
@@ -1367,7 +1367,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
foreach(GridRegion r in regions)
{
if(r.TerrainImage == UUID.Zero)
if(r.TerrainImage.IsZero())
continue;
if(doneLocal && r.RegionHandle == m_regionHandle)