== 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

@@ -1496,7 +1496,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return false;
}
if (uinfo.HomeRegionID == UUID.Zero)
if (uinfo.HomeRegionID.IsZero())
{
// can't find the Home region: Tell viewer and abort
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] no home set {0}", id);
@@ -1833,7 +1833,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.Name, neighbourRegion.RegionName, reason);
ReInstantiateScripts(agent);
if(agent.ParentID == 0 && agent.ParentUUID == UUID.Zero)
if(agent.ParentID == 0 && agent.ParentUUID.IsZero())
{
agent.AddToPhysicalScene(isFlying);
}

View File

@@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return base.HandleIncomingSceneObject(so, newPosition);
// Equally, we can't use so.AttachedAvatar here.
if (OwnerID == UUID.Zero || Scene.UserManagementModule.IsLocalGridUser(OwnerID))
if (OwnerID.IsZero() || Scene.UserManagementModule.IsLocalGridUser(OwnerID))
return base.HandleIncomingSceneObject(so, newPosition);
// foreign user

View File

@@ -319,7 +319,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);
if (item == null || item.AssetID == UUID.Zero)
if (item == null || item.AssetID.IsZero())
return null;
string userAssetServer;

View File

@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if(envModule == null)
return;
UUID assetID = envModule.GetDefaultAsset(subType);
if(assetID == UUID.Zero)
if(assetID.IsZero())
{
m_log.ErrorFormat(
"[INVENTORY ACCESS MODULE CreateNewInventoryItem]: failed to create default environment setting asset {0} for agent {1}", name, remoteClient.AgentId);
@@ -743,7 +743,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// action, userID);
}
if (userID == UUID.Zero) // Can't proceed
if (userID.IsZero()) // Can't proceed
{
return null;
}
@@ -797,7 +797,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
}
if (folderID == UUID.Zero && folder == null)
if (folderID.IsZero() && folder == null)
{
if (action == DeRezAction.Delete)
{
@@ -829,7 +829,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
// Override and put into where it came from, if it came
// from anywhere in inventory and the owner is taking it back.
if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
if (!so.FromFolderID.IsZero() && so.RootPart.OwnerID.Equals(remoteClient.AgentId))
{
folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID);
@@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
while(true)
{
parent = m_Scene.InventoryService.GetFolder(userID, parent.ParentID);
if (parent != null && (parent.ParentID == UUID.Zero || parent.ID == parent.ParentID))
if (parent != null && (parent.ParentID.IsZero() || parent.ID.Equals(parent.ParentID)))
break;
if (parent == null || parent.Type == (int)FolderType.Trash || parent.Type == (int)FolderType.LostAndFound)
{
@@ -923,7 +923,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
if(assetID == UUID.Zero)
if(assetID.IsZero())
return null;
AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
@@ -1042,7 +1042,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// remoteClient.Name);
// Vector3 storedPosition = group.AbsolutePosition;
if (group.UUID == UUID.Zero)
if (group.UUID.IsZero())
{
m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3");
}

View File

@@ -316,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
if (found.Contains(data.Id))
continue;
if (data.Id == UUID.Zero || data.IsUnknownUser)
if (data.Id.IsZero() || data.IsUnknownUser)
continue;
if (data.FirstName.ToLower().StartsWith(q) || data.LastName.ToLower().StartsWith(q))
users.Add(data);
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
var untried = new Dictionary<UUID, UserData>();
foreach (string id in ids)
{
if(!UUID.TryParse(id, out UUID uuid) || uuid == UUID.Zero)
if(!UUID.TryParse(id, out UUID uuid) || uuid.IsZero())
continue;
if (m_userCacheByID.TryGetValue(uuid, out UserData userdata))
@@ -551,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
var untried = new Dictionary<UUID, UserData>();
foreach (string id in ids)
{
if (!UUID.TryParse(id, out UUID uuid) || uuid == UUID.Zero)
if (!UUID.TryParse(id, out UUID uuid) || uuid.IsZero())
continue;
if (m_userCacheByID.TryGetValue(uuid, out UserData userdata))