== UUID.Zero is slow

This commit is contained in:
UbitUmarov
2022-01-08 23:35:56 +00:00
parent cb98fb309c
commit 357f20eb14
73 changed files with 251 additions and 260 deletions

View File

@@ -487,7 +487,7 @@ namespace OpenSim.Groups
{
return gmd.AgentID == sp.UUID;
});
if (m.AgentID == UUID.Zero)
if (m.AgentID.IsZero())
{
if (m_debugEnabled)
m_log.DebugFormat("[Groups.Messaging]: skipping agent {0} because he is not a member of the group", sp.UUID);

View File

@@ -249,8 +249,8 @@ namespace OpenSim.Groups
// There might be some problem with the thread we're generating this on but not
// doing the update at this time causes problems (Mantis #7920 and #7915)
// TODO: move sending this update to a later time in the rootification of the client.
if(!sp.m_haveGroupInformation)
SendAgentGroupDataUpdate(sp.ControllingClient, false);
//if(!sp.m_haveGroupInformation)
// SendAgentGroupDataUpdate(sp.ControllingClient, false);
}
private void OnMakeChild(ScenePresence sp)
@@ -347,7 +347,7 @@ namespace OpenSim.Groups
if (m_debugEnabled)
m_log.DebugFormat("[Groups]: OnInstantMessage called");
if(remoteClient == null || !remoteClient.IsActive || remoteClient.AgentId == UUID.Zero)
if(remoteClient == null || !remoteClient.IsActive || remoteClient.AgentId.IsZero())
return;
Scene scene = (Scene)remoteClient.Scene;
@@ -526,7 +526,7 @@ namespace OpenSim.Groups
if (m_debugEnabled)
m_log.DebugFormat("[xmlGROUPS]: Accepted notice {0} for {1}", noticeID, remoteClient.AgentId);
if (noticeID == UUID.Zero)
if (noticeID.IsZero())
return;
UUID folderID = UUID.Zero;
@@ -580,7 +580,7 @@ namespace OpenSim.Groups
if (m_debugEnabled)
m_log.DebugFormat("[GROUPS]: Accepted notice {0} for {1}", noticeID, remoteAgentIDstr);
if (noticeID == UUID.Zero)
if (noticeID.IsZero())
return;
UUID remoteAgentID = remoteClient.AgentId;
@@ -598,7 +598,7 @@ namespace OpenSim.Groups
UUID attachmentUUID = notice.noticeData.AttachmentItemID;
if (attachmentUUID == null ||
attachmentUUID == UUID.Zero ||
attachmentUUID.IsZero() ||
giver == null ||
giver == UUID.Zero.ToString()
)

View File

