!= UUID.Zero is slow

This commit is contained in:
UbitUmarov
2022-01-09 02:28:51 +00:00
parent 7e0fc95c3a
commit da928d6099
78 changed files with 254 additions and 263 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -224,7 +224,7 @@ namespace OpenSim.Groups
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["AgentID"] = AgentID;
if (GroupID != UUID.Zero)
if (!GroupID.IsZero())
sendData["GroupID"] = GroupID.ToString();
sendData["RequestingAgentID"] = RequestingAgentID;
Dictionary<string, object> ret = MakeRequest("GETMEMBERSHIP", sendData);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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

View File

@@ -2873,7 +2873,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
for (int i = 0; i<wearables.Length; i++)
{
wearable = wearables[i];
if (wearable[0].ItemID != UUID.Zero)
if (!wearable[0].ItemID.IsZero())
{
// Get inventory item and copy it
InventoryItemBase item = inventoryService.GetItem(source, wearable[0].ItemID);
@@ -2926,7 +2926,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
int attachpoint = attachment.AttachPoint;
UUID itemID = attachment.ItemID;
if (itemID != UUID.Zero)
if (!itemID.IsZero())
{
// Get inventory item and copy it
InventoryItemBase item = inventoryService.GetItem(source, itemID);

View File

@@ -70,16 +70,16 @@ namespace OpenSim.Capabilities.Handlers
InventoryItemBase[] items = null;
if (m_agentID != UUID.Zero)
{
items = m_inventoryService.GetMultipleItems(m_agentID, itemIDs);
}
else
if (m_agentID.IsZero())
{
items = new InventoryItemBase[itemsRequested.Count];
foreach (UUID id in itemIDs)
items[i++] = m_inventoryService.GetItem(UUID.Zero, id);
}
else
{
items = m_inventoryService.GetMultipleItems(m_agentID, itemIDs);
}
osUTF8 lsl = LLSDxmlEncode2.Start(4096);
LLSDxmlEncode2.AddMap(lsl);

View File

@@ -67,7 +67,7 @@ namespace OpenSim.Data.MySQL
public List<RegionData> 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<RegionData> 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))

View File

@@ -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"];

View File

@@ -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());

View File

@@ -99,7 +99,7 @@ namespace OpenSim.Data.PGSQL
public List<RegionData> 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<RegionData> 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<RegionData> 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<RegionData> 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))

View File

@@ -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"];

View File

@@ -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());

View File

@@ -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}",

View File

@@ -205,7 +205,7 @@ namespace OpenSim.Framework
}
}
if (itemID != UUID.Zero)
if (!itemID.IsZero())
{
m_ids.Remove(itemID);
m_items.Remove(itemID);

View File

@@ -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;

View File

@@ -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)

View File

@@ -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())

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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"))

View File

@@ -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);

View File

@@ -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;

View File

@@ -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<uint> updatedFaces = new HashSet<uint>();
@@ -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)

View File

@@ -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);

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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());

View File

@@ -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)

View File

@@ -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
{

View File

@@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// propagate the change
List<UUID> 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<UUID> regions = Scene.GetEstateRegions(estateID);
UUID regionId = (regions.Count() > 0) ? regions.ElementAt(0) : UUID.Zero;
if (regionId != UUID.Zero)
if (!regionId.IsZero())
{
OnEstateInfoChange?.Invoke(regionId);
}

View File

@@ -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);

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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;

View File

@@ -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());

View File

@@ -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;

View File

@@ -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;

View File

@@ -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";

View File

@@ -139,7 +139,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="item"></param>
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<uint> 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);

View File

@@ -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);

View File

@@ -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;
}
}
}

View File

@@ -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);

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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();
}

View File

@@ -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();

View File

@@ -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", "");

View File

@@ -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;

View File

@@ -478,7 +478,7 @@ namespace OpenSim.Region.UserStatistics
lock (m_sessions)
{
if (agentID != UUID.Zero)
if (!agentID.IsZero())
{
if (!m_sessions.ContainsKey(agentID))
{

View File

@@ -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);

View File

@@ -176,7 +176,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
try
{
if (agentID == UUID.Zero)
if (agentID.IsZero())
npcAvatar = new NPCAvatar(firstname, lastname, position,
owner, senseAsAgent, scene);
else
@@ -477,8 +477,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
/// <returns>true if they do, false if they don't.</returns>
private bool CheckPermissions(NPCAvatar av, UUID callerID)
{
return callerID == UUID.Zero || av.OwnerID == UUID.Zero ||
av.OwnerID == callerID || av.AgentId == callerID;
return callerID.IsZero() || av.OwnerID.IsZero() ||
av.OwnerID.Equals(callerID) || av.AgentId.Equals(callerID);
}
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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<string, UUID> kvp in DefaultAvatarAnimations.AnimsUUIDbyName)
@@ -18591,5 +18583,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return line;
}
}
}

View File

@@ -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<UUID>();
@@ -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<UUID>();
@@ -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)

View File

@@ -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))

View File

@@ -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;

View File

@@ -536,7 +536,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
continue;
}
if (itemId != UUID.Zero)
if (!itemId.IsZero())
{
IScriptInstance instance = GetInstance(itemId);
if (instance == null)

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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));
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -180,7 +180,7 @@ namespace OpenSim.Services.Interfaces
Dictionary<int, List<string>> atts = new Dictionary<int, List<string>>();
foreach (AvatarAttachment attach in attachments)
{
if (attach.ItemID != UUID.Zero)
if (!attach.ItemID.IsZero())
{
if (!atts.ContainsKey(attach.AttachPoint))
atts[attach.AttachPoint] = new List<string>();

View File

@@ -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)

View File

@@ -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)

View File

@@ -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))
{

View File

@@ -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);