mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
== UUID.Zero is slow
This commit is contained in:
@@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
ct.AddRow("Attachment Name", attachmentObject.Name);
|
||||
ct.AddRow("Local ID", attachmentObject.LocalId);
|
||||
ct.AddRow("Item ID", attachmentObject.UUID);
|
||||
if(attachmentObject.FromItemID == UUID.Zero)
|
||||
if(attachmentObject.FromItemID.IsZero())
|
||||
ct.AddRow("Temporary", "");
|
||||
else
|
||||
ct.AddRow("From Item ID", attachmentObject.FromItemID);
|
||||
@@ -697,7 +697,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
// Add the new attachment to inventory if we don't already have it.
|
||||
UUID newAttachmentItemID = group.FromItemID;
|
||||
if (newAttachmentItemID == UUID.Zero)
|
||||
if (newAttachmentItemID.IsZero())
|
||||
newAttachmentItemID = AddSceneObjectAsNewAttachmentInInv(sp, group).ID;
|
||||
|
||||
ShowAttachInUserInventory(sp, attachmentPt, newAttachmentItemID, group, append);
|
||||
@@ -794,7 +794,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
UUID inventoryID = so.FromItemID;
|
||||
|
||||
// As per Linden spec, drop is disabled for temp attachs
|
||||
if (inventoryID == UUID.Zero)
|
||||
if (inventoryID.IsZero())
|
||||
return;
|
||||
|
||||
if (DebugLevel > 0)
|
||||
@@ -872,7 +872,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
// If this didn't come from inventory, it also shouldn't go there
|
||||
// on detach. It's likely a temp attachment.
|
||||
if (so.FromItemID == UUID.Zero)
|
||||
if (so.FromItemID.IsZero())
|
||||
{
|
||||
PrepareScriptInstanceForSave(so, true);
|
||||
|
||||
@@ -970,7 +970,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
/// <param name="saveAllScripted"></param>
|
||||
private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp, string scriptedState)
|
||||
{
|
||||
if (grp.FromItemID == UUID.Zero)
|
||||
if (grp.FromItemID.IsZero())
|
||||
{
|
||||
// We can't save temp attachments
|
||||
grp.HasGroupChanged = false;
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
Primitive.TextureEntryFace bakedTextureFace = bakedTextures[bakeType];
|
||||
|
||||
if (bakedTextureFace == null || bakedTextureFace.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
if (bakedTextureFace == null || bakedTextureFace.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
|
||||
continue;
|
||||
|
||||
AssetBase asset;
|
||||
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
wearableCache[idx].TextureAsset = null; // just in case
|
||||
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
|
||||
|
||||
if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
if (face == null || face.TextureID.IsZero() || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
|
||||
{
|
||||
wearableCache[idx].CacheId = UUID.Zero;
|
||||
wearableCache[idx].TextureID = UUID.Zero;
|
||||
@@ -554,7 +554,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
int idx = AvatarAppearance.BAKE_INDICES[i];
|
||||
face = sp.Appearance.Texture.FaceTextures[idx];
|
||||
|
||||
if(face == null || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
if(face == null || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
|
||||
{
|
||||
wearableCache[idx].CacheId = UUID.Zero;
|
||||
wearableCache[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
|
||||
@@ -679,7 +679,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
if (face == null)
|
||||
continue;
|
||||
|
||||
if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
if (face.TextureID.IsZero() || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
|
||||
continue;
|
||||
|
||||
if (missingTexturesOnly)
|
||||
@@ -837,7 +837,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
for (int j = 0; j < appearance.Wearables[i].Count; j++)
|
||||
{
|
||||
if (appearance.Wearables[i][j].ItemID == UUID.Zero)
|
||||
if (appearance.Wearables[i][j].ItemID.IsZero())
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.",
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
if (checkParcelHide)
|
||||
{
|
||||
checkParcelHide = false;
|
||||
if (c.Type < ChatTypeEnum.DebugChannel && destination == UUID.Zero)
|
||||
if (c.Type < ChatTypeEnum.DebugChannel && destination.IsZero())
|
||||
{
|
||||
ILandObject srcland = scene.LandChannel.GetLandObject(hidePos.X, hidePos.Y);
|
||||
if (srcland != null && !srcland.LandData.SeeAVs)
|
||||
@@ -298,7 +298,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
scene.ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
if (destination != UUID.Zero && presence.UUID != destination)
|
||||
if (!destination.IsZero() && presence.UUID.NotEqual(destination))
|
||||
return;
|
||||
|
||||
if(presence.IsChildAgent)
|
||||
@@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
return;
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID,
|
||||
ownerID, fromNamePrefix + fromName, c.Type,
|
||||
message, sourceType, (destination != UUID.Zero)))
|
||||
message, sourceType, !destination.IsZero()))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
return;
|
||||
}
|
||||
@@ -317,14 +317,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
{
|
||||
if (checkParcelHide)
|
||||
{
|
||||
if (sourceParcelID != Presencecheck.LandData.GlobalID && !presence.IsViewerUIGod)
|
||||
if (sourceParcelID.NotEqual(Presencecheck.LandData.GlobalID) && !presence.IsViewerUIGod)
|
||||
return;
|
||||
}
|
||||
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID,
|
||||
ownerID, fromNamePrefix + fromName, c.Type,
|
||||
message, sourceType, (destination != UUID.Zero)))
|
||||
message, sourceType, !destination.IsZero()))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
}
|
||||
@@ -365,7 +365,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
ownerID = c.Sender.AgentId;
|
||||
sourceType = ChatSourceType.Agent;
|
||||
}
|
||||
else if (c.SenderUUID != UUID.Zero)
|
||||
else if (!c.SenderUUID.IsZero())
|
||||
{
|
||||
if(c.SenderObject == null)
|
||||
return;
|
||||
@@ -386,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID.NotEqual(client.AgentId)))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID,
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
if (inv == null)
|
||||
return UUID.Zero;
|
||||
|
||||
if (folderID == UUID.Zero)
|
||||
if (folderID.IsZero())
|
||||
{
|
||||
InventoryFolderBase folder = inv.GetFolderForType(userID,
|
||||
FolderType.CallingCard);
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
public void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
|
||||
{
|
||||
UUID toAgentID = new UUID(im.toAgentID);
|
||||
if (toAgentID == UUID.Zero)
|
||||
if (toAgentID.IsZero())
|
||||
return;
|
||||
|
||||
ScenePresence achildsp = null;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
|
||||
{
|
||||
UUID toAgentID = new UUID(im.toAgentID);
|
||||
if (toAgentID == UUID.Zero)
|
||||
if (toAgentID.IsZero())
|
||||
return;
|
||||
|
||||
ScenePresence achildsp = null;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
if (assetType == AssetType.Folder)
|
||||
{
|
||||
UUID folderID = new UUID(im.binaryBucket, 1);
|
||||
if (folderID == UUID.Zero)
|
||||
if (folderID.IsZero())
|
||||
{
|
||||
client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false);
|
||||
return;
|
||||
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
else
|
||||
{
|
||||
UUID itemID = new UUID(im.binaryBucket, 1);
|
||||
if (itemID == UUID.Zero)
|
||||
if (itemID.IsZero())
|
||||
{
|
||||
client.SendAgentAlertMessage("Can't find item to give. Nothing given.", false);
|
||||
return;
|
||||
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
case InstantMessageDialog.InventoryAccepted:
|
||||
{
|
||||
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
||||
if(inventoryID == UUID.Zero)
|
||||
if(inventoryID.IsZero())
|
||||
return;
|
||||
|
||||
IInventoryService invService = scene.InventoryService;
|
||||
@@ -300,7 +300,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
return;
|
||||
|
||||
UUID destinationFolderID = new UUID(im.binaryBucket, 0);
|
||||
if(destinationFolderID == UUID.Zero) // uuid-zero is a valid folder ID(?) keeping old code assuming not
|
||||
if(destinationFolderID.IsZero()) // uuid-zero is a valid folder ID(?) keeping old code assuming not
|
||||
return;
|
||||
|
||||
IInventoryService invService = scene.InventoryService;
|
||||
@@ -311,7 +311,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
return; // no where to put it
|
||||
|
||||
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
||||
if(inventoryID == UUID.Zero)
|
||||
if(inventoryID.IsZero())
|
||||
return;
|
||||
|
||||
InventoryItemBase item = invService.GetItem(agentID, inventoryID);
|
||||
@@ -356,7 +356,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
}
|
||||
|
||||
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
||||
if(inventoryID == UUID.Zero)
|
||||
if(inventoryID.IsZero())
|
||||
{
|
||||
client.SendAgentAlertMessage("Item or folder not found", false);
|
||||
return;
|
||||
|
||||
@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>();
|
||||
|
||||
UUID targetID;
|
||||
if(!UUID.TryParse(args[0], out targetID) || targetID == UUID.Zero)
|
||||
if(!UUID.TryParse(args[0], out targetID) || targetID.IsZero())
|
||||
return;
|
||||
|
||||
if (targetID == Constants.m_MrOpenSimID)
|
||||
@@ -667,7 +667,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
}
|
||||
ad = (UserClassifiedAdd) Ad;
|
||||
|
||||
if(ad.CreatorId == UUID.Zero)
|
||||
if(ad.CreatorId.IsZero())
|
||||
return;
|
||||
|
||||
if(foreign)
|
||||
@@ -1485,14 +1485,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
|
||||
public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
|
||||
{
|
||||
if (avatarID == UUID.Zero)
|
||||
if (avatarID.IsZero())
|
||||
{
|
||||
// Looking for a reason that some viewers are sending null Id's
|
||||
m_log.Debug("[PROFILES]: got request of null ID");
|
||||
return;
|
||||
}
|
||||
|
||||
if (avatarID == Constants.m_MrOpenSimID)
|
||||
if (avatarID.Equals(Constants.m_MrOpenSimID))
|
||||
{
|
||||
remoteClient.SendAvatarProperties(avatarID, "Creator of OpenSimulator shared assets library", Constants.m_MrOpenSimBorn.ToString(),
|
||||
Utils.StringToBytes("System agent"), "MrOpenSim has no life", 0x10,
|
||||
@@ -1884,7 +1884,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
|
||||
void cacheForeignImage(UUID agent, UUID imageID)
|
||||
{
|
||||
if(imageID == null || imageID == UUID.Zero)
|
||||
if(imageID.IsZero())
|
||||
return;
|
||||
|
||||
string assetServerURI = UserManagementModule.GetUserServerURL(agent, "AssetServerURI");
|
||||
|
||||
Reference in New Issue
Block a user