From 357f20eb14018de2f171120a2812c8b60a8cc187 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 8 Jan 2022 23:35:56 +0000 Subject: [PATCH] == UUID.Zero is slow --- .../Addons/Groups/GroupsMessagingModule.cs | 2 +- OpenSim/Addons/Groups/GroupsModule.cs | 12 +- .../Hypergrid/GroupsServiceHGConnector.cs | 4 +- .../GroupsServiceHGConnectorModule.cs | 6 +- .../Remote/GroupsServiceRemoteConnector.cs | 4 +- .../GroupsServiceRemoteConnectorModule.cs | 2 +- .../Remote/GroupsServiceRobustConnector.cs | 2 +- .../Groups/RemoteConnectorCacheWrapper.cs | 2 +- .../Addons/Groups/Service/GroupsService.cs | 4 +- .../Addons/Groups/Service/HGGroupsService.cs | 2 +- .../LoadRegions/EstateLoaderFileSystem.cs | 2 +- .../LoadRegions/LoadRegionsPlugin.cs | 2 +- .../FetchInventory/FetchInvDescHandler.cs | 4 +- .../FetchInventory/FetchInventory2Handler.cs | 2 +- OpenSim/Data/MySQL/MySQLInventoryData.cs | 2 +- OpenSim/Data/MySQL/MySQLPresenceData.cs | 2 +- OpenSim/Data/MySQL/MySQLSimulationData.cs | 2 +- OpenSim/Data/PGSQL/PGSQLInventoryData.cs | 6 +- OpenSim/Data/PGSQL/PGSQLPresenceData.cs | 2 +- OpenSim/Framework/AnimationSet.cs | 2 +- OpenSim/Framework/AvatarAppearance.cs | 7 +- OpenSim/Framework/AvatarWearable.cs | 2 +- OpenSim/Framework/ConfigurationMember.cs | 2 +- OpenSim/Framework/EstateSettings.cs | 6 +- OpenSim/Framework/LLSDxmlEncode.cs | 4 +- OpenSim/Framework/RegionInfo.cs | 2 +- OpenSim/Framework/RegionSettings.cs | 8 +- OpenSim/Framework/Util.cs | 2 +- OpenSim/Region/Application/OpenSimBase.cs | 4 +- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 4 +- .../Caps/BunchOfCaps/UpdateItemAsset.cs | 6 +- .../ClientStack/Linden/Caps/EstateAccess.cs | 6 +- .../AssetTransaction/AssetXferUploader.cs | 2 +- .../CoreModules/Asset/FlotsamAssetCache.cs | 4 +- .../Avatar/Attachments/AttachmentsModule.cs | 10 +- .../AvatarFactory/AvatarFactoryModule.cs | 10 +- .../CoreModules/Avatar/Chat/ChatModule.cs | 14 +- .../Avatar/Friends/CallingCardModule.cs | 2 +- .../InstantMessage/HGMessageTransferModule.cs | 2 +- .../InstantMessage/MessageTransferModule.cs | 2 +- .../Transfer/InventoryTransferModule.cs | 12 +- .../Avatar/UserProfiles/UserProfileModule.cs | 10 +- .../EntityTransfer/EntityTransferModule.cs | 4 +- .../EntityTransfer/HGEntityTransferModule.cs | 2 +- .../HGInventoryAccessModule.cs | 2 +- .../InventoryAccess/InventoryAccessModule.cs | 14 +- .../UserManagement/UserManagementModule.cs | 6 +- .../Scripting/WorldComm/WorldCommModule.cs | 3 +- .../Scripting/XMLRPC/XMLRPCModule.cs | 8 +- .../World/Archiver/ArchiverModule.cs | 2 +- .../World/Estate/EstateManagementModule.cs | 4 +- .../CoreModules/World/Estate/EstateModule.cs | 2 +- .../World/Estate/TelehubManager.cs | 6 +- .../World/Land/LandManagementModule.cs | 12 +- .../CoreModules/World/Land/LandObject.cs | 11 +- .../LegacyMap/TexturedMapTileRenderer.cs | 2 +- .../World/Permissions/PermissionsModule.cs | 151 +++++++++--------- .../CoreModules/World/Sound/SoundModule.cs | 7 +- .../World/Warp3DMap/TerrainSplat.cs | 2 +- .../World/Warp3DMap/Warp3DImageModule.cs | 4 +- .../World/WorldMap/WorldMapModule.cs | 8 +- .../Scenes/Animation/AnimationSet.cs | 2 +- .../Animation/MovementAnimationOverrides.cs | 2 +- .../Scenes/Animation/ScenePresenceAnimator.cs | 6 +- .../Framework/Scenes/Scene.Inventory.cs | 18 +-- .../Framework/Scenes/Scene.PacketHandlers.cs | 2 +- .../Framework/Scenes/Scene.Permissions.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 16 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- .../Framework/Scenes/SceneObjectGroup.cs | 6 +- .../Framework/Scenes/SceneObjectPart.cs | 12 +- .../Scenes/SceneObjectPartInventory.cs | 4 +- .../Region/Framework/Scenes/ScenePresence.cs | 2 +- 73 files changed, 251 insertions(+), 260 deletions(-) diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index fa6d91c7a7..dc52320b32 100755 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs @@ -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); diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 48de9ace64..3fb6eacb8f 100755 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -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() ) diff --git a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnector.cs b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnector.cs index b1b646865a..6239623c66 100644 --- a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnector.cs @@ -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 sendData = new Dictionary(); - if (GroupID != UUID.Zero) + if (!GroupID.IsZero()) sendData["GroupID"] = GroupID.ToString(); if (!string.IsNullOrEmpty(GroupName)) sendData["Name"] = GroupsDataUtils.Sanitize(GroupName); diff --git a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs index c136cb834c..e15d8a0266 100644 --- a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs +++ b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs @@ -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) diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs index 45ad8f7701..9159a0f74a 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs @@ -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 sendData = new Dictionary(); - if (GroupID != UUID.Zero) + if (!GroupID.IsZero()) sendData["GroupID"] = GroupID.ToString(); if (!string.IsNullOrEmpty(GroupName)) sendData["Name"] = GroupsDataUtils.Sanitize(GroupName); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs index eb3277cbee..40a6e34c02 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs @@ -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 diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 8502bb5bda..fd75abb04f 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs @@ -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); } diff --git a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs index 2e78ed7b7f..9f06f43e15 100644 --- a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs +++ b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs @@ -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; diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs index 783b36f701..96f19b9eaa 100644 --- a/OpenSim/Addons/Groups/Service/GroupsService.cs +++ b/OpenSim/Addons/Groups/Service/GroupsService.cs @@ -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 diff --git a/OpenSim/Addons/Groups/Service/HGGroupsService.cs b/OpenSim/Addons/Groups/Service/HGGroupsService.cs index 7d86f85186..d0e5d17023 100644 --- a/OpenSim/Addons/Groups/Service/HGGroupsService.cs +++ b/OpenSim/Addons/Groups/Service/HGGroupsService.cs @@ -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); diff --git a/OpenSim/ApplicationPlugins/LoadRegions/EstateLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/EstateLoaderFileSystem.cs index 85c9f9a86d..a696bb9f6d 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/EstateLoaderFileSystem.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/EstateLoaderFileSystem.cs @@ -124,7 +124,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions if (string.IsNullOrWhiteSpace(ownerString)) continue; - if (!UUID.TryParse(ownerString, out UUID estateOwner) || estateOwner == UUID.Zero) + if (!UUID.TryParse(ownerString, out UUID estateOwner) || estateOwner.IsZero()) continue; // Check If Estate Exists (Skip If So) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index f4c75d5b5a..62ece8f59d 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -175,7 +175,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions foreach (RegionInfo region in regions) { - if (region.RegionID == UUID.Zero) + if (region.RegionID.IsZero()) { m_log.ErrorFormat( "[LOAD REGIONS PLUGIN]: Region {0} has invalid UUID {1}", diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs index af87a688c6..8ef9b312a6 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs @@ -332,7 +332,7 @@ namespace OpenSim.Capabilities.Handlers bool doneZeroID = false; foreach(LLSDFetchInventoryDescendents f in fetchFolders) { - if (f.folder_id == UUID.Zero) + if (f.folder_id.IsZero()) { if(doneZeroID) continue; @@ -427,7 +427,7 @@ namespace OpenSim.Capabilities.Handlers // The inventory server isn't sending FolderID in the collection... // Must fetch it individually - if (contents.FolderID == UUID.Zero) + if (contents.FolderID.IsZero()) { InventoryFolderBase containingFolder = m_InventoryService.GetFolder(freq.owner_id, freq.folder_id); if (containingFolder == null) diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs index e93a077963..40f5155206 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs @@ -84,7 +84,7 @@ namespace OpenSim.Capabilities.Handlers osUTF8 lsl = LLSDxmlEncode2.Start(4096); LLSDxmlEncode2.AddMap(lsl); - if(m_agentID == UUID.Zero && items.Length > 0) + if(m_agentID.IsZero() && items.Length > 0) LLSDxmlEncode2.AddElem("agent_id", items[0].Owner, lsl); else LLSDxmlEncode2.AddElem("agent_id", m_agentID, lsl); diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index cc787ccde8..c0895f5835 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -723,7 +723,7 @@ namespace OpenSim.Data.MySQL if (parentFolder.Count >= 1) // No result means parent folder does not exist { - if (parentFolder[0].ParentID == UUID.Zero) // We are querying the root folder + if (parentFolder[0].ParentID.IsZero()) // We are querying the root folder { /* Get all of the agent's folders from the database, put them in a list and return it */ using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", dbcon)) diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 70aca5f271..cd11fb31e1 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs @@ -79,7 +79,7 @@ namespace OpenSim.Data.MySQL if (pd.Length == 0) return false; - if (regionID == UUID.Zero) + if (regionID.IsZero()) return false; using (MySqlCommand cmd = new MySqlCommand()) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 95b52c2c23..cd033b9713 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -378,7 +378,7 @@ namespace OpenSim.Data.MySQL // Create all of the SOGs from the root prims first foreach (SceneObjectPart prim in prims.Values) { - if (prim.ParentUUID == UUID.Zero) + if (prim.ParentUUID.IsZero()) { objects[prim.UUID] = new SceneObjectGroup(prim); } diff --git a/OpenSim/Data/PGSQL/PGSQLInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLInventoryData.cs index 30fc5ea574..6880482fb6 100644 --- a/OpenSim/Data/PGSQL/PGSQLInventoryData.cs +++ b/OpenSim/Data/PGSQL/PGSQLInventoryData.cs @@ -111,7 +111,7 @@ namespace OpenSim.Data.PGSQL /// A list of folder objects public List getUserRootFolders(UUID user) { - if (user == UUID.Zero) + if (user.IsZero()) return new List(); return getInventoryFolders(UUID.Zero, user); @@ -197,7 +197,7 @@ namespace OpenSim.Data.PGSQL List folders = new List(); - if (parentID == UUID.Zero) + if (parentID.IsZero()) return folders; string sql = "SELECT * FROM inventoryfolders WHERE \"parentFolderID\" = :parentID"; @@ -702,7 +702,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) using (NpgsqlCommand command = new NpgsqlCommand(sql, conn)) { - if (user == UUID.Zero) + if (user.IsZero()) { command.Parameters.Add(database.CreateParameter("uuid", "%")); } diff --git a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs index ebbe8d35d1..3ffc8eb062 100755 --- a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs +++ b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs @@ -81,7 +81,7 @@ namespace OpenSim.Data.PGSQL if (pd.Length == 0) return false; - if (regionID == UUID.Zero) + if (regionID.IsZero()) return false; using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) diff --git a/OpenSim/Framework/AnimationSet.cs b/OpenSim/Framework/AnimationSet.cs index 8753088cc7..ea2ba5d346 100644 --- a/OpenSim/Framework/AnimationSet.cs +++ b/OpenSim/Framework/AnimationSet.cs @@ -109,7 +109,7 @@ namespace OpenSim.Framework public void SetAnimation(string index, string name, UUID anim) { - if (anim == UUID.Zero) + if (anim.IsZero()) { m_animations.Remove(index); return; diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 0cb02bbc72..b72f65af51 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -598,7 +598,7 @@ namespace OpenSim.Framework lock (m_attachments) { - if (item == UUID.Zero) + if (item.IsZero()) { if (m_attachments.ContainsKey(attachpoint)) { @@ -848,7 +848,7 @@ namespace OpenSim.Framework if (m_texture.FaceTextures[idx] == null) continue; if (m_texture.FaceTextures[idx].TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE || - m_texture.FaceTextures[idx].TextureID == UUID.Zero) + m_texture.FaceTextures[idx].TextureID.IsZero()) continue; needExtra = true; } @@ -1036,8 +1036,7 @@ namespace OpenSim.Framework int idx = BAKE_INDICES[i]; if (m_texture.FaceTextures[idx] == null) continue; - if (m_texture.FaceTextures[idx].TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE || - m_texture.FaceTextures[idx].TextureID == UUID.Zero) + if (m_texture.FaceTextures[idx].TextureID.IsZero() || m_texture.FaceTextures[idx].TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE)) continue; return false; } diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 1733559d96..e3104b06a4 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -152,7 +152,7 @@ namespace OpenSim.Framework public void Add(UUID itemID, UUID assetID) { - if (itemID == UUID.Zero) + if (itemID.IsZero()) return; if (m_items.ContainsKey(itemID)) { diff --git a/OpenSim/Framework/ConfigurationMember.cs b/OpenSim/Framework/ConfigurationMember.cs index 32c6a3ef23..08bf91ee3a 100755 --- a/OpenSim/Framework/ConfigurationMember.cs +++ b/OpenSim/Framework/ConfigurationMember.cs @@ -382,7 +382,7 @@ namespace OpenSim.Framework { convertSuccess = true; - if (uuidResult2 == UUID.Zero) + if (uuidResult2.IsZero()) uuidResult2 = UUID.Random(); return_result = uuidResult2; diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index 7fe75e5b4d..0e9a46e2f3 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs @@ -299,7 +299,7 @@ namespace OpenSim.Framework public void AddEstateUser(UUID avatarID) { - if (avatarID == UUID.Zero) + if (avatarID.IsZero()) return; if (!l_EstateAccess.Contains(avatarID) && (l_EstateAccess.Count < (int)Constants.EstateAccessLimits.AllowedAccess)) @@ -319,7 +319,7 @@ namespace OpenSim.Framework public void AddEstateGroup(UUID avatarID) { - if (avatarID == UUID.Zero) + if (avatarID.IsZero()) return; if (!l_EstateGroups.Contains(avatarID) && (l_EstateGroups.Count < (int)Constants.EstateAccessLimits.AllowedGroups)) @@ -339,7 +339,7 @@ namespace OpenSim.Framework public void AddEstateManager(UUID avatarID) { - if (avatarID == UUID.Zero) + if (avatarID.IsZero()) return; if (!l_EstateManagers.Contains(avatarID) && (l_EstateManagers.Count < (int)Constants.EstateAccessLimits.EstateManagers)) diff --git a/OpenSim/Framework/LLSDxmlEncode.cs b/OpenSim/Framework/LLSDxmlEncode.cs index 0c1a81f29d..1c35068641 100644 --- a/OpenSim/Framework/LLSDxmlEncode.cs +++ b/OpenSim/Framework/LLSDxmlEncode.cs @@ -311,7 +311,7 @@ namespace OpenSim.Framework public static void AddElem(UUID e, StringBuilder sb) { - if(e == UUID.Zero) + if(e.IsZero()) sb.Append(""); else { @@ -660,7 +660,7 @@ namespace OpenSim.Framework sb.Append(name); sb.Append(""); - if(e == UUID.Zero) + if(e.IsZero()) sb.Append(""); else { diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 5af10c12d5..410f9c12b9 100755 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -488,7 +488,7 @@ namespace OpenSim.Framework if (!UUID.TryParse(regionUUID.Trim(), out RegionID)) { UUID newID = UUID.Random(); - while (RegionID == UUID.Zero) + while (RegionID.IsZero()) { regionUUID = MainConsole.Instance.Prompt("RegionUUID", newID.ToString()); if (!UUID.TryParse(regionUUID.Trim(), out RegionID)) diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 0b469c1e4b..99214561f3 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -227,7 +227,7 @@ namespace OpenSim.Framework get { return m_TerrainTexture1; } set { - if (value == UUID.Zero) + if (value.IsZero()) m_TerrainTexture1 = DEFAULT_TERRAIN_TEXTURE_1; else m_TerrainTexture1 = value; @@ -241,7 +241,7 @@ namespace OpenSim.Framework get { return m_TerrainTexture2; } set { - if (value == UUID.Zero) + if (value.IsZero()) m_TerrainTexture2 = DEFAULT_TERRAIN_TEXTURE_2; else m_TerrainTexture2 = value; @@ -255,7 +255,7 @@ namespace OpenSim.Framework get { return m_TerrainTexture3; } set { - if (value == UUID.Zero) + if (value.IsZero()) m_TerrainTexture3 = DEFAULT_TERRAIN_TEXTURE_3; else m_TerrainTexture3 = value; @@ -269,7 +269,7 @@ namespace OpenSim.Framework get { return m_TerrainTexture4; } set { - if (value == UUID.Zero) + if (value.IsZero()) m_TerrainTexture4 = DEFAULT_TERRAIN_TEXTURE_4; else m_TerrainTexture4 = value; diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e978acb826..e5e51b9e9a 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -3466,7 +3466,7 @@ namespace OpenSim.Framework [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void AddToGatheredIds(Dictionary uuids, UUID id, sbyte type) { - if (id == UUID.Zero) + if (id.IsZero()) return; uuids[id] = type; } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index ad90bdaac0..35966fda9c 100755 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -479,7 +479,7 @@ namespace OpenSim scene.SnmpService.BootInfo("Loading prims", scene); } - while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) + while (regionInfo.EstateSettings.EstateOwner.IsZero() && MainConsole.Instance != null) SetUpEstateOwner(scene); scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); @@ -638,7 +638,7 @@ namespace OpenSim } // If we've been given a zero uuid then this signals that we should use a random user id - if (estateOwnerUuid == UUID.Zero) + if (estateOwnerUuid.IsZero()) estateOwnerUuid = UUID.Random(); account diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index cc44aac7c3..d547e5b6c5 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -2176,7 +2176,7 @@ namespace OpenSim.Region.ClientStack.Linden break; groupID = tmp.AsUUID(); - if(groupID == UUID.Zero) + if(groupID.IsZero()) break; List roles = m_GroupsModule.GroupRoleDataRequest(client, groupID); @@ -2309,7 +2309,7 @@ namespace OpenSim.Region.ClientStack.Linden fullname = "(hippos)"; } - if(kvp.Key == UUID.Zero) + if(kvp.Key.IsZero()) continue; // dont tell about unknown users, we can't send them back on Bad either diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs index 374d0b7e05..d471dfdaa0 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.ClientStack.Linden } catch { } - if (itemID == UUID.Zero) + if (itemID.IsZero()) { LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "failed to recode request"; @@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.Linden } catch { } - if (itemID == UUID.Zero || objectID == UUID.Zero) + if (itemID.IsZero() || objectID.IsZero()) { LLSDAssetUploadError error = new LLSDAssetUploadError(); error.message = "failed to recode request"; @@ -312,7 +312,7 @@ namespace OpenSim.Region.ClientStack.Linden UUID assetID = OnUpLoad(m_inventoryItemID, m_objectID, data); - if (assetID == UUID.Zero) + if (assetID.IsZero()) { LLSDAssetUploadError uperror = new LLSDAssetUploadError(); uperror.message = "Failed to update inventory item asset"; diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs b/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs index 4c8ba1b7ad..fe9fab4e5e 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EstateAccess.cs @@ -173,7 +173,7 @@ namespace OpenSim.Region.ClientStack.Linden for (int i = 0; i < allowed.Length; ++i) { UUID id = allowed[i]; - if (id == UUID.Zero) + if (id.IsZero()) continue; LLSDxmlEncode2.AddMap(sb); LLSDxmlEncode2.AddElem("id", id, sb); @@ -190,7 +190,7 @@ namespace OpenSim.Region.ClientStack.Linden for (int i = 0; i < groups.Length; ++i) { UUID id = groups[i]; - if (id == UUID.Zero) + if (id.IsZero()) continue; LLSDxmlEncode2.AddMap(sb); LLSDxmlEncode2.AddElem("id", id, sb); @@ -208,7 +208,7 @@ namespace OpenSim.Region.ClientStack.Linden { EstateBan ban = EstateBans[i]; UUID id = ban.BannedUserID; - if (id == UUID.Zero) + if (id.IsZero()) continue; LLSDxmlEncode2.AddMap(sb); LLSDxmlEncode2.AddElem("id", id, sb); diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 52b9d0ee84..b87b7e00c8 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -556,7 +556,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction UUID tx = new UUID(parts[1]); int id = Convert.ToInt32(parts[0]); - if (defaultIDs.Contains(tx) || tx == UUID.Zero || + if (defaultIDs.Contains(tx) || tx.IsZero() || (allowed.ContainsKey(id) && allowed[id] == tx)) { continue; diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 2313903e6c..b937350b0a 100755 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -596,7 +596,7 @@ namespace OpenSim.Region.CoreModules.Asset m_Requests++; - if (id.Equals(Util.UUIDZeroString)) + if (id.Equals(UUID.ZeroString)) return false; if (m_negativeCache.ContainsKey(id)) @@ -1255,7 +1255,7 @@ namespace OpenSim.Region.CoreModules.Asset Primitive.TextureEntryFace face = FaceTextures[idx]; 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; gatherer.AddGathered(face.TextureID, (sbyte)AssetType.Texture); } diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 5a89145491..8aeeb97212 100755 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -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 /// 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; diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 9ee8b681a7..2ec8e59c01 100755 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -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.", diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index eb78fb807c..fc7286bb59 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -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, diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index 4a55a7e4ea..d201488fb7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs @@ -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); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index fafb9f03f7..19d0c2c5e0 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs @@ -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; diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 39274fa8c8..cc189c0493 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -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; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5c5d51dd44..8779750160 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -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; diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 26ead920bd..b237b99d44 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles Dictionary classifieds = new Dictionary(); 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"); diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index f45c56571b..872980dc65 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1496,7 +1496,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return false; } - if (uinfo.HomeRegionID == UUID.Zero) + if (uinfo.HomeRegionID.IsZero()) { // can't find the Home region: Tell viewer and abort m_log.ErrorFormat("[ENTITY TRANSFER MODULE] no home set {0}", id); @@ -1833,7 +1833,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.Name, neighbourRegion.RegionName, reason); ReInstantiateScripts(agent); - if(agent.ParentID == 0 && agent.ParentUUID == UUID.Zero) + if(agent.ParentID == 0 && agent.ParentUUID.IsZero()) { agent.AddToPhysicalScene(isFlying); } diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 553ba7dd4b..edc9d09446 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return base.HandleIncomingSceneObject(so, newPosition); // Equally, we can't use so.AttachedAvatar here. - if (OwnerID == UUID.Zero || Scene.UserManagementModule.IsLocalGridUser(OwnerID)) + if (OwnerID.IsZero() || Scene.UserManagementModule.IsLocalGridUser(OwnerID)) return base.HandleIncomingSceneObject(so, newPosition); // foreign user diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 9e1536b963..bea12cd675 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -319,7 +319,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) { InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); - if (item == null || item.AssetID == UUID.Zero) + if (item == null || item.AssetID.IsZero()) return null; string userAssetServer; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index b585a43c5e..666a6f50f4 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if(envModule == null) return; UUID assetID = envModule.GetDefaultAsset(subType); - if(assetID == UUID.Zero) + if(assetID.IsZero()) { m_log.ErrorFormat( "[INVENTORY ACCESS MODULE CreateNewInventoryItem]: failed to create default environment setting asset {0} for agent {1}", name, remoteClient.AgentId); @@ -743,7 +743,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // action, userID); } - if (userID == UUID.Zero) // Can't proceed + if (userID.IsZero()) // Can't proceed { return null; } @@ -797,7 +797,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound); } - if (folderID == UUID.Zero && folder == null) + if (folderID.IsZero() && folder == null) { if (action == DeRezAction.Delete) { @@ -829,7 +829,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { // Override and put into where it came from, if it came // from anywhere in inventory and the owner is taking it back. - if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) + if (!so.FromFolderID.IsZero() && so.RootPart.OwnerID.Equals(remoteClient.AgentId)) { folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID); @@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess while(true) { parent = m_Scene.InventoryService.GetFolder(userID, parent.ParentID); - if (parent != null && (parent.ParentID == UUID.Zero || parent.ID == parent.ParentID)) + if (parent != null && (parent.ParentID.IsZero() || parent.ID.Equals(parent.ParentID))) break; if (parent == null || parent.Type == (int)FolderType.Trash || parent.Type == (int)FolderType.LostAndFound) { @@ -923,7 +923,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess byte BypassRayCast, bool RayEndIsIntersection, bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) { - if(assetID == UUID.Zero) + if(assetID.IsZero()) return null; AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); @@ -1042,7 +1042,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // remoteClient.Name); // Vector3 storedPosition = group.AbsolutePosition; - if (group.UUID == UUID.Zero) + if (group.UUID.IsZero()) { m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3"); } diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index d139746173..e192911abe 100755 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -316,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement { if (found.Contains(data.Id)) continue; - if (data.Id == UUID.Zero || data.IsUnknownUser) + if (data.Id.IsZero() || data.IsUnknownUser) continue; if (data.FirstName.ToLower().StartsWith(q) || data.LastName.ToLower().StartsWith(q)) users.Add(data); @@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement var untried = new Dictionary(); foreach (string id in ids) { - if(!UUID.TryParse(id, out UUID uuid) || uuid == UUID.Zero) + if(!UUID.TryParse(id, out UUID uuid) || uuid.IsZero()) continue; if (m_userCacheByID.TryGetValue(uuid, out UserData userdata)) @@ -551,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement var untried = new Dictionary(); foreach (string id in ids) { - if (!UUID.TryParse(id, out UUID uuid) || uuid == UUID.Zero) + if (!UUID.TryParse(id, out UUID uuid) || uuid.IsZero()) continue; if (m_userCacheByID.TryGetValue(uuid, out UserData userdata)) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 768028b2ba..9c893772a3 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -278,7 +278,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm m_listenerManager.DeleteListener(itemID); } - protected static Vector3 CenterOfRegion = new Vector3(128, 128, 20); public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg) @@ -387,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (channel == DEBUG_CHANNEL) return; - if(target == UUID.Zero) + if(target.IsZero()) return; // Is target an avatar? diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index c9e3698401..5f53439542 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -231,9 +231,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } } - if (newChannel == UUID.Zero) + if (newChannel.IsZero()) { - newChannel = (channelID == UUID.Zero) ? UUID.Random() : channelID; + newChannel = (channelID.IsZero()) ? UUID.Random() : channelID; RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel); lock (XMLRPCListLock) { @@ -283,10 +283,10 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC RPCRequestInfo rpcInfo = null; - if (message_key == UUID.Zero) + if (message_key.IsZero()) { foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values) - if (oneRpcInfo.GetChannelKey() == channel_key) + if (oneRpcInfo.GetChannelKey().Equals(channel_key)) rpcInfo = oneRpcInfo; } else diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 329b0835a1..4810029ba3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver { m_log.ErrorFormat("[ARCHIVER MODULE] default user must be in format \"First Last\"", defaultUser); } - if (defaultUserUUID == UUID.Zero) + if (defaultUserUUID.IsZero()) { m_log.ErrorFormat("[ARCHIVER MODULE] cannot find specified default user {0}", defaultUser); return; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index ff4ecfbcd2..c91916d65f 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.World.Estate public void SetEstateTerrainBaseTexture(IClientAPI remoteClient, int level, UUID texture) { - if (texture == UUID.Zero) + if (texture.IsZero()) return; switch (level) @@ -1185,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.World.Estate private void HandleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey, bool kick) { - if (prey == UUID.Zero) + if (prey.IsZero()) return; EstateTeleportOneUserHomeRequest evOverride = OnEstateTeleportOneUserHomeRequest; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs index fc083d69da..ca6235e992 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs @@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Estate private void OnEstateTeleportOneUserHomeRequest(IClientAPI client, UUID invoice, UUID senderID, UUID prey, bool kick) { - if (prey == UUID.Zero) + if (prey.IsZero()) return; if (!(client.Scene is Scene)) diff --git a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs index 8bc831f221..e64973afb9 100644 --- a/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs +++ b/OpenSim/Region/CoreModules/World/Estate/TelehubManager.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // Disconnect the Telehub: public void Disconnect() { - if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero) + if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero()) return; m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // Add a SpawnPoint to the Telehub public void AddSpawnPoint(Vector3 point) { - if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero) + if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero()) return; SceneObjectGroup grp = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject); @@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // Remove a SpawnPoint from the Telehub public void RemoveSpawnPoint(int spawnpoint) { - if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero) + if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero()) return; m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint); diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 6a15637c64..ed5103724e 100755 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1423,13 +1423,13 @@ namespace OpenSim.Region.CoreModules.World.Land curByte = LandChannel.LAND_TYPE_OWNED_BY_GROUP; } else if (currentParcel.LandData.SalePrice > 0 && - (currentParcel.LandData.AuthBuyerID == UUID.Zero || - currentParcel.LandData.AuthBuyerID == remote_client.AgentId)) + (currentParcel.LandData.AuthBuyerID.IsZero() || + currentParcel.LandData.AuthBuyerID.Equals(remote_client.AgentId))) { //Sale type curByte = LandChannel.LAND_TYPE_IS_FOR_SALE; } - else if (currentParcel.LandData.OwnerID == UUID.Zero) + else if (currentParcel.LandData.OwnerID.IsZero()) { //Public type curByte = LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero @@ -1790,7 +1790,7 @@ namespace OpenSim.Region.CoreModules.World.Land bool landforsale = ((lob.LandData.Flags & (uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0); - if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale) + if ((AuthorizedID.IsZero() || AuthorizedID.Equals(e.agentId)) && e.parcelPrice >= saleprice && landforsale) { // TODO I don't think we have to lock it here, no? //lock (e) @@ -2204,7 +2204,7 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - //m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID == UUID.Zero ? args.ToString() :""); + //m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID.IsZero() ? args.ToString() :""); osUTF8 sb = LLSDxmlEncode2.Start(); LLSDxmlEncode2.AddMap(sb); LLSDxmlEncode2.AddElem("parcel_id", parcelID,sb); @@ -2217,7 +2217,7 @@ namespace OpenSim.Region.CoreModules.World.Land private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID) { - if (parcelID == UUID.Zero) + if (parcelID.IsZero()) return; if(!m_parcelInfoCache.TryGetValue(parcelID, 30000, out ExtendedLandData data)) diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 49b2e0e060..cf09fd6c29 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -850,10 +850,10 @@ namespace OpenSim.Region.CoreModules.World.Land UUID owner = npccli.Owner; - if(owner == UUID.Zero) + if(owner.IsZero()) return true; - if (owner == LandData.OwnerID) + if (owner.Equals(LandData.OwnerID)) return false; return !IsInLandAccessList(owner); @@ -1043,7 +1043,7 @@ namespace OpenSim.Region.CoreModules.World.Land parcelAccessList.Remove(entry); // a delete all command ? - if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) + if (entries.Count == 1 && entries[0].AgentID.IsZero()) { LandData.ParcelAccessList = parcelAccessList; if ((flags & (uint)AccessList.Access) != 0) @@ -1839,11 +1839,10 @@ namespace OpenSim.Region.CoreModules.World.Land { if (obj.OwnerID != LandData.OwnerID && (obj.GroupID != LandData.GroupID || - LandData.GroupID == UUID.Zero)) + LandData.GroupID.IsZero())) { if (!returns.ContainsKey(obj.OwnerID)) - returns[obj.OwnerID] = - new List(); + returns[obj.OwnerID] = new List(); returns[obj.OwnerID].Add(obj); } } diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs index c71f5c0d89..18ab34b61a 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs @@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap // return either the average color of the texture, or the defaultColor if the texturID is invalid // or the texture couldn't be found private Color computeAverageColor(UUID textureID, Color defaultColor) { - if (textureID == UUID.Zero) return defaultColor; // not set + if (textureID.IsZero()) return defaultColor; // not set if (m_mapping.ContainsKey(textureID)) return m_mapping[textureID]; // one of the predefined textures Color color; diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 831701dba6..8f53c98b1b 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -624,10 +624,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions /// protected bool IsAdministrator(UUID user) { - if (user == UUID.Zero) + if (user.IsZero()) return false; - if (m_RegionOwnerIsAdmin && m_scene.RegionInfo.EstateSettings.EstateOwner == user) + if (m_RegionOwnerIsAdmin && m_scene.RegionInfo.EstateSettings.EstateOwner.Equals(user)) return true; if (m_RegionManagerIsAdmin && IsEstateManager(user)) @@ -650,7 +650,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if (user == UUID.Zero) + if (user.IsZero()) return false; if (m_allowGridAdmins) @@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (FriendsModule == null) return false; - if (user == UUID.Zero) + if (user.IsZero()) return false; int friendPerms = FriendsModule.GetRightsGrantedByFriend(user, objectOwner); @@ -681,7 +681,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions protected bool IsEstateManager(UUID user) { - if (user == UUID.Zero) return false; + if (user.IsZero()) + return false; return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user); } @@ -786,7 +787,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if(sp.IsGod) { // do locked on objects owned by admin - if(!unlocked && spID == taskOwnerID) + if(!unlocked && spID.Equals(taskOwnerID)) return objflags | LOCKED_GOD_FLAGS; else return objflags | GOD_FLAGS; @@ -804,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions uint grpEffectiveOwnerPerms = grp.EffectiveOwnerPerms; // owner - if (spID == taskOwnerID) + if (spID.Equals(taskOwnerID)) { returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked); returnMask |= EXTRAOWNERMASK; @@ -817,13 +818,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (task.ParentGroup.IsAttachment) { returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked); - if (taskOwnerID != UUID.Zero) + if (!taskOwnerID.IsZero()) returnMask |= (uint)PrimFlags.ObjectAnyOwner; return returnMask; } UUID taskGroupID = task.GroupID; - bool notGroupdOwned = taskOwnerID != taskGroupID; + bool notGroupdOwned = taskOwnerID.NotEqual(taskGroupID); if ((grpEffectiveOwnerPerms & (uint)PermissionMask.Transfer) == 0) grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy; @@ -841,13 +842,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions // group owned or shared ? IClientAPI client = sp.ControllingClient; ulong powers = 0; - if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers)) + if(!taskGroupID.IsZero() && GroupMemberPowers(taskGroupID, sp, ref powers)) { if(notGroupdOwned) { // group sharing or everyone returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked); - if (taskOwnerID != UUID.Zero) + if (!taskOwnerID.IsZero()) returnMask |= (uint)PrimFlags.ObjectAnyOwner; return returnMask; } @@ -875,7 +876,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // fallback is everyone rights returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked); - if (taskOwnerID != UUID.Zero) + if (!taskOwnerID.IsZero()) returnMask |= (uint)PrimFlags.ObjectAnyOwner; return returnMask; } @@ -922,7 +923,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Object owners should be able to edit their own content UUID objectOwner = obj.OwnerID; - if (user == objectOwner) + if (user.Equals(objectOwner)) return PermissionClass.Owner; // Admin should be able to edit anything in the sim (including admin objects) @@ -935,7 +936,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return PermissionClass.Owner; // Group permissions - if (obj.GroupID != UUID.Zero && IsGroupMember(obj.GroupID, user, 0)) + if (!obj.GroupID.IsZero() && IsGroupMember(obj.GroupID, user, 0)) return PermissionClass.Group; } @@ -958,7 +959,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (IsAdministrator(currentUser)) { // do lock on admin owned objects - if(locked && currentUser == objectOwner) + if(locked && currentUser.Equals(objectOwner)) return (uint)(PermissionMask.AllEffective & ~(PermissionMask.Modify | PermissionMask.Move)); return (uint)PermissionMask.AllEffective; } @@ -969,7 +970,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions uint grpEffectiveOwnerPerms = group.EffectiveOwnerPerms & lockmask; - if (currentUser == objectOwner) + if (currentUser.Equals(objectOwner)) return grpEffectiveOwnerPerms & lockmask; if (group.IsAttachment) @@ -979,13 +980,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy; UUID sogGroupID = group.GroupID; - bool notgroudOwned = sogGroupID != objectOwner; + bool notgroudOwned = sogGroupID.NotEqual(objectOwner); if (notgroudOwned && IsFriendWithPerms(currentUser, objectOwner)) return grpEffectiveOwnerPerms & lockmask; ulong powers = 0; - if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers)) + if (!sogGroupID.IsZero() && GroupMemberPowers(sogGroupID, currentUser, ref powers)) { if(notgroudOwned) return group.EffectiveGroupOrEveryOnePerms & lockmask; @@ -1016,7 +1017,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (sp.IsGod) { - if(locked && spID == objectOwner) + if(locked && spID.Equals(objectOwner)) return (uint)(PermissionMask.AllEffective & ~(PermissionMask.Modify | PermissionMask.Move)); return (uint)PermissionMask.AllEffective; } @@ -1026,7 +1027,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions lockmask &= ~(uint)(PermissionMask.Modify | PermissionMask.Move); uint ownerperms = group.EffectiveOwnerPerms; - if (spID == objectOwner) + if (spID.Equals(objectOwner)) return ownerperms & lockmask; if (group.IsAttachment) @@ -1036,7 +1037,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions ownerperms &= ~(uint)PermissionMask.Copy; UUID sogGroupID = group.GroupID; - bool notgroudOwned = sogGroupID != objectOwner; + bool notgroudOwned = sogGroupID.NotEqual(objectOwner); if (notgroudOwned && IsFriendWithPerms(spID, objectOwner)) { @@ -1044,7 +1045,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions } ulong powers = 0; - if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers)) + if (!sogGroupID.IsZero() && GroupMemberPowers(sogGroupID, sp, ref powers)) { if(notgroudOwned) return group.EffectiveGroupOrEveryOnePerms & lockmask; @@ -1071,12 +1072,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions return ti.CurrentPermissions; UUID tiGroupID = ti.GroupID; - if(tiGroupID != UUID.Zero) + if(!tiGroupID.IsZero()) { ulong powers = 0; if(GroupMemberPowers(tiGroupID, userID, ref powers)) { - if(tiGroupID == ti.OwnerID) + if(tiGroupID.Equals(ti.OwnerID)) { if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) return ti.CurrentPermissions; @@ -1093,7 +1094,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID tiOwnerID = ti.OwnerID; UUID spID = sp.UUID; - if(tiOwnerID == spID) + if(tiOwnerID.Equals(spID)) return ti.CurrentPermissions; // ?? @@ -1101,12 +1102,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions return ti.CurrentPermissions; UUID tiGroupID = ti.GroupID; - if(tiGroupID != UUID.Zero) + if(!tiGroupID.IsZero()) { ulong powers = 0; if(GroupMemberPowers(tiGroupID, spID, ref powers)) { - if(tiGroupID == ti.OwnerID) + if(tiGroupID.Equals(ti.OwnerID)) { if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) return ti.CurrentPermissions; @@ -1162,7 +1163,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager) { - if (parcel.LandData.OwnerID == user) + if (parcel.LandData.OwnerID.Equals(user)) return true; if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) @@ -1200,13 +1201,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if(parcel.LandData.GroupID == UUID.Zero) + if(parcel.LandData.GroupID.IsZero()) return false; if (IsAdministrator(user)) return true; - if (parcel.LandData.OwnerID != user) // Only the owner can deed! + if (parcel.LandData.OwnerID.NotEqual(user)) // Only the owner can deed! return false; ScenePresence sp = m_scene.GetScenePresence(user); @@ -1225,11 +1226,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID == UUID.Zero) + if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID.IsZero()) return false; // object has group already? - if(sog.GroupID != targetGroupID) + if(sog.GroupID.NotEqual(targetGroupID)) return false; // is effectivelly shared? @@ -1240,7 +1241,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; // owned by requester? - if(sog.OwnerID != sp.UUID) + if(sog.OwnerID.NotEqual(sp.UUID)) return false; // owner can transfer? @@ -1271,7 +1272,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if((perms & (uint)PermissionMask.Copy) == 0) return false; - if(sog.OwnerID != sp.UUID && (perms & (uint)PermissionMask.Transfer) == 0) + if(sog.OwnerID.NotEqual(sp.UUID) && (perms & (uint)PermissionMask.Transfer) == 0) return false; //If they can rez, they can duplicate @@ -1294,7 +1295,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID sogOwnerID = sog.OwnerID; UUID spID = sp.UUID; - if(sogOwnerID == spID) + if(sogOwnerID.Equals(spID)) return true; if (sp.IsGod) @@ -1304,12 +1305,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; UUID sogGroupID = sog.GroupID; - if (sogGroupID != UUID.Zero) + if (!sogGroupID.IsZero()) { ulong powers = 0; if(GroupMemberPowers(sogGroupID, sp, ref powers)) { - if(sogGroupID == sogOwnerID) + if(sogGroupID.Equals(sogOwnerID)) { if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) return true; @@ -1336,7 +1337,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID sogOwnerID = sog.OwnerID; - if(sogOwnerID == userID) + if(sogOwnerID.Equals(userID)) return true; if (IsAdministrator(userID)) @@ -1346,12 +1347,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; UUID sogGroupID = sog.GroupID; - if (sogGroupID != UUID.Zero) + if (!sogGroupID.IsZero()) { ulong powers = 0; if(GroupMemberPowers(sogGroupID, userID, ref powers)) { - if(sogGroupID == sogOwnerID) + if(sogGroupID.Equals(sogOwnerID)) { if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) return true; @@ -1399,11 +1400,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (sog == null) return false; - if(sog.OwnerID == userID || IsAdministrator(userID)) + if(sog.OwnerID.Equals(userID) || IsAdministrator(userID)) return true; UUID sogGroupID = sog.GroupID; - if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID) + if(sogGroupID.IsZero() || sogGroupID.NotEqual(sog.OwnerID)) return false; uint perms = sog.EffectiveOwnerPerms; @@ -1478,7 +1479,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if (objectID == UUID.Zero) // User inventory + if (objectID.IsZero()) // User inventory { IInventoryService invService = m_scene.InventoryService; InventoryItemBase assetRequestItem = invService.GetItem(user, notecard); @@ -1521,17 +1522,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (ti == null) return false; - if (ti.OwnerID != user) + if (ti.OwnerID.NotEqual(user)) { UUID tiGroupID = ti.GroupID; - if (tiGroupID == UUID.Zero) + if (tiGroupID.IsZero()) return false; ulong powers = 0; if(!GroupMemberPowers(tiGroupID, user, ref powers)) return false; - if(tiGroupID == ti.OwnerID && (powers & (ulong)GroupPowers.ObjectManipulate) != 0) + if(tiGroupID.Equals(ti.OwnerID) && (powers & (ulong)GroupPowers.ObjectManipulate) != 0) { if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy)) == ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy)) @@ -1602,7 +1603,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) { - if (sog.OwnerID != sp.UUID && sog.IsAttachment) + if (sog.OwnerID.NotEqual(sp.UUID) && sog.IsAttachment) return false; return m_bypassPermissionsValue; } @@ -1649,14 +1650,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID userID = sog.OwnerID; LandData landdata = parcel.LandData; - if (landdata.OwnerID == userID) + if (landdata.OwnerID.Equals(userID)) return true; if (IsAdministrator(userID)) return true; UUID landGroupID = landdata.GroupID; - if (landGroupID != UUID.Zero) + if (!landGroupID.IsZero()) { if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowGroupObjectEntry)) != 0) return IsGroupMember(landGroupID, userID, 0); @@ -1693,14 +1694,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID userID = sog.OwnerID; LandData landdata = parcel.LandData; - if (landdata.OwnerID == userID) + if (landdata.OwnerID.Equals(userID)) return true; if (IsAdministrator(userID)) return true; UUID landGroupID = landdata.GroupID; - if (landGroupID != UUID.Zero) + if (!landGroupID.IsZero()) { checkflags = (int)ParcelFlags.AllowGroupObjectEntry; if(scripts) @@ -1741,7 +1742,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions continue; } - if (isPrivUser || g.OwnerID == userID) + if (isPrivUser || g.OwnerID.Equals(userID)) continue; // This is a short cut for efficiency. If land is non-null, @@ -1768,7 +1769,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions LandData ldata = l.LandData; // If we own the land outright, then allow // - if (ldata.OwnerID == userID) + if (ldata.OwnerID.Equals(userID)) continue; // Group voodoo @@ -1787,8 +1788,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Group deeded object? // - if (g.OwnerID == lGroupID && - (powers & (ulong)GroupPowers.ReturnGroupOwned) == 0) + if (g.OwnerID.Equals(lGroupID) && (powers & (ulong)GroupPowers.ReturnGroupOwned) == 0) { objects.Remove(g); continue; @@ -1796,8 +1796,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Group set object? // - if (g.GroupID == lGroupID && - (powers & (ulong)GroupPowers.ReturnGroupSet) == 0) + if (g.GroupID.Equals(lGroupID) && (powers & (ulong)GroupPowers.ReturnGroupSet) == 0) { objects.Remove(g); continue; @@ -1848,7 +1847,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if(IsAdministrator(userID)) return true; - if(landdata.GroupID != UUID.Zero) + if(!landdata.GroupID.IsZero()) { if ((landdata.Flags & (uint)ParcelFlags.CreateGroupObjects) != 0) return IsGroupMember(landdata.GroupID, userID, 0); @@ -1899,7 +1898,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; if (((lflags & (uint)ParcelFlags.AllowGroupScripts) != 0) - && (ldata.GroupID != UUID.Zero) && (ldata.GroupID == part.GroupID)) + && (!ldata.GroupID.IsZero()) && (ldata.GroupID.Equals(part.GroupID))) return true; return GenericEstatePermission(part.OwnerID); @@ -1926,7 +1925,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if (sog == null || sog.IsDeleted || userID == UUID.Zero) + if (sog == null || sog.IsDeleted || userID.IsZero()) return false; // sell is not a attachment op @@ -1946,12 +1945,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID sogOwnerID = sog.OwnerID; - if(sogOwnerID == userID) + if(sogOwnerID.Equals(userID)) return true; // else only group owned can be sold by members with powers UUID sogGroupID = sog.GroupID; - if(sog.OwnerID != sogGroupID || sogGroupID == UUID.Zero) + if(sogGroupID.IsZero() || sog.OwnerID.NotEqual(sogGroupID)) return false; return IsGroupMember(sogGroupID, userID, (ulong)GroupPowers.ObjectSetForSale); @@ -1980,15 +1979,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions (sogEffectiveOwnerPerms & (uint)PermissionMask.Copy) == 0) return false; - UUID userID = sp.UUID; - UUID sogOwnerID = sog.OwnerID; - - if(sogOwnerID == userID) + if(sog.OwnerID.Equals(sp.UUID)) return true; // else only group owned can be sold by members with powers UUID sogGroupID = sog.GroupID; - if(sog.OwnerID != sogGroupID || sogGroupID == UUID.Zero) + if(sogGroupID.IsZero() || sog.OwnerID.NotEqual(sogGroupID)) return false; ulong powers = 0; @@ -2015,9 +2011,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; UUID sogOwnerID = sog.OwnerID; - UUID spID = sp.UUID; - if(sogOwnerID == spID) + if(sogOwnerID.Equals(sp.UUID)) return true; if (sp.IsGod) @@ -2030,12 +2025,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; UUID sogGroupID = sog.GroupID; - if (sogGroupID != UUID.Zero) + if (!sogGroupID.IsZero()) { ulong powers = 0; if(GroupMemberPowers(sogGroupID, sp, ref powers)) { - if(sogGroupID == sogOwnerID) + if(sogGroupID.Equals(sogOwnerID)) { if((powers & (ulong)GroupPowers.ObjectManipulate) != 0) return true; @@ -2128,7 +2123,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (IsAdministrator(userID)) return true; - if (objectID == UUID.Zero) // User inventory + if (objectID.IsZero()) // User inventory { IInventoryService invService = m_scene.InventoryService; InventoryItemBase assetRequestItem = invService.GetItem(userID, script); @@ -2221,7 +2216,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (IsAdministrator(userID)) return true; - if (objectID == UUID.Zero) // User inventory + if (objectID.IsZero()) // User inventory { IInventoryService invService = m_scene.InventoryService; InventoryItemBase assetRequestItem = invService.GetItem(userID, notecard); @@ -2326,7 +2321,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (sog == null) return false; - if(sog.OwnerID == userID || IsAdministrator(userID)) + if(sog.OwnerID.Equals(userID) || IsAdministrator(userID)) return true; if(sog.IsAttachment) @@ -2334,7 +2329,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID sogGroupID = sog.GroupID; - if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID) + if(sogGroupID.IsZero() || sogGroupID.NotEqual(sog.OwnerID)) return false; TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID); @@ -2388,7 +2383,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } - bool notSameOwner = srcsog.OwnerID != destsog.OwnerID; + bool notSameOwner = srcsog.OwnerID.NotEqual(destsog.OwnerID); if(notSameOwner) { @@ -2432,13 +2427,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions UUID destOwner = destsog.OwnerID; UUID spID = sp.UUID; - bool spNotOwner = spID != destOwner; + bool spNotOwner = spID.NotEqual(destOwner); // scripts can't be droped if(spNotOwner && item.InvType == (int)InventoryType.LSL) return false; - if(spNotOwner || item.Owner != destOwner) + if(spNotOwner || item.Owner.NotEqual(destOwner)) { // no copy item will be moved if it has transfer uint itperms = item.CurrentPermissions; diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 96cbfec598..a3d19cb0fb 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -236,8 +236,7 @@ namespace OpenSim.Region.CoreModules.World.Sound public virtual void PreloadSound(UUID objectID, UUID soundID) { SceneObjectPart part; - if (soundID == UUID.Zero - || !m_scene.TryGetSceneObjectPart(objectID, out part)) + if (soundID.IsZero() || !m_scene.TryGetSceneObjectPart(objectID, out part)) { return; } @@ -295,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Sound bool triggered, byte flags, bool useMaster, bool isMaster) { - if (soundID == UUID.Zero) + if (soundID.IsZero()) return; SceneObjectPart part; @@ -327,7 +326,7 @@ namespace OpenSim.Region.CoreModules.World.Sound public void TriggerSoundLimited(UUID objectID, UUID sound, double volume, Vector3 min, Vector3 max) { - if (sound == UUID.Zero) + if (sound.IsZero()) return; SceneObjectPart part; diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs index e7201750e8..4f7680cacb 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap // Swap empty terrain textureIDs with default IDs for(int i = 0; i < textureIDs.Length; i++) { - if(textureIDs[i] == UUID.Zero) + if(textureIDs[i].IsZero()) textureIDs[i] = DEFAULT_TERRAIN_DETAIL[i]; } diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index 9338426998..6eee596f13 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs @@ -687,7 +687,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap int color; Color4 ctmp = Color4.White; - if (face.TextureID == UUID.Zero) + if (face.TextureID.IsZero()) return warp_Color.White; if (!m_colors.TryGetValue(face.TextureID, out color)) @@ -788,7 +788,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap private warp_Texture GetTexture(UUID id, SceneObjectPart sop) { warp_Texture ret = null; - if (id == UUID.Zero) + if (id.IsZero()) return ret; if (m_warpTextures.TryGetValue(id, out ret)) return ret; diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 00e5b9282a..035608d2e2 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -647,7 +647,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap ScenePresence av = null; MapRequestState st = o as MapRequestState; - if (st == null || st.agentID == UUID.Zero) + if (st == null || st.agentID.IsZero()) return; if (m_blacklistedregions.ContainsKey(st.regionhandle)) @@ -765,7 +765,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } UUID agentID = requestState.agentID; - if (agentID == UUID.Zero || !m_scene.TryGetScenePresence(agentID, out ScenePresence sp)) + if (agentID.IsZero() || !m_scene.TryGetScenePresence(agentID, out ScenePresence sp)) { m_cachedRegionMapItemsResponses.Remove(regionhandle); Interlocked.Decrement(ref nAsyncRequests); @@ -1169,7 +1169,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public void OnHTTPGetMapImage(IOSHttpRequest request, IOSHttpResponse response) { response.KeepAlive = false; - if (request.HttpMethod != "GET" || m_scene.RegionInfo.RegionSettings.TerrainImageID == UUID.Zero) + if (request.HttpMethod != "GET" || m_scene.RegionInfo.RegionSettings.TerrainImageID.IsZero()) { response.StatusCode = (int)HttpStatusCode.NotFound; return; @@ -1367,7 +1367,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap foreach(GridRegion r in regions) { - if(r.TerrainImage == UUID.Zero) + if(r.TerrainImage.IsZero()) continue; if(doneLocal && r.RegionHandle == m_regionHandle) diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 17d242c99f..36bc5dd309 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -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]; diff --git a/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs b/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs index 2f17734432..f9f740753a 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/MovementAnimationOverrides.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes private Dictionary m_overrides = new Dictionary(); public void SetOverride(string state, UUID animID) { - if (animID == UUID.Zero) + if (animID.IsZero()) { if (state == "ALL") m_overrides.Clear(); diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index c57f98072b..a491dce00a 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -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; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 860708383b..6353f9d481 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -263,7 +263,7 @@ namespace OpenSim.Region.Framework.Scenes return UUID.Zero; } - if (objectID == UUID.Zero) + if (objectID.IsZero()) { IInventoryAccessModule invAccess = RequestModuleInterface(); 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(); diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 07bd40bb1f..673a47a81d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -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! diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 79093316ee..60bde1625b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -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; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 16532e33c3..fa808b1236 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -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 /// True if the SceneObjectGroup was added, False if it was not 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; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index dcf4e9b9e9..c3c4cd0349 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -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}", diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b38326a50e..3fa7e5a38d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -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) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3b2af30c5a..7268b40536 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -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(); @@ -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++]; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index e982cef7cf..5704b055bc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -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; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6e3d21b7aa..efb770f5af 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -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,