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

@@ -487,7 +487,7 @@ namespace OpenSim.Groups
{
return gmd.AgentID == sp.UUID;
});
if (m.AgentID == UUID.Zero)
if (m.AgentID.IsZero())
{
if (m_debugEnabled)
m_log.DebugFormat("[Groups.Messaging]: skipping agent {0} because he is not a member of the group", sp.UUID);

View File

@@ -249,8 +249,8 @@ namespace OpenSim.Groups
// There might be some problem with the thread we're generating this on but not
// doing the update at this time causes problems (Mantis #7920 and #7915)
// TODO: move sending this update to a later time in the rootification of the client.
if(!sp.m_haveGroupInformation)
SendAgentGroupDataUpdate(sp.ControllingClient, false);
//if(!sp.m_haveGroupInformation)
// SendAgentGroupDataUpdate(sp.ControllingClient, false);
}
private void OnMakeChild(ScenePresence sp)
@@ -347,7 +347,7 @@ namespace OpenSim.Groups
if (m_debugEnabled)
m_log.DebugFormat("[Groups]: OnInstantMessage called");
if(remoteClient == null || !remoteClient.IsActive || remoteClient.AgentId == UUID.Zero)
if(remoteClient == null || !remoteClient.IsActive || remoteClient.AgentId.IsZero())
return;
Scene scene = (Scene)remoteClient.Scene;
@@ -526,7 +526,7 @@ namespace OpenSim.Groups
if (m_debugEnabled)
m_log.DebugFormat("[xmlGROUPS]: Accepted notice {0} for {1}", noticeID, remoteClient.AgentId);
if (noticeID == UUID.Zero)
if (noticeID.IsZero())
return;
UUID folderID = UUID.Zero;
@@ -580,7 +580,7 @@ namespace OpenSim.Groups
if (m_debugEnabled)
m_log.DebugFormat("[GROUPS]: Accepted notice {0} for {1}", noticeID, remoteAgentIDstr);
if (noticeID == UUID.Zero)
if (noticeID.IsZero())
return;
UUID remoteAgentID = remoteClient.AgentId;
@@ -598,7 +598,7 @@ namespace OpenSim.Groups
UUID attachmentUUID = notice.noticeData.AttachmentItemID;
if (attachmentUUID == null ||
attachmentUUID == UUID.Zero ||
attachmentUUID.IsZero() ||
giver == null ||
giver == UUID.Zero.ToString()
)

View File

@@ -95,11 +95,11 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName, string token)
{
if (GroupID == UUID.Zero && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
if (GroupID.IsZero() && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
return null;
Dictionary<string, object> sendData = new Dictionary<string, object>();
if (GroupID != UUID.Zero)
if (!GroupID.IsZero())
sendData["GroupID"] = GroupID.ToString();
if (!string.IsNullOrEmpty(GroupName))
sendData["Name"] = GroupsDataUtils.Sanitize(GroupName);

View File

@@ -605,7 +605,7 @@ namespace OpenSim.Groups
private string AgentUUI(string AgentIDStr)
{
UUID AgentID = UUID.Zero;
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID == UUID.Zero)
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID.IsZero())
return UUID.Zero.ToString();
if (m_UserManagement.IsLocalGridUser(AgentID))
@@ -630,8 +630,8 @@ namespace OpenSim.Groups
private string AgentUUIForOutside(string AgentIDStr)
{
UUID AgentID = UUID.Zero;
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID == UUID.Zero)
return UUID.Zero.ToString();
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID.IsZero())
return UUID.ZeroString;
AgentCircuitData agent = null;
foreach (Scene scene in m_Scenes)

View File

@@ -134,11 +134,11 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName)
{
if (GroupID == UUID.Zero && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
if (GroupID.IsZero() && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
return null;
Dictionary<string, object> sendData = new Dictionary<string, object>();
if (GroupID != UUID.Zero)
if (!GroupID.IsZero())
sendData["GroupID"] = GroupID.ToString();
if (!string.IsNullOrEmpty(GroupName))
sendData["Name"] = GroupsDataUtils.Sanitize(GroupName);

View File

@@ -183,7 +183,7 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName)
{
if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty))
if (GroupID.IsZero() && (GroupName == null || GroupName != null && GroupName == string.Empty))
return null;
return m_CacheWrapper.GetGroupRecord(RequestingAgentID,GroupID,GroupName, delegate

View File

@@ -314,7 +314,7 @@ namespace OpenSim.Groups
if (!all)
{
ExtendedGroupMembershipData membership = null;
if (groupID == UUID.Zero)
if (groupID.IsZero())
{
membership = m_GroupsService.GetAgentActiveMembership(requestingAgentID, agentID);
}

View File

@@ -109,7 +109,7 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName, GroupRecordDelegate d)
{
//if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty))
//if (GroupID.IsZero() && (GroupName == null || GroupName != null && GroupName == string.Empty))
// return null;
object group = null;

View File

@@ -383,7 +383,7 @@ namespace OpenSim.Groups
}
// Can't delete Everyone and Owners roles
if (roleID == UUID.Zero)
if (roleID.IsZero())
{
m_log.DebugFormat("[Groups]: Attempt at deleting Everyone role from group {0} denied", groupID);
return;
@@ -527,7 +527,7 @@ namespace OpenSim.Groups
public bool RemoveAgentFromGroupRole(string RequestingAgentID, string AgentID, UUID GroupID, UUID RoleID)
{
// Don't remove from Everyone role!
if (RoleID == UUID.Zero)
if (RoleID.IsZero())
return false;
// check permissions

View File

@@ -161,7 +161,7 @@ namespace OpenSim.Groups
return null;
ExtendedGroupRecord grec;
if (GroupID == UUID.Zero)
if (GroupID.IsZero())
grec = GetGroupRecord(RequestingAgentID, groupName);
else
grec = GetGroupRecord(RequestingAgentID, GroupID);