From 13526097f24b7a8ad63b1d482c44b44397fa055f Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Thu, 1 May 2008 16:35:00 +0000
Subject: * Spring cleaning on Region.Environment. * Converted a large number
of read-only fields to be actually, readonly. * Reformatted code sections. *
Removed redundant code.
---
.../Region/Environment/InstantMessageReceiver.cs | 5 +-
.../Interfaces/IAgentAssetTransactions.cs | 2 +-
.../Environment/Interfaces/IAvatarFactory.cs | 4 +-
.../Region/Environment/Interfaces/IHttpRequests.cs | 2 +-
.../Region/Environment/Interfaces/ILandChannel.cs | 5 +-
.../Environment/Interfaces/IRegionDataStore.cs | 6 +-
.../Region/Environment/Interfaces/IRegionModule.cs | 6 +-
OpenSim/Region/Environment/Interfaces/ISimChat.cs | 2 +-
.../Region/Environment/Interfaces/IWorldComm.cs | 2 +-
OpenSim/Region/Environment/Interfaces/IXMLRPC.cs | 2 +-
OpenSim/Region/Environment/Interfaces/IXfer.cs | 2 +-
OpenSim/Region/Environment/ModuleLoader.cs | 36 +-
.../Agent/AssetDownload/AssetDownloadModule.cs | 21 +-
.../AssetTransaction/AgentAssetsTransactions.cs | 20 +-
.../AssetTransaction/AssetTransactionModule.cs | 13 +-
.../Agent/TextureDownload/TextureDownloadModule.cs | 9 +-
.../Agent/TextureDownload/TextureNotFoundSender.cs | 6 +-
.../Modules/Agent/TextureSender/TextureSender.cs | 19 +-
.../Environment/Modules/Agent/Xfer/XferModule.cs | 12 +-
.../Environment/Modules/Avatar/Chat/ChatModule.cs | 56 +-
.../Currency/SampleMoney/SampleMoneyModule.cs | 80 +-
.../Modules/Avatar/Friends/FriendsModule.cs | 34 +-
.../Modules/Avatar/Groups/GroupsModule.cs | 10 +-
.../Modules/Avatar/Inventory/InventoryModule.cs | 2 +-
.../Avatar/Profiles/AvatarProfilesModule.cs | 6 +-
.../Environment/Modules/Framework/Commander.cs | 22 +-
.../Modules/Framework/CommanderTestModule.cs | 2 +-
.../Modules/Grid/Interregion/InterregionModule.cs | 4 +-
.../DynamicTexture/DynamicTextureModule.cs | 10 +-
.../Scripting/HttpRequest/ScriptsHttpRequests.cs | 6 +-
.../Scripting/LoadImageURL/LoadImageURLModule.cs | 10 +-
.../Scripting/VectorRender/VectorRenderModule.cs | 10 +-
.../Modules/Scripting/WorldComm/WorldCommModule.cs | 8 +-
.../Modules/Scripting/XMLRPC/XMLRPCModule.cs | 24 +-
.../Environment/Modules/World/Land/LandChannel.cs | 30 +-
.../Modules/World/Land/LandManagementModule.cs | 6 +-
.../Environment/Modules/World/Land/LandObject.cs | 30 +-
.../Modules/World/Serialiser/SerialiserModule.cs | 14 +-
.../Environment/Modules/World/Sun/SunModule.cs | 2 +-
.../Modules/World/Terrain/Effects/CookieCutter.cs | 2 +-
.../Modules/World/Terrain/FileLoaders/LLRAW.cs | 4 +-
.../Modules/World/Terrain/FileLoaders/Terragen.cs | 6 +-
.../World/Terrain/PaintBrushes/FlattenSphere.cs | 1 -
.../World/Terrain/PaintBrushes/NoiseSphere.cs | 2 +-
.../World/Terrain/PaintBrushes/RevertSphere.cs | 2 +-
.../Modules/World/Terrain/TerrainException.cs | 2 +-
.../Modules/World/Terrain/TerrainModule.cs | 6 +-
.../World/TreePopulator/TreePopulatorModule.cs | 4 +-
OpenSim/Region/Environment/PermissionManager.cs | 361 ++-
.../Region/Environment/Scenes/AvatarAnimations.cs | 6 +-
.../Region/Environment/Scenes/AvatarAppearance.cs | 123 +-
OpenSim/Region/Environment/Scenes/EntityBase.cs | 193 +-
.../Environment/Scenes/IScenePresenceBody.cs | 2 +-
OpenSim/Region/Environment/Scenes/InnerScene.cs | 198 +-
.../Region/Environment/Scenes/Scene.Inventory.cs | 316 +-
.../Environment/Scenes/Scene.PacketHandlers.cs | 30 +-
OpenSim/Region/Environment/Scenes/Scene.cs | 561 ++--
OpenSim/Region/Environment/Scenes/SceneBase.cs | 71 +-
.../Scenes/SceneCommunicationService.cs | 534 ++--
OpenSim/Region/Environment/Scenes/SceneEvents.cs | 337 ++-
OpenSim/Region/Environment/Scenes/SceneManager.cs | 82 +-
.../Scenes/SceneObjectGroup.Inventory.cs | 59 +-
.../Region/Environment/Scenes/SceneObjectGroup.cs | 377 ++-
.../Scenes/SceneObjectPart.Inventory.cs | 150 +-
.../Region/Environment/Scenes/SceneObjectPart.cs | 2670 ++++++++--------
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 3190 ++++++++++----------
.../Region/Environment/Scenes/SceneXmlLoader.cs | 10 +-
.../Environment/Scenes/Scripting/IScriptHost.cs | 2 +-
.../Environment/Scenes/Scripting/NullScriptHost.cs | 8 +-
.../Scenes/Scripting/ScriptEngineInterface.cs | 2 +-
.../Scenes/Scripting/ScriptEngineLoader.cs | 4 +-
.../Region/Environment/Scenes/SimStatsReporter.cs | 274 +-
OpenSim/Region/Environment/Scenes/UndoState.cs | 20 +-
OpenSim/Region/Environment/StorageManager.cs | 14 +-
.../Region/Environment/Types/BasicQuadTreeNode.cs | 53 +-
OpenSim/Region/Environment/Types/UpdateQueue.cs | 103 +-
76 files changed, 5093 insertions(+), 5226 deletions(-)
(limited to 'OpenSim/Region/Environment')
diff --git a/OpenSim/Region/Environment/InstantMessageReceiver.cs b/OpenSim/Region/Environment/InstantMessageReceiver.cs
index b82b4aa..cc7880d 100644
--- a/OpenSim/Region/Environment/InstantMessageReceiver.cs
+++ b/OpenSim/Region/Environment/InstantMessageReceiver.cs
@@ -32,13 +32,10 @@ namespace OpenSim.Region.Environment
///
/// Bit Vector for Which Modules to send an instant message to from the Scene or an Associated Module
///
-
// This prevents the Modules from sending Instant messages to other modules through the scene
// and then receiving the same messages
-
// This is mostly here because on LLSL and the SecondLife Client, IMs,Groups and friends are linked
// inseparably
-
[Flags]
public enum InstantMessageReceiver : uint
{
@@ -51,4 +48,4 @@ namespace OpenSim.Region.Environment
/// The Groups Module
GroupsModule = 0x00000004
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs b/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs
index c099fa1..5d2ec89 100644
--- a/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs
+++ b/OpenSim/Region/Environment/Interfaces/IAgentAssetTransactions.cs
@@ -41,4 +41,4 @@ namespace OpenSim.Region.Environment.Interfaces
void RemoveAgentAssetTransactions(LLUUID userID);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
index 3ebbaab..d5473fb 100644
--- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
+++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
@@ -30,9 +30,9 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Interfaces
{
- public interface IAvatarFactory
+ public interface IAvatarFactory
{
bool TryGetAvatarAppearance(LLUUID avatarId, out AvatarAppearance appearance);
void UpdateDatabase(LLUUID userID, AvatarAppearance avatAppearance);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
index 46ba9b2..8e2c978 100644
--- a/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
+++ b/OpenSim/Region/Environment/Interfaces/IHttpRequests.cs
@@ -39,4 +39,4 @@ namespace OpenSim.Region.Environment.Interfaces
HttpRequestClass GetNextCompletedRequest();
void RemoveCompletedRequest(LLUUID id);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs
index 464a213..8486f70 100644
--- a/OpenSim/Region/Environment/Interfaces/ILandChannel.cs
+++ b/OpenSim/Region/Environment/Interfaces/ILandChannel.cs
@@ -70,7 +70,8 @@ namespace OpenSim.Region.Environment.Interfaces
void handleSignificantClientMovement(IClientAPI remote_client);
void handleAnyClientMovement(ScenePresence avatar);
void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);
- void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, List entries, IClientAPI remote_client);
+ void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID, uint flags, int landLocalID, List entries,
+ IClientAPI remote_client);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index c757461..e7af0a9 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Environment.Interfaces
///
///
void StoreObject(SceneObjectGroup obj, LLUUID regionUUID);
-
+
///
/// Entirely removes the object, including inventory
///
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Environment.Interfaces
///
///
void RemoveObject(LLUUID uuid, LLUUID regionUUID);
-
+
///
/// Store a prim's inventory
///
@@ -74,4 +74,4 @@ namespace OpenSim.Region.Environment.Interfaces
void Shutdown();
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionModule.cs b/OpenSim/Region/Environment/Interfaces/IRegionModule.cs
index ffa4f32..80698d5 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionModule.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionModule.cs
@@ -32,10 +32,10 @@ namespace OpenSim.Region.Environment.Interfaces
{
public interface IRegionModule
{
+ string Name { get; }
+ bool IsSharedModule { get; }
void Initialise(Scene scene, IConfigSource source);
void PostInitialise();
void Close();
- string Name { get; }
- bool IsSharedModule { get; }
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/ISimChat.cs b/OpenSim/Region/Environment/Interfaces/ISimChat.cs
index d52e58b..9335b00 100644
--- a/OpenSim/Region/Environment/Interfaces/ISimChat.cs
+++ b/OpenSim/Region/Environment/Interfaces/ISimChat.cs
@@ -34,4 +34,4 @@ namespace OpenSim.Region.Environment.Interfaces
{
void SimChat(Object sender, ChatFromViewerArgs e);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs
index 8a63c54..992db19 100644
--- a/OpenSim/Region/Environment/Interfaces/IWorldComm.cs
+++ b/OpenSim/Region/Environment/Interfaces/IWorldComm.cs
@@ -43,4 +43,4 @@ namespace OpenSim.Region.Environment.Interfaces
uint PeekNextMessageLocalID();
LLUUID PeekNextMessageItemID();
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
index 6c1d025..959b0b7 100644
--- a/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
+++ b/OpenSim/Region/Environment/Interfaces/IXMLRPC.cs
@@ -45,4 +45,4 @@ namespace OpenSim.Region.Environment.Interfaces
void RemoveCompletedSRDRequest(LLUUID id);
void CancelSRDRequests(LLUUID itemID);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Interfaces/IXfer.cs b/OpenSim/Region/Environment/Interfaces/IXfer.cs
index bad1833..bb2caca 100644
--- a/OpenSim/Region/Environment/Interfaces/IXfer.cs
+++ b/OpenSim/Region/Environment/Interfaces/IXfer.cs
@@ -31,4 +31,4 @@ namespace OpenSim.Region.Environment.Interfaces
{
bool AddNewFile(string fileName, byte[] data);
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index 3f8b9ff..caaa28f 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -47,12 +47,11 @@ namespace OpenSim.Region.Environment
public class ModuleLoader
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- public Dictionary LoadedAssemblys = new Dictionary();
+ private readonly IConfigSource m_config;
private readonly List m_loadedModules = new List();
private readonly Dictionary m_loadedSharedModules = new Dictionary();
- private readonly IConfigSource m_config;
+ public Dictionary LoadedAssemblys = new Dictionary();
public ModuleLoader(IConfigSource config)
{
@@ -86,7 +85,8 @@ namespace OpenSim.Region.Environment
DynamicTextureModule dynamicModule = new DynamicTextureModule();
if (m_loadedSharedModules.ContainsKey(dynamicModule.Name))
{
- m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule");
+ m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name,
+ "DynamicTextureModule");
}
else
{
@@ -123,15 +123,15 @@ namespace OpenSim.Region.Environment
m_loadedSharedModules.Add(loadMod.Name, loadMod);
}
- // AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
- // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name))
- // {
- // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule");
- // }
- // else
- // {
- // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory);
- // }
+ // AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
+ // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name))
+ // {
+ // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule");
+ // }
+ // else
+ // {
+ // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory);
+ // }
XMLRPCModule xmlRpcMod = new XMLRPCModule();
if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name))
@@ -149,13 +149,13 @@ namespace OpenSim.Region.Environment
AssetTransactionModule transactionsModule = new AssetTransactionModule();
if (m_loadedSharedModules.ContainsKey(transactionsModule.Name))
{
- m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", transactionsModule.Name, "TransactionModule");
+ m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", transactionsModule.Name,
+ "TransactionModule");
}
else
{
m_loadedSharedModules.Add(transactionsModule.Name, transactionsModule);
}
-
}
public void InitialiseSharedModules(Scene scene)
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment
{
if (pluginType.GetInterface("IRegionModule") != null)
{
- modules.Add((IRegionModule)Activator.CreateInstance(pluginType));
+ modules.Add((IRegionModule) Activator.CreateInstance(pluginType));
}
}
}
@@ -320,8 +320,8 @@ namespace OpenSim.Region.Environment
public void UnloadModule(IRegionModule rm)
{
rm.Close();
-
+
m_loadedModules.Remove(rm);
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
index 48db51b..550b673 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
@@ -40,15 +40,16 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
///
/// Asset requests with data which are ready to be sent back to requesters. This includes textures.
///
- private List AssetRequests;
+ private readonly List AssetRequests;
- private Scene m_scene;
- private Dictionary RegisteredScenes = new Dictionary();
+ private readonly Dictionary RegisteredScenes = new Dictionary();
///
/// Assets requests (for each user) which are waiting for asset server data. This includes texture requests
///
- private Dictionary> RequestedAssets;
+ private readonly Dictionary> RequestedAssets;
+
+ private Scene m_scene;
public AssetDownloadModule()
{
@@ -205,22 +206,18 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
{
public AssetBase AssetInf;
public byte AssetRequestSource = 2;
- public long DataPointer = 0;
+ public long DataPointer;
public int DiscardLevel = -1;
public AssetBase ImageInfo;
public bool IsTextureRequest;
- public int NumPackets = 0;
- public int PacketCounter = 0;
- public byte[] Params = null;
+ public int NumPackets;
+ public int PacketCounter;
+ public byte[] Params;
public LLUUID RequestAssetID;
public IClientAPI RequestUser;
public LLUUID TransferRequestID;
//public bool AssetInCache;
//public int TimeRequested;
-
- public AssetRequest()
- {
- }
}
#endregion
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 555d5f4..008daa2 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Fields
- private bool m_dumpAssetsToFile;
+ private readonly bool m_dumpAssetsToFile;
public AgentAssetTransactionsManager Manager;
public LLUUID UserID;
public Dictionary XferUploaders = new Dictionary();
@@ -141,23 +141,23 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
public class AssetXferUploader
{
// Fields
+ private readonly bool m_dumpAssetToFile;
+ private readonly AgentAssetTransactions m_userTransactions;
public bool AddToInventory;
public AssetBase Asset;
public LLUUID InventFolder = LLUUID.Zero;
- private sbyte invType = 0;
- private bool m_createItem = false;
+ private sbyte invType;
+ private bool m_createItem;
private string m_description = String.Empty;
- private bool m_dumpAssetToFile;
- private bool m_finished = false;
+ private bool m_finished;
private string m_name = String.Empty;
private bool m_storeLocal;
- private AgentAssetTransactions m_userTransactions;
- private uint nextPerm = 0;
+ private uint nextPerm;
private IClientAPI ourClient;
public LLUUID TransactionID = LLUUID.Zero;
- private sbyte type = 0;
+ private sbyte type;
public bool UploadComplete;
- private byte wearableType = 0;
+ private byte wearableType;
public ulong XferID;
public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile)
@@ -390,7 +390,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
item.BasePermissions = 2147483647;
item.CurrentPermissions = 2147483647;
item.NextPermissions = nextPerm;
- item.Flags = (uint) wearableType;
+ item.Flags = wearableType;
userInfo.AddItem(ourClient.AgentId, item);
ourClient.SendInventoryItemCreateUpdate(item);
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
index fcd0e0c..d7f5804 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -40,16 +40,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions
{
private readonly Dictionary RegisteredScenes = new Dictionary();
- private bool m_dumpAssetsToFile = false;
- private Scene m_scene = null;
+ private bool m_dumpAssetsToFile;
+ private Scene m_scene;
private AgentAssetTransactionsManager m_transactionManager;
- public AssetTransactionModule()
- {
- // System.Console.WriteLine("creating AgentAssetTransactionModule");
- }
-
#region IAgentAssetTransactions Members
public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID,
@@ -145,13 +140,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
///
/// Each agent has its own singleton collection of transactions
///
- private Dictionary AgentTransactions =
+ private readonly Dictionary AgentTransactions =
new Dictionary();
///
/// Should we dump uploaded assets to the filesystem?
///
- private bool m_dumpAssetsToFile;
+ private readonly bool m_dumpAssetsToFile;
public Scene MyScene;
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
index 474ac75..96ef61f 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
private readonly BlockingQueue m_queueSenders
= new BlockingQueue();
+ private readonly List m_scenes = new List();
+
///
/// Each user has their own texture download service.
///
@@ -54,14 +56,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
new Dictionary();
private Scene m_scene;
- private List m_scenes = new List();
private Thread m_thread;
- public TextureDownloadModule()
- {
- }
-
#region IRegionModule Members
public void Initialise(Scene scene, IConfigSource config)
@@ -69,7 +66,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
if (m_scene == null)
{
//Console.WriteLine("Creating Texture download module");
- m_thread = new Thread(new ThreadStart(ProcessTextureSenders));
+ m_thread = new Thread(ProcessTextureSenders);
m_thread.Name = "ProcessTextureSenderThread";
m_thread.IsBackground = true;
m_thread.Start();
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
index 70e44d4..7d4c919 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs
@@ -40,13 +40,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
//private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- private bool m_cancel = false;
+ private readonly LLUUID m_textureId;
+ private bool m_cancel;
private IClientAPI m_client;
// See ITextureSender
- private bool m_sending = false;
- private LLUUID m_textureId;
+ private bool m_sending;
// See ITextureSender
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index 02c541b..44b9a23 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -43,12 +43,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly IClientAPI RequestUser;
+
///
/// Records the number of times texture send has been called.
///
- public int counter = 0;
+ public int counter;
- public bool ImageLoaded = false;
+ public bool ImageLoaded;
///
/// Holds the texture asset to send.
@@ -57,27 +59,26 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
//public LLUUID assetID { get { return m_asset.FullID; } }
- private bool m_cancel = false;
+ private bool m_cancel;
// See ITextureSender
- private bool m_sending = false;
+ private bool m_sending;
///
/// This is actually the number of extra packets required to send the texture data! We always assume
/// at least one is required.
///
- private int NumPackets = 0;
+ private int NumPackets;
///
/// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts
/// at the 600th byte (0th indexed).
///
- private int PacketCounter = 0;
+ private int PacketCounter;
private int RequestedDiscardLevel = -1;
- private IClientAPI RequestUser;
- private uint StartPacketNumber = 0;
+ private uint StartPacketNumber;
public TextureSender(IClientAPI client, int discardLevel, uint packetNumber)
{
@@ -190,7 +191,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
catch (ArgumentOutOfRangeException)
{
m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
- m_asset.FullID.ToString());
+ m_asset.FullID);
return;
}
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
index 8e90d17..eaf2198 100644
--- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs
@@ -41,10 +41,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
public Dictionary NewFiles = new Dictionary();
public Dictionary Transfers = new Dictionary();
- public XferModule()
- {
- }
-
#region IRegionModule Members
public void Initialise(Scene scene, IConfigSource config)
@@ -149,11 +145,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
public IClientAPI Client;
private bool complete;
public byte[] Data = new byte[0];
- public int DataPointer = 0;
+ public int DataPointer;
public string FileName = String.Empty;
- public uint Packet = 0;
+ public uint Packet;
public uint Serial = 1;
- public ulong XferID = 0;
+ public ulong XferID;
public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client)
{
@@ -217,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
{
byte[] transferData = new byte[Data.Length - DataPointer];
Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer);
- uint endPacket = Packet |= (uint) 0x80000000;
+ uint endPacket = Packet |= 0x80000000;
Client.SendXferPacket(XferID, endPacket, transferData);
Packet++;
DataPointer += (Data.Length - DataPointer);
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index 15720fc..8d42681 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -44,15 +44,15 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
public class ChatModule : IRegionModule, ISimChat
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private string m_defaultzone = null;
+ private readonly List m_scenes = new List();
+ private string m_defaultzone;
- private IRCChatModule m_irc = null;
- private Thread m_irc_connector = null;
+ private IRCChatModule m_irc;
+ private Thread m_irc_connector;
- private string m_last_leaving_user = null;
- private string m_last_new_user = null;
+ private string m_last_leaving_user;
+ private string m_last_new_user;
private int m_saydistance = 30;
- private List m_scenes = new List();
private int m_shoutdistance = 100;
internal object m_syncInit = new object();
internal object m_syncLogout = new object();
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception ex)
{
- m_log.Error("[IRC]: NewClient exception trap:" + ex.ToString());
+ m_log.Error("[IRC]: NewClient exception trap:" + ex);
}
}
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception ex)
{
- m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex.ToString());
+ m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex);
}
}
}
@@ -372,24 +372,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
#endregion
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private Thread listener;
- private string m_basenick = null;
- private string m_channel = null;
- private bool m_connected = false;
- private bool m_enabled = false;
- private List m_last_scenes = null;
- private string m_nick = null;
- private uint m_port = 6668;
- private string m_privmsgformat = "PRIVMSG {0} :<{1} in {2}>: {3}";
+ private readonly string m_basenick;
+ private readonly string m_channel;
+ private readonly bool m_enabled;
+ private readonly uint m_port = 6668;
+ private readonly string m_privmsgformat = "PRIVMSG {0} :<{1} in {2}>: {3}";
+ private readonly string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
+ private Thread listener;
+ private bool m_connected;
+ private List m_last_scenes;
+ private string m_nick;
private StreamReader m_reader;
- private List m_scenes = null;
- private string m_server = null;
+ private List m_scenes;
+ private string m_server;
private NetworkStream m_stream;
internal object m_syncConnect = new object();
private TcpClient m_tcp;
- private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
private StreamWriter m_writer;
private Thread pingSender;
@@ -478,13 +478,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
m_reader = new StreamReader(m_stream);
m_writer = new StreamWriter(m_stream);
- pingSender = new Thread(new ThreadStart(PingRun));
+ pingSender = new Thread(PingRun);
pingSender.Name = "PingSenderThread";
pingSender.IsBackground = true;
pingSender.Start();
ThreadTracker.Add(pingSender);
- listener = new Thread(new ThreadStart(ListenerRun));
+ listener = new Thread(ListenerRun);
listener.Name = "IRCChatModuleListenerThread";
listener.IsBackground = true;
listener.Start();
@@ -545,7 +545,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception ex)
{
- m_log.Error("[IRC]: PrivMsg exception trap:" + ex.ToString());
+ m_log.Error("[IRC]: PrivMsg exception trap:" + ex);
}
}
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
try
{
- if (m_connected == true)
+ if (m_connected)
{
m_writer.WriteLine("PING :" + m_server);
m_writer.Flush();
@@ -602,7 +602,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception ex)
{
- m_log.Error("[IRC]: PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
+ m_log.Error("[IRC]: PingRun exception trap:" + ex + "\n" + ex.StackTrace);
}
}
}
@@ -615,7 +615,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
try
{
- while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null))
+ while (m_connected && ((inputLine = m_reader.ReadLine()) != null))
{
// Console.WriteLine(inputLine);
if (inputLine.Contains(m_channel))
@@ -659,7 +659,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception ex)
{
- m_log.Error("[IRC]: ListenerRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
+ m_log.Error("[IRC]: ListenerRun exception trap:" + ex + "\n" + ex.StackTrace);
}
}
}
@@ -685,7 +685,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
}
catch (Exception ex) // IRC gate should not crash Sim
{
- m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace);
+ m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex + "\n" + ex.StackTrace);
}
}
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
index 966c5e2..cc6fd77 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
@@ -65,55 +65,55 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
public class SampleMoneyModule : IMoneyModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly Dictionary m_KnownClientFunds = new Dictionary();
+
+ ///
+ /// Region UUIDS indexed by AgentID
+ ///
+ private readonly Dictionary m_rootAgents = new Dictionary();
+
+ ///
+ /// Scenes by Region Handle
+ ///
+ private readonly Dictionary m_scenel = new Dictionary();
///
/// Where Stipends come from and Fees go to.
///
private LLUUID EconomyBaseAccount = LLUUID.Zero;
- private float EnergyEfficiency = 0f;
- private bool gridmode = false;
+ private float EnergyEfficiency;
+ private bool gridmode;
private ObjectPaid handerOnObjectPaid;
private bool m_enabled = true;
private IConfigSource m_gConfig;
private bool m_keepMoneyAcrossLogins = true;
- private Dictionary m_KnownClientFunds = new Dictionary();
private string m_LandAddress = String.Empty;
private int m_minFundsBeforeRefresh = 100;
private string m_MoneyAddress = String.Empty;
- ///
- /// Region UUIDS indexed by AgentID
- ///
- private Dictionary m_rootAgents = new Dictionary();
-
- ///
- /// Scenes by Region Handle
- ///
- private Dictionary m_scenel = new Dictionary();
-
private int m_stipend = 1000;
private int ObjectCapacity = 45000;
- private int ObjectCount = 0;
- private int PriceEnergyUnit = 0;
- private int PriceGroupCreate = 0;
- private int PriceObjectClaim = 0;
- private float PriceObjectRent = 0f;
- private float PriceObjectScaleFactor = 0f;
- private int PriceParcelClaim = 0;
- private float PriceParcelClaimFactor = 0f;
- private int PriceParcelRent = 0;
- private int PricePublicObjectDecay = 0;
- private int PricePublicObjectDelete = 0;
- private int PriceRentLight = 0;
- private int PriceUpload = 0;
- private int TeleportMinPrice = 0;
-
- private float TeleportPriceExponent = 0f;
+ private int ObjectCount;
+ private int PriceEnergyUnit;
+ private int PriceGroupCreate;
+ private int PriceObjectClaim;
+ private float PriceObjectRent;
+ private float PriceObjectScaleFactor;
+ private int PriceParcelClaim;
+ private float PriceParcelClaimFactor;
+ private int PriceParcelRent;
+ private int PricePublicObjectDecay;
+ private int PricePublicObjectDelete;
+ private int PriceRentLight;
+ private int PriceUpload;
+ private int TeleportMinPrice;
+
+ private float TeleportPriceExponent;
private int UserLevelPaysFees = 2;
private Scene XMLRPCHandler;
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
Hashtable hbinfo =
GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(),
s.RegionInfo.regionSecret);
- if ((bool) hbinfo["success"] == true)
+ if ((bool) hbinfo["success"])
{
Helpers.TryParse((string) hbinfo["agentId"], out agentID);
try
@@ -333,7 +333,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
else
{
m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentID,
- (string) hbinfo["errorMessage"]);
+ hbinfo["errorMessage"]);
client.SendAlertMessage((string) hbinfo["errorMessage"]);
}
SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero);
@@ -660,7 +660,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
Hashtable hresult = genericCurrencyXMLRPCRequest(ht, "regionMoveMoney");
- if ((bool) hresult["success"] == true)
+ if ((bool) hresult["success"])
{
int funds1 = 0;
int funds2 = 0;
@@ -718,7 +718,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
Hashtable hbinfo =
GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(),
s.RegionInfo.regionSecret);
- if ((bool) hbinfo["success"] == true)
+ if ((bool) hbinfo["success"])
{
try
{
@@ -743,7 +743,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
else
{
m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId,
- (string) hbinfo["errorMessage"]);
+ hbinfo["errorMessage"]);
aClient.SendAlertMessage((string) hbinfo["errorMessage"]);
}
}
@@ -812,7 +812,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
string secret = (string) requestData["secret"];
Scene userScene = GetRandomScene();
- if (userScene.RegionInfo.regionSecret.ToString() == secret)
+ if (userScene.RegionInfo.regionSecret == secret)
{
IClientAPI client = LocateClientObject(agentId);
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
{
lock (e)
{
- if (e.economyValidated == true && e.transactionID == 0)
+ if (e.economyValidated && e.transactionID == 0)
{
e.transactionID = Util.UnixTimeSinceEpoch();
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
else
{
m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" +
- e.sender.ToString() + " Receiver: " + e.receiver.ToString() + " Amount: " + e.amount.ToString());
+ e.sender + " Receiver: " + e.receiver + " Amount: " + e.amount);
}
}
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
{
Hashtable hresult =
claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret);
- if ((bool) hresult["success"] == true)
+ if ((bool) hresult["success"])
{
int funds = 0;
try
@@ -1432,7 +1432,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
if (RegionItem != null)
{
Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret);
- if ((bool) hresult["success"] == true)
+ if ((bool) hresult["success"])
{
int funds = 0;
try
@@ -1460,7 +1460,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
#endregion
}
- public enum TransactionType : int
+ public enum TransactionType
{
SystemGenerated = 0,
RegionMoneyRequest = 1,
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
index dd6a92e..1dffc62 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
@@ -42,10 +42,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private Dictionary> FriendLists = new Dictionary>();
- private Dictionary m_pendingFriendRequests = new Dictionary();
- private Dictionary m_rootAgents = new Dictionary();
- private List m_scene = new List();
+ private readonly Dictionary> FriendLists = new Dictionary>();
+ private readonly Dictionary m_pendingFriendRequests = new Dictionary();
+ private readonly Dictionary m_rootAgents = new Dictionary();
+ private readonly List m_scene = new List();
#region IRegionModule Members
@@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
List updateUsers = new List();
foreach (FriendListItem fli in lfli)
{
- if (fli.onlinestatus == true)
+ if (fli.onlinestatus)
{
updateUsers.Add(fli.Friend);
}
@@ -357,20 +357,20 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
// https://wiki.secondlife.com/wiki/ImprovedInstantMessage
// 38 == Offer friendship
- if (dialog == (byte) 38)
+ if (dialog == 38)
{
LLUUID friendTransactionID = LLUUID.Random();
m_pendingFriendRequests.Add(friendTransactionID, fromAgentID);
- m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" +
+ m_log.Info("[FRIEND]: 38 - From:" + fromAgentID + " To: " + toAgentID + " Session:" + imSessionID + " Message:" +
message);
GridInstantMessage msg = new GridInstantMessage();
msg.fromAgentID = fromAgentID.UUID;
msg.fromAgentSession = fromAgentSession.UUID;
msg.toAgentID = toAgentID.UUID;
msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here
- m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString());
+ m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID);
msg.timestamp = timestamp;
if (client != null)
{
@@ -393,16 +393,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
}
// 39 == Accept Friendship
- if (dialog == (byte) 39)
+ if (dialog == 39)
{
- m_log.Info("[FRIEND]: 39 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" +
+ m_log.Info("[FRIEND]: 39 - From:" + fromAgentID + " To: " + toAgentID + " Session:" + imSessionID + " Message:" +
message);
}
// 40 == Decline Friendship
- if (dialog == (byte) 40)
+ if (dialog == 40)
{
- m_log.Info("[FRIEND]: 40 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" +
+ m_log.Info("[FRIEND]: 40 - From:" + fromAgentID + " To: " + toAgentID + " Session:" + imSessionID + " Message:" +
message);
}
}
@@ -433,14 +433,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
msg.ParentEstateID = 0;
msg.timestamp = (uint) Util.UnixTimeSinceEpoch();
msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID;
- msg.dialog = (byte) 39; // Approved friend request
+ msg.dialog = 39; // Approved friend request
msg.Position = new sLLVector3();
- msg.offline = (byte) 0;
+ msg.offline = 0;
msg.binaryBucket = new byte[0];
// We don't really care which scene we pipe it through, it goes to the shared IM Module and/or the database
SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
- SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1);
+ SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, 1);
m_pendingFriendRequests.Remove(transactionID);
// TODO: Inform agent that the friend is online
@@ -471,9 +471,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
msg.ParentEstateID = 0;
msg.timestamp = (uint) Util.UnixTimeSinceEpoch();
msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID;
- msg.dialog = (byte) 40; // Deny friend request
+ msg.dialog = 40; // Deny friend request
msg.Position = new sLLVector3();
- msg.offline = (byte) 0;
+ msg.offline = 0;
msg.binaryBucket = new byte[0];
SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
m_pendingFriendRequests.Remove(transactionID);
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
index 6edc44d..858cf21 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
@@ -41,10 +41,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private Dictionary m_grouplistmap = new Dictionary();
- private Dictionary m_groupmap = new Dictionary();
- private Dictionary m_iclientmap = new Dictionary();
- private List m_scene = new List();
+ private readonly Dictionary m_grouplistmap = new Dictionary();
+ private readonly Dictionary m_groupmap = new Dictionary();
+ private readonly Dictionary m_iclientmap = new Dictionary();
+ private readonly List m_scene = new List();
#region IRegionModule Members
@@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
}
else
{
- m_log.Info("[GROUP]: Removing all reference to groups for " + agentID.ToString());
+ m_log.Info("[GROUP]: Removing all reference to groups for " + agentID);
}
m_iclientmap.Remove(agentID);
}
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
index 624f307..9f2d461 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory
/// occurs in the initial offer message, not the accept message. So this dictionary links
/// IM Session Ids to ItemIds
///
- private IDictionary m_pendingOffers = new Dictionary();
+ private readonly IDictionary m_pendingOffers = new Dictionary();
private Scene m_scene;
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
index 15825b6..87f0177 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs
@@ -41,10 +41,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
- public AvatarProfilesModule()
- {
- }
-
#region IRegionModule Members
public void Initialise(Scene scene, IConfigSource config)
@@ -104,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles
}
else
{
- m_log.Debug("[AvatarProfilesModule]: Got null for profile for " + avatarID.ToString());
+ m_log.Debug("[AvatarProfilesModule]: Got null for profile for " + avatarID);
}
}
diff --git a/OpenSim/Region/Environment/Modules/Framework/Commander.cs b/OpenSim/Region/Environment/Modules/Framework/Commander.cs
index 4430c10..d226c3d 100644
--- a/OpenSim/Region/Environment/Modules/Framework/Commander.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/Commander.cs
@@ -42,11 +42,11 @@ namespace OpenSim.Region.Environment.Modules.Framework
public class Command : ICommand
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private List m_args = new List();
+ private readonly List m_args = new List();
- private Action