mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
!= UUID.Zero is slow
This commit is contained in:
@@ -527,7 +527,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
return;
|
||||
}
|
||||
|
||||
if(itemID != UUID.Zero && ownerID != UUID.Zero)
|
||||
if(!itemID.IsZero() && !ownerID.IsZero())
|
||||
{
|
||||
item = scene.InventoryService.GetItem(ownerID, itemID);
|
||||
if (item != null)
|
||||
|
||||
@@ -348,7 +348,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName)
|
||||
{
|
||||
Hashtable param = new Hashtable();
|
||||
if (GroupID != UUID.Zero)
|
||||
if (!GroupID.IsZero())
|
||||
{
|
||||
param["GroupID"] = GroupID.ToString();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,6 @@ namespace OpenSim.Region.DataSnapshot
|
||||
|
||||
public void OnGetSnapshot(IOSHttpRequest req, IOSHttpResponse resp)
|
||||
{
|
||||
Hashtable reply = new Hashtable();
|
||||
string reqtag;
|
||||
if(req.QueryAsDictionary.TryGetValue("region", out string snapObj) && !string.IsNullOrWhiteSpace(snapObj))
|
||||
reqtag = snapObj + req.RemoteIPEndPoint.Address.ToString();
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||
//TODO: figure how to figure out teleport system landData.landingType
|
||||
|
||||
//land texture snapshot uuid
|
||||
if (parcel.SnapshotID != UUID.Zero)
|
||||
if (!parcel.SnapshotID.IsZero())
|
||||
{
|
||||
XmlNode textureuuid = nodeFactory.CreateNode(XmlNodeType.Element, "image", "");
|
||||
textureuuid.InnerText = parcel.SnapshotID.ToString();
|
||||
@@ -232,7 +232,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||
string groupName = String.Empty;
|
||||
|
||||
//attached user and group
|
||||
if (parcel.GroupID != UUID.Zero)
|
||||
if (!parcel.GroupID.IsZero())
|
||||
{
|
||||
XmlNode groupblock = nodeFactory.CreateNode(XmlNodeType.Element, "group", "");
|
||||
XmlNode groupuuid = nodeFactory.CreateNode(XmlNodeType.Element, "groupuuid", "");
|
||||
|
||||
@@ -219,9 +219,9 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||
if (textures != null)
|
||||
{
|
||||
if (textures.DefaultTexture != null &&
|
||||
textures.DefaultTexture.TextureID != UUID.Zero &&
|
||||
textures.DefaultTexture.TextureID != m_DefaultImage &&
|
||||
textures.DefaultTexture.TextureID != m_BlankImage &&
|
||||
!textures.DefaultTexture.TextureID.IsZero() &&
|
||||
textures.DefaultTexture.TextureID.NotEqual(m_DefaultImage) &&
|
||||
textures.DefaultTexture.TextureID.NotEqual(m_BlankImage) &&
|
||||
textures.DefaultTexture.RGBA.A < 50f)
|
||||
{
|
||||
counts[textures.DefaultTexture.TextureID] = 8;
|
||||
|
||||
@@ -478,7 +478,7 @@ namespace OpenSim.Region.UserStatistics
|
||||
|
||||
lock (m_sessions)
|
||||
{
|
||||
if (agentID != UUID.Zero)
|
||||
if (!agentID.IsZero())
|
||||
{
|
||||
if (!m_sessions.ContainsKey(agentID))
|
||||
{
|
||||
|
||||
@@ -458,7 +458,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
||||
if (client != null)
|
||||
{
|
||||
|
||||
if (soundId != UUID.Zero)
|
||||
if (!soundId.IsZero())
|
||||
client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0);
|
||||
|
||||
client.SendBlueBoxMessage(UUID.Zero, "", text);
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
|
||||
try
|
||||
{
|
||||
if (agentID == UUID.Zero)
|
||||
if (agentID.IsZero())
|
||||
npcAvatar = new NPCAvatar(firstname, lastname, position,
|
||||
owner, senseAsAgent, scene);
|
||||
else
|
||||
@@ -477,8 +477,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
/// <returns>true if they do, false if they don't.</returns>
|
||||
private bool CheckPermissions(NPCAvatar av, UUID callerID)
|
||||
{
|
||||
return callerID == UUID.Zero || av.OwnerID == UUID.Zero ||
|
||||
av.OwnerID == callerID || av.AgentId == callerID;
|
||||
return callerID.IsZero() || av.OwnerID.IsZero() ||
|
||||
av.OwnerID.Equals(callerID) || av.AgentId.Equals(callerID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user