Fixed some comparisons of LLUUIDs to null.

Thanks to DrSchofld for pointing this out.
0.6.0-stable
Jeff Ames 2008-03-19 09:36:13 +00:00
parent d135dad051
commit a0e1be3280
6 changed files with 13 additions and 19 deletions

View File

@ -439,17 +439,15 @@ namespace OpenSim.Framework.UserManagement
userAgent.agentOnline = false; userAgent.agentOnline = false;
userAgent.logoutTime = Util.UnixTimeSinceEpoch(); userAgent.logoutTime = Util.UnixTimeSinceEpoch();
//userAgent.sessionID = LLUUID.Zero; //userAgent.sessionID = LLUUID.Zero;
if (regionid != null) if (regionid != LLUUID.Zero)
{ {
userAgent.currentRegion = regionid; userAgent.currentRegion = regionid;
} }
userAgent.currentHandle = regionhandle; userAgent.currentHandle = regionhandle;
userAgent.currentPos = currentPos; userAgent.currentPos = currentPos;
userProfile.currentAgent = userAgent; userProfile.currentAgent = userAgent;
CommitAgent(ref userProfile); CommitAgent(ref userProfile);
} }
else else

View File

@ -359,7 +359,7 @@ namespace OpenSim.Framework
public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) public bool shouldMasterAvatarDetailsBeAsked(string configuration_key)
{ {
if (MasterAvatarAssignedUUID.Equals(null) || MasterAvatarAssignedUUID.ToString() == LLUUID.Zero.ToString()) if (MasterAvatarAssignedUUID == LLUUID.Zero)
{ {
return true; return true;
} }

View File

@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules
public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID) public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID)
{ {
LLUUID channel = null; LLUUID channel = new LLUUID();
//Is a dupe? //Is a dupe?
foreach (RPCChannelInfo ci in m_openChannels.Values) foreach (RPCChannelInfo ci in m_openChannels.Values)
@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules
} }
} }
if ((channel.Equals(null)) || (channel.Equals(LLUUID.Zero))) if (channel == LLUUID.Zero)
{ {
channel = LLUUID.Random(); channel = LLUUID.Random();
RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, channel); RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, channel);

View File

@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment
} }
// If there is no master avatar, return false // If there is no master avatar, return false
if (!m_scene.RegionInfo.MasterAvatarAssignedUUID.Equals(null)) if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
{ {
return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; return m_scene.RegionInfo.MasterAvatarAssignedUUID == user;
} }
@ -96,7 +96,8 @@ namespace OpenSim.Region.Environment
{ {
return true; return true;
} }
if (!user.Equals(null))
if (user != LLUUID.Zero)
{ {
LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers; LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers;
for (int i = 0; i < estatemanagers.Length; i++) for (int i = 0; i < estatemanagers.Length; i++)
@ -105,11 +106,6 @@ namespace OpenSim.Region.Environment
return true; return true;
} }
} }
// The below is commented out because logically it happens anyway. It's left in for readability
//else
//{
//return false;
//}
return false; return false;
} }

View File

@ -178,8 +178,8 @@ namespace OpenSim.Region.Environment.Scenes
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
InventoryItemBase item, LLUUID copyItemID) InventoryItemBase item, LLUUID copyItemID)
{ {
LLUUID newItemId = (!copyItemID.Equals(null)) ? copyItemID : item.inventoryID; LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.inventoryID;
SceneObjectPart part = GetChildPart(localID); SceneObjectPart part = GetChildPart(localID);
if (part != null) if (part != null)
{ {

View File

@ -3339,7 +3339,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (landowner.Equals(null)) if (landowner == LLUUID.Zero)
{ {
return; return;
} }
@ -3355,7 +3355,7 @@ namespace OpenSim.Region.ScriptEngine.Common
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if(landowner.Equals(null)) if(landowner == LLUUID.Zero)
{ {
return; return;
} }
@ -4306,7 +4306,7 @@ namespace OpenSim.Region.ScriptEngine.Common
LLUUID reqID = httpScriptMod. LLUUID reqID = httpScriptMod.
StartHttpRequest(m_localID, m_itemID, url, param, body); StartHttpRequest(m_localID, m_itemID, url, param, body);
if (!reqID.Equals(null)) if (reqID != LLUUID.Zero)
return reqID.ToString(); return reqID.ToString();
else else
return null; return null;