mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
!= UUID.Zero is slow
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user