diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index e82f963ffd..197d785860 100755 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -477,7 +477,7 @@ namespace OpenSim.Groups return; } - if (itemID != UUID.Zero && ownerID != UUID.Zero) + if (!itemID.IsZero() && !ownerID.IsZero()) { item = scene.InventoryService.GetItem(ownerID, itemID); if(item != null) @@ -927,7 +927,7 @@ namespace OpenSim.Groups UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, remoteClient.AgentId, out reason); - if (groupID != UUID.Zero) + if (!groupID.IsZero()) { if (money != null && money.GroupCreationCharge > 0) money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate, name); diff --git a/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs b/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs index 826b245232..cee1c9c8ff 100644 --- a/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs +++ b/OpenSim/Addons/Groups/Local/GroupsServiceLocalConnectorModule.cs @@ -165,7 +165,7 @@ namespace OpenSim.Groups public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName) { - if (GroupID != UUID.Zero) + if (!GroupID.IsZero()) return m_GroupsService.GetGroupRecord(RequestingAgentID, GroupID); else if (GroupName != null) return m_GroupsService.GetGroupRecord(RequestingAgentID, GroupName); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs index 9159a0f74a..46db729003 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs @@ -224,7 +224,7 @@ namespace OpenSim.Groups { Dictionary sendData = new Dictionary(); sendData["AgentID"] = AgentID; - if (GroupID != UUID.Zero) + if (!GroupID.IsZero()) sendData["GroupID"] = GroupID.ToString(); sendData["RequestingAgentID"] = RequestingAgentID; Dictionary ret = MakeRequest("GETMEMBERSHIP", sendData); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index fd75abb04f..569755e60a 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs @@ -186,7 +186,7 @@ namespace OpenSim.Groups } - if (grec.GroupID != UUID.Zero) + if (!grec.GroupID.IsZero()) { grec = m_GroupsService.GetGroupRecord(RequestingAgentID, grec.GroupID); if (grec == null) diff --git a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs index 9f06f43e15..d0847ad462 100644 --- a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs +++ b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs @@ -87,7 +87,7 @@ namespace OpenSim.Groups if (group == null) return UUID.Zero; - if (group.GroupID != UUID.Zero) + if (!group.GroupID.IsZero()) { m_Cache.AddOrUpdate("group-" + group.GroupID.ToString(), group, GROUPS_CACHE_TIMEOUT); m_Cache.Remove("memberships-" + RequestingAgentID.ToString()); @@ -101,7 +101,7 @@ namespace OpenSim.Groups //ExtendedGroupRecord group = m_GroupsService.UpdateGroup(RequestingAgentID, groupID, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish); ExtendedGroupRecord group = d(); - if (group != null && group.GroupID != UUID.Zero) + if (group != null && !group.GroupID.IsZero()) m_Cache.AddOrUpdate("group-" + group.GroupID.ToString(), group, GROUPS_CACHE_TIMEOUT); return true; @@ -115,10 +115,10 @@ namespace OpenSim.Groups object group = null; bool firstCall = false; string cacheKey = "group-"; - if (GroupID != UUID.Zero) - cacheKey += GroupID.ToString(); - else + if (GroupID.IsZero()) cacheKey += GroupName; + else + cacheKey += GroupID.ToString(); //m_log.DebugFormat("[XXX]: GetGroupRecord {0}", cacheKey); diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs index 96f19b9eaa..a54b182174 100644 --- a/OpenSim/Addons/Groups/Service/GroupsService.cs +++ b/OpenSim/Addons/Groups/Service/GroupsService.cs @@ -564,7 +564,7 @@ namespace OpenSim.Groups if (rdata != null) foreach (RoleMembershipData r in rdata) { - if (r.RoleID != UUID.Zero) + if (!r.RoleID.IsZero()) { newRoleID = r.RoleID; break; @@ -837,7 +837,7 @@ namespace OpenSim.Groups _AddAgentToGroupRole(RequestingAgentID, AgentID, GroupID, UUID.Zero); // Add principal to role, if different from everyone role - if (RoleID != UUID.Zero) + if (!RoleID.IsZero()) _AddAgentToGroupRole(RequestingAgentID, AgentID, GroupID, RoleID); // Make this the active group diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index d7ca4764de..07a9ba83dc 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -2873,7 +2873,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController for (int i = 0; i Get(string regionName, UUID scopeID) { string command = "select * from `"+m_Realm+"` where regionName like ?regionName"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) command += " and ScopeID = ?scopeID"; command += " order by regionName"; @@ -84,7 +84,7 @@ namespace OpenSim.Data.MySQL public RegionData GetSpecific(string regionName, UUID scopeID) { string command = "select * from `" + m_Realm + "` where regionName = ?regionName"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) command += " and ScopeID = ?scopeID"; using (MySqlCommand cmd = new MySqlCommand(command)) @@ -104,7 +104,7 @@ namespace OpenSim.Data.MySQL public RegionData Get(int posX, int posY, UUID scopeID) { string command = "select * from `" + m_Realm + "` where locX between ?startX and ?endX and locY between ?startY and ?endY"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) command += " and ScopeID = ?scopeID"; int startX = posX - (int)Constants.MaximumRegionSize; @@ -145,7 +145,7 @@ namespace OpenSim.Data.MySQL public RegionData Get(UUID regionID, UUID scopeID) { string command = "select * from `"+m_Realm+"` where uuid = ?regionID"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) command += " and ScopeID = ?scopeID"; using (MySqlCommand cmd = new MySqlCommand(command)) @@ -325,7 +325,7 @@ namespace OpenSim.Data.MySQL update += " where uuid = ?regionID"; - if (data.ScopeID != UUID.Zero) + if (!data.ScopeID.IsZero()) update += " and ScopeID = ?scopeID"; cmd.CommandText = update; @@ -410,7 +410,7 @@ namespace OpenSim.Data.MySQL private List Get(int regionFlags, UUID scopeID) { string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) command += " and ScopeID = ?scopeID"; using (MySqlCommand cmd = new MySqlCommand(command)) diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index cd033b9713..09374ca89b 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1090,10 +1090,10 @@ namespace OpenSim.Data.MySQL prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString()); prim.SoundGain = (float)row["LoopedSoundGain"]; - if (prim.Sound != UUID.Zero) - prim.SoundFlags = 1; // If it's persisted at all, it's looped - else + if (prim.Sound.IsZero()) prim.SoundFlags = 0; + else + prim.SoundFlags = 1; // If it's persisted at all, it's looped if (!(row["TextureAnimation"] is DBNull)) prim.TextureAnimation = (byte[])row["TextureAnimation"]; diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index 59cfe70421..d5581317ad 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs @@ -90,7 +90,7 @@ namespace OpenSim.Data.MySQL { using (MySqlCommand cmd = new MySqlCommand()) { - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) { where = "(ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (" + where + ")"; cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs index f90a3858c4..5059eadaf5 100644 --- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs +++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs @@ -99,7 +99,7 @@ namespace OpenSim.Data.PGSQL public List Get(string regionName, UUID scopeID) { string sql = "select * from "+m_Realm+" where lower(\"regionName\") like lower(:regionName) "; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) sql += " and \"ScopeID\" = :scopeID"; sql += " order by lower(\"regionName\")"; @@ -107,7 +107,7 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) { cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName)); - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); return RunCommand(cmd); @@ -117,14 +117,14 @@ namespace OpenSim.Data.PGSQL public RegionData GetSpecific(string regionName, UUID scopeID) { string sql = "select * from " + m_Realm + " where lower(\"regionName\") = lower(:regionName) "; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) sql += " and \"ScopeID\" = :scopeID"; using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) { cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName)); - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); List ret = RunCommand(cmd); @@ -139,7 +139,7 @@ namespace OpenSim.Data.PGSQL { // extend database search for maximum region size area string sql = "select * from "+m_Realm+" where \"locX\" between :startX and :endX and \"locY\" between :startY and :endY"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) sql += " and \"ScopeID\" = :scopeID"; int startX = posX - (int)Constants.MaximumRegionSize; @@ -155,7 +155,7 @@ namespace OpenSim.Data.PGSQL cmd.Parameters.Add(m_database.CreateParameter("startY", startY)); cmd.Parameters.Add(m_database.CreateParameter("endX", endX)); cmd.Parameters.Add(m_database.CreateParameter("endY", endY)); - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); ret = RunCommand(cmd); @@ -182,13 +182,13 @@ namespace OpenSim.Data.PGSQL public RegionData Get(UUID regionID, UUID scopeID) { string sql = "select * from "+m_Realm+" where uuid = :regionID"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) sql += " and \"ScopeID\" = :scopeID"; using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) { cmd.Parameters.Add(m_database.CreateParameter("regionID", regionID)); - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); List ret = RunCommand(cmd); @@ -203,7 +203,7 @@ namespace OpenSim.Data.PGSQL { // extend database search for maximum region size area string sql = "select * from "+m_Realm+" where \"locX\" between :startX and :endX and \"locY\" between :startY and :endY"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) sql += " and \"ScopeID\" = :scopeID"; int qstartX = startX - (int)Constants.MaximumRegionSize; @@ -217,7 +217,7 @@ namespace OpenSim.Data.PGSQL cmd.Parameters.Add(m_database.CreateParameter("startY", qstartY)); cmd.Parameters.Add(m_database.CreateParameter("endX", endX)); cmd.Parameters.Add(m_database.CreateParameter("endY", endY)); - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); conn.Open(); @@ -334,7 +334,7 @@ namespace OpenSim.Data.PGSQL update += " where uuid = :regionID"; - if (data.ScopeID != UUID.Zero) + if (!data.ScopeID.IsZero()) update += " and \"ScopeID\" = :scopeID"; cmd.CommandText = update; @@ -439,7 +439,7 @@ namespace OpenSim.Data.PGSQL private List Get(int regionFlags, UUID scopeID) { string sql = "SELECT * FROM " + m_Realm + " WHERE (\"flags\" & " + regionFlags.ToString() + ") <> 0"; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) sql += " AND \"ScopeID\" = :scopeID"; using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 1d2fd35d4a..759528448f 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -148,7 +148,7 @@ namespace OpenSim.Data.PGSQL // this case, force the UUID to be the same as the group UUID so that at least these can be // deleted (we need to change the UUID so that any other prims in the linkset can also be // deleted). - if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero) + if (!groupID.IsZero() && sceneObjectPart.UUID.NotEqual(groupID)) { _Log.WarnFormat( "[REGION DB]: Found root prim {0} {1} at {2} where group was actually {3}. Forcing UUID to group UUID", @@ -1314,10 +1314,10 @@ namespace OpenSim.Data.PGSQL prim.Sound = new UUID((Guid)primRow["LoopedSound"]); prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]); - if (prim.Sound != UUID.Zero) - prim.SoundFlags = 1; // If it's persisted at all, it's looped - else + if (prim.Sound.IsZero()) prim.SoundFlags = 0; + else + prim.SoundFlags = 1; // If it's persisted at all, it's looped if (!(primRow["TextureAnimation"] is DBNull)) prim.TextureAnimation = (Byte[])primRow["TextureAnimation"]; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index c224ef82b8..64ca73dc8a 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1692,10 +1692,10 @@ namespace OpenSim.Data.SQLite prim.Sound = new UUID(row["LoopedSound"].ToString()); prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); - if (prim.Sound != UUID.Zero) - prim.SoundFlags = 1; // If it's persisted at all, it's looped - else + if (prim.Sound.IsZero()) prim.SoundFlags = 0; + else + prim.SoundFlags = 1; // If it's persisted at all, it's looped if (!row.IsNull("TextureAnimation")) prim.TextureAnimation = Convert.FromBase64String(row["TextureAnimation"].ToString()); diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index b72f65af51..a3747e7e5d 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -265,7 +265,7 @@ namespace OpenSim.Framework UUID itemID = m_wearables[i][j].ItemID; UUID assetID = app.Wearables[i].GetAsset(itemID); - if (assetID != UUID.Zero) + if (!assetID.IsZero()) m_wearables[i].Add(itemID, assetID); } } @@ -622,7 +622,7 @@ namespace OpenSim.Framework // "[AVATAR APPEARANCE]: Found existing attachment for {0}, asset {1} at point {2}", // existingAttachment.ItemID, existingAttachment.AssetID, existingAttachment.AttachPoint); - if (existingAttachment.AssetID != UUID.Zero && existingAttachment.AttachPoint == (attachpoint & 0x7F)) + if (!existingAttachment.AssetID.IsZero() && existingAttachment.AttachPoint == (attachpoint & 0x7F)) { m_log.DebugFormat( "[AVATAR APPEARANCE]: Ignoring attempt to attach an already attached item {0} at point {1}", diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index e3104b06a4..6435307b98 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -205,7 +205,7 @@ namespace OpenSim.Framework } } - if (itemID != UUID.Zero) + if (!itemID.IsZero()) { m_ids.Remove(itemID); m_items.Remove(itemID); diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs index c59f614c92..5b1db55d49 100755 --- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs @@ -87,7 +87,7 @@ namespace OpenSim.Framework.Monitoring public void ReceiveClassicSimStatsPacket(SimStats stats) { UUID id = stats.RegionUUID; - if (id != UUID.Zero) + if (!id.IsZero()) { if(ReceivedStats.Count == 0) firstReceivedRegion = id; diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 410f9c12b9..c36a1331b5 100755 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -828,13 +828,13 @@ namespace OpenSim.Framework if (AgentCapacity > 0) config.Set("MaxAgents", AgentCapacity); - if (ScopeID != UUID.Zero) + if (!ScopeID.IsZero()) config.Set("ScopeID", ScopeID.ToString()); if (RegionType != String.Empty) config.Set("RegionType", RegionType); - if (m_maptileStaticUUID != UUID.Zero) + if (!m_maptileStaticUUID.IsZero()) config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); if (MaptileStaticFile != null && MaptileStaticFile != String.Empty) diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index f114fda3cc..8341e04a56 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -321,7 +321,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteEndElement(); xtw.WriteStartElement("Telehub"); - if (settings.TelehubObject != UUID.Zero) + if (!settings.TelehubObject.IsZero()) { xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString()); foreach (SpawnPoint sp in settings.SpawnPoints()) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index d547e5b6c5..2eab896191 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1769,7 +1769,7 @@ namespace OpenSim.Region.ClientStack.Linden { if (parcelOwner == m_AgentID) showType = 2; - else if (landdata.GroupID != UUID.Zero) + else if (!landdata.GroupID.IsZero()) { ulong powers = sp.ControllingClient.GetGroupPowers(landdata.GroupID); if ((powers & (ulong)(GroupPowers.ReturnGroupOwned | GroupPowers.ReturnGroupSet | GroupPowers.ReturnNonGroup)) != 0) @@ -2058,7 +2058,7 @@ namespace OpenSim.Region.ClientStack.Linden ulong gpowers = client.GetGroupPowers(land.LandData.GroupID); SceneObjectGroup telehub = null; - if (m_Scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) + if (!m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero()) // Does the telehub exist in the scene? telehub = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs index d471dfdaa0..0a312a2e20 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/UpdateItemAsset.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack.Linden return; } - if (objectID != UUID.Zero) + if (!objectID.IsZero()) { SceneObjectPart sop = m_Scene.GetSceneObjectPart(objectID); if (sop == null) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetAssetsModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetAssetsModule.cs index 6a5456cd0f..9c0ba5416c 100755 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetAssetsModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetAssetsModule.cs @@ -180,7 +180,7 @@ namespace OpenSim.Region.ClientStack.Linden if (m_NumberScenes <= 0) return; APollRequest poolreq = o as APollRequest; - if (poolreq != null && poolreq.reqID != UUID.Zero) + if (poolreq != null && !poolreq.reqID.IsZero()) poolreq.thepoll.Process(poolreq); } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index f389ba4703..5f4c1d53ee 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -148,7 +148,7 @@ namespace OpenSim.Region.ClientStack.Linden typesMap["prim"] = true; m_features["PhysicsShapeTypes"] = typesMap; - if(m_doScriptSyntax && m_scriptSyntaxID != UUID.Zero) + if(m_doScriptSyntax && !m_scriptSyntaxID.IsZero()) m_features["LSLSyntaxId"] = OSD.FromUUID(m_scriptSyntaxID); OSDMap meshAnim = new OSDMap(); @@ -194,7 +194,7 @@ namespace OpenSim.Region.ClientStack.Linden HandleSimulatorFeaturesRequest(request, response, agentID); })); - if (m_doScriptSyntax && m_scriptSyntaxID != UUID.Zero && m_scriptSyntaxXML != null) + if (m_doScriptSyntax && !m_scriptSyntaxID.IsZero() && m_scriptSyntaxXML != null) { caps.RegisterSimpleHandler("LSLSyntax", new SimpleStreamHandler("/" + UUID.Random(), HandleSyntaxRequest)); @@ -389,7 +389,7 @@ namespace OpenSim.Region.ClientStack.Linden { lock(m_scriptSyntaxLock) { - if(!m_doScriptSyntax || m_scriptSyntaxID != UUID.Zero) + if(!m_doScriptSyntax || !m_scriptSyntaxID.IsZero()) return; if(!File.Exists("ScriptSyntax.xml")) diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index b87b7e00c8..eedb015af1 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -428,7 +428,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction else { m_Scene.AssetService.Store(m_asset); - if (m_asset.FullID != UUID.Zero) + if (!m_asset.FullID.IsZero()) { item.AssetID = m_asset.FullID; m_Scene.InventoryService.UpdateItem(item); diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 8aeeb97212..9fe0e005fc 100755 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -665,7 +665,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments for (int i = 0; i< toRemove.Count; ++i) { SceneObjectGroup g = toRemove[i]; - if (g.FromItemID != UUID.Zero) + if (!g.FromItemID.IsZero()) DetachSingleAttachmentToInv(sp, g); } } @@ -809,7 +809,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments return; bool changed = false; - if (inventoryID != UUID.Zero) + if (!inventoryID.IsZero()) changed = sp.Appearance.DetachAttachment(inventoryID); if (changed && m_scene.AvatarFactory != null) m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); @@ -1248,7 +1248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments return null; } - bool ItemIDNotZero = itemID != UUID.Zero; + bool ItemIDNotZero = !itemID.IsZero(); if (ItemIDNotZero) objatt = m_invAccessModule.RezObject(sp.ControllingClient, @@ -1499,7 +1499,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments foreach (SceneObjectGroup group in attachments) { - if (group.FromItemID == itemID && group.FromItemID != UUID.Zero) + if (group.FromItemID.Equals(itemID) && !group.FromItemID.IsZero()) { DetachSingleAttachmentToInv(sp, group); return; diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 2ec8e59c01..42a14a3474 100755 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -377,7 +377,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory wearableCache = WearableCacheItem.GetDefaultCacheItem(); else { - hadSkirt = (wearableCache[19].TextureID != UUID.Zero); + hadSkirt = !wearableCache[19].TextureID.IsZero(); } HashSet updatedFaces = new HashSet(); @@ -562,8 +562,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory continue; } - if (face.TextureID == wearableCache[idx].TextureID && - face.TextureID != UUID.Zero) + if (face.TextureID.Equals(wearableCache[idx].TextureID) && !face.TextureID.IsZero()) { if (cache.Check((wearableCache[idx].TextureID).ToString())) { @@ -628,7 +627,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory hits++; } else if(sp.Appearance.Texture.FaceTextures[idx] == null || - sp.Appearance.Texture.FaceTextures[idx].TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) + sp.Appearance.Texture.FaceTextures[idx].TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE)) hits++; wearableCache[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE; wearableCache[idx].CacheId = UUID.Zero; @@ -1058,7 +1057,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) { UUID defaultwearable = GetDefaultItem(type); - if (defaultwearable != UUID.Zero) + if (!defaultwearable.IsZero()) { UUID newInvItem = UUID.Random(); InventoryItemBase itembase = new InventoryItemBase(newInvItem, userID) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 4151ac05f8..f0a15f7fb2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -563,7 +563,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends foreach (PresenceInfo friendSession in friendSessions) { // let's guard against sessions-gone-bad - if (friendSession != null && friendSession.RegionID != UUID.Zero) + if (friendSession != null && !friendSession.RegionID.IsZero()) { //m_log.DebugFormat("[FRIENDS]: Get region {0}", friendSession.RegionID); GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index cc189c0493..881215854b 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -506,7 +506,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { foreach (PresenceInfo p in presences) { - if (p.RegionID != UUID.Zero) + if (!p.RegionID.IsZero()) { upd = p; break; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 666a6f50f4..561bea48ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (folder == null || folder.Owner != remoteClient.AgentId) return; - if (transactionID != UUID.Zero && assetType != (byte)AssetType.Settings) + if (!transactionID.IsZero() && assetType != (byte)AssetType.Settings) { IAgentAssetTransactions agentTransactions = m_Scene.AgentTransactionsModule; if (agentTransactions != null) diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index e192911abe..855b594604 100755 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement m_userAccountService = s.UserAccountService; if(m_gridUserService == null) m_gridUserService = s.GridUserService; - if (s.RegionInfo.ScopeID != UUID.Zero) + if (!s.RegionInfo.ScopeID.IsZero()) m_scopeID = s.RegionInfo.ScopeID; } diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 6393102d6a..dacb69c53f 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -538,7 +538,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture UUID oldID = UpdatePart(part, asset.FullID); - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + if (!oldID.IsZero() && ((Disp & DISP_EXPIRE) != 0)) { if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 9c893772a3..0b3d18d2df 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -754,7 +754,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm return collection; } - bool itemIDNotZero = itemID != UUID.Zero; + bool itemIDNotZero = !itemID.IsZero(); foreach (ListenerInfo li in listeners) { if (!li.IsActive()) @@ -763,7 +763,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (itemIDNotZero && itemID != li.GetItemID()) continue; - if (li.GetID() != UUID.Zero && id != li.GetID()) + if (!li.GetID().IsZero() && id.NotEqual(li.GetID())) continue; if (li.GetName().Length > 0) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 270d1686a0..af17754529 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -712,7 +712,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (m_debug) m_log.DebugFormat("[ARCHIVER]: Placing object from OAR in scene at position {0}. ", pos.ToString()); - bool isTelehub = (sceneObject.UUID == oldTelehubUUID) && (oldTelehubUUID != UUID.Zero); + bool isTelehub = (sceneObject.UUID.Equals(oldTelehubUUID)) && (!oldTelehubUUID.IsZero()); // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned // on the same region server and multiple examples a single object archive to be imported @@ -752,7 +752,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (ignoredObjects > 0) m_log.WarnFormat("[ARCHIVER]: Ignored {0} possible out of bounds", ignoredObjects); - if (oldTelehubUUID != UUID.Zero) + if (!oldTelehubUUID.IsZero()) { m_log.WarnFormat("[ARCHIVER]: Telehub object not found: {0}", oldTelehubUUID); scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero; @@ -933,16 +933,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (parcel.IsGroupOwned) { - if (parcel.GroupID != UUID.Zero) - { - // In group-owned parcels, OwnerID=GroupID. This should already be the case, but let's make sure. - parcel.OwnerID = parcel.GroupID; - } - else + if (parcel.GroupID.IsZero()) { parcel.OwnerID = m_rootScene.RegionInfo.EstateSettings.EstateOwner; parcel.IsGroupOwned = false; } + else + { + // In group-owned parcels, OwnerID=GroupID. This should already be the case, but let's make sure. + parcel.OwnerID = parcel.GroupID; + } } else { diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index c91916d65f..4ed9cc301d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // propagate the change List regions = Scene.GetEstateRegions(estateID); UUID regionId = (regions.Count() > 0) ? regions.ElementAt(0) : UUID.Zero; - if (regionId != UUID.Zero) + if (!regionId.IsZero()) { OnEstateInfoChange?.Invoke(regionId); } @@ -320,7 +320,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // propagate the change List regions = Scene.GetEstateRegions(estateID); UUID regionId = (regions.Count() > 0) ? regions.ElementAt(0) : UUID.Zero; - if (regionId != UUID.Zero) + if (!regionId.IsZero()) { OnEstateInfoChange?.Invoke(regionId); } diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index ed5103724e..015b4f6ec5 100755 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -269,11 +269,11 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_landList.TryGetValue(local_id, out land)) { m_landGlobalIDs.Remove(land.LandData.GlobalID); - if (land.LandData.FakeID != UUID.Zero) + if (!land.LandData.FakeID.IsZero()) m_landFakeIDs.Remove(land.LandData.FakeID); land.LandData = newData; m_landGlobalIDs[newData.GlobalID] = local_id; - if (newData.FakeID != UUID.Zero) + if (!newData.FakeID.IsZero()) m_landFakeIDs[newData.FakeID] = local_id; } } @@ -852,7 +852,7 @@ namespace OpenSim.Region.CoreModules.World.Land } } - if(landGlobalID != UUID.Zero) + if(!landGlobalID.IsZero()) { m_scene.EventManager.TriggerLandObjectRemoved(landGlobalID); land.Clear(); @@ -2338,13 +2338,13 @@ namespace OpenSim.Region.CoreModules.World.Land return; bool validParcelOwner = false; - if (DefaultGodParcelOwner != UUID.Zero && m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, DefaultGodParcelOwner) != null) + if (!DefaultGodParcelOwner.IsZero() && m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, DefaultGodParcelOwner) != null) validParcelOwner = true; bool validParcelGroup = false; if (m_groupManager != null) { - if (DefaultGodParcelGroup != UUID.Zero && m_groupManager.GetGroupRecord(DefaultGodParcelGroup) != null) + if (!DefaultGodParcelGroup.IsZero() && m_groupManager.GetGroupRecord(DefaultGodParcelGroup) != null) validParcelGroup = true; } @@ -2583,7 +2583,7 @@ namespace OpenSim.Region.CoreModules.World.Land // Gather some data ulong gpowers = remoteClient.GetGroupPowers(land.LandData.GroupID); SceneObjectGroup telehub = null; - if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) + if (!m_scene.RegionInfo.RegionSettings.TelehubObject.IsZero()) // Does the telehub exist in the scene? telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject); diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index cf09fd6c29..92a09ca8d0 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -715,7 +715,7 @@ namespace OpenSim.Region.CoreModules.World.Land public bool HasGroupAccess(UUID avatar) { - if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) + if (!LandData.GroupID.IsZero() && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) { if (m_groupMemberCache.TryGetValue(avatar, out bool isMember)) { @@ -1635,16 +1635,15 @@ namespace OpenSim.Region.CoreModules.World.Land { if (obj.LocalId > 0) { - if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == LandData.OwnerID) + if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID.Equals(LandData.OwnerID)) { resultLocalIDs.Add(obj.LocalId); } - else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID == LandData.GroupID && LandData.GroupID != UUID.Zero) + else if (request_type == LandChannel.LAND_SELECT_OBJECTS_GROUP && obj.GroupID.Equals(LandData.GroupID) && !LandData.GroupID.IsZero()) { resultLocalIDs.Add(obj.LocalId); } - else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER && - obj.OwnerID != remote_client.AgentId) + else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER && obj.OwnerID.NotEqual(remote_client.AgentId)) { resultLocalIDs.Add(obj.LocalId); } @@ -1818,7 +1817,7 @@ namespace OpenSim.Region.CoreModules.World.Land } } } - else if (type == (uint)ObjectReturnType.Group && LandData.GroupID != UUID.Zero) + else if (type == (uint)ObjectReturnType.Group && !LandData.GroupID.IsZero()) { foreach (SceneObjectGroup obj in primsOverMe) { diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index 2a720db660..a6e603e855 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs @@ -218,7 +218,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (obj.OwnerID == landData.OwnerID) parcelCounts.Owner += partCount; - else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID) + else if (!landData.GroupID.IsZero() && obj.GroupID.Equals(landData.GroupID)) parcelCounts.Group += partCount; else parcelCounts.Others += partCount; diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 8f53c98b1b..dde3b05e3a 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -2099,7 +2099,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if(landdata.OwnerID == userID) return true; - if (landdata.IsGroupOwned && parcel.LandData.GroupID != UUID.Zero && + if (landdata.IsGroupOwned && !parcel.LandData.GroupID.IsZero() && IsGroupMember(landdata.GroupID, userID, (ulong)GroupPowers.AllowEditLand)) return true; diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index 6eee596f13..280d17a7bb 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs @@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap if (m_renderMeshes) { - if (omvPrim.Sculpt != null && omvPrim.Sculpt.SculptTexture != UUID.Zero) + if (omvPrim.Sculpt != null && !omvPrim.Sculpt.SculptTexture.IsZero()) { // Try fetchinng the asset AssetBase sculptAsset = m_scene.AssetService.Get(omvPrim.Sculpt.SculptTexture.ToString()); diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 035608d2e2..ff3e859df0 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1514,7 +1514,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } } - if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) + if (!m_scene.RegionInfo.RegionSettings.TelehubObject.IsZero()) { SceneObjectGroup sog = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject); if (sog != null) @@ -1572,7 +1572,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // remove old assets UUID lastID = m_scene.RegionInfo.RegionSettings.TerrainImageID; - if (lastID != UUID.Zero) + if (!lastID.IsZero()) { m_scene.AssetService.Delete(lastID.ToString()); m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Zero; @@ -1581,7 +1581,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } lastID = m_scene.RegionInfo.RegionSettings.ParcelImageID; - if (lastID != UUID.Zero) + if (!lastID.IsZero()) { m_scene.AssetService.Delete(lastID.ToString()); m_scene.RegionInfo.RegionSettings.ParcelImageID = UUID.Zero; diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 36bc5dd309..6f71f88fd4 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -189,7 +189,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation sequenceNums = new int[defaultSize]; objectIDs = new UUID[defaultSize]; - if (m_defaultAnimation.AnimID != UUID.Zero) + if (!m_defaultAnimation.AnimID.IsZero()) { animIDs[0] = m_defaultAnimation.AnimID; sequenceNums[0] = m_defaultAnimation.SequenceNum; diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index a491dce00a..478887404f 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; - if (animID != UUID.Zero) + if (!animID.IsZero()) { if (addRemove) m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero); @@ -201,14 +201,14 @@ namespace OpenSim.Region.Framework.Scenes.Animation // "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}", // anim, m_scenePresence.Name); - if (aoSitGndAnim != UUID.Zero) + if (!aoSitGndAnim.IsZero()) { avnChangeAnim(aoSitGndAnim, false, true); aoSitGndAnim = UUID.Zero; } UUID overridenAnim = m_scenePresence.Overrides.GetOverriddenAnimation(anim); - if (overridenAnim != UUID.Zero) + if (!overridenAnim.IsZero()) { if (anim == "SITGROUND") { @@ -284,7 +284,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation currentControlState = motionControlStates.sitted; return "SITGROUND"; } - if (m_scenePresence.ParentID != 0 || m_scenePresence.ParentUUID != UUID.Zero) + if (m_scenePresence.ParentID != 0 || !m_scenePresence.ParentUUID.IsZero()) { currentControlState = motionControlStates.sitted; return "SIT"; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 6353f9d481..f4d993173a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Scenes /// public bool AddInventoryItem(InventoryItemBase item, bool trigger) { - if (item.Folder != UUID.Zero && InventoryService.AddItem(item)) + if (!item.Folder.IsZero() && InventoryService.AddItem(item)) { int userlevel = 0; if (Permissions.IsGod(item.Owner)) @@ -191,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes if (trigger) EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel); - if (originalFolder != UUID.Zero) + if (!originalFolder.IsZero()) { // Tell the viewer that the item didn't go there ChangePlacement(item, f); @@ -1898,7 +1898,7 @@ namespace OpenSim.Region.Framework.Scenes // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the // case for updates uploded through UDP. Updates uploaded via a capability (e.g. a script update) // will not pass in a transaction ID in the update message. - if (transactionID != UUID.Zero && AgentTransactionsModule != null) + if (!transactionID.IsZero() && AgentTransactionsModule != null) { AgentTransactionsModule.HandleTaskItemUpdateFromTransaction( remoteClient, part, transactionID, currentItem); @@ -1999,10 +1999,10 @@ namespace OpenSim.Region.Framework.Scenes { SceneObjectPart partWhereRezzed; - if (itemBase.ID != UUID.Zero) - partWhereRezzed = RezScriptFromAgentInventory(remoteClient.AgentId, itemBase.ID, localID); - else + if (itemBase.ID.IsZero()) partWhereRezzed = RezNewScript(remoteClient.AgentId, itemBase); + else + partWhereRezzed = RezScriptFromAgentInventory(remoteClient.AgentId, itemBase.ID, localID); if (partWhereRezzed != null) partWhereRezzed.SendPropertiesToClient(remoteClient); @@ -2887,9 +2887,10 @@ namespace OpenSim.Region.Framework.Scenes void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List localIDs) { + if (!Permissions.IsGod(remoteClient.AgentId)) { - if (ownerID != UUID.Zero) + if (!ownerID.IsZero()) return; } @@ -2907,7 +2908,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectGroup sog in groups) { - if (ownerID != UUID.Zero) + if (!ownerID.IsZero()) { sog.SetOwnerId(ownerID); sog.SetGroup(groupID, remoteClient); diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 673a47a81d..a42d5c7b88 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -224,7 +224,7 @@ namespace OpenSim.Region.Framework.Scenes // XXX: Might be better to get rid of this special casing and have GetMembershipData return something // reasonable for a UUID.Zero group. - if (groupID != UUID.Zero) + if (!groupID.IsZero()) { GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index fa808b1236..9de6a36fa6 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2510,7 +2510,7 @@ namespace OpenSim.Region.Framework.Scenes } } - if (RayTargetID != UUID.Zero) + if (!RayTargetID.IsZero()) { SceneObjectPart target = GetSceneObjectPart(RayTargetID); @@ -5192,11 +5192,11 @@ Label_GroupsDone: if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) return true; - if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID)) + if ((part.OwnerID.Equals(parcel.LandData.OwnerID)) || Permissions.IsGod(part.OwnerID)) return true; if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) - && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID)) + && (!parcel.LandData.GroupID.IsZero()) && (parcel.LandData.GroupID.Equals(part.GroupID))) return true; } else @@ -6274,7 +6274,7 @@ Environment.Exit(1); if (!RegionInfo.EstateSettings.AllowDirectTeleport) { SceneObjectGroup telehub; - if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = GetSceneObjectGroup (RegionInfo.RegionSettings.TelehubObject)) != null && checkTeleHub) + if (!RegionInfo.RegionSettings.TelehubObject.IsZero() && (telehub = GetSceneObjectGroup (RegionInfo.RegionSettings.TelehubObject)) != null && checkTeleHub) { bool banned = true; bool validTelehub = false; @@ -6490,5 +6490,7 @@ Environment.Exit(1); return lastSource == sourceID; return false; } + + } } diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index c3c4cd0349..f219fb151f 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -679,7 +679,7 @@ namespace OpenSim.Region.Framework.Scenes protected internal void HandleUndo(IClientAPI remoteClient, UUID primId) { - if (primId != UUID.Zero) + if (!primId.IsZero()) { SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); if (part != null) @@ -689,7 +689,7 @@ namespace OpenSim.Region.Framework.Scenes protected internal void HandleRedo(IClientAPI remoteClient, UUID primId) { - if (primId != UUID.Zero) + if (!primId.IsZero()) { SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index f3d0bf2186..bb50e5b35e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Scenes // "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}", // item.Name, remoteClient.Name, localID); - UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; + UUID newItemId = copyItemID.IsZero() ? item.ID : copyItemID; SceneObjectPart part = GetPart(localID); if (part == null) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3fa7e5a38d..ca68786a04 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -910,7 +910,7 @@ namespace OpenSim.Region.Framework.Scenes if (av.IsChildAgent) { // avatar crossed do some extra cleanup - if (av.ParentUUID != UUID.Zero) + if (!av.ParentUUID.IsZero()) { av.ClearControls(); av.ParentPart = null; @@ -1479,7 +1479,7 @@ namespace OpenSim.Region.Framework.Scenes if (node.Attributes["UUID"] != null) { UUID itemid = new UUID(node.Attributes["UUID"].Value); - if (itemid != UUID.Zero) + if (!itemid.IsZero()) m_savedScriptState[itemid] = node.InnerXml; } } @@ -1510,7 +1510,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE OBJECT GROUP]: Found state for item ID {0} in object {1}", uuid, Name); UUID itemid = new UUID(uuid); - if (itemid != UUID.Zero) + if (!itemid.IsZero()) m_savedScriptState[itemid] = innerXml; } else diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 5704b055bc..57b85d8a74 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -1420,9 +1420,9 @@ namespace OpenSim.Region.Framework.Scenes invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); invString.AddNameValueLine("group_id",groupID.ToString()); - if(groupID != UUID.Zero && ownerID == groupID) + if(!groupID.IsZero() && ownerID.Equals(groupID)) { - invString.AddNameValueLine("owner_id", UUID.Zero.ToString()); + invString.AddNameValueLine("owner_id", UUID.ZeroString); invString.AddNameValueLine("group_owned","1"); } else diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index efb770f5af..d756ee30fb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.Framework.Scenes if (land != null) m_currentParcelHide = !land.LandData.SeeAVs; - if (m_previusParcelUUID != UUID.Zero || checksame) + if (!m_previusParcelUUID.IsZero() || checksame) ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, m_currentParcelHide, m_previusParcelHide, oldhide,checksame); } } @@ -1245,7 +1245,7 @@ namespace OpenSim.Region.Framework.Scenes // if ParentUUID is NOT UUID.Zero, we are looking to // be sat on an object that isn't there yet. Should // be treated as if sat. - if(ParentID == 0 && !SitGround && ParentUUID == UUID.Zero) // skip it if sitting + if(ParentID == 0 && !SitGround && ParentUUID.IsZero()) // skip it if sitting Animator.UpdateMovementAnimations(); } else @@ -1367,7 +1367,7 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE]: Upgrading child to root agent for {0} in {1}", // Name, m_scene.RegionInfo.RegionName); - if (ParentUUID != UUID.Zero) + if (!ParentUUID.IsZero()) { m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID); SceneObjectPart part = m_scene.GetSceneObjectPart(ParentUUID); @@ -3425,7 +3425,7 @@ namespace OpenSim.Region.Framework.Scenes //look for prims with explicit sit targets that are available foreach (SceneObjectPart part in partArray) { - if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero && part.SitActiveRange >= 0) + if (part.IsSitTargetSet && part.SitTargetAvatar.IsZero() && part.SitActiveRange >= 0) { //switch the target to this prim return part; @@ -3460,7 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes if (PhysicsActor != null) m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; - if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero) + if (part.IsSitTargetSet && part.SitTargetAvatar.IsZero()) { offset = part.SitTargetPosition; sitOrientation = part.SitTargetOrientation; @@ -4683,7 +4683,7 @@ namespace OpenSim.Region.Framework.Scenes // Also don't do this while sat, sitting avatars cross with the // object they sit on. ParentUUID denoted a pending sit, don't // interfere with it. - if (ParentID != 0 || PhysicsActor == null || ParentUUID != UUID.Zero) + if (ParentID != 0 || PhysicsActor == null || !ParentUUID.IsZero()) return; Vector3 pos2 = AbsolutePosition; @@ -4701,7 +4701,7 @@ namespace OpenSim.Region.Framework.Scenes if (Scene.PositionIsInCurrentRegion(pos2)) return; - if (!CrossToNewRegion() && m_requestedSitTargetUUID == UUID.Zero) + if (!CrossToNewRegion() && m_requestedSitTargetUUID.IsZero()) { // we don't have entity transfer module Vector3 pos = AbsolutePosition; @@ -4726,7 +4726,7 @@ namespace OpenSim.Region.Framework.Scenes public void CrossToNewRegionFail() { - if (m_requestedSitTargetUUID == UUID.Zero) + if (m_requestedSitTargetUUID.IsZero()) { bool isFlying = Flying; RemoveFromPhysicalScene(); @@ -6214,7 +6214,7 @@ namespace OpenSim.Region.Framework.Scenes // first check telehub UUID TelehubObjectID = m_scene.RegionInfo.RegionSettings.TelehubObject; - if ( TelehubObjectID != UUID.Zero) + if ( !TelehubObjectID.IsZero()) { SceneObjectGroup telehubSOG = m_scene.GetSceneObjectGroup(TelehubObjectID); if(telehubSOG != null) @@ -6428,7 +6428,7 @@ namespace OpenSim.Region.Framework.Scenes return false; SceneObjectGroup telehub = null; - if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject)) != null) + if (!m_scene.RegionInfo.RegionSettings.TelehubObject.IsZero() && (telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject)) != null) { if (!m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) { @@ -6485,7 +6485,7 @@ namespace OpenSim.Region.Framework.Scenes if (!m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) { SceneObjectGroup telehub = null; - if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero && (telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject)) != null) + if (!m_scene.RegionInfo.RegionSettings.TelehubObject.IsZero() && (telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject)) != null) { if(CheckAndAdjustTelehub(telehub, ref pos, ref positionChanged)) return true; @@ -6894,7 +6894,7 @@ namespace OpenSim.Region.Framework.Scenes // now on a private parcel allpresences = m_scene.GetScenePresences(); - if (previusParcelHide && previusParcelID != UUID.Zero) + if (previusParcelHide && !previusParcelID.IsZero()) { foreach (ScenePresence p in allpresences) { @@ -6943,7 +6943,7 @@ namespace OpenSim.Region.Framework.Scenes else { // now on public parcel - if (previusParcelHide && previusParcelID != UUID.Zero) + if (previusParcelHide && !previusParcelID.IsZero()) { // was on private area allpresences = m_scene.GetScenePresences(); diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 74aa326575..a9ac3820c3 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -401,15 +401,14 @@ namespace OpenSim.Region.Framework.Scenes } } - if (part.Shape.SculptTexture != UUID.Zero) + if (!part.Shape.SculptTexture.IsZero()) GatheredUuids[part.Shape.SculptTexture] = (sbyte)AssetType.Texture; - if (part.Shape.ProjectionTextureUUID != UUID.Zero) + if (!part.Shape.ProjectionTextureUUID.IsZero()) GatheredUuids[part.Shape.ProjectionTextureUUID] = (sbyte)AssetType.Texture; UUID collisionSound = part.CollisionSound; - if ( collisionSound != UUID.Zero && - collisionSound != part.invalidCollisionSoundUUID) + if ( !collisionSound.IsZero() && collisionSound.NotEqual(part.invalidCollisionSoundUUID)) GatheredUuids[collisionSound] = (sbyte)AssetType.Sound; if (part.ParticleSystem.Length > 0) @@ -417,7 +416,7 @@ namespace OpenSim.Region.Framework.Scenes try { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(part.ParticleSystem, 0); - if (ps.Texture != UUID.Zero) + if (!ps.Texture.IsZero()) GatheredUuids[ps.Texture] = (sbyte)AssetType.Texture; } catch (Exception) @@ -440,7 +439,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach(UUID id in part.Animations.Keys) { - if(id != UUID.Zero && + if(!id.IsZero() && !ToSkip.Contains(id) && !FailedUUIDs.Contains(id)) { @@ -668,14 +667,14 @@ namespace OpenSim.Region.Framework.Scenes private void RecordTextureEntryAssetUuids(Primitive.TextureEntryFace texture) { UUID teid = texture.TextureID; - if (teid != UUID.Zero && + if (!teid.IsZero() && !ToSkip.Contains(teid) && !FailedUUIDs.Contains(teid)) { GatheredUuids[teid] = (sbyte)AssetType.Texture; } - if (texture.MaterialID != UUID.Zero) + if (!texture.MaterialID.IsZero()) AddForInspection(texture.MaterialID); } @@ -720,7 +719,7 @@ namespace OpenSim.Region.Framework.Scenes if (mat.ContainsKey("NormMap")) { UUID normalMapId = mat["NormMap"].AsUUID(); - if (normalMapId != UUID.Zero) + if (!normalMapId.IsZero()) { GatheredUuids[normalMapId] = (sbyte)AssetType.Texture; //m_log.Info("[UUID Gatherer]: found normal map ID: " + normalMapId.ToString()); @@ -729,7 +728,7 @@ namespace OpenSim.Region.Framework.Scenes if (mat.ContainsKey("SpecMap")) { UUID specularMapId = mat["SpecMap"].AsUUID(); - if (specularMapId != UUID.Zero) + if (!specularMapId.IsZero()) { GatheredUuids[specularMapId] = (sbyte)AssetType.Texture; //m_log.Info("[UUID Gatherer]: found specular map ID: " + specularMapId.ToString()); @@ -857,7 +856,7 @@ namespace OpenSim.Region.Framework.Scenes if(texparts.Length <2 || texparts[1].Length < 36) continue; texparts[1].SelfTrim(wearableSeps); - if (UUID.TryParse(texparts[1].ToString(), out UUID id) && id != UUID.Zero) + if (UUID.TryParse(texparts[1].ToString(), out UUID id) && !id.IsZero()) GatheredUuids[id] = (sbyte)AssetType.Texture; } } @@ -1028,21 +1027,21 @@ namespace OpenSim.Region.Framework.Scenes { if (!nodeName.EndsWith((byte)'d')) continue; - if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero) + if (TryGetxmlUUIDValue(data, out UUID id) && !id.IsZero()) GatheredUuids[id] = (sbyte)AssetType.Sound; } else if (nodeName.StartsWith(SoundIDB)) { if (nodeName.EndsWith((byte)'/')) continue; - if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero) + if (TryGetxmlUUIDValue(data, out UUID id) && !id.IsZero()) GatheredUuids[id] = (sbyte)AssetType.Sound; } else if (nodeName.StartsWith(SculptTextureB)) { if (nodeName.EndsWith((byte)'/')) continue; - if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero) + if (TryGetxmlUUIDValue(data, out UUID id) && !id.IsZero()) GatheredUuids[id] = (sbyte)AssetType.Texture; // can be mesh but no prob } else if (nodeName.StartsWith(ExtraParamsB)) @@ -1057,7 +1056,7 @@ namespace OpenSim.Region.Framework.Scenes PrimitiveBaseShape ps = new PrimitiveBaseShape(); ps.ReadInExtraParamsBytes(exbytes); UUID teid = ps.ProjectionTextureUUID; - if (teid != UUID.Zero && + if (!teid.IsZero() && !ToSkip.Contains(teid) && !FailedUUIDs.Contains(teid)) { @@ -1089,7 +1088,7 @@ namespace OpenSim.Region.Framework.Scenes { Primitive.ParticleSystem ps = new Primitive.ParticleSystem(psbytes, 0); UUID teid = ps.Texture; - if (teid != UUID.Zero && + if (!teid.IsZero() && !ToSkip.Contains(teid) && !FailedUUIDs.Contains(teid)) { @@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Framework.Scenes { if (nodeName.StartsWith(AssetIDB)) { - if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero) + if (TryGetxmlUUIDValue(data, out UUID id) && !id.IsZero()) AddForInspection(id); } else if (nodeName.StartsWith(endTaskInventoryB)) @@ -1192,7 +1191,7 @@ namespace OpenSim.Region.Framework.Scenes return; if (!osdata.ReadLine(out id)) // uuid return; - if (osUTF8Slice.TryParseUUID(id, out uid) && uid != UUID.Zero) + if (osUTF8Slice.TryParseUUID(id, out uid) && !uid.IsZero()) GatheredUuids[uid] = type == 0 ? (sbyte)AssetType.Animation : (sbyte)AssetType.Sound; if (!osdata.SkipLine()) // flags return; @@ -1229,7 +1228,7 @@ namespace OpenSim.Region.Framework.Scenes if(indx < 0) continue; osUTF8Slice tmp = data.SubUTF8(0, indx); - if(osUTF8Slice.TryParseUUID(tmp, out UUID id) && id != UUID.Zero) + if(osUTF8Slice.TryParseUUID(tmp, out UUID id) && !id.IsZero()) GatheredUuids[id] = (sbyte)AssetType.Texture; data.SubUTF8Self(indx + 1); } diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index a612268691..14ab65c161 100755 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -527,7 +527,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return; } - if(itemID != UUID.Zero && ownerID != UUID.Zero) + if(!itemID.IsZero() && !ownerID.IsZero()) { item = scene.InventoryService.GetItem(ownerID, itemID); if (item != null) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 052427adbf..7933ef70ad 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -348,7 +348,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName) { Hashtable param = new Hashtable(); - if (GroupID != UUID.Zero) + if (!GroupID.IsZero()) { param["GroupID"] = GroupID.ToString(); } diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs index 981850f0c8..71d7594ea4 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs @@ -61,7 +61,6 @@ namespace OpenSim.Region.DataSnapshot public void OnGetSnapshot(IOSHttpRequest req, IOSHttpResponse resp) { - Hashtable reply = new Hashtable(); string reqtag; if(req.QueryAsDictionary.TryGetValue("region", out string snapObj) && !string.IsNullOrWhiteSpace(snapObj)) reqtag = snapObj + req.RemoteIPEndPoint.Address.ToString(); diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs index 8e6a30e9b3..40e32747a0 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs @@ -222,7 +222,7 @@ namespace OpenSim.Region.DataSnapshot.Providers //TODO: figure how to figure out teleport system landData.landingType //land texture snapshot uuid - if (parcel.SnapshotID != UUID.Zero) + if (!parcel.SnapshotID.IsZero()) { XmlNode textureuuid = nodeFactory.CreateNode(XmlNodeType.Element, "image", ""); textureuuid.InnerText = parcel.SnapshotID.ToString(); @@ -232,7 +232,7 @@ namespace OpenSim.Region.DataSnapshot.Providers string groupName = String.Empty; //attached user and group - if (parcel.GroupID != UUID.Zero) + if (!parcel.GroupID.IsZero()) { XmlNode groupblock = nodeFactory.CreateNode(XmlNodeType.Element, "group", ""); XmlNode groupuuid = nodeFactory.CreateNode(XmlNodeType.Element, "groupuuid", ""); diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/ObjectSnapshot.cs index 4546b2012e..f70feb7271 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/ObjectSnapshot.cs @@ -219,9 +219,9 @@ namespace OpenSim.Region.DataSnapshot.Providers if (textures != null) { if (textures.DefaultTexture != null && - textures.DefaultTexture.TextureID != UUID.Zero && - textures.DefaultTexture.TextureID != m_DefaultImage && - textures.DefaultTexture.TextureID != m_BlankImage && + !textures.DefaultTexture.TextureID.IsZero() && + textures.DefaultTexture.TextureID.NotEqual(m_DefaultImage) && + textures.DefaultTexture.TextureID.NotEqual(m_BlankImage) && textures.DefaultTexture.RGBA.A < 50f) { counts[textures.DefaultTexture.TextureID] = 8; diff --git a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs index b498599107..6bf303ebd9 100644 --- a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs @@ -478,7 +478,7 @@ namespace OpenSim.Region.UserStatistics lock (m_sessions) { - if (agentID != UUID.Zero) + if (!agentID.IsZero()) { if (!m_sessions.ContainsKey(agentID)) { diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index f543d02eeb..74e7ac04cc 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -458,7 +458,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule if (client != null) { - if (soundId != UUID.Zero) + if (!soundId.IsZero()) client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0); client.SendBlueBoxMessage(UUID.Zero, "", text); diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index abc5dc6d66..59e6c4352d 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -176,7 +176,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC try { - if (agentID == UUID.Zero) + if (agentID.IsZero()) npcAvatar = new NPCAvatar(firstname, lastname, position, owner, senseAsAgent, scene); else @@ -477,8 +477,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC /// true if they do, false if they don't. private bool CheckPermissions(NPCAvatar av, UUID callerID) { - return callerID == UUID.Zero || av.OwnerID == UUID.Zero || - av.OwnerID == callerID || av.AgentId == callerID; + return callerID.IsZero() || av.OwnerID.IsZero() || + av.OwnerID.Equals(callerID) || av.AgentId.Equals(callerID); } } } diff --git a/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs index de39d0ed07..fd9c73b84a 100644 --- a/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs @@ -636,7 +636,7 @@ namespace OpenSim.Region.PhysicsModule.Meshing Image idata = null; string decodedSculptFileName = ""; - if (cacheSculptMaps && primShape.SculptTexture != UUID.Zero) + if (cacheSculptMaps && !primShape.SculptTexture.IsZero()) { decodedSculptFileName = System.IO.Path.Combine(decodedSculptMapPath, "smap_" + primShape.SculptTexture.ToString()); try diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index f63bf2cc8d..7c9f3b45cf 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs @@ -3163,7 +3163,7 @@ Console.WriteLine(" JointCreateFixed"); private void CheckMeshAsset() { - if (_pbs.SculptEntry && !m_assetFailed && _pbs.SculptTexture != UUID.Zero) + if (_pbs.SculptEntry && !m_assetFailed && !_pbs.SculptTexture.IsZero()) { m_assetFailed = true; Util.FireAndForget(delegate diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index f7eff077b7..46d388b02b 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs @@ -440,7 +440,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (pbs.SculptEntry) { - if (pbs.SculptTexture != null && pbs.SculptTexture != UUID.Zero) + if (pbs.SculptTexture != null && !pbs.SculptTexture.IsZero()) { repData.assetID = pbs.SculptTexture; repData.meshState = MeshState.needAsset; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1a6355c94f..10456ca61b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -620,10 +620,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetScriptState(string name) { - UUID item; + UUID item = GetScriptByName(name); - - if ((item = GetScriptByName(name)) != UUID.Zero) + if (!item.IsZero()) { return m_ScriptEngine.GetScriptState(item) ?1:0; } @@ -638,15 +637,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetScriptState(string name, int run) { - UUID item; + UUID item = GetScriptByName(name); // These functions are supposed to be robust, // so get the state one step at a time. - if ((item = GetScriptByName(name)) != UUID.Zero) + if (!item.IsZero()) { - m_ScriptEngine.SetScriptState(item, run == 0 ? false : true, item == m_item.ItemID); + m_ScriptEngine.SetScriptState(item, run == 0 ? false : true, item.Equals(m_item.ItemID)); } else { @@ -3737,7 +3736,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTakeControls(int controls, int accept, int pass_on) { - if (m_item.PermsGranter != UUID.Zero) + if (!m_item.PermsGranter.IsZero()) { ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); @@ -3755,7 +3754,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llReleaseControls() { - if (m_item.PermsGranter != UUID.Zero) + if (!m_item.PermsGranter.IsZero()) { ScenePresence presence = World.GetScenePresence(m_item.PermsGranter); @@ -4906,12 +4905,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key llRequestAgentData(string id, int data) { - - if (UUID.TryParse(id, out UUID uuid) && uuid != UUID.Zero) + if (UUID.TryParse(id, out UUID uuid) && !uuid.IsZero()) { - if (uuid == UUID.Zero) - return string.Empty; - //pre process fast local avatars switch(data) { @@ -4960,7 +4955,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { foreach (PresenceInfo p in pinfos) { - if (p.RegionID != UUID.Zero) + if (!p.RegionID.IsZero()) { pinfo = p; } @@ -5096,7 +5091,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llTeleportAgent(string agent, string destination, LSL_Vector targetPos, LSL_Vector targetLookAt) { // If attached using llAttachToAvatarTemp, cowardly refuse - if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero) + if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID.IsZero()) return; if (UUID.TryParse(agent, out UUID agentId)) @@ -5242,14 +5237,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // TODO: Parameter check logic required. UUID soundId = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound); - if(soundId != UUID.Zero) + if(soundId.IsZero()) + m_host.CollisionSoundType = -1; + else { m_host.CollisionSound = soundId; m_host.CollisionSoundVolume = (float)impact_volume; m_host.CollisionSoundType = 1; } - else - m_host.CollisionSoundType = -1; m_host.aggregateScriptEvents(); } @@ -6807,7 +6802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (userManager != null) { userID = userManager.GetUserIdByName(firstName, lastName); - if (userID != UUID.Zero) + if (!userID.IsZero()) reply = userID.ToString(); } } @@ -6822,7 +6817,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string hgfirst = firstName + "." + lastName; string hglast = "@" + server; userID = userManager.GetUserIdByName(hgfirst, hglast); - if (userID != UUID.Zero) + if (!userID.IsZero()) { notfound = false; reply = userID.ToString(); @@ -6837,7 +6832,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (userConnection != null) { userID = userConnection.GetUUID(firstName, lastName); - if (userID != UUID.Zero) + if (!userID.IsZero()) { if (userManager != null) userManager.AddUser(userID, firstName, lastName, url); @@ -11747,7 +11742,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if(m_materialsModule != null) matID = texface.MaterialID; - if(matID != UUID.Zero) + if(!matID.IsZero()) { FaceMaterial mat = m_materialsModule.GetMaterial(matID); if(mat != null) @@ -14223,10 +14218,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (status == HttpInitialRequestStatus.DISALLOWED_BY_FILTER) Error("llHttpRequest", string.Format("Request to {0} disallowed by filter", url)); - if (reqID != UUID.Zero) - return reqID.ToString(); - else - return ""; + return reqID.IsZero() ? "" : reqID.ToString(); } @@ -15235,7 +15227,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetDisplayName(LSL_Key id) { - if (UUID.TryParse(id, out UUID key) && key != UUID.Zero) + if (UUID.TryParse(id, out UUID key) && !key.IsZero()) { ScenePresence presence = World.GetScenePresence(key); if (presence != null) @@ -17448,7 +17440,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence == null) return; - if (m_item.PermsGranter == UUID.Zero) + if (m_item.PermsGranter.IsZero()) { llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations"); return; @@ -17492,7 +17484,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence == null) return String.Empty; - if (m_item.PermsGranter == UUID.Zero) + if (m_item.PermsGranter.IsZero()) { llShout(ScriptBaseClass.DEBUG_CHANNEL, "No permission to override animations"); return String.Empty; @@ -17521,7 +17513,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } UUID animID = presence.GetAnimationOverride(state); - if (animID == UUID.Zero) + if (animID.IsZero()) return animState; foreach (KeyValuePair kvp in DefaultAvatarAnimations.AnimsUUIDbyName) @@ -18591,5 +18583,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return line; } + } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e6cb7e3bbe..c16b6dc37e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -407,7 +407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (UUID.TryParse(current, out UUID uuid)) { - if (uuid != UUID.Zero) + if (!uuid.IsZero()) { if (perms.AllowedOwners == null) perms.AllowedOwners = new List(); @@ -435,7 +435,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string current = id.Trim(); if (UUID.TryParse(current, out UUID uuid)) { - if (uuid != UUID.Zero) + if (!uuid.IsZero()) { if (perms.AllowedCreators == null) perms.AllowedCreators = new List(); @@ -497,7 +497,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((functionControl & AllowedControlFlags.PARCEL_GROUP_MEMBER) != 0) { ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); - if (land.LandData.GroupID == m_item.GroupID && land.LandData.GroupID != UUID.Zero) + if (land.LandData.GroupID.Equals(m_item.GroupID) && !land.LandData.GroupID.IsZero()) { return String.Empty; } @@ -2310,7 +2310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { UUID assetID = CacheNotecard(notecardNameOrUuid); - if (assetID != UUID.Zero) + if (!assetID.IsZero()) { StringBuilder notecardData = new StringBuilder(); @@ -2495,7 +2495,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // Check local grid UUID userID = userManager.GetUserIdByName(firstname, lastname); - if (userID != UUID.Zero) + if (!userID.IsZero()) return userID.ToString(); // HG ? @@ -2508,7 +2508,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (userConnection != null) { userID = userConnection.GetUUID(realFirstName, realLastName); - if (userID != UUID.Zero) + if (!userID.IsZero()) { userManager.AddUser(userID, realFirstName, realLastName, serverURI); return userID.ToString(); @@ -2952,7 +2952,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api senseAsAgent = false; } - if(hostGroupID && m_host.GroupID != UUID.Zero) + if(hostGroupID && !m_host.GroupID.IsZero()) { if (m_groupsModule != null) { @@ -3116,7 +3116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (UUID.TryParse(npc.m_string, out UUID npcId)) { UUID owner = npcModule.GetOwner(npcId); - if (owner != UUID.Zero) + if (!owner.IsZero()) return new LSL_Key(owner.ToString()); else return npc; @@ -4697,14 +4697,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } // TODO: Parameter check logic required. UUID soundId = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound); - if(soundId != UUID.Zero) + if(soundId.IsZero()) + m_host.CollisionSoundType = -1; + else { m_host.CollisionSound = soundId; m_host.CollisionSoundVolume = (float)impact_volume; m_host.CollisionSoundType = 1; } - else - m_host.CollisionSoundType = -1; m_host.aggregateScriptEvents(); } @@ -6053,7 +6053,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!UUID.TryParse(objkey, out UUID obj)) return -4; - if(obj != UUID.Zero) + if(!obj.IsZero()) { ScenePresence objSP = World.GetScenePresence(obj); if(objSP == null) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index f8b73220a8..528bf7df42 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -326,7 +326,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins // If this is an object sense by key try to get it directly // rather than getting a list to scan through - if (ts.keyID != UUID.Zero) + if (!ts.keyID.IsZero()) { m_CmdManager.m_ScriptEngine.World.Entities.TryGetValue(ts.keyID, out EntityBase e); if (e == null) @@ -624,7 +624,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins // If this is an avatar sense by key try to get them directly // rather than getting a list to scan through - if (ts.keyID != UUID.Zero) + if (!ts.keyID.IsZero()) { // Try direct lookup by UUID if (!m_CmdManager.m_ScriptEngine.World.TryGetScenePresence(ts.keyID, out ScenePresence sp)) diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs index a771443e16..9c5c0ac7cd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs @@ -172,7 +172,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if (instance.ScriptTask != null) { - if (instance.ScriptTask.PermsMask != 0 && instance.ScriptTask.PermsGranter != UUID.Zero) + if (instance.ScriptTask.PermsMask != 0 && !instance.ScriptTask.PermsGranter.IsZero()) { XmlNode permissions = xmldoc.CreateElement("", "Permissions", ""); XmlAttribute granter = xmldoc.CreateAttribute("", "granter", ""); @@ -369,7 +369,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { UUID granter = new UUID(); UUID.TryParse(tmpPerm, out granter); - if (granter != UUID.Zero) + if (!granter.IsZero()) { instance.ScriptTask.PermsMask = mask; instance.ScriptTask.PermsGranter = granter; diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index b09849e4f1..9ab6add071 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine continue; } - if (itemId != UUID.Zero) + if (!itemId.IsZero()) { IScriptInstance instance = GetInstance(itemId); if (instance == null) diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstCtor.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstCtor.cs index e82a8af87b..5521563053 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstCtor.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstCtor.cs @@ -851,7 +851,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine { UUID granter = new UUID(); UUID.TryParse(tmpPerm, out granter); - if (granter != UUID.Zero) + if (!granter.IsZero()) { permsMask = mask; permsGranter = granter; diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index 8f3f13e5c2..cc869584b1 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs @@ -76,22 +76,22 @@ namespace OpenSim.Server.Handlers.Login { // Debug code to show exactly what login parameters the viewer is sending us. // TODO: Extract into a method that can be generally applied if one doesn't already exist. -// foreach (string key in requestData.Keys) -// { -// object value = requestData[key]; -// Console.WriteLine("{0}:{1}", key, value); -// if (value is ArrayList) -// { -// ICollection col = value as ICollection; -// foreach (object item in col) -// Console.WriteLine(" {0}", item); -// } -// } + // foreach (string key in requestData.Keys) + // { + // object value = requestData[key]; + // Console.WriteLine("{0}:{1}", key, value); + // if (value is ArrayList) + // { + // ICollection col = value as ICollection; + // foreach (object item in col) + // Console.WriteLine(" {0}", item); + // } + // } if (requestData.ContainsKey("first") && requestData["first"] != null && requestData.ContainsKey("last") && requestData["last"] != null && ( (requestData.ContainsKey("passwd") && requestData["passwd"] != null) || - (!requestData.ContainsKey("passwd") && requestData.ContainsKey("web_login_key") && requestData["web_login_key"] != null && requestData["web_login_key"].ToString() != UUID.Zero.ToString()) + (!requestData.ContainsKey("passwd") && requestData.ContainsKey("web_login_key") && requestData["web_login_key"] != null && requestData["web_login_key"].ToString() != UUID.ZeroString) )) { string first = requestData["first"].ToString(); @@ -189,7 +189,6 @@ namespace OpenSim.Server.Handlers.Login Hashtable failHash = new Hashtable(); failHash["success"] = "false"; failResponse.Value = failHash; - return failResponse; } diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index cb15fc0eff..43da95b72b 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -215,7 +215,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { Hashtable hash = new Hashtable(); hash["region_uuid"] = regionID.ToString(); - if (agentID != UUID.Zero) + if (!agentID.IsZero()) { hash["agent_id"] = agentID.ToString(); if (agentHomeURI != null) diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs index 174099fd01..7e8dc1a9fc 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs @@ -211,7 +211,7 @@ namespace OpenSim.Services.Connectors UUID uuid = UUID.Zero; foreach(string id in IDs) { - if(UUID.TryParse(id, out uuid) && uuid != UUID.Zero) + if(UUID.TryParse(id, out uuid) && !uuid.IsZero()) accs.Add(GetUserAccount(scopeID,uuid)); } diff --git a/OpenSim/Services/HypergridService/HGFriendsService.cs b/OpenSim/Services/HypergridService/HGFriendsService.cs index d3b4f18283..0a5575264f 100644 --- a/OpenSim/Services/HypergridService/HGFriendsService.cs +++ b/OpenSim/Services/HypergridService/HGFriendsService.cs @@ -260,7 +260,7 @@ namespace OpenSim.Services.HypergridService { PresenceInfo friendSession = null; foreach (PresenceInfo pinfo in friendSessions) - if (pinfo.RegionID != UUID.Zero) // let's guard against traveling agents + if (!pinfo.RegionID.IsZero()) // let's guard against traveling agents { friendSession = pinfo; break; diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index bafd7773fe..6352bab11a 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -211,7 +211,7 @@ namespace OpenSim.Services.HypergridService GridUserInfo uinfo = m_GridUserService.GetGridUserInfo(userID.ToString()); if (uinfo != null) { - if (uinfo.HomeRegionID != UUID.Zero) + if (!uinfo.HomeRegionID.IsZero()) { home = m_GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); position = uinfo.HomePosition; @@ -459,7 +459,7 @@ namespace OpenSim.Services.HypergridService { PresenceInfo friendSession = null; foreach (PresenceInfo pinfo in friendSessions) - if (pinfo.RegionID != UUID.Zero) // let's guard against traveling agents + if (!pinfo.RegionID.IsZero()) // let's guard against traveling agents { friendSession = pinfo; break; diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index ef8d1583c9..58115c1268 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -180,7 +180,7 @@ namespace OpenSim.Services.Interfaces Dictionary> atts = new Dictionary>(); foreach (AvatarAttachment attach in attachments) { - if (attach.ItemID != UUID.Zero) + if (!attach.ItemID.IsZero()) { if (!atts.ContainsKey(attach.AttachPoint)) atts[attach.AttachPoint] = new List(); diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 3c8e59d633..8982810201 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -441,7 +441,7 @@ namespace OpenSim.Services.Interfaces if ((object)region == null) return false; // Return true if the non-zero UUIDs are equal: - return (RegionID != UUID.Zero) && RegionID.Equals(region.RegionID); + return (!RegionID.IsZero()) && RegionID.Equals(region.RegionID); } public override bool Equals(Object obj) diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 5dfefc62dd..115e0d95da 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -768,7 +768,7 @@ namespace OpenSim.Services.InventoryService UUID parentFolder = folder[0].parentFolderID; - while (parentFolder != UUID.Zero) + while (!parentFolder.IsZero()) { XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()}); if (parent.Length < 1) @@ -795,7 +795,7 @@ namespace OpenSim.Services.InventoryService UUID parentFolder = folder[0].parentFolderID; - while (parentFolder != UUID.Zero) + while (!parentFolder.IsZero()) { XInventoryFolder[] parent = m_Database.GetFolders(new string[] { "folderID" }, new string[] { parentFolder.ToString() }); if (parent.Length < 1) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 3b4f215958..e7b39adae4 100755 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -375,19 +375,19 @@ namespace OpenSim.Services.LLLoginService // If a scope id is requested, check that the account is in // that scope, or unscoped. // - if (scopeID != UUID.Zero) + if (scopeID.IsZero()) { - if (account.ScopeID != scopeID && account.ScopeID != UUID.Zero) + scopeID = account.ScopeID; + } + else + { + if (account.ScopeID.NotEqual(scopeID) && !account.ScopeID.IsZero()) { m_log.InfoFormat( "[LLOGIN SERVICE]: Login failed, reason: user {0} {1} not found", firstName, lastName); return LLFailedLoginResponse.UserProblem; } } - else - { - scopeID = account.ScopeID; - } // // Authenticate this user @@ -411,7 +411,7 @@ namespace OpenSim.Services.LLLoginService if(!m_allowDuplicatePresences) { - if(guinfo != null && guinfo.Online && guinfo.LastRegionID != UUID.Zero) + if(guinfo != null && guinfo.Online && !guinfo.LastRegionID.IsZero()) { if(SendAgentGodKillToRegion(scopeID, account.PrincipalID, guinfo)) { diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 9e104cf73b..494ae35ecc 100755 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -156,7 +156,7 @@ namespace OpenSim.Services.UserAccountService UserAccountData[] d; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) { d = m_Database.Get( new string[] { "ScopeID", "FirstName", "LastName" }, @@ -234,7 +234,7 @@ namespace OpenSim.Services.UserAccountService { UserAccountData[] d; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) { d = m_Database.Get( new string[] { "ScopeID", "Email" }, @@ -263,7 +263,7 @@ namespace OpenSim.Services.UserAccountService { UserAccountData[] d; - if (scopeID != UUID.Zero) + if (!scopeID.IsZero()) { d = m_Database.Get( new string[] { "ScopeID", "PrincipalID" }, @@ -903,7 +903,7 @@ namespace OpenSim.Services.UserAccountService for(int j = 0; j < basewearable.Count; j++) { wearable = basewearable[j]; - if (wearable.ItemID != UUID.Zero) + if (!wearable.ItemID.IsZero()) { m_log.DebugFormat("[XXX]: Getting item {0} from avie {1} for {2} {3}", wearable.ItemID, source, i, j); @@ -970,7 +970,7 @@ namespace OpenSim.Services.UserAccountService int attachpoint = attachment.AttachPoint; UUID itemID = attachment.ItemID; - if (itemID != UUID.Zero) + if (!itemID.IsZero()) { // Get inventory item and copy it InventoryItemBase item = m_InventoryService.GetItem(source, itemID);