mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
!= UUID.Zero is slow
This commit is contained in:
@@ -712,7 +712,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
if (m_debug)
|
||||
m_log.DebugFormat("[ARCHIVER]: Placing object from OAR in scene at position {0}. ", pos.ToString());
|
||||
|
||||
bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero);
|
||||
bool isTelehub = (sceneObject.UUID.Equals(oldTelehubUUID)) && (!oldTelehubUUID.IsZero());
|
||||
|
||||
// For now, give all incoming scene objects new uuids. This will allow scenes to be cloned
|
||||
// on the same region server and multiple examples a single object archive to be imported
|
||||
@@ -752,7 +752,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
if (ignoredObjects > 0)
|
||||
m_log.WarnFormat("[ARCHIVER]: Ignored {0} possible out of bounds", ignoredObjects);
|
||||
|
||||
if (oldTelehubUUID != UUID.Zero)
|
||||
if (!oldTelehubUUID.IsZero())
|
||||
{
|
||||
m_log.WarnFormat("[ARCHIVER]: Telehub object not found: {0}", oldTelehubUUID);
|
||||
scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero;
|
||||
@@ -933,16 +933,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
if (parcel.IsGroupOwned)
|
||||
{
|
||||
if (parcel.GroupID != UUID.Zero)
|
||||
{
|
||||
// In group-owned parcels, OwnerID=GroupID. This should already be the case, but let's make sure.
|
||||
parcel.OwnerID = parcel.GroupID;
|
||||
}
|
||||
else
|
||||
if (parcel.GroupID.IsZero())
|
||||
{
|
||||
parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner;
|
||||
parcel.IsGroupOwned = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// In group-owned parcels, OwnerID=GroupID. This should already be the case, but let's make sure.
|
||||
parcel.OwnerID = parcel.GroupID;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
// propagate the change
|
||||
List<UUID> regions = Scene.GetEstateRegions(estateID);
|
||||
UUID regionId = (regions.Count() > 0) ? regions.ElementAt(0) : UUID.Zero;
|
||||
if (regionId != UUID.Zero)
|
||||
if (!regionId.IsZero())
|
||||
{
|
||||
OnEstateInfoChange?.Invoke(regionId);
|
||||
}
|
||||
@@ -320,7 +320,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
// propagate the change
|
||||
List<UUID> regions = Scene.GetEstateRegions(estateID);
|
||||
UUID regionId = (regions.Count() > 0) ? regions.ElementAt(0) : UUID.Zero;
|
||||
if (regionId != UUID.Zero)
|
||||
if (!regionId.IsZero())
|
||||
{
|
||||
OnEstateInfoChange?.Invoke(regionId);
|
||||
}
|
||||
|
||||
@@ -269,11 +269,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (m_landList.TryGetValue(local_id, out land))
|
||||
{
|
||||
m_landGlobalIDs.Remove(land.LandData.GlobalID);
|
||||
if (land.LandData.FakeID != UUID.Zero)
|
||||
if (!land.LandData.FakeID.IsZero())
|
||||
m_landFakeIDs.Remove(land.LandData.FakeID);
|
||||
land.LandData = newData;
|
||||
m_landGlobalIDs[newData.GlobalID] = local_id;
|
||||
if (newData.FakeID != UUID.Zero)
|
||||
if (!newData.FakeID.IsZero())
|
||||
m_landFakeIDs[newData.FakeID] = local_id;
|
||||
}
|
||||
}
|
||||
@@ -852,7 +852,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
}
|
||||
}
|
||||
|
||||
if(landGlobalID != UUID.Zero)
|
||||
if(!landGlobalID.IsZero())
|
||||
{
|
||||
m_scene.EventManager.TriggerLandObjectRemoved(landGlobalID);
|
||||
land.Clear();
|
||||
@@ -2338,13 +2338,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return;
|
||||
|
||||
bool validParcelOwner = false;
|
||||
if (DefaultGodParcelOwner != UUID.Zero && m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, DefaultGodParcelOwner) != null)
|
||||
if (!DefaultGodParcelOwner.IsZero() && m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, DefaultGodParcelOwner) != null)
|
||||
validParcelOwner = true;
|
||||
|
||||
bool validParcelGroup = false;
|
||||
if (m_groupManager != null)
|
||||
{
|
||||
if (DefaultGodParcelGroup != UUID.Zero && m_groupManager.GetGroupRecord(DefaultGodParcelGroup) != null)
|
||||
if (!DefaultGodParcelGroup.IsZero() && m_groupManager.GetGroupRecord(DefaultGodParcelGroup) != null)
|
||||
validParcelGroup = true;
|
||||
}
|
||||
|
||||
@@ -2583,7 +2583,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
// Gather some data
|
||||
ulong gpowers = remoteClient.GetGroupPowers(land.LandData.GroupID);
|
||||
SceneObjectGroup telehub = null;
|
||||
if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero)
|
||||
if (!m_scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
|
||||
// Does the telehub exist in the scene?
|
||||
telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
|
||||
|
||||
|
||||
@@ -715,7 +715,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public bool HasGroupAccess(UUID avatar)
|
||||
{
|
||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
if (!LandData.GroupID.IsZero() && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
{
|
||||
if (m_groupMemberCache.TryGetValue(avatar, out bool isMember))
|
||||
{
|
||||
@@ -1635,16 +1635,15 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (obj.LocalId > 0)
|
||||
{
|
||||
if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == LandData.OwnerID)
|
||||
if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID.Equals(LandData.OwnerID))
|
||||
{
|
||||
resultLocalIDs.Add(obj.LocalId);
|
||||
}
|
||||
else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == LandData.GroupID && LandData.GroupID != UUID.Zero)
|
||||
else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID.Equals(LandData.GroupID) && !LandData.GroupID.IsZero())
|
||||
{
|
||||
resultLocalIDs.Add(obj.LocalId);
|
||||
}
|
||||
else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER &&
|
||||
obj.OwnerID != remote_client.AgentId)
|
||||
else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER && obj.OwnerID.NotEqual(remote_client.AgentId))
|
||||
{
|
||||
resultLocalIDs.Add(obj.LocalId);
|
||||
}
|
||||
@@ -1818,7 +1817,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == (uint)ObjectReturnType.Group && LandData.GroupID != UUID.Zero)
|
||||
else if (type == (uint)ObjectReturnType.Group && !LandData.GroupID.IsZero())
|
||||
{
|
||||
foreach (SceneObjectGroup obj in primsOverMe)
|
||||
{
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
if (obj.OwnerID == landData.OwnerID)
|
||||
parcelCounts.Owner += partCount;
|
||||
else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
|
||||
else if (!landData.GroupID.IsZero() && obj.GroupID.Equals(landData.GroupID))
|
||||
parcelCounts.Group += partCount;
|
||||
else
|
||||
parcelCounts.Others += partCount;
|
||||
|
||||
@@ -2099,7 +2099,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
if(landdata.OwnerID == userID)
|
||||
return true;
|
||||
|
||||
if (landdata.IsGroupOwned && parcel.LandData.GroupID != UUID.Zero &&
|
||||
if (landdata.IsGroupOwned && !parcel.LandData.GroupID.IsZero() &&
|
||||
IsGroupMember(landdata.GroupID, userID, (ulong)GroupPowers.AllowEditLand))
|
||||
return true;
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||
|
||||
if (m_renderMeshes)
|
||||
{
|
||||
if (omvPrim.Sculpt != null && omvPrim.Sculpt.SculptTexture != UUID.Zero)
|
||||
if (omvPrim.Sculpt != null && !omvPrim.Sculpt.SculptTexture.IsZero())
|
||||
{
|
||||
// Try fetchinng the asset
|
||||
AssetBase sculptAsset = m_scene.AssetService.Get(omvPrim.Sculpt.SculptTexture.ToString());
|
||||
|
||||
@@ -1514,7 +1514,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
}
|
||||
|
||||
if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero)
|
||||
if (!m_scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
|
||||
{
|
||||
SceneObjectGroup sog = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
|
||||
if (sog != null)
|
||||
@@ -1572,7 +1572,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
// remove old assets
|
||||
UUID lastID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
|
||||
if (lastID != UUID.Zero)
|
||||
if (!lastID.IsZero())
|
||||
{
|
||||
m_scene.AssetService.Delete(lastID.ToString());
|
||||
m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Zero;
|
||||
@@ -1581,7 +1581,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
|
||||
lastID = m_scene.RegionInfo.RegionSettings.ParcelImageID;
|
||||
if (lastID != UUID.Zero)
|
||||
if (!lastID.IsZero())
|
||||
{
|
||||
m_scene.AssetService.Delete(lastID.ToString());
|
||||
m_scene.RegionInfo.RegionSettings.ParcelImageID = UUID.Zero;
|
||||
|
||||
Reference in New Issue
Block a user