mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
!= UUID.Zero is slow
This commit is contained in:
@@ -428,7 +428,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
else
|
||||
{
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
if (m_asset.FullID != UUID.Zero)
|
||||
if (!m_asset.FullID.IsZero())
|
||||
{
|
||||
item.AssetID = m_asset.FullID;
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
|
||||
@@ -665,7 +665,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
for (int i = 0; i< toRemove.Count; ++i)
|
||||
{
|
||||
SceneObjectGroup g = toRemove[i];
|
||||
if (g.FromItemID != UUID.Zero)
|
||||
if (!g.FromItemID.IsZero())
|
||||
DetachSingleAttachmentToInv(sp, g);
|
||||
}
|
||||
}
|
||||
@@ -809,7 +809,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
return;
|
||||
|
||||
bool changed = false;
|
||||
if (inventoryID != UUID.Zero)
|
||||
if (!inventoryID.IsZero())
|
||||
changed = sp.Appearance.DetachAttachment(inventoryID);
|
||||
if (changed && m_scene.AvatarFactory != null)
|
||||
m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID);
|
||||
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
return null;
|
||||
}
|
||||
|
||||
bool ItemIDNotZero = itemID != UUID.Zero;
|
||||
bool ItemIDNotZero = !itemID.IsZero();
|
||||
|
||||
if (ItemIDNotZero)
|
||||
objatt = m_invAccessModule.RezObject(sp.ControllingClient,
|
||||
@@ -1499,7 +1499,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
foreach (SceneObjectGroup group in attachments)
|
||||
{
|
||||
if (group.FromItemID == itemID && group.FromItemID != UUID.Zero)
|
||||
if (group.FromItemID.Equals(itemID) && !group.FromItemID.IsZero())
|
||||
{
|
||||
DetachSingleAttachmentToInv(sp, group);
|
||||
return;
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
wearableCache = WearableCacheItem.GetDefaultCacheItem();
|
||||
else
|
||||
{
|
||||
hadSkirt = (wearableCache[19].TextureID != UUID.Zero);
|
||||
hadSkirt = !wearableCache[19].TextureID.IsZero();
|
||||
}
|
||||
|
||||
HashSet<uint> updatedFaces = new HashSet<uint>();
|
||||
@@ -562,8 +562,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
continue;
|
||||
}
|
||||
|
||||
if (face.TextureID == wearableCache[idx].TextureID &&
|
||||
face.TextureID != UUID.Zero)
|
||||
if (face.TextureID.Equals(wearableCache[idx].TextureID) && !face.TextureID.IsZero())
|
||||
{
|
||||
if (cache.Check((wearableCache[idx].TextureID).ToString()))
|
||||
{
|
||||
@@ -628,7 +627,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
hits++;
|
||||
}
|
||||
else if(sp.Appearance.Texture.FaceTextures[idx] == null ||
|
||||
sp.Appearance.Texture.FaceTextures[idx].TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
sp.Appearance.Texture.FaceTextures[idx].TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
|
||||
hits++;
|
||||
wearableCache[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
|
||||
wearableCache[idx].CacheId = UUID.Zero;
|
||||
@@ -1058,7 +1057,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance)
|
||||
{
|
||||
UUID defaultwearable = GetDefaultItem(type);
|
||||
if (defaultwearable != UUID.Zero)
|
||||
if (!defaultwearable.IsZero())
|
||||
{
|
||||
UUID newInvItem = UUID.Random();
|
||||
InventoryItemBase itembase = new InventoryItemBase(newInvItem, userID)
|
||||
|
||||
@@ -563,7 +563,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
foreach (PresenceInfo friendSession in friendSessions)
|
||||
{
|
||||
// let's guard against sessions-gone-bad
|
||||
if (friendSession != null && friendSession.RegionID != UUID.Zero)
|
||||
if (friendSession != null && !friendSession.RegionID.IsZero())
|
||||
{
|
||||
//m_log.DebugFormat("[FRIENDS]: Get region {0}", friendSession.RegionID);
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
|
||||
@@ -506,7 +506,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
foreach (PresenceInfo p in presences)
|
||||
{
|
||||
if (p.RegionID != UUID.Zero)
|
||||
if (!p.RegionID.IsZero())
|
||||
{
|
||||
upd = p;
|
||||
break;
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
if (folder == null || folder.Owner != remoteClient.AgentId)
|
||||
return;
|
||||
|
||||
if (transactionID != UUID.Zero && assetType != (byte)AssetType.Settings)
|
||||
if (!transactionID.IsZero() && assetType != (byte)AssetType.Settings)
|
||||
{
|
||||
IAgentAssetTransactions agentTransactions = m_Scene.AgentTransactionsModule;
|
||||
if (agentTransactions != null)
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
m_userAccountService = s.UserAccountService;
|
||||
if(m_gridUserService == null)
|
||||
m_gridUserService = s.GridUserService;
|
||||
if (s.RegionInfo.ScopeID != UUID.Zero)
|
||||
if (!s.RegionInfo.ScopeID.IsZero())
|
||||
m_scopeID = s.RegionInfo.ScopeID;
|
||||
}
|
||||
|
||||
|
||||
@@ -538,7 +538,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||
|
||||
UUID oldID = UpdatePart(part, asset.FullID);
|
||||
|
||||
if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0))
|
||||
if (!oldID.IsZero() && ((Disp & DISP_EXPIRE) != 0))
|
||||
{
|
||||
if (oldAsset == null)
|
||||
oldAsset = scene.AssetService.Get(oldID.ToString());
|
||||
|
||||
@@ -754,7 +754,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
return collection;
|
||||
}
|
||||
|
||||
bool itemIDNotZero = itemID != UUID.Zero;
|
||||
bool itemIDNotZero = !itemID.IsZero();
|
||||
foreach (ListenerInfo li in listeners)
|
||||
{
|
||||
if (!li.IsActive())
|
||||
@@ -763,7 +763,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
if (itemIDNotZero && itemID != li.GetItemID())
|
||||
continue;
|
||||
|
||||
if (li.GetID() != UUID.Zero && id != li.GetID())
|
||||
if (!li.GetID().IsZero() && id.NotEqual(li.GetID()))
|
||||
continue;
|
||||
|
||||
if (li.GetName().Length > 0)
|
||||
|
||||
@@ -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