@@ -95,11 +95,11 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName, string token)
{
if (GroupID == UUID.Zero && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
if (GroupID.IsZero() && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
return null;
Dictionary<string, object> sendData = new Dictionary<string, object>();
if (GroupID != UUID.Zero)
if (!GroupID.IsZero())
sendData["GroupID"] = GroupID.ToString();
if (!string.IsNullOrEmpty(GroupName))
sendData["Name"] = GroupsDataUtils.Sanitize(GroupName);

View File

@@ -605,7 +605,7 @@ namespace OpenSim.Groups
private string AgentUUI(string AgentIDStr)
{
UUID AgentID = UUID.Zero;
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID == UUID.Zero)
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID.IsZero())
return UUID.Zero.ToString();
if (m_UserManagement.IsLocalGridUser(AgentID))
@@ -630,8 +630,8 @@ namespace OpenSim.Groups
private string AgentUUIForOutside(string AgentIDStr)
{
UUID AgentID = UUID.Zero;
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID == UUID.Zero)
return UUID.Zero.ToString();
if (!UUID.TryParse(AgentIDStr, out AgentID) || AgentID.IsZero())
return UUID.ZeroString;
AgentCircuitData agent = null;
foreach (Scene scene in m_Scenes)

View File

@@ -134,11 +134,11 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName)
{
if (GroupID == UUID.Zero && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
if (GroupID.IsZero() && (GroupName == null || (GroupName != null && GroupName == string.Empty)))
return null;
Dictionary<string, object> sendData = new Dictionary<string, object>();
if (GroupID != UUID.Zero)
if (!GroupID.IsZero())
sendData["GroupID"] = GroupID.ToString();
if (!string.IsNullOrEmpty(GroupName))
sendData["Name"] = GroupsDataUtils.Sanitize(GroupName);

View File

@@ -183,7 +183,7 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName)
{
if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty))
if (GroupID.IsZero() && (GroupName == null || GroupName != null && GroupName == string.Empty))
return null;
return m_CacheWrapper.GetGroupRecord(RequestingAgentID,GroupID,GroupName, delegate

View File

@@ -314,7 +314,7 @@ namespace OpenSim.Groups
if (!all)
{
ExtendedGroupMembershipData membership = null;
if (groupID == UUID.Zero)
if (groupID.IsZero())
{
membership = m_GroupsService.GetAgentActiveMembership(requestingAgentID, agentID);
}

View File

@@ -109,7 +109,7 @@ namespace OpenSim.Groups
public ExtendedGroupRecord GetGroupRecord(string RequestingAgentID, UUID GroupID, string GroupName, GroupRecordDelegate d)
{
//if (GroupID == UUID.Zero && (GroupName == null || GroupName != null && GroupName == string.Empty))
//if (GroupID.IsZero() && (GroupName == null || GroupName != null && GroupName == string.Empty))
// return null;
object group = null;

View File

@@ -383,7 +383,7 @@ namespace OpenSim.Groups
}
// Can't delete Everyone and Owners roles
if (roleID == UUID.Zero)
if (roleID.IsZero())
{
m_log.DebugFormat("[Groups]: Attempt at deleting Everyone role from group {0} denied", groupID);
return;
@@ -527,7 +527,7 @@ namespace OpenSim.Groups
public bool RemoveAgentFromGroupRole(string RequestingAgentID, string AgentID, UUID GroupID, UUID RoleID)
{
// Don't remove from Everyone role!
if (RoleID == UUID.Zero)
if (RoleID.IsZero())
return false;
// check permissions

View File

@@ -161,7 +161,7 @@ namespace OpenSim.Groups
return null;
ExtendedGroupRecord grec;
if (GroupID == UUID.Zero)
if (GroupID.IsZero())
grec = GetGroupRecord(RequestingAgentID, groupName);
else
grec = GetGroupRecord(RequestingAgentID, GroupID);

View File

@@ -124,7 +124,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
if (string.IsNullOrWhiteSpace(ownerString))
continue;
if (!UUID.TryParse(ownerString, out UUID estateOwner) || estateOwner == UUID.Zero)
if (!UUID.TryParse(ownerString, out UUID estateOwner) || estateOwner.IsZero())
continue;
// Check If Estate Exists (Skip If So)

View File

@@ -175,7 +175,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
foreach (RegionInfo region in regions)
{
if (region.RegionID == UUID.Zero)
if (region.RegionID.IsZero())
{
m_log.ErrorFormat(
"[LOAD REGIONS PLUGIN]: Region {0} has invalid UUID {1}",

View File

@@ -332,7 +332,7 @@ namespace OpenSim.Capabilities.Handlers
bool doneZeroID = false;
foreach(LLSDFetchInventoryDescendents f in fetchFolders)
{
if (f.folder_id == UUID.Zero)
if (f.folder_id.IsZero())
{
if(doneZeroID)
continue;
@@ -427,7 +427,7 @@ namespace OpenSim.Capabilities.Handlers
// The inventory server isn't sending FolderID in the collection...
// Must fetch it individually
if (contents.FolderID == UUID.Zero)
if (contents.FolderID.IsZero())
{
InventoryFolderBase containingFolder = m_InventoryService.GetFolder(freq.owner_id, freq.folder_id);
if (containingFolder == null)

View File

@@ -84,7 +84,7 @@ namespace OpenSim.Capabilities.Handlers
osUTF8 lsl = LLSDxmlEncode2.Start(4096);
LLSDxmlEncode2.AddMap(lsl);
if(m_agentID == UUID.Zero && items.Length > 0)
if(m_agentID.IsZero() && items.Length > 0)
LLSDxmlEncode2.AddElem("agent_id", items[0].Owner, lsl);
else
LLSDxmlEncode2.AddElem("agent_id", m_agentID, lsl);

View File

@@ -723,7 +723,7 @@ namespace OpenSim.Data.MySQL
if (parentFolder.Count >= 1) // No result means parent folder does not exist
{
if (parentFolder[0].ParentID == UUID.Zero) // We are querying the root folder
if (parentFolder[0].ParentID.IsZero()) // We are querying the root folder
{
/* Get all of the agent's folders from the database, put them in a list and return it */
using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", dbcon))

View File

@@ -79,7 +79,7 @@ namespace OpenSim.Data.MySQL
if (pd.Length == 0)
return false;
if (regionID == UUID.Zero)
if (regionID.IsZero())
return false;
using (MySqlCommand cmd = new MySqlCommand())

View File

@@ -378,7 +378,7 @@ namespace OpenSim.Data.MySQL
// Create all of the SOGs from the root prims first
foreach (SceneObjectPart prim in prims.Values)
{
if (prim.ParentUUID == UUID.Zero)
if (prim.ParentUUID.IsZero())
{
objects[prim.UUID] = new SceneObjectGroup(prim);
}

View File

@@ -111,7 +111,7 @@ namespace OpenSim.Data.PGSQL
/// <returns>A list of folder objects</returns>
public List<InventoryFolderBase> getUserRootFolders(UUID user)
{
if (user == UUID.Zero)
if (user.IsZero())
return new List<InventoryFolderBase>();
return getInventoryFolders(UUID.Zero, user);
@@ -197,7 +197,7 @@ namespace OpenSim.Data.PGSQL
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
if (parentID == UUID.Zero)
if (parentID.IsZero())
return folders;
string sql = "SELECT * FROM inventoryfolders WHERE \"parentFolderID\" = :parentID";
@@ -702,7 +702,7 @@ namespace OpenSim.Data.PGSQL
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand command = new NpgsqlCommand(sql, conn))
{
if (user == UUID.Zero)
if (user.IsZero())
{
command.Parameters.Add(database.CreateParameter("uuid", "%"));
}

View File

@@ -81,7 +81,7 @@ namespace OpenSim.Data.PGSQL
if (pd.Length == 0)
return false;
if (regionID == UUID.Zero)
if (regionID.IsZero())
return false;
using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))

View File

@@ -109,7 +109,7 @@ namespace OpenSim.Framework
public void SetAnimation(string index, string name, UUID anim)
{
if (anim == UUID.Zero)
if (anim.IsZero())
{
m_animations.Remove(index);
return;

View File

@@ -598,7 +598,7 @@ namespace OpenSim.Framework
lock (m_attachments)
{
if (item == UUID.Zero)
if (item.IsZero())
{
if (m_attachments.ContainsKey(attachpoint))
{
@@ -848,7 +848,7 @@ namespace OpenSim.Framework
if (m_texture.FaceTextures[idx] == null)
continue;
if (m_texture.FaceTextures[idx].TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE ||
m_texture.FaceTextures[idx].TextureID == UUID.Zero)
m_texture.FaceTextures[idx].TextureID.IsZero())
continue;
needExtra = true;
}
@@ -1036,8 +1036,7 @@ namespace OpenSim.Framework
int idx = BAKE_INDICES[i];
if (m_texture.FaceTextures[idx] == null)
continue;
if (m_texture.FaceTextures[idx].TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE ||
m_texture.FaceTextures[idx].TextureID == UUID.Zero)
if (m_texture.FaceTextures[idx].TextureID.IsZero() || m_texture.FaceTextures[idx].TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
continue;
return false;
}

View File

@@ -152,7 +152,7 @@ namespace OpenSim.Framework
public void Add(UUID itemID, UUID assetID)
{
if (itemID == UUID.Zero)
if (itemID.IsZero())
return;
if (m_items.ContainsKey(itemID))
{

View File

@@ -382,7 +382,7 @@ namespace OpenSim.Framework
{
convertSuccess = true;
if (uuidResult2 == UUID.Zero)
if (uuidResult2.IsZero())
uuidResult2 = UUID.Random();
return_result = uuidResult2;

View File

@@ -299,7 +299,7 @@ namespace OpenSim.Framework
public void AddEstateUser(UUID avatarID)
{
if (avatarID == UUID.Zero)
if (avatarID.IsZero())
return;
if (!l_EstateAccess.Contains(avatarID) &&
(l_EstateAccess.Count < (int)Constants.EstateAccessLimits.AllowedAccess))
@@ -319,7 +319,7 @@ namespace OpenSim.Framework
public void AddEstateGroup(UUID avatarID)
{
if (avatarID == UUID.Zero)
if (avatarID.IsZero())
return;
if (!l_EstateGroups.Contains(avatarID) &&
(l_EstateGroups.Count < (int)Constants.EstateAccessLimits.AllowedGroups))
@@ -339,7 +339,7 @@ namespace OpenSim.Framework
public void AddEstateManager(UUID avatarID)
{
if (avatarID == UUID.Zero)
if (avatarID.IsZero())
return;
if (!l_EstateManagers.Contains(avatarID) &&
(l_EstateManagers.Count < (int)Constants.EstateAccessLimits.EstateManagers))

View File

@@ -311,7 +311,7 @@ namespace OpenSim.Framework
public static void AddElem(UUID e, StringBuilder sb)
{
if(e == UUID.Zero)
if(e.IsZero())
sb.Append("<uuid />");
else
{
@@ -660,7 +660,7 @@ namespace OpenSim.Framework
sb.Append(name);
sb.Append("</key>");
if(e == UUID.Zero)
if(e.IsZero())
sb.Append("<uuid />");
else
{

View File

@@ -488,7 +488,7 @@ namespace OpenSim.Framework
if (!UUID.TryParse(regionUUID.Trim(), out RegionID))
{
UUID newID = UUID.Random();
while (RegionID == UUID.Zero)
while (RegionID.IsZero())
{
regionUUID = MainConsole.Instance.Prompt("RegionUUID", newID.ToString());
if (!UUID.TryParse(regionUUID.Trim(), out RegionID))

View File

@@ -227,7 +227,7 @@ namespace OpenSim.Framework
get { return m_TerrainTexture1; }
set
{
if (value == UUID.Zero)
if (value.IsZero())
m_TerrainTexture1 = DEFAULT_TERRAIN_TEXTURE_1;
else
m_TerrainTexture1 = value;
@@ -241,7 +241,7 @@ namespace OpenSim.Framework
get { return m_TerrainTexture2; }
set
{
if (value == UUID.Zero)
if (value.IsZero())
m_TerrainTexture2 = DEFAULT_TERRAIN_TEXTURE_2;
else
m_TerrainTexture2 = value;
@@ -255,7 +255,7 @@ namespace OpenSim.Framework
get { return m_TerrainTexture3; }
set
{
if (value == UUID.Zero)
if (value.IsZero())
m_TerrainTexture3 = DEFAULT_TERRAIN_TEXTURE_3;
else
m_TerrainTexture3 = value;
@@ -269,7 +269,7 @@ namespace OpenSim.Framework
get { return m_TerrainTexture4; }
set
{
if (value == UUID.Zero)
if (value.IsZero())
m_TerrainTexture4 = DEFAULT_TERRAIN_TEXTURE_4;
else
m_TerrainTexture4 = value;

View File

@@ -3466,7 +3466,7 @@ namespace OpenSim.Framework
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void AddToGatheredIds(Dictionary<UUID, sbyte> uuids, UUID id, sbyte type)
{
if (id == UUID.Zero)
if (id.IsZero())
return;
uuids[id] = type;
}

View File

@@ -479,7 +479,7 @@ namespace OpenSim
scene.SnmpService.BootInfo("Loading prims", scene);
}
while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
while (regionInfo.EstateSettings.EstateOwner.IsZero() && MainConsole.Instance != null)
SetUpEstateOwner(scene);
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
@@ -638,7 +638,7 @@ namespace OpenSim
}
// If we've been given a zero uuid then this signals that we should use a random user id
if (estateOwnerUuid == UUID.Zero)
if (estateOwnerUuid.IsZero())
estateOwnerUuid = UUID.Random();
account

View File

@@ -2176,7 +2176,7 @@ namespace OpenSim.Region.ClientStack.Linden
break;
groupID = tmp.AsUUID();
if(groupID == UUID.Zero)
if(groupID.IsZero())
break;
List<GroupRolesData> roles = m_GroupsModule.GroupRoleDataRequest(client, groupID);
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.ClientStack.Linden
fullname = "(hippos)";
}
if(kvp.Key == UUID.Zero)
if(kvp.Key.IsZero())
continue;
// dont tell about unknown users, we can't send them back on Bad either

View File

@@ -65,7 +65,7 @@ namespace OpenSim.Region.ClientStack.Linden
}
catch { }
if (itemID == UUID.Zero)
if (itemID.IsZero())
{
LLSDAssetUploadError error = new LLSDAssetUploadError();
error.message = "failed to recode request";
@@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.Linden
}
catch { }
if (itemID == UUID.Zero || objectID == UUID.Zero)
if (itemID.IsZero() || objectID.IsZero())
{
LLSDAssetUploadError error = new LLSDAssetUploadError();
error.message = "failed to recode request";
@@ -312,7 +312,7 @@ namespace OpenSim.Region.ClientStack.Linden
UUID assetID = OnUpLoad(m_inventoryItemID, m_objectID, data);
if (assetID == UUID.Zero)
if (assetID.IsZero())
{
LLSDAssetUploadError uperror = new LLSDAssetUploadError();
uperror.message = "Failed to update inventory item asset";

View File

@@ -173,7 +173,7 @@ namespace OpenSim.Region.ClientStack.Linden
for (int i = 0; i < allowed.Length; ++i)
{
UUID id = allowed[i];
if (id == UUID.Zero)
if (id.IsZero())
continue;
LLSDxmlEncode2.AddMap(sb);
LLSDxmlEncode2.AddElem("id", id, sb);
@@ -190,7 +190,7 @@ namespace OpenSim.Region.ClientStack.Linden
for (int i = 0; i < groups.Length; ++i)
{
UUID id = groups[i];
if (id == UUID.Zero)
if (id.IsZero())
continue;
LLSDxmlEncode2.AddMap(sb);
LLSDxmlEncode2.AddElem("id", id, sb);
@@ -208,7 +208,7 @@ namespace OpenSim.Region.ClientStack.Linden
{
EstateBan ban = EstateBans[i];
UUID id = ban.BannedUserID;
if (id == UUID.Zero)
if (id.IsZero())
continue;
LLSDxmlEncode2.AddMap(sb);
LLSDxmlEncode2.AddElem("id", id, sb);

View File

@@ -556,7 +556,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
UUID tx = new UUID(parts[1]);
int id = Convert.ToInt32(parts[0]);
if (defaultIDs.Contains(tx) || tx == UUID.Zero ||
if (defaultIDs.Contains(tx) || tx.IsZero() ||
(allowed.ContainsKey(id) && allowed[id] == tx))
{
continue;

View File

@@ -596,7 +596,7 @@ namespace OpenSim.Region.CoreModules.Asset
m_Requests++;
if (id.Equals(Util.UUIDZeroString))
if (id.Equals(UUID.ZeroString))
return false;
if (m_negativeCache.ContainsKey(id))
@@ -1255,7 +1255,7 @@ namespace OpenSim.Region.CoreModules.Asset
Primitive.TextureEntryFace face = FaceTextures[idx];
if (face == null)
continue;
if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
if (face.TextureID.IsZero() || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
continue;
gatherer.AddGathered(face.TextureID, (sbyte)AssetType.Texture);
}

View File

@@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
ct.AddRow("Attachment Name", attachmentObject.Name);
ct.AddRow("Local ID", attachmentObject.LocalId);
ct.AddRow("Item ID", attachmentObject.UUID);
if(attachmentObject.FromItemID == UUID.Zero)
if(attachmentObject.FromItemID.IsZero())
ct.AddRow("Temporary", "");
else
ct.AddRow("From Item ID", attachmentObject.FromItemID);
@@ -697,7 +697,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
{
// Add the new attachment to inventory if we don't already have it.
UUID newAttachmentItemID = group.FromItemID;
if (newAttachmentItemID == UUID.Zero)
if (newAttachmentItemID.IsZero())
newAttachmentItemID = AddSceneObjectAsNewAttachmentInInv(sp, group).ID;
ShowAttachInUserInventory(sp, attachmentPt, newAttachmentItemID, group, append);
@@ -794,7 +794,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
UUID inventoryID = so.FromItemID;
// As per Linden spec, drop is disabled for temp attachs
if (inventoryID == UUID.Zero)
if (inventoryID.IsZero())
return;
if (DebugLevel > 0)
@@ -872,7 +872,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// If this didn't come from inventory, it also shouldn't go there
// on detach. It's likely a temp attachment.
if (so.FromItemID == UUID.Zero)
if (so.FromItemID.IsZero())
{
PrepareScriptInstanceForSave(so, true);
@@ -970,7 +970,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
/// <param name="saveAllScripted"></param>
private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp, string scriptedState)
{
if (grp.FromItemID == UUID.Zero)
if (grp.FromItemID.IsZero())
{
// We can't save temp attachments
grp.HasGroupChanged = false;

View File

@@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{
Primitive.TextureEntryFace bakedTextureFace = bakedTextures[bakeType];
if (bakedTextureFace == null || bakedTextureFace.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
if (bakedTextureFace == null || bakedTextureFace.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
continue;
AssetBase asset;
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
wearableCache[idx].TextureAsset = null; // just in case
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
if (face == null || face.TextureID.IsZero() || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
{
wearableCache[idx].CacheId = UUID.Zero;
wearableCache[idx].TextureID = UUID.Zero;
@@ -554,7 +554,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
int idx = AvatarAppearance.BAKE_INDICES[i];
face = sp.Appearance.Texture.FaceTextures[idx];
if(face == null || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
if(face == null || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
{
wearableCache[idx].CacheId = UUID.Zero;
wearableCache[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
@@ -679,7 +679,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
if (face == null)
continue;
if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
if (face.TextureID.IsZero() || face.TextureID.Equals(AppearanceManager.DEFAULT_AVATAR_TEXTURE))
continue;
if (missingTexturesOnly)
@@ -837,7 +837,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{
for (int j = 0; j < appearance.Wearables[i].Count; j++)
{
if (appearance.Wearables[i][j].ItemID == UUID.Zero)
if (appearance.Wearables[i][j].ItemID.IsZero())
{
m_log.WarnFormat(
"[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.",

View File

@@ -283,7 +283,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
if (checkParcelHide)
{
checkParcelHide = false;
if (c.Type < ChatTypeEnum.DebugChannel && destination == UUID.Zero)
if (c.Type < ChatTypeEnum.DebugChannel && destination.IsZero())
{
ILandObject srcland = scene.LandChannel.GetLandObject(hidePos.X, hidePos.Y);
if (srcland != null && !srcland.LandData.SeeAVs)
@@ -298,7 +298,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
scene.ForEachScenePresence(
delegate(ScenePresence presence)
{
if (destination != UUID.Zero && presence.UUID != destination)
if (!destination.IsZero() && presence.UUID.NotEqual(destination))
return;
if(presence.IsChildAgent)
@@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
return;
if (TrySendChatMessage(presence, fromPos, regionPos, fromID,
ownerID, fromNamePrefix + fromName, c.Type,
message, sourceType, (destination != UUID.Zero)))
message, sourceType, !destination.IsZero()))
receiverIDs.Add(presence.UUID);
return;
}
@@ -317,14 +317,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{
if (checkParcelHide)
{
if (sourceParcelID != Presencecheck.LandData.GlobalID && !presence.IsViewerUIGod)
if (sourceParcelID.NotEqual(Presencecheck.LandData.GlobalID) && !presence.IsViewerUIGod)
return;
}
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
{
if (TrySendChatMessage(presence, fromPos, regionPos, fromID,
ownerID, fromNamePrefix + fromName, c.Type,
message, sourceType, (destination != UUID.Zero)))
message, sourceType, !destination.IsZero()))
receiverIDs.Add(presence.UUID);
}
}
@@ -365,7 +365,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
ownerID = c.Sender.AgentId;
sourceType = ChatSourceType.Agent;
}
else if (c.SenderUUID != UUID.Zero)
else if (!c.SenderUUID.IsZero())
{
if(c.SenderObject == null)
return;
@@ -386,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
// non-owner agents
if ((c.Type == ChatTypeEnum.Owner) &&
(null != c.SenderObject) &&
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
(((SceneObjectPart)c.SenderObject).OwnerID.NotEqual(client.AgentId)))
return;
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID,

View File

@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (inv == null)
return UUID.Zero;
if (folderID == UUID.Zero)
if (folderID.IsZero())
{
InventoryFolderBase folder = inv.GetFolderForType(userID,
FolderType.CallingCard);

View File

@@ -139,7 +139,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
public void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
{
UUID toAgentID = new UUID(im.toAgentID);
if (toAgentID == UUID.Zero)
if (toAgentID.IsZero())
return;
ScenePresence achildsp = null;

View File

@@ -140,7 +140,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result)
{
UUID toAgentID = new UUID(im.toAgentID);
if (toAgentID == UUID.Zero)
if (toAgentID.IsZero())
return;
ScenePresence achildsp = null;

View File

@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
if (assetType == AssetType.Folder)
{
UUID folderID = new UUID(im.binaryBucket, 1);
if (folderID == UUID.Zero)
if (folderID.IsZero())
{
client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false);
return;
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
else
{
UUID itemID = new UUID(im.binaryBucket, 1);
if (itemID == UUID.Zero)
if (itemID.IsZero())
{
client.SendAgentAlertMessage("Can't find item to give. Nothing given.", false);
return;
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
case InstantMessageDialog.InventoryAccepted:
{
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
if(inventoryID == UUID.Zero)
if(inventoryID.IsZero())
return;
IInventoryService invService = scene.InventoryService;
@@ -300,7 +300,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
return;
UUID destinationFolderID = new UUID(im.binaryBucket, 0);
if(destinationFolderID == UUID.Zero) // uuid-zero is a valid folder ID(?) keeping old code assuming not
if(destinationFolderID.IsZero()) // uuid-zero is a valid folder ID(?) keeping old code assuming not
return;
IInventoryService invService = scene.InventoryService;
@@ -311,7 +311,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
return; // no where to put it
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
if(inventoryID == UUID.Zero)
if(inventoryID.IsZero())
return;
InventoryItemBase item = invService.GetItem(agentID, inventoryID);
@@ -356,7 +356,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
}
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
if(inventoryID == UUID.Zero)
if(inventoryID.IsZero())
{
client.SendAgentAlertMessage("Item or folder not found", false);
return;

View File

@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>();
UUID targetID;
if(!UUID.TryParse(args[0], out targetID) || targetID == UUID.Zero)
if(!UUID.TryParse(args[0], out targetID) || targetID.IsZero())
return;
if (targetID == Constants.m_MrOpenSimID)
@@ -667,7 +667,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
}
ad = (UserClassifiedAdd) Ad;
if(ad.CreatorId == UUID.Zero)
if(ad.CreatorId.IsZero())
return;
if(foreign)
@@ -1485,14 +1485,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
{
if (avatarID == UUID.Zero)
if (avatarID.IsZero())
{
// Looking for a reason that some viewers are sending null Id's
m_log.Debug("[PROFILES]: got request of null ID");
return;
}
if (avatarID == Constants.m_MrOpenSimID)
if (avatarID.Equals(Constants.m_MrOpenSimID))
{
remoteClient.SendAvatarProperties(avatarID, "Creator of OpenSimulator shared assets library", Constants.m_MrOpenSimBorn.ToString(),
Utils.StringToBytes("System agent"), "MrOpenSim has no life", 0x10,
@@ -1884,7 +1884,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
void cacheForeignImage(UUID agent, UUID imageID)
{
if(imageID == null || imageID == UUID.Zero)
if(imageID.IsZero())
return;
string assetServerURI = UserManagementModule.GetUserServerURL(agent, "AssetServerURI");

View File

@@ -1496,7 +1496,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return false;
}
if (uinfo.HomeRegionID == UUID.Zero)
if (uinfo.HomeRegionID.IsZero())
{
// can't find the Home region: Tell viewer and abort
m_log.ErrorFormat("[ENTITY TRANSFER MODULE] no home set {0}", id);
@@ -1833,7 +1833,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.Name, neighbourRegion.RegionName, reason);
ReInstantiateScripts(agent);
if(agent.ParentID == 0 && agent.ParentUUID == UUID.Zero)
if(agent.ParentID == 0 && agent.ParentUUID.IsZero())
{
agent.AddToPhysicalScene(isFlying);
}

View File

@@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return base.HandleIncomingSceneObject(so, newPosition);
// Equally, we can't use so.AttachedAvatar here.
if (OwnerID == UUID.Zero || Scene.UserManagementModule.IsLocalGridUser(OwnerID))
if (OwnerID.IsZero() || Scene.UserManagementModule.IsLocalGridUser(OwnerID))
return base.HandleIncomingSceneObject(so, newPosition);
// foreign user

View File

@@ -319,7 +319,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);
if (item == null || item.AssetID == UUID.Zero)
if (item == null || item.AssetID.IsZero())
return null;
string userAssetServer;

View File

@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if(envModule == null)
return;
UUID assetID = envModule.GetDefaultAsset(subType);
if(assetID == UUID.Zero)
if(assetID.IsZero())
{
m_log.ErrorFormat(
"[INVENTORY ACCESS MODULE CreateNewInventoryItem]: failed to create default environment setting asset {0} for agent {1}", name, remoteClient.AgentId);
@@ -743,7 +743,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// action, userID);
}
if (userID == UUID.Zero) // Can't proceed
if (userID.IsZero()) // Can't proceed
{
return null;
}
@@ -797,7 +797,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.LostAndFound);
}
if (folderID == UUID.Zero && folder == null)
if (folderID.IsZero() && folder == null)
{
if (action == DeRezAction.Delete)
{
@@ -829,7 +829,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
// Override and put into where it came from, if it came
// from anywhere in inventory and the owner is taking it back.
if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
if (!so.FromFolderID.IsZero() && so.RootPart.OwnerID.Equals(remoteClient.AgentId))
{
folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID);
@@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
while(true)
{
parent = m_Scene.InventoryService.GetFolder(userID, parent.ParentID);
if (parent != null && (parent.ParentID == UUID.Zero || parent.ID == parent.ParentID))
if (parent != null && (parent.ParentID.IsZero() || parent.ID.Equals(parent.ParentID)))
break;
if (parent == null || parent.Type == (int)FolderType.Trash || parent.Type == (int)FolderType.LostAndFound)
{
@@ -923,7 +923,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
if(assetID == UUID.Zero)
if(assetID.IsZero())
return null;
AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
@@ -1042,7 +1042,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// remoteClient.Name);
// Vector3 storedPosition = group.AbsolutePosition;
if (group.UUID == UUID.Zero)
if (group.UUID.IsZero())
{
m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3");
}

View File

@@ -316,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
if (found.Contains(data.Id))
continue;
if (data.Id == UUID.Zero || data.IsUnknownUser)
if (data.Id.IsZero() || data.IsUnknownUser)
continue;
if (data.FirstName.ToLower().StartsWith(q) || data.LastName.ToLower().StartsWith(q))
users.Add(data);
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
var untried = new Dictionary<UUID, UserData>();
foreach (string id in ids)
{
if(!UUID.TryParse(id, out UUID uuid) || uuid == UUID.Zero)
if(!UUID.TryParse(id, out UUID uuid) || uuid.IsZero())
continue;
if (m_userCacheByID.TryGetValue(uuid, out UserData userdata))
@@ -551,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
var untried = new Dictionary<UUID, UserData>();
foreach (string id in ids)
{
if (!UUID.TryParse(id, out UUID uuid) || uuid == UUID.Zero)
if (!UUID.TryParse(id, out UUID uuid) || uuid.IsZero())
continue;
if (m_userCacheByID.TryGetValue(uuid, out UserData userdata))

View File

@@ -278,7 +278,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
m_listenerManager.DeleteListener(itemID);
}
protected static Vector3 CenterOfRegion = new Vector3(128, 128, 20);
public void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg)
@@ -387,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
if (channel == DEBUG_CHANNEL)
return;
if(target == UUID.Zero)
if(target.IsZero())
return;
// Is target an avatar?

View File

@@ -231,9 +231,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
}
}
if (newChannel == UUID.Zero)
if (newChannel.IsZero())
{
newChannel = (channelID == UUID.Zero) ? UUID.Random() : channelID;
newChannel = (channelID.IsZero()) ? UUID.Random() : channelID;
RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, newChannel);
lock (XMLRPCListLock)
{
@@ -283,10 +283,10 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
RPCRequestInfo rpcInfo = null;
if (message_key == UUID.Zero)
if (message_key.IsZero())
{
foreach (RPCRequestInfo oneRpcInfo in m_rpcPendingResponses.Values)
if (oneRpcInfo.GetChannelKey() == channel_key)
if (oneRpcInfo.GetChannelKey().Equals(channel_key))
rpcInfo = oneRpcInfo;
}
else

View File

@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
m_log.ErrorFormat("[ARCHIVER MODULE] default user must be in format \"First Last\"", defaultUser);
}
if (defaultUserUUID == UUID.Zero)
if (defaultUserUUID.IsZero())
{
m_log.ErrorFormat("[ARCHIVER MODULE] cannot find specified default user {0}", defaultUser);
return;

View File

@@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
public void SetEstateTerrainBaseTexture(IClientAPI remoteClient, int level, UUID texture)
{
if (texture == UUID.Zero)
if (texture.IsZero())
return;
switch (level)
@@ -1185,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void HandleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey, bool kick)
{
if (prey == UUID.Zero)
if (prey.IsZero())
return;
EstateTeleportOneUserHomeRequest evOverride = OnEstateTeleportOneUserHomeRequest;

View File

@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void OnEstateTeleportOneUserHomeRequest(IClientAPI client, UUID invoice, UUID senderID, UUID prey, bool kick)
{
if (prey == UUID.Zero)
if (prey.IsZero())
return;
if (!(client.Scene is Scene))

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// Disconnect the Telehub:
public void Disconnect()
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
return;
m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero;
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// Add a SpawnPoint to the Telehub
public void AddSpawnPoint(Vector3 point)
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
return;
SceneObjectGroup grp = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject);
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// Remove a SpawnPoint from the Telehub
public void RemoveSpawnPoint(int spawnpoint)
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
if (m_Scene.RegionInfo.RegionSettings.TelehubObject.IsZero())
return;
m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint);

View File

@@ -1423,13 +1423,13 @@ namespace OpenSim.Region.CoreModules.World.Land
curByte = LandChannel.LAND_TYPE_OWNED_BY_GROUP;
}
else if (currentParcel.LandData.SalePrice > 0 &&
(currentParcel.LandData.AuthBuyerID == UUID.Zero ||
currentParcel.LandData.AuthBuyerID == remote_client.AgentId))
(currentParcel.LandData.AuthBuyerID.IsZero() ||
currentParcel.LandData.AuthBuyerID.Equals(remote_client.AgentId)))
{
//Sale type
curByte = LandChannel.LAND_TYPE_IS_FOR_SALE;
}
else if (currentParcel.LandData.OwnerID == UUID.Zero)
else if (currentParcel.LandData.OwnerID.IsZero())
{
//Public type
curByte = LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero
@@ -1790,7 +1790,7 @@ namespace OpenSim.Region.CoreModules.World.Land
bool landforsale = ((lob.LandData.Flags &
(uint)(ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects)) != 0);
if ((AuthorizedID == UUID.Zero || AuthorizedID == e.agentId) && e.parcelPrice >= saleprice && landforsale)
if ((AuthorizedID.IsZero() || AuthorizedID.Equals(e.agentId)) && e.parcelPrice >= saleprice && landforsale)
{
// TODO I don't think we have to lock it here, no?
//lock (e)
@@ -2204,7 +2204,7 @@ namespace OpenSim.Region.CoreModules.World.Land
return;
}
//m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID == UUID.Zero ? args.ToString() :"");
//m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelID {0} {1}", parcelID, parcelID.IsZero() ? args.ToString() :"");
osUTF8 sb = LLSDxmlEncode2.Start();
LLSDxmlEncode2.AddMap(sb);
LLSDxmlEncode2.AddElem("parcel_id", parcelID,sb);
@@ -2217,7 +2217,7 @@ namespace OpenSim.Region.CoreModules.World.Land
private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID)
{
if (parcelID == UUID.Zero)
if (parcelID.IsZero())
return;
if(!m_parcelInfoCache.TryGetValue(parcelID, 30000, out ExtendedLandData data))

View File

@@ -850,10 +850,10 @@ namespace OpenSim.Region.CoreModules.World.Land
UUID owner = npccli.Owner;
if(owner == UUID.Zero)
if(owner.IsZero())
return true;
if (owner == LandData.OwnerID)
if (owner.Equals(LandData.OwnerID))
return false;
return !IsInLandAccessList(owner);
@@ -1043,7 +1043,7 @@ namespace OpenSim.Region.CoreModules.World.Land
parcelAccessList.Remove(entry);
// a delete all command ?
if (entries.Count == 1 && entries[0].AgentID == UUID.Zero)
if (entries.Count == 1 && entries[0].AgentID.IsZero())
{
LandData.ParcelAccessList = parcelAccessList;
if ((flags & (uint)AccessList.Access) != 0)
@@ -1839,11 +1839,10 @@ namespace OpenSim.Region.CoreModules.World.Land
{
if (obj.OwnerID != LandData.OwnerID &&
(obj.GroupID != LandData.GroupID ||
LandData.GroupID == UUID.Zero))
LandData.GroupID.IsZero()))
{
if (!returns.ContainsKey(obj.OwnerID))
returns[obj.OwnerID] =
new List<SceneObjectGroup>();
returns[obj.OwnerID] = new List<SceneObjectGroup>();
returns[obj.OwnerID].Add(obj);
}
}

View File

@@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
// return either the average color of the texture, or the defaultColor if the texturID is invalid
// or the texture couldn't be found
private Color computeAverageColor(UUID textureID, Color defaultColor) {
if (textureID == UUID.Zero) return defaultColor; // not set
if (textureID.IsZero()) return defaultColor; // not set
if (m_mapping.ContainsKey(textureID)) return m_mapping[textureID]; // one of the predefined textures
Color color;

View File

@@ -624,10 +624,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
/// <returns></returns>
protected bool IsAdministrator(UUID user)
{
if (user == UUID.Zero)
if (user.IsZero())
return false;
if (m_RegionOwnerIsAdmin && m_scene.RegionInfo.EstateSettings.EstateOwner == user)
if (m_RegionOwnerIsAdmin && m_scene.RegionInfo.EstateSettings.EstateOwner.Equals(user))
return true;
if (m_RegionManagerIsAdmin && IsEstateManager(user))
@@ -650,7 +650,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (user == UUID.Zero)
if (user.IsZero())
return false;
if (m_allowGridAdmins)
@@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (FriendsModule == null)
return false;
if (user == UUID.Zero)
if (user.IsZero())
return false;
int friendPerms = FriendsModule.GetRightsGrantedByFriend(user, objectOwner);
@@ -681,7 +681,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
protected bool IsEstateManager(UUID user)
{
if (user == UUID.Zero) return false;
if (user.IsZero())
return false;
return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user);
}
@@ -786,7 +787,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if(sp.IsGod)
{
// do locked on objects owned by admin
if(!unlocked && spID == taskOwnerID)
if(!unlocked && spID.Equals(taskOwnerID))
return objflags | LOCKED_GOD_FLAGS;
else
return objflags | GOD_FLAGS;
@@ -804,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
uint grpEffectiveOwnerPerms = grp.EffectiveOwnerPerms;
// owner
if (spID == taskOwnerID)
if (spID.Equals(taskOwnerID))
{
returnMask = ApplyObjectModifyMasks(grpEffectiveOwnerPerms, objflags, unlocked);
returnMask |= EXTRAOWNERMASK;
@@ -817,13 +818,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (task.ParentGroup.IsAttachment)
{
returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
if (!taskOwnerID.IsZero())
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
UUID taskGroupID = task.GroupID;
bool notGroupdOwned = taskOwnerID != taskGroupID;
bool notGroupdOwned = taskOwnerID.NotEqual(taskGroupID);
if ((grpEffectiveOwnerPerms & (uint)PermissionMask.Transfer) == 0)
grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy;
@@ -841,13 +842,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// group owned or shared ?
IClientAPI client = sp.ControllingClient;
ulong powers = 0;
if(taskGroupID != UUID.Zero && GroupMemberPowers(taskGroupID, sp, ref powers))
if(!taskGroupID.IsZero() && GroupMemberPowers(taskGroupID, sp, ref powers))
{
if(notGroupdOwned)
{
// group sharing or everyone
returnMask = ApplyObjectModifyMasks(grp.EffectiveGroupOrEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
if (!taskOwnerID.IsZero())
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
@@ -875,7 +876,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// fallback is everyone rights
returnMask = ApplyObjectModifyMasks(grp.EffectiveEveryOnePerms, objflags, unlocked);
if (taskOwnerID != UUID.Zero)
if (!taskOwnerID.IsZero())
returnMask |= (uint)PrimFlags.ObjectAnyOwner;
return returnMask;
}
@@ -922,7 +923,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Object owners should be able to edit their own content
UUID objectOwner = obj.OwnerID;
if (user == objectOwner)
if (user.Equals(objectOwner))
return PermissionClass.Owner;
// Admin should be able to edit anything in the sim (including admin objects)
@@ -935,7 +936,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return PermissionClass.Owner;
// Group permissions
if (obj.GroupID != UUID.Zero && IsGroupMember(obj.GroupID, user, 0))
if (!obj.GroupID.IsZero() && IsGroupMember(obj.GroupID, user, 0))
return PermissionClass.Group;
}
@@ -958,7 +959,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsAdministrator(currentUser))
{
// do lock on admin owned objects
if(locked && currentUser == objectOwner)
if(locked && currentUser.Equals(objectOwner))
return (uint)(PermissionMask.AllEffective & ~(PermissionMask.Modify | PermissionMask.Move));
return (uint)PermissionMask.AllEffective;
}
@@ -969,7 +970,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
uint grpEffectiveOwnerPerms = group.EffectiveOwnerPerms & lockmask;
if (currentUser == objectOwner)
if (currentUser.Equals(objectOwner))
return grpEffectiveOwnerPerms & lockmask;
if (group.IsAttachment)
@@ -979,13 +980,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
grpEffectiveOwnerPerms &= ~(uint)PermissionMask.Copy;
UUID sogGroupID = group.GroupID;
bool notgroudOwned = sogGroupID != objectOwner;
bool notgroudOwned = sogGroupID.NotEqual(objectOwner);
if (notgroudOwned && IsFriendWithPerms(currentUser, objectOwner))
return grpEffectiveOwnerPerms & lockmask;
ulong powers = 0;
if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, currentUser, ref powers))
if (!sogGroupID.IsZero() && GroupMemberPowers(sogGroupID, currentUser, ref powers))
{
if(notgroudOwned)
return group.EffectiveGroupOrEveryOnePerms & lockmask;
@@ -1016,7 +1017,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sp.IsGod)
{
if(locked && spID == objectOwner)
if(locked && spID.Equals(objectOwner))
return (uint)(PermissionMask.AllEffective & ~(PermissionMask.Modify | PermissionMask.Move));
return (uint)PermissionMask.AllEffective;
}
@@ -1026,7 +1027,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
lockmask &= ~(uint)(PermissionMask.Modify | PermissionMask.Move);
uint ownerperms = group.EffectiveOwnerPerms;
if (spID == objectOwner)
if (spID.Equals(objectOwner))
return ownerperms & lockmask;
if (group.IsAttachment)
@@ -1036,7 +1037,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
ownerperms &= ~(uint)PermissionMask.Copy;
UUID sogGroupID = group.GroupID;
bool notgroudOwned = sogGroupID != objectOwner;
bool notgroudOwned = sogGroupID.NotEqual(objectOwner);
if (notgroudOwned && IsFriendWithPerms(spID, objectOwner))
{
@@ -1044,7 +1045,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
}
ulong powers = 0;
if (sogGroupID != UUID.Zero && GroupMemberPowers(sogGroupID, sp, ref powers))
if (!sogGroupID.IsZero() && GroupMemberPowers(sogGroupID, sp, ref powers))
{
if(notgroudOwned)
return group.EffectiveGroupOrEveryOnePerms & lockmask;
@@ -1071,12 +1072,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return ti.CurrentPermissions;
UUID tiGroupID = ti.GroupID;
if(tiGroupID != UUID.Zero)
if(!tiGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(tiGroupID, userID, ref powers))
{
if(tiGroupID == ti.OwnerID)
if(tiGroupID.Equals(ti.OwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return ti.CurrentPermissions;
@@ -1093,7 +1094,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID tiOwnerID = ti.OwnerID;
UUID spID = sp.UUID;
if(tiOwnerID == spID)
if(tiOwnerID.Equals(spID))
return ti.CurrentPermissions;
// ??
@@ -1101,12 +1102,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return ti.CurrentPermissions;
UUID tiGroupID = ti.GroupID;
if(tiGroupID != UUID.Zero)
if(!tiGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(tiGroupID, spID, ref powers))
{
if(tiGroupID == ti.OwnerID)
if(tiGroupID.Equals(ti.OwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return ti.CurrentPermissions;
@@ -1162,7 +1163,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager)
{
if (parcel.LandData.OwnerID == user)
if (parcel.LandData.OwnerID.Equals(user))
return true;
if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
@@ -1200,13 +1201,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if(parcel.LandData.GroupID == UUID.Zero)
if(parcel.LandData.GroupID.IsZero())
return false;
if (IsAdministrator(user))
return true;
if (parcel.LandData.OwnerID != user) // Only the owner can deed!
if (parcel.LandData.OwnerID.NotEqual(user)) // Only the owner can deed!
return false;
ScenePresence sp = m_scene.GetScenePresence(user);
@@ -1225,11 +1226,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID == UUID.Zero)
if(sog == null || sog.IsDeleted || sp == null || sp.IsDeleted || targetGroupID.IsZero())
return false;
// object has group already?
if(sog.GroupID != targetGroupID)
if(sog.GroupID.NotEqual(targetGroupID))
return false;
// is effectivelly shared?
@@ -1240,7 +1241,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
// owned by requester?
if(sog.OwnerID != sp.UUID)
if(sog.OwnerID.NotEqual(sp.UUID))
return false;
// owner can transfer?
@@ -1271,7 +1272,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if((perms & (uint)PermissionMask.Copy) == 0)
return false;
if(sog.OwnerID != sp.UUID && (perms & (uint)PermissionMask.Transfer) == 0)
if(sog.OwnerID.NotEqual(sp.UUID) && (perms & (uint)PermissionMask.Transfer) == 0)
return false;
//If they can rez, they can duplicate
@@ -1294,7 +1295,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogOwnerID = sog.OwnerID;
UUID spID = sp.UUID;
if(sogOwnerID == spID)
if(sogOwnerID.Equals(spID))
return true;
if (sp.IsGod)
@@ -1304,12 +1305,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
UUID sogGroupID = sog.GroupID;
if (sogGroupID != UUID.Zero)
if (!sogGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, sp, ref powers))
{
if(sogGroupID == sogOwnerID)
if(sogGroupID.Equals(sogOwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
@@ -1336,7 +1337,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogOwnerID = sog.OwnerID;
if(sogOwnerID == userID)
if(sogOwnerID.Equals(userID))
return true;
if (IsAdministrator(userID))
@@ -1346,12 +1347,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
UUID sogGroupID = sog.GroupID;
if (sogGroupID != UUID.Zero)
if (!sogGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, userID, ref powers))
{
if(sogGroupID == sogOwnerID)
if(sogGroupID.Equals(sogOwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
@@ -1399,11 +1400,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sog == null)
return false;
if(sog.OwnerID == userID || IsAdministrator(userID))
if(sog.OwnerID.Equals(userID) || IsAdministrator(userID))
return true;
UUID sogGroupID = sog.GroupID;
if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
if(sogGroupID.IsZero() || sogGroupID.NotEqual(sog.OwnerID))
return false;
uint perms = sog.EffectiveOwnerPerms;
@@ -1478,7 +1479,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (objectID == UUID.Zero) // User inventory
if (objectID.IsZero()) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(user, notecard);
@@ -1521,17 +1522,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (ti == null)
return false;
if (ti.OwnerID != user)
if (ti.OwnerID.NotEqual(user))
{
UUID tiGroupID = ti.GroupID;
if (tiGroupID == UUID.Zero)
if (tiGroupID.IsZero())
return false;
ulong powers = 0;
if(!GroupMemberPowers(tiGroupID, user, ref powers))
return false;
if(tiGroupID == ti.OwnerID && (powers & (ulong)GroupPowers.ObjectManipulate) != 0)
if(tiGroupID.Equals(ti.OwnerID) && (powers & (ulong)GroupPowers.ObjectManipulate) != 0)
{
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy)) ==
((uint)PermissionMask.Modify | (uint)PermissionMask.Copy))
@@ -1602,7 +1603,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (m_bypassPermissions)
{
if (sog.OwnerID != sp.UUID && sog.IsAttachment)
if (sog.OwnerID.NotEqual(sp.UUID) && sog.IsAttachment)
return false;
return m_bypassPermissionsValue;
}
@@ -1649,14 +1650,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID userID = sog.OwnerID;
LandData landdata = parcel.LandData;
if (landdata.OwnerID == userID)
if (landdata.OwnerID.Equals(userID))
return true;
if (IsAdministrator(userID))
return true;
UUID landGroupID = landdata.GroupID;
if (landGroupID != UUID.Zero)
if (!landGroupID.IsZero())
{
if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowGroupObjectEntry)) != 0)
return IsGroupMember(landGroupID, userID, 0);
@@ -1693,14 +1694,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID userID = sog.OwnerID;
LandData landdata = parcel.LandData;
if (landdata.OwnerID == userID)
if (landdata.OwnerID.Equals(userID))
return true;
if (IsAdministrator(userID))
return true;
UUID landGroupID = landdata.GroupID;
if (landGroupID != UUID.Zero)
if (!landGroupID.IsZero())
{
checkflags = (int)ParcelFlags.AllowGroupObjectEntry;
if(scripts)
@@ -1741,7 +1742,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
continue;
}
if (isPrivUser || g.OwnerID == userID)
if (isPrivUser || g.OwnerID.Equals(userID))
continue;
// This is a short cut for efficiency. If land is non-null,
@@ -1768,7 +1769,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
LandData ldata = l.LandData;
// If we own the land outright, then allow
//
if (ldata.OwnerID == userID)
if (ldata.OwnerID.Equals(userID))
continue;
// Group voodoo
@@ -1787,8 +1788,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Group deeded object?
//
if (g.OwnerID == lGroupID &&
(powers & (ulong)GroupPowers.ReturnGroupOwned) == 0)
if (g.OwnerID.Equals(lGroupID) && (powers & (ulong)GroupPowers.ReturnGroupOwned) == 0)
{
objects.Remove(g);
continue;
@@ -1796,8 +1796,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Group set object?
//
if (g.GroupID == lGroupID &&
(powers & (ulong)GroupPowers.ReturnGroupSet) == 0)
if (g.GroupID.Equals(lGroupID) && (powers & (ulong)GroupPowers.ReturnGroupSet) == 0)
{
objects.Remove(g);
continue;
@@ -1848,7 +1847,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if(IsAdministrator(userID))
return true;
if(landdata.GroupID != UUID.Zero)
if(!landdata.GroupID.IsZero())
{
if ((landdata.Flags & (uint)ParcelFlags.CreateGroupObjects) != 0)
return IsGroupMember(landdata.GroupID, userID, 0);
@@ -1899,7 +1898,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
if (((lflags & (uint)ParcelFlags.AllowGroupScripts) != 0)
&& (ldata.GroupID != UUID.Zero) && (ldata.GroupID == part.GroupID))
&& (!ldata.GroupID.IsZero()) && (ldata.GroupID.Equals(part.GroupID)))
return true;
return GenericEstatePermission(part.OwnerID);
@@ -1926,7 +1925,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue;
if (sog == null || sog.IsDeleted || userID == UUID.Zero)
if (sog == null || sog.IsDeleted || userID.IsZero())
return false;
// sell is not a attachment op
@@ -1946,12 +1945,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogOwnerID = sog.OwnerID;
if(sogOwnerID == userID)
if(sogOwnerID.Equals(userID))
return true;
// else only group owned can be sold by members with powers
UUID sogGroupID = sog.GroupID;
if(sog.OwnerID != sogGroupID || sogGroupID == UUID.Zero)
if(sogGroupID.IsZero() || sog.OwnerID.NotEqual(sogGroupID))
return false;
return IsGroupMember(sogGroupID, userID, (ulong)GroupPowers.ObjectSetForSale);
@@ -1980,15 +1979,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
(sogEffectiveOwnerPerms & (uint)PermissionMask.Copy) == 0)
return false;
UUID userID = sp.UUID;
UUID sogOwnerID = sog.OwnerID;
if(sogOwnerID == userID)
if(sog.OwnerID.Equals(sp.UUID))
return true;
// else only group owned can be sold by members with powers
UUID sogGroupID = sog.GroupID;
if(sog.OwnerID != sogGroupID || sogGroupID == UUID.Zero)
if(sogGroupID.IsZero() || sog.OwnerID.NotEqual(sogGroupID))
return false;
ulong powers = 0;
@@ -2015,9 +2011,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
UUID sogOwnerID = sog.OwnerID;
UUID spID = sp.UUID;
if(sogOwnerID == spID)
if(sogOwnerID.Equals(sp.UUID))
return true;
if (sp.IsGod)
@@ -2030,12 +2025,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
UUID sogGroupID = sog.GroupID;
if (sogGroupID != UUID.Zero)
if (!sogGroupID.IsZero())
{
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, sp, ref powers))
{
if(sogGroupID == sogOwnerID)
if(sogGroupID.Equals(sogOwnerID))
{
if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
@@ -2128,7 +2123,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsAdministrator(userID))
return true;
if (objectID == UUID.Zero) // User inventory
if (objectID.IsZero()) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(userID, script);
@@ -2221,7 +2216,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (IsAdministrator(userID))
return true;
if (objectID == UUID.Zero) // User inventory
if (objectID.IsZero()) // User inventory
{
IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(userID, notecard);
@@ -2326,7 +2321,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sog == null)
return false;
if(sog.OwnerID == userID || IsAdministrator(userID))
if(sog.OwnerID.Equals(userID) || IsAdministrator(userID))
return true;
if(sog.IsAttachment)
@@ -2334,7 +2329,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID sogGroupID = sog.GroupID;
if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
if(sogGroupID.IsZero() || sogGroupID.NotEqual(sog.OwnerID))
return false;
TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
@@ -2388,7 +2383,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
}
bool notSameOwner = srcsog.OwnerID != destsog.OwnerID;
bool notSameOwner = srcsog.OwnerID.NotEqual(destsog.OwnerID);
if(notSameOwner)
{
@@ -2432,13 +2427,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions
UUID destOwner = destsog.OwnerID;
UUID spID = sp.UUID;
bool spNotOwner = spID != destOwner;
bool spNotOwner = spID.NotEqual(destOwner);
// scripts can't be droped
if(spNotOwner && item.InvType == (int)InventoryType.LSL)
return false;
if(spNotOwner || item.Owner != destOwner)
if(spNotOwner || item.Owner.NotEqual(destOwner))
{
// no copy item will be moved if it has transfer
uint itperms = item.CurrentPermissions;

View File

@@ -236,8 +236,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
public virtual void PreloadSound(UUID objectID, UUID soundID)
{
SceneObjectPart part;
if (soundID == UUID.Zero
|| !m_scene.TryGetSceneObjectPart(objectID, out part))
if (soundID.IsZero() || !m_scene.TryGetSceneObjectPart(objectID, out part))
{
return;
}
@@ -295,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
bool triggered, byte flags, bool useMaster,
bool isMaster)
{
if (soundID == UUID.Zero)
if (soundID.IsZero())
return;
SceneObjectPart part;
@@ -327,7 +326,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
public void TriggerSoundLimited(UUID objectID, UUID sound,
double volume, Vector3 min, Vector3 max)
{
if (sound == UUID.Zero)
if (sound.IsZero())
return;
SceneObjectPart part;

View File

@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
// Swap empty terrain textureIDs with default IDs
for(int i = 0; i < textureIDs.Length; i++)
{
if(textureIDs[i] == UUID.Zero)
if(textureIDs[i].IsZero())
textureIDs[i] = DEFAULT_TERRAIN_DETAIL[i];
}

View File

@@ -687,7 +687,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
int color;
Color4 ctmp = Color4.White;
if (face.TextureID == UUID.Zero)
if (face.TextureID.IsZero())
return warp_Color.White;
if (!m_colors.TryGetValue(face.TextureID, out color))
@@ -788,7 +788,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
private warp_Texture GetTexture(UUID id, SceneObjectPart sop)
{
warp_Texture ret = null;
if (id == UUID.Zero)
if (id.IsZero())
return ret;
if (m_warpTextures.TryGetValue(id, out ret))
return ret;

View File

@@ -647,7 +647,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
ScenePresence av = null;
MapRequestState st = o as MapRequestState;
if (st == null || st.agentID == UUID.Zero)
if (st == null || st.agentID.IsZero())
return;
if (m_blacklistedregions.ContainsKey(st.regionhandle))
@@ -765,7 +765,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
UUID agentID = requestState.agentID;
if (agentID == UUID.Zero || !m_scene.TryGetScenePresence(agentID, out ScenePresence sp))
if (agentID.IsZero() || !m_scene.TryGetScenePresence(agentID, out ScenePresence sp))
{
m_cachedRegionMapItemsResponses.Remove(regionhandle);
Interlocked.Decrement(ref nAsyncRequests);
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
public void OnHTTPGetMapImage(IOSHttpRequest request, IOSHttpResponse response)
{
response.KeepAlive = false;
if (request.HttpMethod != "GET" || m_scene.RegionInfo.RegionSettings.TerrainImageID == UUID.Zero)
if (request.HttpMethod != "GET" || m_scene.RegionInfo.RegionSettings.TerrainImageID.IsZero())
{
response.StatusCode = (int)HttpStatusCode.NotFound;
return;
@@ -1367,7 +1367,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
foreach(GridRegion r in regions)
{
if(r.TerrainImage == UUID.Zero)
if(r.TerrainImage.IsZero())
continue;
if(doneLocal && r.RegionHandle == m_regionHandle)

View File

@@ -182,7 +182,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
lock (m_animations)
{
int j = m_defaultAnimation.AnimID == UUID.Zero ? 0 : 1;
int j = m_defaultAnimation.AnimID.IsZero() ? 0 : 1;
int defaultSize = m_animations.Count + j;
animIDs = new UUID[defaultSize];

View File

@@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes
private Dictionary<string, UUID> m_overrides = new Dictionary<string, UUID>();
public void SetOverride(string state, UUID animID)
{
if (animID == UUID.Zero)
if (animID.IsZero())
{
if (state == "ALL")
m_overrides.Clear();

View File

@@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
return;
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
if (animID == UUID.Zero)
if (animID.IsZero())
return;
// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", animID, name, m_scenePresence.Name);
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
return;
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
if (animID == UUID.Zero)
if (animID.IsZero())
return;
RemoveAnimation(animID, true);
@@ -213,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
if (anim == "SITGROUND")
{
UUID defsit = DefaultAvatarAnimations.AnimsUUIDbyName["SIT_GROUND_CONSTRAINED"];
if (defsit == UUID.Zero)
if (defsit.IsZero())
return false;
m_animations.SetDefaultAnimation(defsit, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
aoSitGndAnim = overridenAnim;

View File

@@ -263,7 +263,7 @@ namespace OpenSim.Region.Framework.Scenes
return UUID.Zero;
}
if (objectID == UUID.Zero)
if (objectID.IsZero())
{
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
if (invAccess != null)
@@ -845,7 +845,7 @@ namespace OpenSim.Region.Framework.Scenes
itemCopy.BasePermissions = item.BasePermissions;
}
if (itemCopy.Folder == UUID.Zero)
if (itemCopy.Folder.IsZero())
{
InventoryFolderBase folder = null;
if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType))
@@ -936,7 +936,7 @@ namespace OpenSim.Region.Framework.Scenes
return null;
}
if (recipientParentFolderId == UUID.Zero)
if (recipientParentFolderId.IsZero())
{
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
if (recipientRootFolder != null)
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Framework.Scenes
return null;
}
if (recipientParentFolderId == UUID.Zero)
if (recipientParentFolderId.IsZero())
{
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
if (recipientRootFolder != null)
@@ -1538,7 +1538,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetSceneObjectPart(primLocalId);
// Can't move a null item
if (itemId == UUID.Zero)
if (itemId.IsZero())
return;
if (null == part)
@@ -1829,7 +1829,7 @@ namespace OpenSim.Region.Framework.Scenes
uint primLocalID)
{
UUID itemID = itemInfo.ItemID;
if (itemID == UUID.Zero)
if (itemID.IsZero())
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: UpdateTaskInventory called with item ID Zero on update for {1}!",
@@ -1923,7 +1923,7 @@ namespace OpenSim.Region.Framework.Scenes
if (remoteClient.AgentId != part.OwnerID) // Not owner
{
noChange = true;
if(itemInfo.OwnerID == UUID.Zero && itemInfo.GroupID != UUID.Zero)
if(itemInfo.OwnerID.IsZero() && !itemInfo.GroupID.IsZero())
{
if(remoteClient.IsGroupMember(itemInfo.GroupID))
{
@@ -2195,7 +2195,7 @@ namespace OpenSim.Region.Framework.Scenes
if (srcPart.OwnerID != destPart.OwnerID)
{
// Group permissions
if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) ||
if ((destPart.GroupID.IsZero()) || (destPart.GroupID.NotEqual(srcPart.GroupID)) ||
((destPart.GroupMask & (uint)PermissionMask.Modify) == 0))
return;
if((srcPart.OwnerMask & (uint)PermissionMask.Transfer) == 0)
@@ -2643,7 +2643,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}",
// remoteClient.Name, itemID, fromTaskID);
if (fromTaskID == UUID.Zero)
if (fromTaskID.IsZero())
{
// rez from user inventory
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();

View File

@@ -548,7 +548,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[USER INVENTORY]: HandleFetchInventoryDescendents() for {0}, folder={1}, fetchFolders={2}, fetchItems={3}, sortOrder={4}",
// remoteClient.Name, folderID, fetchFolders, fetchItems, sortOrder);
if (folderID == UUID.Zero)
if (folderID.IsZero())
return;
// FIXME MAYBE: We're not handling sortOrder!

View File

@@ -1040,7 +1040,7 @@ namespace OpenSim.Region.Framework.Scenes
DeedObjectHandler handler = OnDeedObject;
if (handler != null)
{
if(sog == null || client == null || client.SceneAgent == null || targetGroupID == UUID.Zero)
if(sog == null || client == null || client.SceneAgent == null || targetGroupID.IsZero())
return false;
ScenePresence sp = client.SceneAgent as ScenePresence;

View File

@@ -882,25 +882,25 @@ namespace OpenSim.Region.Framework.Scenes
m_extraSettings = simDataService.GetExtra(RegionInfo.RegionID);
bool updatedTerrainTextures = false;
if (rs.TerrainTexture1 == UUID.Zero)
if (rs.TerrainTexture1.IsZero())
{
rs.TerrainTexture1 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_1;
updatedTerrainTextures = true;
}
if (rs.TerrainTexture2 == UUID.Zero)
if (rs.TerrainTexture2.IsZero())
{
rs.TerrainTexture2 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_2;
updatedTerrainTextures = true;
}
if (rs.TerrainTexture3 == UUID.Zero)
if (rs.TerrainTexture3.IsZero())
{
rs.TerrainTexture3 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_3;
updatedTerrainTextures = true;
}
if (rs.TerrainTexture4 == UUID.Zero)
if (rs.TerrainTexture4.IsZero())
{
rs.TerrainTexture4 = RegionSettings.DEFAULT_TERRAIN_TEXTURE_4;
updatedTerrainTextures = true;
@@ -2466,7 +2466,7 @@ namespace OpenSim.Region.Framework.Scenes
if (physresults != null && physresults.Count > 0)
{
// look for terrain ?
if(RayTargetID == UUID.Zero)
if(RayTargetID.IsZero())
{
foreach (ContactResult r in physresults)
{
@@ -3037,7 +3037,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
public bool AddSceneObject(SceneObjectGroup sceneObject)
{
if (sceneObject.OwnerID == UUID.Zero)
if (sceneObject.OwnerID.IsZero())
{
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero", sceneObject.UUID);
return false;
@@ -3101,7 +3101,7 @@ namespace OpenSim.Region.Framework.Scenes
// RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
// RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
}
if (sceneObject.OwnerID == UUID.Zero)
if (sceneObject.OwnerID.IsZero())
{
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero after attachment processing. BUG!", sceneObject.UUID);
return false;
@@ -3109,7 +3109,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
if (sceneObject.OwnerID == UUID.Zero)
if (sceneObject.OwnerID.IsZero())
{
m_log.ErrorFormat("[SCENE]: Owner ID for non-attachment {0} was zero", sceneObject.UUID);
return false;

View File

@@ -432,7 +432,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("[SCENEGRAPH]: Tried to add null scene object");
return false;
}
if (sceneObject.UUID == UUID.Zero)
if (sceneObject.UUID.IsZero())
{
m_log.ErrorFormat(
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",

View File

@@ -2419,7 +2419,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
if (IsDeleted || inTransit || UUID == UUID.Zero)
if (IsDeleted || inTransit || UUID.IsZero())
{
// m_log.DebugFormat(
// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
@@ -2445,8 +2445,8 @@ namespace OpenSim.Region.Framework.Scenes
parcel.LandData.OtherCleanTime != 0)
{
if (parcel.LandData.OwnerID != OwnerID &&
(parcel.LandData.GroupID != GroupID ||
parcel.LandData.GroupID == UUID.Zero))
(parcel.LandData.GroupID.NotEqual(GroupID) ||
parcel.LandData.GroupID.IsZero()))
{
if ((DateTime.UtcNow - RootPart.Rezzed).TotalMinutes >
parcel.LandData.OtherCleanTime)

View File

@@ -1511,7 +1511,7 @@ namespace OpenSim.Region.Framework.Scenes
if (value == invalidCollisionSoundUUID)
m_collisionSoundType = -1;
else if (value == UUID.Zero)
else if (value.IsZero())
m_collisionSoundType = 0;
else
m_collisionSoundType = 1;
@@ -3032,7 +3032,7 @@ namespace OpenSim.Region.Framework.Scenes
// The Collision sounds code calls this
public void SendCollisionSound(UUID soundID, double volume, Vector3 position)
{
if (soundID == UUID.Zero)
if (soundID.IsZero())
return;
ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>();
@@ -5626,7 +5626,7 @@ namespace OpenSim.Region.Framework.Scenes
{
lock (ParentGroup.m_sittingAvatars)
{
if (IsSitTargetSet && SitTargetAvatar == UUID.Zero)
if (IsSitTargetSet && SitTargetAvatar.IsZero())
SitTargetAvatar = sp.UUID;
if (m_sittingAvatars == null)
@@ -5762,7 +5762,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool AddAnimation(UUID animId, string animName)
{
if (animId == UUID.Zero || string.IsNullOrEmpty(animName) ||
if (animId.IsZero() || string.IsNullOrEmpty(animName) ||
ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
return false;
@@ -5785,7 +5785,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool RemoveAnimation(UUID animId)
{
if (animId == UUID.Zero || ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
if (animId.IsZero() || ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
return false;
lock (animsLock)
@@ -5944,7 +5944,7 @@ namespace OpenSim.Region.Framework.Scenes
while(--count >= 0)
{
UUID id = new UUID(data, pos);
if(id == UUID.Zero)
if(id.IsZero())
break;
pos += 16;
int strlen = data[pos++];

View File

@@ -1238,10 +1238,10 @@ namespace OpenSim.Region.Framework.Scenes
if (item.GroupPermissions != (uint)PermissionMask.None)
item.GroupID = m_part.GroupID;
if(item.OwnerID == UUID.Zero) // viewer to internal enconding of group owned
if(item.OwnerID.IsZero()) // viewer to internal enconding of group owned
item.OwnerID = item.GroupID;
if (item.AssetID == UUID.Zero)
if (item.AssetID.IsZero())
item.AssetID = m_items[item.ItemID].AssetID;
m_items[item.ItemID] = item;

View File

@@ -4638,7 +4638,7 @@ namespace OpenSim.Region.Framework.Scenes
AgentPosition agentpos = new AgentPosition()
{
AgentID = new UUID(UUID.Guid),
AgentID = UUID,
SessionID = ControllingClient.SessionId,
Size = Appearance.AvatarSize,
Center = CameraPosition,