!= UUID.Zero is slow

This commit is contained in:
UbitUmarov
2022-01-09 02:28:51 +00:00
parent 7e0fc95c3a
commit da928d6099
78 changed files with 254 additions and 263 deletions

View File

@@ -215,7 +215,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
{
Hashtable hash = new Hashtable();
hash["region_uuid"] = regionID.ToString();
if (agentID != UUID.Zero)
if (!agentID.IsZero())
{
hash["agent_id"] = agentID.ToString();
if (agentHomeURI != null)

View File

@@ -211,7 +211,7 @@ namespace OpenSim.Services.Connectors
UUID uuid = UUID.Zero;
foreach(string id in IDs)
{
if(UUID.TryParse(id, out uuid) && uuid != UUID.Zero)
if(UUID.TryParse(id, out uuid) && !uuid.IsZero())
accs.Add(GetUserAccount(scopeID,uuid));
}

View File

@@ -260,7 +260,7 @@ namespace OpenSim.Services.HypergridService
{
PresenceInfo friendSession = null;
foreach (PresenceInfo pinfo in friendSessions)
if (pinfo.RegionID != UUID.Zero) // let's guard against traveling agents
if (!pinfo.RegionID.IsZero()) // let's guard against traveling agents
{
friendSession = pinfo;
break;

View File

@@ -211,7 +211,7 @@ namespace OpenSim.Services.HypergridService
GridUserInfo uinfo = m_GridUserService.GetGridUserInfo(userID.ToString());
if (uinfo != null)
{
if (uinfo.HomeRegionID != UUID.Zero)
if (!uinfo.HomeRegionID.IsZero())
{
home = m_GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
position = uinfo.HomePosition;
@@ -459,7 +459,7 @@ namespace OpenSim.Services.HypergridService
{
PresenceInfo friendSession = null;
foreach (PresenceInfo pinfo in friendSessions)
if (pinfo.RegionID != UUID.Zero) // let's guard against traveling agents
if (!pinfo.RegionID.IsZero()) // let's guard against traveling agents
{
friendSession = pinfo;
break;

View File

@@ -180,7 +180,7 @@ namespace OpenSim.Services.Interfaces
Dictionary<int, List<string>> atts = new Dictionary<int, List<string>>();
foreach (AvatarAttachment attach in attachments)
{
if (attach.ItemID != UUID.Zero)
if (!attach.ItemID.IsZero())
{
if (!atts.ContainsKey(attach.AttachPoint))
atts[attach.AttachPoint] = new List<string>();

View File

@@ -441,7 +441,7 @@ namespace OpenSim.Services.Interfaces
if ((object)region == null)
return false;
// Return true if the non-zero UUIDs are equal:
return (RegionID != UUID.Zero) && RegionID.Equals(region.RegionID);
return (!RegionID.IsZero()) && RegionID.Equals(region.RegionID);
}
public override bool Equals(Object obj)

View File

@@ -768,7 +768,7 @@ namespace OpenSim.Services.InventoryService
UUID parentFolder = folder[0].parentFolderID;
while (parentFolder != UUID.Zero)
while (!parentFolder.IsZero())
{
XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
if (parent.Length < 1)
@@ -795,7 +795,7 @@ namespace OpenSim.Services.InventoryService
UUID parentFolder = folder[0].parentFolderID;
while (parentFolder != UUID.Zero)
while (!parentFolder.IsZero())
{
XInventoryFolder[] parent = m_Database.GetFolders(new string[] { "folderID" }, new string[] { parentFolder.ToString() });
if (parent.Length < 1)

View File

@@ -375,19 +375,19 @@ namespace OpenSim.Services.LLLoginService
// If a scope id is requested, check that the account is in
// that scope, or unscoped.
//
if (scopeID != UUID.Zero)
if (scopeID.IsZero())
{
if (account.ScopeID != scopeID && account.ScopeID != UUID.Zero)
scopeID = account.ScopeID;
}
else
{
if (account.ScopeID.NotEqual(scopeID) && !account.ScopeID.IsZero())
{
m_log.InfoFormat(
"[LLOGIN SERVICE]: Login failed, reason: user {0} {1} not found", firstName, lastName);
return LLFailedLoginResponse.UserProblem;
}
}
else
{
scopeID = account.ScopeID;
}
//
// Authenticate this user
@@ -411,7 +411,7 @@ namespace OpenSim.Services.LLLoginService
if(!m_allowDuplicatePresences)
{
if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero)
if(guinfo != null && guinfo.Online && !guinfo.LastRegionID.IsZero())
{
if(SendAgentGodKillToRegion(scopeID, account.PrincipalID, guinfo))
{

View File

@@ -156,7 +156,7 @@ namespace OpenSim.Services.UserAccountService
UserAccountData[] d;
if (scopeID != UUID.Zero)
if (!scopeID.IsZero())
{
d = m_Database.Get(
new string[] { "ScopeID", "FirstName", "LastName" },
@@ -234,7 +234,7 @@ namespace OpenSim.Services.UserAccountService
{
UserAccountData[] d;
if (scopeID != UUID.Zero)
if (!scopeID.IsZero())
{
d = m_Database.Get(
new string[] { "ScopeID", "Email" },
@@ -263,7 +263,7 @@ namespace OpenSim.Services.UserAccountService
{
UserAccountData[] d;
if (scopeID != UUID.Zero)
if (!scopeID.IsZero())
{
d = m_Database.Get(
new string[] { "ScopeID", "PrincipalID" },
@@ -903,7 +903,7 @@ namespace OpenSim.Services.UserAccountService
for(int j = 0; j < basewearable.Count; j++)
{
wearable = basewearable[j];
if (wearable.ItemID != UUID.Zero)
if (!wearable.ItemID.IsZero())
{
m_log.DebugFormat("[XXX]: Getting item {0} from avie {1} for {2} {3}",
wearable.ItemID, source, i, j);
@@ -970,7 +970,7 @@ namespace OpenSim.Services.UserAccountService
int attachpoint = attachment.AttachPoint;
UUID itemID = attachment.ItemID;
if (itemID != UUID.Zero)
if (!itemID.IsZero())
{
// Get inventory item and copy it
InventoryItemBase item = m_InventoryService.GetItem(source, itemID);