mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
== UUID.Zero is slow
This commit is contained in:
@@ -182,7 +182,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
{
|
||||
lock (m_animations)
|
||||
{
|
||||
int j = m_defaultAnimation.AnimID == UUID.Zero ? 0 : 1;
|
||||
int j = m_defaultAnimation.AnimID.IsZero() ? 0 : 1;
|
||||
|
||||
int defaultSize = m_animations.Count + j;
|
||||
animIDs = new UUID[defaultSize];
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private Dictionary<string, UUID> m_overrides = new Dictionary<string, UUID>();
|
||||
public void SetOverride(string state, UUID animID)
|
||||
{
|
||||
if (animID == UUID.Zero)
|
||||
if (animID.IsZero())
|
||||
{
|
||||
if (state == "ALL")
|
||||
m_overrides.Clear();
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
return;
|
||||
|
||||
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
|
||||
if (animID == UUID.Zero)
|
||||
if (animID.IsZero())
|
||||
return;
|
||||
|
||||
// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", animID, name, m_scenePresence.Name);
|
||||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
return;
|
||||
|
||||
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
|
||||
if (animID == UUID.Zero)
|
||||
if (animID.IsZero())
|
||||
return;
|
||||
|
||||
RemoveAnimation(animID, true);
|
||||
@@ -213,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
if (anim == "SITGROUND")
|
||||
{
|
||||
UUID defsit = DefaultAvatarAnimations.AnimsUUIDbyName["SIT_GROUND_CONSTRAINED"];
|
||||
if (defsit == UUID.Zero)
|
||||
if (defsit.IsZero())
|
||||
return false;
|
||||
m_animations.SetDefaultAnimation(defsit, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
|
||||
aoSitGndAnim = overridenAnim;
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
if (objectID == UUID.Zero)
|
||||
if (objectID.IsZero())
|
||||
{
|
||||
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
@@ -845,7 +845,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
itemCopy.BasePermissions = item.BasePermissions;
|
||||
}
|
||||
|
||||
if (itemCopy.Folder == UUID.Zero)
|
||||
if (itemCopy.Folder.IsZero())
|
||||
{
|
||||
InventoryFolderBase folder = null;
|
||||
if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType))
|
||||
@@ -936,7 +936,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return null;
|
||||
}
|
||||
|
||||
if (recipientParentFolderId == UUID.Zero)
|
||||
if (recipientParentFolderId.IsZero())
|
||||
{
|
||||
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
|
||||
if (recipientRootFolder != null)
|
||||
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return null;
|
||||
}
|
||||
|
||||
if (recipientParentFolderId == UUID.Zero)
|
||||
if (recipientParentFolderId.IsZero())
|
||||
{
|
||||
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
|
||||
if (recipientRootFolder != null)
|
||||
@@ -1538,7 +1538,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SceneObjectPart part = GetSceneObjectPart(primLocalId);
|
||||
|
||||
// Can't move a null item
|
||||
if (itemId == UUID.Zero)
|
||||
if (itemId.IsZero())
|
||||
return;
|
||||
|
||||
if (null == part)
|
||||
@@ -1829,7 +1829,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
uint primLocalID)
|
||||
{
|
||||
UUID itemID = itemInfo.ItemID;
|
||||
if (itemID == UUID.Zero)
|
||||
if (itemID.IsZero())
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: UpdateTaskInventory called with item ID Zero on update for {1}!",
|
||||
@@ -1923,7 +1923,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (remoteClient.AgentId != part.OwnerID) // Not owner
|
||||
{
|
||||
noChange = true;
|
||||
if(itemInfo.OwnerID == UUID.Zero && itemInfo.GroupID != UUID.Zero)
|
||||
if(itemInfo.OwnerID.IsZero() && !itemInfo.GroupID.IsZero())
|
||||
{
|
||||
if(remoteClient.IsGroupMember(itemInfo.GroupID))
|
||||
{
|
||||
@@ -2195,7 +2195,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (srcPart.OwnerID != destPart.OwnerID)
|
||||
{
|
||||
// Group permissions
|
||||
if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) ||
|
||||
if ((destPart.GroupID.IsZero()) || (destPart.GroupID.NotEqual(srcPart.GroupID)) ||
|
||||
((destPart.GroupMask & (uint)PermissionMask.Modify) == 0))
|
||||
return;
|
||||
if((srcPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
|
||||
@@ -2643,7 +2643,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}",
|
||||
// remoteClient.Name, itemID, fromTaskID);
|
||||
|
||||
if (fromTaskID == UUID.Zero)
|
||||
if (fromTaskID.IsZero())
|
||||
{
|
||||
// rez from user inventory
|
||||
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
|
||||
|
||||
@@ -548,7 +548,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// "[USER INVENTORY]: HandleFetchInventoryDescendents() for {0}, folder={1}, fetchFolders={2}, fetchItems={3}, sortOrder={4}",
|
||||
// remoteClient.Name, folderID, fetchFolders, fetchItems, sortOrder);
|
||||
|
||||
if (folderID == UUID.Zero)
|
||||
if (folderID.IsZero())
|
||||
return;
|
||||
|
||||
// FIXME MAYBE: We're not handling sortOrder!
|
||||
|
||||
@@ -1040,7 +1040,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
DeedObjectHandler handler = OnDeedObject;
|
||||
if (handler != null)
|
||||
{
|
||||
if(sog == null || client == null || client.SceneAgent == null || targetGroupID == UUID.Zero)
|
||||
if(sog == null || client == null || client.SceneAgent == null || targetGroupID.IsZero())
|
||||
return false;
|
||||
|
||||
ScenePresence sp = client.SceneAgent as ScenePresence;
|
||||
|
||||
@@ -882,25 +882,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_extraSettings = simDataService.GetExtra(RegionInfo.RegionID);
|
||||
|
||||
bool updatedTerrainTextures = false;
|
||||
if (rs.TerrainTexture1 == UUID.Zero)
|
||||
if (rs.TerrainTexture1.IsZero())
|
||||
{
|
||||
rs.TerrainTexture1 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_1;
|
||||
updatedTerrainTextures = true;
|
||||
}
|
||||
|
||||
if (rs.TerrainTexture2 == UUID.Zero)
|
||||
if (rs.TerrainTexture2.IsZero())
|
||||
{
|
||||
rs.TerrainTexture2 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_2;
|
||||
updatedTerrainTextures = true;
|
||||
}
|
||||
|
||||
if (rs.TerrainTexture3 == UUID.Zero)
|
||||
if (rs.TerrainTexture3.IsZero())
|
||||
{
|
||||
rs.TerrainTexture3 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_3;
|
||||
updatedTerrainTextures = true;
|
||||
}
|
||||
|
||||
if (rs.TerrainTexture4 == UUID.Zero)
|
||||
if (rs.TerrainTexture4.IsZero())
|
||||
{
|
||||
rs.TerrainTexture4 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_4;
|
||||
updatedTerrainTextures = true;
|
||||
@@ -2466,7 +2466,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (physresults != null && physresults.Count > 0)
|
||||
{
|
||||
// look for terrain ?
|
||||
if(RayTargetID == UUID.Zero)
|
||||
if(RayTargetID.IsZero())
|
||||
{
|
||||
foreach (ContactResult r in physresults)
|
||||
{
|
||||
@@ -3037,7 +3037,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
|
||||
public bool AddSceneObject(SceneObjectGroup sceneObject)
|
||||
{
|
||||
if (sceneObject.OwnerID == UUID.Zero)
|
||||
if (sceneObject.OwnerID.IsZero())
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero", sceneObject.UUID);
|
||||
return false;
|
||||
@@ -3101,7 +3101,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
|
||||
// RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
|
||||
}
|
||||
if (sceneObject.OwnerID == UUID.Zero)
|
||||
if (sceneObject.OwnerID.IsZero())
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero after attachment processing. BUG!", sceneObject.UUID);
|
||||
return false;
|
||||
@@ -3109,7 +3109,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sceneObject.OwnerID == UUID.Zero)
|
||||
if (sceneObject.OwnerID.IsZero())
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Owner ID for non-attachment {0} was zero", sceneObject.UUID);
|
||||
return false;
|
||||
|
||||
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat("[SCENEGRAPH]: Tried to add null scene object");
|
||||
return false;
|
||||
}
|
||||
if (sceneObject.UUID == UUID.Zero)
|
||||
if (sceneObject.UUID.IsZero())
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
|
||||
|
||||
@@ -2419,7 +2419,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsDeleted || inTransit || UUID == UUID.Zero)
|
||||
if (IsDeleted || inTransit || UUID.IsZero())
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
|
||||
@@ -2445,8 +2445,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
parcel.LandData.OtherCleanTime != 0)
|
||||
{
|
||||
if (parcel.LandData.OwnerID != OwnerID &&
|
||||
(parcel.LandData.GroupID != GroupID ||
|
||||
parcel.LandData.GroupID == UUID.Zero))
|
||||
(parcel.LandData.GroupID.NotEqual(GroupID) ||
|
||||
parcel.LandData.GroupID.IsZero()))
|
||||
{
|
||||
if ((DateTime.UtcNow - RootPart.Rezzed).TotalMinutes >
|
||||
parcel.LandData.OtherCleanTime)
|
||||
|
||||
@@ -1511,7 +1511,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (value == invalidCollisionSoundUUID)
|
||||
m_collisionSoundType = -1;
|
||||
else if (value == UUID.Zero)
|
||||
else if (value.IsZero())
|
||||
m_collisionSoundType = 0;
|
||||
else
|
||||
m_collisionSoundType = 1;
|
||||
@@ -3032,7 +3032,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// The Collision sounds code calls this
|
||||
public void SendCollisionSound(UUID soundID, double volume, Vector3 position)
|
||||
{
|
||||
if (soundID == UUID.Zero)
|
||||
if (soundID.IsZero())
|
||||
return;
|
||||
|
||||
ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>();
|
||||
@@ -5626,7 +5626,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
lock (ParentGroup.m_sittingAvatars)
|
||||
{
|
||||
if (IsSitTargetSet && SitTargetAvatar == UUID.Zero)
|
||||
if (IsSitTargetSet && SitTargetAvatar.IsZero())
|
||||
SitTargetAvatar = sp.UUID;
|
||||
|
||||
if (m_sittingAvatars == null)
|
||||
@@ -5762,7 +5762,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool AddAnimation(UUID animId, string animName)
|
||||
{
|
||||
if (animId == UUID.Zero || string.IsNullOrEmpty(animName) ||
|
||||
if (animId.IsZero() || string.IsNullOrEmpty(animName) ||
|
||||
ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
|
||||
return false;
|
||||
|
||||
@@ -5785,7 +5785,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool RemoveAnimation(UUID animId)
|
||||
{
|
||||
if (animId == UUID.Zero || ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
|
||||
if (animId.IsZero() || ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
|
||||
return false;
|
||||
|
||||
lock (animsLock)
|
||||
@@ -5944,7 +5944,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
while(--count >= 0)
|
||||
{
|
||||
UUID id = new UUID(data, pos);
|
||||
if(id == UUID.Zero)
|
||||
if(id.IsZero())
|
||||
break;
|
||||
pos += 16;
|
||||
int strlen = data[pos++];
|
||||
|
||||
@@ -1238,10 +1238,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (item.GroupPermissions != (uint)PermissionMask.None)
|
||||
item.GroupID = m_part.GroupID;
|
||||
|
||||
if(item.OwnerID == UUID.Zero) // viewer to internal enconding of group owned
|
||||
if(item.OwnerID.IsZero()) // viewer to internal enconding of group owned
|
||||
item.OwnerID = item.GroupID;
|
||||
|
||||
if (item.AssetID == UUID.Zero)
|
||||
if (item.AssetID.IsZero())
|
||||
item.AssetID = m_items[item.ItemID].AssetID;
|
||||
|
||||
m_items[item.ItemID] = item;
|
||||
|
||||
@@ -4638,7 +4638,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
AgentPosition agentpos = new AgentPosition()
|
||||
{
|
||||
AgentID = new UUID(UUID.Guid),
|
||||
AgentID = UUID,
|
||||
SessionID = ControllingClient.SessionId,
|
||||
Size = Appearance.AvatarSize,
|
||||
Center = CameraPosition,
|
||||
|
||||
Reference in New Issue
Block a user