Formatting cleanup, minor refactoring. Fixed some comparisons of value types and null.

This commit is contained in:
Jeff Ames
2008-05-18 23:06:50 +00:00
parent 901e97f821
commit 6ec680918b
14 changed files with 93 additions and 122 deletions

View File

@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Interfaces
{
public delegate void ObjectPaid(LLUUID objectID, LLUUID agentID, int amount);
public interface IMoneyModule : IRegionModule
{
{
bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID,
int amount);

View File

@@ -2658,7 +2658,7 @@ namespace OpenSim.Region.Environment.Scenes
ClientManager.ForEachClient(delegate(IClientAPI controller)
{
ScenePresence p = GetScenePresence(controller.AgentId);
bool childagent = !p.Equals(null) && p.IsChildAgent;
bool childagent = p != null && p.IsChildAgent;
if (controller.AgentId != godID && !childagent)
// Do we really want to kick the initiator of this madness?
{
@@ -2669,14 +2669,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
if (m_scenePresences[agentID].IsChildAgent)
{
m_innerScene.removeUserCount(false);
}
else
{
m_innerScene.removeUserCount(true);
}
m_innerScene.removeUserCount(!m_scenePresences[agentID].IsChildAgent);
m_scenePresences[agentID].ControllingClient.Kick(Helpers.FieldToUTF8String(reason));
m_scenePresences[agentID].ControllingClient.Close(true);
@@ -2696,7 +2689,6 @@ namespace OpenSim.Region.Environment.Scenes
// Check for spoofing.. since this is permissions we're talking about here!
if ((controller.SessionId == sessionID) && (controller.AgentId == agentID))
{
// Tell the object to do permission update
if (localId != 0)
{
@@ -2706,7 +2698,6 @@ namespace OpenSim.Region.Environment.Scenes
chObjectGroup.UpdatePermissions(agentID, field, localId, mask, set);
}
}
}
}
@@ -3126,8 +3117,8 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="action"></param>
public void ForEachScenePresence(Action<ScenePresence> action)
{
// We don't want to try to send messages if there are no avatar.
if (!(m_scenePresences.Equals(null)))
// We don't want to try to send messages if there are no avatars.
if (m_scenePresences != null)
{
try
{

View File

@@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Scenes
Result = m_localScenes[i].RegionInfo;
}
}
if (!(Result.Equals(null)))
if (Result != null)
{
for (int i = 0; i < m_localScenes.Count; i++)
{

View File

@@ -497,26 +497,26 @@ namespace OpenSim.Region.Environment.Scenes
{
foreach (TaskInventoryItem item in m_taskInventory.Values)
{
LLUUID ownerID=item.OwnerID;
uint everyoneMask=0;
uint baseMask=item.BaseMask;
uint ownerMask=item.OwnerMask;
LLUUID ownerID = item.OwnerID;
uint everyoneMask = 0;
uint baseMask = item.BaseMask;
uint ownerMask = item.OwnerMask;
if(item.InvType == 10) // Script
if (item.InvType == 10) // Script
{
if((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanViewScript(item.ItemID, UUID, client.AgentId))
if ((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanViewScript(item.ItemID, UUID, client.AgentId))
{
ownerID=client.AgentId;
baseMask=0x7fffffff;
ownerMask=0x7fffffff;
everyoneMask=(uint)(PermissionMask.Move | PermissionMask.Transfer);
ownerID = client.AgentId;
baseMask = 0x7fffffff;
ownerMask = 0x7fffffff;
everyoneMask = (uint)(PermissionMask.Move | PermissionMask.Transfer);
}
if((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanEditScript(item.ItemID, UUID, client.AgentId))
if ((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanEditScript(item.ItemID, UUID, client.AgentId))
{
ownerID=client.AgentId;
baseMask=0x7fffffff;
ownerMask=0x7fffffff;
everyoneMask=(uint)(PermissionMask.Move | PermissionMask.Transfer | PermissionMask.Modify);
ownerID = client.AgentId;
baseMask = 0x7fffffff;
ownerMask = 0x7fffffff;
everyoneMask = (uint)(PermissionMask.Move | PermissionMask.Transfer | PermissionMask.Modify);
}
}

View File

@@ -1469,7 +1469,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
{
m_log.Info("[APPEARANCE] Setting wearable with client, wearableid, wearable");
m_log.Info("[APPEARANCE] Setting wearable with client, wearableid, wearable");
m_appearance.SetWearable(wearableId, wearable);
m_scene.CommsManager.UserService.UpdateUserAppearance(client.AgentId, m_appearance);
client.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
@@ -1524,7 +1524,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetWearable(int wearableId, AvatarWearable wearable)
{
m_log.Warn("[APPEARANCE] Setting Wearable");
m_log.Warn("[APPEARANCE] Setting Wearable");
m_appearance.SetWearable(wearableId, wearable);
m_scene.CommsManager.UserService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
}