aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 16:35:00 +0000
committerAdam Frisby2008-05-01 16:35:00 +0000
commit13526097f24b7a8ad63b1d482c44b44397fa055f (patch)
tree7a82c20ed7c63e2aea5ad3863325e37f64e1cbea /OpenSim/Region/Environment/Modules
parent* Breaking all the code, breaking all the code..! (diff)
downloadopensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.zip
opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.gz
opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.bz2
opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.xz
* Spring cleaning on Region.Environment.
* Converted a large number of read-only fields to be actually, readonly. * Reformatted code sections. * Removed redundant code.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs21
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs13
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs9
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs19
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs56
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs80
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs34
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/Commander.cs22
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs24
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs30
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs30
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs1
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs4
36 files changed, 232 insertions, 263 deletions
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
40 /// <summary> 40 /// <summary>
41 /// Asset requests with data which are ready to be sent back to requesters. This includes textures. 41 /// Asset requests with data which are ready to be sent back to requesters. This includes textures.
42 /// </summary> 42 /// </summary>
43 private List<AssetRequest> AssetRequests; 43 private readonly List<AssetRequest> AssetRequests;
44 44
45 private Scene m_scene; 45 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
46 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
47 46
48 /// 47 ///
49 /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests 48 /// Assets requests (for each user) which are waiting for asset server data. This includes texture requests
50 /// </summary> 49 /// </summary>
51 private Dictionary<LLUUID, Dictionary<LLUUID, AssetRequest>> RequestedAssets; 50 private readonly Dictionary<LLUUID, Dictionary<LLUUID, AssetRequest>> RequestedAssets;
51
52 private Scene m_scene;
52 53
53 public AssetDownloadModule() 54 public AssetDownloadModule()
54 { 55 {
@@ -205,22 +206,18 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
205 { 206 {
206 public AssetBase AssetInf; 207 public AssetBase AssetInf;
207 public byte AssetRequestSource = 2; 208 public byte AssetRequestSource = 2;
208 public long DataPointer = 0; 209 public long DataPointer;
209 public int DiscardLevel = -1; 210 public int DiscardLevel = -1;
210 public AssetBase ImageInfo; 211 public AssetBase ImageInfo;
211 public bool IsTextureRequest; 212 public bool IsTextureRequest;
212 public int NumPackets = 0; 213 public int NumPackets;
213 public int PacketCounter = 0; 214 public int PacketCounter;
214 public byte[] Params = null; 215 public byte[] Params;
215 public LLUUID RequestAssetID; 216 public LLUUID RequestAssetID;
216 public IClientAPI RequestUser; 217 public IClientAPI RequestUser;
217 public LLUUID TransferRequestID; 218 public LLUUID TransferRequestID;
218 //public bool AssetInCache; 219 //public bool AssetInCache;
219 //public int TimeRequested; 220 //public int TimeRequested;
220
221 public AssetRequest()
222 {
223 }
224 } 221 }
225 222
226 #endregion 223 #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
44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 44 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 // Fields 46 // Fields
47 private bool m_dumpAssetsToFile; 47 private readonly bool m_dumpAssetsToFile;
48 public AgentAssetTransactionsManager Manager; 48 public AgentAssetTransactionsManager Manager;
49 public LLUUID UserID; 49 public LLUUID UserID;
50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>(); 50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>();
@@ -141,23 +141,23 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
141 public class AssetXferUploader 141 public class AssetXferUploader
142 { 142 {
143 // Fields 143 // Fields
144 private readonly bool m_dumpAssetToFile;
145 private readonly AgentAssetTransactions m_userTransactions;
144 public bool AddToInventory; 146 public bool AddToInventory;
145 public AssetBase Asset; 147 public AssetBase Asset;
146 public LLUUID InventFolder = LLUUID.Zero; 148 public LLUUID InventFolder = LLUUID.Zero;
147 private sbyte invType = 0; 149 private sbyte invType;
148 private bool m_createItem = false; 150 private bool m_createItem;
149 private string m_description = String.Empty; 151 private string m_description = String.Empty;
150 private bool m_dumpAssetToFile; 152 private bool m_finished;
151 private bool m_finished = false;
152 private string m_name = String.Empty; 153 private string m_name = String.Empty;
153 private bool m_storeLocal; 154 private bool m_storeLocal;
154 private AgentAssetTransactions m_userTransactions; 155 private uint nextPerm;
155 private uint nextPerm = 0;
156 private IClientAPI ourClient; 156 private IClientAPI ourClient;
157 public LLUUID TransactionID = LLUUID.Zero; 157 public LLUUID TransactionID = LLUUID.Zero;
158 private sbyte type = 0; 158 private sbyte type;
159 public bool UploadComplete; 159 public bool UploadComplete;
160 private byte wearableType = 0; 160 private byte wearableType;
161 public ulong XferID; 161 public ulong XferID;
162 162
163 public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile) 163 public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile)
@@ -390,7 +390,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
390 item.BasePermissions = 2147483647; 390 item.BasePermissions = 2147483647;
391 item.CurrentPermissions = 2147483647; 391 item.CurrentPermissions = 2147483647;
392 item.NextPermissions = nextPerm; 392 item.NextPermissions = nextPerm;
393 item.Flags = (uint) wearableType; 393 item.Flags = wearableType;
394 394
395 userInfo.AddItem(ourClient.AgentId, item); 395 userInfo.AddItem(ourClient.AgentId, item);
396 ourClient.SendInventoryItemCreateUpdate(item); 396 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
40 public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions 40 public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions
41 { 41 {
42 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); 42 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
43 private bool m_dumpAssetsToFile = false; 43 private bool m_dumpAssetsToFile;
44 private Scene m_scene = null; 44 private Scene m_scene;
45 45
46 private AgentAssetTransactionsManager m_transactionManager; 46 private AgentAssetTransactionsManager m_transactionManager;
47 47
48 public AssetTransactionModule()
49 {
50 // System.Console.WriteLine("creating AgentAssetTransactionModule");
51 }
52
53 #region IAgentAssetTransactions Members 48 #region IAgentAssetTransactions Members
54 49
55 public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID, 50 public void HandleItemCreationFromTransaction(IClientAPI remoteClient, LLUUID transactionID, LLUUID folderID,
@@ -145,13 +140,13 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
145 /// <summary> 140 /// <summary>
146 /// Each agent has its own singleton collection of transactions 141 /// Each agent has its own singleton collection of transactions
147 /// </summary> 142 /// </summary>
148 private Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = 143 private readonly Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions =
149 new Dictionary<LLUUID, AgentAssetTransactions>(); 144 new Dictionary<LLUUID, AgentAssetTransactions>();
150 145
151 /// <summary> 146 /// <summary>
152 /// Should we dump uploaded assets to the filesystem? 147 /// Should we dump uploaded assets to the filesystem?
153 /// </summary> 148 /// </summary>
154 private bool m_dumpAssetsToFile; 149 private readonly bool m_dumpAssetsToFile;
155 150
156 public Scene MyScene; 151 public Scene MyScene;
157 152
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
47 private readonly BlockingQueue<ITextureSender> m_queueSenders 47 private readonly BlockingQueue<ITextureSender> m_queueSenders
48 = new BlockingQueue<ITextureSender>(); 48 = new BlockingQueue<ITextureSender>();
49 49
50 private readonly List<Scene> m_scenes = new List<Scene>();
51
50 /// <summary> 52 /// <summary>
51 /// Each user has their own texture download service. 53 /// Each user has their own texture download service.
52 /// </summary> 54 /// </summary>
@@ -54,14 +56,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
54 new Dictionary<LLUUID, UserTextureDownloadService>(); 56 new Dictionary<LLUUID, UserTextureDownloadService>();
55 57
56 private Scene m_scene; 58 private Scene m_scene;
57 private List<Scene> m_scenes = new List<Scene>();
58 59
59 private Thread m_thread; 60 private Thread m_thread;
60 61
61 public TextureDownloadModule()
62 {
63 }
64
65 #region IRegionModule Members 62 #region IRegionModule Members
66 63
67 public void Initialise(Scene scene, IConfigSource config) 64 public void Initialise(Scene scene, IConfigSource config)
@@ -69,7 +66,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
69 if (m_scene == null) 66 if (m_scene == null)
70 { 67 {
71 //Console.WriteLine("Creating Texture download module"); 68 //Console.WriteLine("Creating Texture download module");
72 m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); 69 m_thread = new Thread(ProcessTextureSenders);
73 m_thread.Name = "ProcessTextureSenderThread"; 70 m_thread.Name = "ProcessTextureSenderThread";
74 m_thread.IsBackground = true; 71 m_thread.IsBackground = true;
75 m_thread.Start(); 72 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
40 //private static readonly log4net.ILog m_log 40 //private static readonly log4net.ILog m_log
41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private bool m_cancel = false; 43 private readonly LLUUID m_textureId;
44 private bool m_cancel;
44 private IClientAPI m_client; 45 private IClientAPI m_client;
45 46
46 // See ITextureSender 47 // See ITextureSender
47 48
48 private bool m_sending = false; 49 private bool m_sending;
49 private LLUUID m_textureId;
50 50
51 // See ITextureSender 51 // See ITextureSender
52 52
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
43 private static readonly ILog m_log 43 private static readonly ILog m_log
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 private readonly IClientAPI RequestUser;
47
46 /// <summary> 48 /// <summary>
47 /// Records the number of times texture send has been called. 49 /// Records the number of times texture send has been called.
48 /// </summary> 50 /// </summary>
49 public int counter = 0; 51 public int counter;
50 52
51 public bool ImageLoaded = false; 53 public bool ImageLoaded;
52 54
53 /// <summary> 55 /// <summary>
54 /// Holds the texture asset to send. 56 /// Holds the texture asset to send.
@@ -57,27 +59,26 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
57 59
58 //public LLUUID assetID { get { return m_asset.FullID; } } 60 //public LLUUID assetID { get { return m_asset.FullID; } }
59 61
60 private bool m_cancel = false; 62 private bool m_cancel;
61 63
62 // See ITextureSender 64 // See ITextureSender
63 65
64 private bool m_sending = false; 66 private bool m_sending;
65 67
66 /// <summary> 68 /// <summary>
67 /// This is actually the number of extra packets required to send the texture data! We always assume 69 /// This is actually the number of extra packets required to send the texture data! We always assume
68 /// at least one is required. 70 /// at least one is required.
69 /// </summary> 71 /// </summary>
70 private int NumPackets = 0; 72 private int NumPackets;
71 73
72 /// <summary> 74 /// <summary>
73 /// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts 75 /// Holds the packet number to send next. In this case, each packet is 1000 bytes long and starts
74 /// at the 600th byte (0th indexed). 76 /// at the 600th byte (0th indexed).
75 /// </summary> 77 /// </summary>
76 private int PacketCounter = 0; 78 private int PacketCounter;
77 79
78 private int RequestedDiscardLevel = -1; 80 private int RequestedDiscardLevel = -1;
79 private IClientAPI RequestUser; 81 private uint StartPacketNumber;
80 private uint StartPacketNumber = 0;
81 82
82 public TextureSender(IClientAPI client, int discardLevel, uint packetNumber) 83 public TextureSender(IClientAPI client, int discardLevel, uint packetNumber)
83 { 84 {
@@ -190,7 +191,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
190 catch (ArgumentOutOfRangeException) 191 catch (ArgumentOutOfRangeException)
191 { 192 {
192 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + 193 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
193 m_asset.FullID.ToString()); 194 m_asset.FullID);
194 return; 195 return;
195 } 196 }
196 RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); 197 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
41 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>(); 41 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
42 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>(); 42 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
43 43
44 public XferModule()
45 {
46 }
47
48 #region IRegionModule Members 44 #region IRegionModule Members
49 45
50 public void Initialise(Scene scene, IConfigSource config) 46 public void Initialise(Scene scene, IConfigSource config)
@@ -149,11 +145,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
149 public IClientAPI Client; 145 public IClientAPI Client;
150 private bool complete; 146 private bool complete;
151 public byte[] Data = new byte[0]; 147 public byte[] Data = new byte[0];
152 public int DataPointer = 0; 148 public int DataPointer;
153 public string FileName = String.Empty; 149 public string FileName = String.Empty;
154 public uint Packet = 0; 150 public uint Packet;
155 public uint Serial = 1; 151 public uint Serial = 1;
156 public ulong XferID = 0; 152 public ulong XferID;
157 153
158 public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client) 154 public XferDownLoad(string fileName, byte[] data, ulong xferID, IClientAPI client)
159 { 155 {
@@ -217,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
217 { 213 {
218 byte[] transferData = new byte[Data.Length - DataPointer]; 214 byte[] transferData = new byte[Data.Length - DataPointer];
219 Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); 215 Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer);
220 uint endPacket = Packet |= (uint) 0x80000000; 216 uint endPacket = Packet |= 0x80000000;
221 Client.SendXferPacket(XferID, endPacket, transferData); 217 Client.SendXferPacket(XferID, endPacket, transferData);
222 Packet++; 218 Packet++;
223 DataPointer += (Data.Length - DataPointer); 219 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
44 public class ChatModule : IRegionModule, ISimChat 44 public class ChatModule : IRegionModule, ISimChat
45 { 45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 private string m_defaultzone = null; 47 private readonly List<Scene> m_scenes = new List<Scene>();
48 private string m_defaultzone;
48 49
49 private IRCChatModule m_irc = null; 50 private IRCChatModule m_irc;
50 private Thread m_irc_connector = null; 51 private Thread m_irc_connector;
51 52
52 private string m_last_leaving_user = null; 53 private string m_last_leaving_user;
53 private string m_last_new_user = null; 54 private string m_last_new_user;
54 private int m_saydistance = 30; 55 private int m_saydistance = 30;
55 private List<Scene> m_scenes = new List<Scene>();
56 private int m_shoutdistance = 100; 56 private int m_shoutdistance = 100;
57 internal object m_syncInit = new object(); 57 internal object m_syncInit = new object();
58 internal object m_syncLogout = new object(); 58 internal object m_syncLogout = new object();
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
257 } 257 }
258 catch (Exception ex) 258 catch (Exception ex)
259 { 259 {
260 m_log.Error("[IRC]: NewClient exception trap:" + ex.ToString()); 260 m_log.Error("[IRC]: NewClient exception trap:" + ex);
261 } 261 }
262 } 262 }
263 263
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
284 } 284 }
285 catch (Exception ex) 285 catch (Exception ex)
286 { 286 {
287 m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex.ToString()); 287 m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex);
288 } 288 }
289 } 289 }
290 } 290 }
@@ -372,24 +372,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
372 #endregion 372 #endregion
373 373
374 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 374 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
375 private Thread listener;
376 375
377 private string m_basenick = null; 376 private readonly string m_basenick;
378 private string m_channel = null; 377 private readonly string m_channel;
379 private bool m_connected = false; 378 private readonly bool m_enabled;
380 private bool m_enabled = false; 379 private readonly uint m_port = 6668;
381 private List<Scene> m_last_scenes = null; 380 private readonly string m_privmsgformat = "PRIVMSG {0} :<{1} in {2}>: {3}";
382 private string m_nick = null; 381 private readonly string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
383 private uint m_port = 6668; 382 private Thread listener;
384 private string m_privmsgformat = "PRIVMSG {0} :<{1} in {2}>: {3}"; 383 private bool m_connected;
384 private List<Scene> m_last_scenes;
385 private string m_nick;
385 private StreamReader m_reader; 386 private StreamReader m_reader;
386 private List<Scene> m_scenes = null; 387 private List<Scene> m_scenes;
387 private string m_server = null; 388 private string m_server;
388 389
389 private NetworkStream m_stream; 390 private NetworkStream m_stream;
390 internal object m_syncConnect = new object(); 391 internal object m_syncConnect = new object();
391 private TcpClient m_tcp; 392 private TcpClient m_tcp;
392 private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
393 private StreamWriter m_writer; 393 private StreamWriter m_writer;
394 394
395 private Thread pingSender; 395 private Thread pingSender;
@@ -478,13 +478,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
478 m_reader = new StreamReader(m_stream); 478 m_reader = new StreamReader(m_stream);
479 m_writer = new StreamWriter(m_stream); 479 m_writer = new StreamWriter(m_stream);
480 480
481 pingSender = new Thread(new ThreadStart(PingRun)); 481 pingSender = new Thread(PingRun);
482 pingSender.Name = "PingSenderThread"; 482 pingSender.Name = "PingSenderThread";
483 pingSender.IsBackground = true; 483 pingSender.IsBackground = true;
484 pingSender.Start(); 484 pingSender.Start();
485 ThreadTracker.Add(pingSender); 485 ThreadTracker.Add(pingSender);
486 486
487 listener = new Thread(new ThreadStart(ListenerRun)); 487 listener = new Thread(ListenerRun);
488 listener.Name = "IRCChatModuleListenerThread"; 488 listener.Name = "IRCChatModuleListenerThread";
489 listener.IsBackground = true; 489 listener.IsBackground = true;
490 listener.Start(); 490 listener.Start();
@@ -545,7 +545,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
545 } 545 }
546 catch (Exception ex) 546 catch (Exception ex)
547 { 547 {
548 m_log.Error("[IRC]: PrivMsg exception trap:" + ex.ToString()); 548 m_log.Error("[IRC]: PrivMsg exception trap:" + ex);
549 } 549 }
550 } 550 }
551 551
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
588 { 588 {
589 try 589 try
590 { 590 {
591 if (m_connected == true) 591 if (m_connected)
592 { 592 {
593 m_writer.WriteLine("PING :" + m_server); 593 m_writer.WriteLine("PING :" + m_server);
594 m_writer.Flush(); 594 m_writer.Flush();
@@ -602,7 +602,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
602 } 602 }
603 catch (Exception ex) 603 catch (Exception ex)
604 { 604 {
605 m_log.Error("[IRC]: PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace); 605 m_log.Error("[IRC]: PingRun exception trap:" + ex + "\n" + ex.StackTrace);
606 } 606 }
607 } 607 }
608 } 608 }
@@ -615,7 +615,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
615 { 615 {
616 try 616 try
617 { 617 {
618 while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null)) 618 while (m_connected && ((inputLine = m_reader.ReadLine()) != null))
619 { 619 {
620 // Console.WriteLine(inputLine); 620 // Console.WriteLine(inputLine);
621 if (inputLine.Contains(m_channel)) 621 if (inputLine.Contains(m_channel))
@@ -659,7 +659,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
659 } 659 }
660 catch (Exception ex) 660 catch (Exception ex)
661 { 661 {
662 m_log.Error("[IRC]: ListenerRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace); 662 m_log.Error("[IRC]: ListenerRun exception trap:" + ex + "\n" + ex.StackTrace);
663 } 663 }
664 } 664 }
665 } 665 }
@@ -685,7 +685,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
685 } 685 }
686 catch (Exception ex) // IRC gate should not crash Sim 686 catch (Exception ex) // IRC gate should not crash Sim
687 { 687 {
688 m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace); 688 m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex + "\n" + ex.StackTrace);
689 } 689 }
690 } 690 }
691 691
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
65 public class SampleMoneyModule : IMoneyModule 65 public class SampleMoneyModule : IMoneyModule
66 { 66 {
67 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 67 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
68 private readonly Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>();
69
70 /// <summary>
71 /// Region UUIDS indexed by AgentID
72 /// </summary>
73 private readonly Dictionary<LLUUID, LLUUID> m_rootAgents = new Dictionary<LLUUID, LLUUID>();
74
75 /// <summary>
76 /// Scenes by Region Handle
77 /// </summary>
78 private readonly Dictionary<ulong, Scene> m_scenel = new Dictionary<ulong, Scene>();
68 79
69 /// <summary> 80 /// <summary>
70 /// Where Stipends come from and Fees go to. 81 /// Where Stipends come from and Fees go to.
71 /// </summary> 82 /// </summary>
72 private LLUUID EconomyBaseAccount = LLUUID.Zero; 83 private LLUUID EconomyBaseAccount = LLUUID.Zero;
73 84
74 private float EnergyEfficiency = 0f; 85 private float EnergyEfficiency;
75 private bool gridmode = false; 86 private bool gridmode;
76 private ObjectPaid handerOnObjectPaid; 87 private ObjectPaid handerOnObjectPaid;
77 private bool m_enabled = true; 88 private bool m_enabled = true;
78 89
79 private IConfigSource m_gConfig; 90 private IConfigSource m_gConfig;
80 91
81 private bool m_keepMoneyAcrossLogins = true; 92 private bool m_keepMoneyAcrossLogins = true;
82 private Dictionary<LLUUID, int> m_KnownClientFunds = new Dictionary<LLUUID, int>();
83 private string m_LandAddress = String.Empty; 93 private string m_LandAddress = String.Empty;
84 94
85 private int m_minFundsBeforeRefresh = 100; 95 private int m_minFundsBeforeRefresh = 100;
86 private string m_MoneyAddress = String.Empty; 96 private string m_MoneyAddress = String.Empty;
87 97
88 /// <summary>
89 /// Region UUIDS indexed by AgentID
90 /// </summary>
91 private Dictionary<LLUUID, LLUUID> m_rootAgents = new Dictionary<LLUUID, LLUUID>();
92
93 /// <summary>
94 /// Scenes by Region Handle
95 /// </summary>
96 private Dictionary<ulong, Scene> m_scenel = new Dictionary<ulong, Scene>();
97
98 private int m_stipend = 1000; 98 private int m_stipend = 1000;
99 99
100 private int ObjectCapacity = 45000; 100 private int ObjectCapacity = 45000;
101 private int ObjectCount = 0; 101 private int ObjectCount;
102 private int PriceEnergyUnit = 0; 102 private int PriceEnergyUnit;
103 private int PriceGroupCreate = 0; 103 private int PriceGroupCreate;
104 private int PriceObjectClaim = 0; 104 private int PriceObjectClaim;
105 private float PriceObjectRent = 0f; 105 private float PriceObjectRent;
106 private float PriceObjectScaleFactor = 0f; 106 private float PriceObjectScaleFactor;
107 private int PriceParcelClaim = 0; 107 private int PriceParcelClaim;
108 private float PriceParcelClaimFactor = 0f; 108 private float PriceParcelClaimFactor;
109 private int PriceParcelRent = 0; 109 private int PriceParcelRent;
110 private int PricePublicObjectDecay = 0; 110 private int PricePublicObjectDecay;
111 private int PricePublicObjectDelete = 0; 111 private int PricePublicObjectDelete;
112 private int PriceRentLight = 0; 112 private int PriceRentLight;
113 private int PriceUpload = 0; 113 private int PriceUpload;
114 private int TeleportMinPrice = 0; 114 private int TeleportMinPrice;
115 115
116 private float TeleportPriceExponent = 0f; 116 private float TeleportPriceExponent;
117 private int UserLevelPaysFees = 2; 117 private int UserLevelPaysFees = 2;
118 private Scene XMLRPCHandler; 118 private Scene XMLRPCHandler;
119 119
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
305 Hashtable hbinfo = 305 Hashtable hbinfo =
306 GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(), 306 GetBalanceForUserFromMoneyServer(client.AgentId, client.SecureSessionId, s.RegionInfo.originRegionID.ToString(),
307 s.RegionInfo.regionSecret); 307 s.RegionInfo.regionSecret);
308 if ((bool) hbinfo["success"] == true) 308 if ((bool) hbinfo["success"])
309 { 309 {
310 Helpers.TryParse((string) hbinfo["agentId"], out agentID); 310 Helpers.TryParse((string) hbinfo["agentId"], out agentID);
311 try 311 try
@@ -333,7 +333,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
333 else 333 else
334 { 334 {
335 m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentID, 335 m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentID,
336 (string) hbinfo["errorMessage"]); 336 hbinfo["errorMessage"]);
337 client.SendAlertMessage((string) hbinfo["errorMessage"]); 337 client.SendAlertMessage((string) hbinfo["errorMessage"]);
338 } 338 }
339 SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero); 339 SendMoneyBalance(client, agentID, client.SessionId, LLUUID.Zero);
@@ -660,7 +660,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
660 660
661 Hashtable hresult = genericCurrencyXMLRPCRequest(ht, "regionMoveMoney"); 661 Hashtable hresult = genericCurrencyXMLRPCRequest(ht, "regionMoveMoney");
662 662
663 if ((bool) hresult["success"] == true) 663 if ((bool) hresult["success"])
664 { 664 {
665 int funds1 = 0; 665 int funds1 = 0;
666 int funds2 = 0; 666 int funds2 = 0;
@@ -718,7 +718,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
718 Hashtable hbinfo = 718 Hashtable hbinfo =
719 GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(), 719 GetBalanceForUserFromMoneyServer(aClient.AgentId, aClient.SecureSessionId, s.RegionInfo.originRegionID.ToString(),
720 s.RegionInfo.regionSecret); 720 s.RegionInfo.regionSecret);
721 if ((bool) hbinfo["success"] == true) 721 if ((bool) hbinfo["success"])
722 { 722 {
723 try 723 try
724 { 724 {
@@ -743,7 +743,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
743 else 743 else
744 { 744 {
745 m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId, 745 m_log.WarnFormat("[MONEY]: Getting Money for user {0} failed with the following message:{1}", agentId,
746 (string) hbinfo["errorMessage"]); 746 hbinfo["errorMessage"]);
747 aClient.SendAlertMessage((string) hbinfo["errorMessage"]); 747 aClient.SendAlertMessage((string) hbinfo["errorMessage"]);
748 } 748 }
749 } 749 }
@@ -812,7 +812,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
812 string secret = (string) requestData["secret"]; 812 string secret = (string) requestData["secret"];
813 813
814 Scene userScene = GetRandomScene(); 814 Scene userScene = GetRandomScene();
815 if (userScene.RegionInfo.regionSecret.ToString() == secret) 815 if (userScene.RegionInfo.regionSecret == secret)
816 { 816 {
817 IClientAPI client = LocateClientObject(agentId); 817 IClientAPI client = LocateClientObject(agentId);
818 818
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1238 { 1238 {
1239 lock (e) 1239 lock (e)
1240 { 1240 {
1241 if (e.economyValidated == true && e.transactionID == 0) 1241 if (e.economyValidated && e.transactionID == 0)
1242 { 1242 {
1243 e.transactionID = Util.UnixTimeSinceEpoch(); 1243 e.transactionID = Util.UnixTimeSinceEpoch();
1244 1244
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1328 else 1328 else
1329 { 1329 {
1330 m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + 1330 m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" +
1331 e.sender.ToString() + " Receiver: " + e.receiver.ToString() + " Amount: " + e.amount.ToString()); 1331 e.sender + " Receiver: " + e.receiver + " Amount: " + e.amount);
1332 } 1332 }
1333 } 1333 }
1334 1334
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1400 { 1400 {
1401 Hashtable hresult = 1401 Hashtable hresult =
1402 claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); 1402 claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret);
1403 if ((bool) hresult["success"] == true) 1403 if ((bool) hresult["success"])
1404 { 1404 {
1405 int funds = 0; 1405 int funds = 0;
1406 try 1406 try
@@ -1432,7 +1432,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1432 if (RegionItem != null) 1432 if (RegionItem != null)
1433 { 1433 {
1434 Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); 1434 Hashtable hresult = claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret);
1435 if ((bool) hresult["success"] == true) 1435 if ((bool) hresult["success"])
1436 { 1436 {
1437 int funds = 0; 1437 int funds = 0;
1438 try 1438 try
@@ -1460,7 +1460,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1460 #endregion 1460 #endregion
1461 } 1461 }
1462 1462
1463 public enum TransactionType : int 1463 public enum TransactionType
1464 { 1464 {
1465 SystemGenerated = 0, 1465 SystemGenerated = 0,
1466 RegionMoneyRequest = 1, 1466 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
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private Dictionary<LLUUID, List<FriendListItem>> FriendLists = new Dictionary<LLUUID, List<FriendListItem>>(); 45 private readonly Dictionary<LLUUID, List<FriendListItem>> FriendLists = new Dictionary<LLUUID, List<FriendListItem>>();
46 private Dictionary<LLUUID, LLUUID> m_pendingFriendRequests = new Dictionary<LLUUID, LLUUID>(); 46 private readonly Dictionary<LLUUID, LLUUID> m_pendingFriendRequests = new Dictionary<LLUUID, LLUUID>();
47 private Dictionary<LLUUID, ulong> m_rootAgents = new Dictionary<LLUUID, ulong>(); 47 private readonly Dictionary<LLUUID, ulong> m_rootAgents = new Dictionary<LLUUID, ulong>();
48 private List<Scene> m_scene = new List<Scene>(); 48 private readonly List<Scene> m_scene = new List<Scene>();
49 49
50 #region IRegionModule Members 50 #region IRegionModule Members
51 51
@@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
213 List<LLUUID> updateUsers = new List<LLUUID>(); 213 List<LLUUID> updateUsers = new List<LLUUID>();
214 foreach (FriendListItem fli in lfli) 214 foreach (FriendListItem fli in lfli)
215 { 215 {
216 if (fli.onlinestatus == true) 216 if (fli.onlinestatus)
217 { 217 {
218 updateUsers.Add(fli.Friend); 218 updateUsers.Add(fli.Friend);
219 } 219 }
@@ -357,20 +357,20 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
357 // https://wiki.secondlife.com/wiki/ImprovedInstantMessage 357 // https://wiki.secondlife.com/wiki/ImprovedInstantMessage
358 358
359 // 38 == Offer friendship 359 // 38 == Offer friendship
360 if (dialog == (byte) 38) 360 if (dialog == 38)
361 { 361 {
362 LLUUID friendTransactionID = LLUUID.Random(); 362 LLUUID friendTransactionID = LLUUID.Random();
363 363
364 m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); 364 m_pendingFriendRequests.Add(friendTransactionID, fromAgentID);
365 365
366 m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + 366 m_log.Info("[FRIEND]: 38 - From:" + fromAgentID + " To: " + toAgentID + " Session:" + imSessionID + " Message:" +
367 message); 367 message);
368 GridInstantMessage msg = new GridInstantMessage(); 368 GridInstantMessage msg = new GridInstantMessage();
369 msg.fromAgentID = fromAgentID.UUID; 369 msg.fromAgentID = fromAgentID.UUID;
370 msg.fromAgentSession = fromAgentSession.UUID; 370 msg.fromAgentSession = fromAgentSession.UUID;
371 msg.toAgentID = toAgentID.UUID; 371 msg.toAgentID = toAgentID.UUID;
372 msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here 372 msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here
373 m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString()); 373 m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID);
374 msg.timestamp = timestamp; 374 msg.timestamp = timestamp;
375 if (client != null) 375 if (client != null)
376 { 376 {
@@ -393,16 +393,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
393 } 393 }
394 394
395 // 39 == Accept Friendship 395 // 39 == Accept Friendship
396 if (dialog == (byte) 39) 396 if (dialog == 39)
397 { 397 {
398 m_log.Info("[FRIEND]: 39 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + 398 m_log.Info("[FRIEND]: 39 - From:" + fromAgentID + " To: " + toAgentID + " Session:" + imSessionID + " Message:" +
399 message); 399 message);
400 } 400 }
401 401
402 // 40 == Decline Friendship 402 // 40 == Decline Friendship
403 if (dialog == (byte) 40) 403 if (dialog == 40)
404 { 404 {
405 m_log.Info("[FRIEND]: 40 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + 405 m_log.Info("[FRIEND]: 40 - From:" + fromAgentID + " To: " + toAgentID + " Session:" + imSessionID + " Message:" +
406 message); 406 message);
407 } 407 }
408 } 408 }
@@ -433,14 +433,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
433 msg.ParentEstateID = 0; 433 msg.ParentEstateID = 0;
434 msg.timestamp = (uint) Util.UnixTimeSinceEpoch(); 434 msg.timestamp = (uint) Util.UnixTimeSinceEpoch();
435 msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID; 435 msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID;
436 msg.dialog = (byte) 39; // Approved friend request 436 msg.dialog = 39; // Approved friend request
437 msg.Position = new sLLVector3(); 437 msg.Position = new sLLVector3();
438 msg.offline = (byte) 0; 438 msg.offline = 0;
439 msg.binaryBucket = new byte[0]; 439 msg.binaryBucket = new byte[0];
440 // We don't really care which scene we pipe it through, it goes to the shared IM Module and/or the database 440 // We don't really care which scene we pipe it through, it goes to the shared IM Module and/or the database
441 441
442 SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); 442 SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
443 SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); 443 SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, 1);
444 m_pendingFriendRequests.Remove(transactionID); 444 m_pendingFriendRequests.Remove(transactionID);
445 445
446 // TODO: Inform agent that the friend is online 446 // TODO: Inform agent that the friend is online
@@ -471,9 +471,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
471 msg.ParentEstateID = 0; 471 msg.ParentEstateID = 0;
472 msg.timestamp = (uint) Util.UnixTimeSinceEpoch(); 472 msg.timestamp = (uint) Util.UnixTimeSinceEpoch();
473 msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID; 473 msg.RegionID = SceneAgentIn.RegionInfo.RegionID.UUID;
474 msg.dialog = (byte) 40; // Deny friend request 474 msg.dialog = 40; // Deny friend request
475 msg.Position = new sLLVector3(); 475 msg.Position = new sLLVector3();
476 msg.offline = (byte) 0; 476 msg.offline = 0;
477 msg.binaryBucket = new byte[0]; 477 msg.binaryBucket = new byte[0];
478 SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); 478 SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
479 m_pendingFriendRequests.Remove(transactionID); 479 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
41 { 41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 private Dictionary<LLUUID, GroupList> m_grouplistmap = new Dictionary<LLUUID, GroupList>(); 44 private readonly Dictionary<LLUUID, GroupList> m_grouplistmap = new Dictionary<LLUUID, GroupList>();
45 private Dictionary<LLUUID, GroupData> m_groupmap = new Dictionary<LLUUID, GroupData>(); 45 private readonly Dictionary<LLUUID, GroupData> m_groupmap = new Dictionary<LLUUID, GroupData>();
46 private Dictionary<LLUUID, IClientAPI> m_iclientmap = new Dictionary<LLUUID, IClientAPI>(); 46 private readonly Dictionary<LLUUID, IClientAPI> m_iclientmap = new Dictionary<LLUUID, IClientAPI>();
47 private List<Scene> m_scene = new List<Scene>(); 47 private readonly List<Scene> m_scene = new List<Scene>();
48 48
49 #region IRegionModule Members 49 #region IRegionModule Members
50 50
@@ -214,7 +214,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
214 } 214 }
215 else 215 else
216 { 216 {
217 m_log.Info("[GROUP]: Removing all reference to groups for " + agentID.ToString()); 217 m_log.Info("[GROUP]: Removing all reference to groups for " + agentID);
218 } 218 }
219 m_iclientmap.Remove(agentID); 219 m_iclientmap.Remove(agentID);
220 } 220 }
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
46 /// occurs in the initial offer message, not the accept message. So this dictionary links 46 /// occurs in the initial offer message, not the accept message. So this dictionary links
47 /// IM Session Ids to ItemIds 47 /// IM Session Ids to ItemIds
48 /// </summary> 48 /// </summary>
49 private IDictionary<LLUUID, LLUUID> m_pendingOffers = new Dictionary<LLUUID, LLUUID>(); 49 private readonly IDictionary<LLUUID, LLUUID> m_pendingOffers = new Dictionary<LLUUID, LLUUID>();
50 50
51 private Scene m_scene; 51 private Scene m_scene;
52 52
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
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 private Scene m_scene; 42 private Scene m_scene;
43 43
44 public AvatarProfilesModule()
45 {
46 }
47
48 #region IRegionModule Members 44 #region IRegionModule Members
49 45
50 public void Initialise(Scene scene, IConfigSource config) 46 public void Initialise(Scene scene, IConfigSource config)
@@ -104,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles
104 } 100 }
105 else 101 else
106 { 102 {
107 m_log.Debug("[AvatarProfilesModule]: Got null for profile for " + avatarID.ToString()); 103 m_log.Debug("[AvatarProfilesModule]: Got null for profile for " + avatarID);
108 } 104 }
109 } 105 }
110 106
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
42 public class Command : ICommand 42 public class Command : ICommand
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 private List<CommandArgument> m_args = new List<CommandArgument>(); 45 private readonly List<CommandArgument> m_args = new List<CommandArgument>();
46 46
47 private Action<object[]> m_command; 47 private readonly Action<object[]> m_command;
48 private string m_help; 48 private readonly string m_help;
49 private string m_name; 49 private readonly string m_name;
50 50
51 public Command(string name, Action<Object[]> command, string help) 51 public Command(string name, Action<Object[]> command, string help)
52 { 52 {
@@ -164,9 +164,9 @@ namespace OpenSim.Region.Environment.Modules.Framework
164 /// </summary> 164 /// </summary>
165 public class CommandArgument 165 public class CommandArgument
166 { 166 {
167 private string m_help; 167 private readonly string m_help;
168 private string m_name; 168 private readonly string m_name;
169 private string m_type; 169 private readonly string m_type;
170 private Object m_val; 170 private Object m_val;
171 171
172 public CommandArgument(string name, string help, string type) 172 public CommandArgument(string name, string help, string type)
@@ -204,8 +204,8 @@ namespace OpenSim.Region.Environment.Modules.Framework
204 public class Commander : ICommander 204 public class Commander : ICommander
205 { 205 {
206 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 206 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
207 private Dictionary<string, ICommand> m_commands = new Dictionary<string, ICommand>(); 207 private readonly Dictionary<string, ICommand> m_commands = new Dictionary<string, ICommand>();
208 private string m_name; 208 private readonly string m_name;
209 209
210 public Commander(string name) 210 public Commander(string name)
211 { 211 {
@@ -235,11 +235,11 @@ namespace OpenSim.Region.Environment.Modules.Framework
235 } 235 }
236 classSrc = classSrc.Remove(classSrc.Length - 1); // Delete the last comma 236 classSrc = classSrc.Remove(classSrc.Length - 1); // Delete the last comma
237 classSrc += " )\n\t{\n"; 237 classSrc += " )\n\t{\n";
238 classSrc += "\t\tObject[] args = new Object[" + com.Arguments.Count.ToString() + "];\n"; 238 classSrc += "\t\tObject[] args = new Object[" + com.Arguments.Count + "];\n";
239 int i = 0; 239 int i = 0;
240 foreach (KeyValuePair<string, string> arg in com.Arguments) 240 foreach (KeyValuePair<string, string> arg in com.Arguments)
241 { 241 {
242 classSrc += "\t\targs[" + i.ToString() + "] = " + Util.Md5Hash(arg.Key) + " " + ";\n"; 242 classSrc += "\t\targs[" + i + "] = " + Util.Md5Hash(arg.Key) + " " + ";\n";
243 i++; 243 i++;
244 } 244 }
245 classSrc += "\t\tGetCommander(\"" + m_name + "\").Run(\"" + com.Name + "\", args);\n"; 245 classSrc += "\t\tGetCommander(\"" + m_name + "\").Run(\"" + com.Name + "\", args);\n";
diff --git a/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs b/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs
index 7b5c981..3df9129 100644
--- a/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs
@@ -34,7 +34,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
34{ 34{
35 public class CommanderTestModule : IRegionModule, ICommandableModule 35 public class CommanderTestModule : IRegionModule, ICommandableModule
36 { 36 {
37 private Commander m_commander = new Commander("CommanderTest"); 37 private readonly Commander m_commander = new Commander("CommanderTest");
38 private Scene m_scene; 38 private Scene m_scene;
39 39
40 #region ICommandableModule Members 40 #region ICommandableModule Members
diff --git a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs
index 2ca4df9..ac2ac0b 100644
--- a/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs
+++ b/OpenSim/Region/Environment/Modules/Grid/Interregion/InterregionModule.cs
@@ -29,14 +29,14 @@ namespace OpenSim.Region.Environment.Modules.Grid.Interregion
29 #endregion 29 #endregion
30 30
31 private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>(); 31 private readonly Dictionary<Type, Object> m_interfaces = new Dictionary<Type, object>();
32 private readonly Object m_lockObject = new object();
32 private readonly List<Location> m_myLocations = new List<Location>(); 33 private readonly List<Location> m_myLocations = new List<Location>();
33 34
34 private readonly Dictionary<Location, string[]> m_neighbourInterfaces = new Dictionary<Location, string[]>(); 35 private readonly Dictionary<Location, string[]> m_neighbourInterfaces = new Dictionary<Location, string[]>();
35 private readonly Dictionary<Location, RemotingObject> m_neighbourRemote = new Dictionary<Location, RemotingObject>(); 36 private readonly Dictionary<Location, RemotingObject> m_neighbourRemote = new Dictionary<Location, RemotingObject>();
36 private IConfigSource m_config; 37 private IConfigSource m_config;
37 private bool m_enabled = false; 38 private bool m_enabled;
38 39
39 private Object m_lockObject = new object();
40 private RemotingObject m_myRemote; 40 private RemotingObject m_myRemote;
41 private TcpChannel m_tcpChannel; 41 private TcpChannel m_tcpChannel;
42 private int m_tcpPort = 10101; 42 private int m_tcpPort = 10101;
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
index c0e3d3b..d926714 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -40,12 +40,12 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
40{ 40{
41 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager 41 public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
42 { 42 {
43 private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>(); 43 private readonly Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
44 44
45 private Dictionary<string, IDynamicTextureRender> RenderPlugins = 45 private readonly Dictionary<string, IDynamicTextureRender> RenderPlugins =
46 new Dictionary<string, IDynamicTextureRender>(); 46 new Dictionary<string, IDynamicTextureRender>();
47 47
48 private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>(); 48 private readonly Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>();
49 49
50 #region IDynamicTextureManager Members 50 #region IDynamicTextureManager Members
51 51
@@ -176,14 +176,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
176 176
177 public class DynamicTextureUpdater 177 public class DynamicTextureUpdater
178 { 178 {
179 public bool BlendWithOldTexture = false; 179 public bool BlendWithOldTexture;
180 public string BodyData; 180 public string BodyData;
181 public string ContentType; 181 public string ContentType;
182 public byte FrontAlpha = 255; 182 public byte FrontAlpha = 255;
183 public LLUUID LastAssetID; 183 public LLUUID LastAssetID;
184 public string Params; 184 public string Params;
185 public LLUUID PrimID; 185 public LLUUID PrimID;
186 public bool SetNewFrontAlpha = false; 186 public bool SetNewFrontAlpha;
187 public LLUUID SimUUID; 187 public LLUUID SimUUID;
188 public LLUUID UpdaterID; 188 public LLUUID UpdaterID;
189 public int UpdateTimer; 189 public int UpdateTimer;
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index e1339a3..4bde33b 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
84{ 84{
85 public class HttpRequestModule : IRegionModule, IHttpRequests 85 public class HttpRequestModule : IRegionModule, IHttpRequests
86 { 86 {
87 private object HttpListLock = new object(); 87 private readonly object HttpListLock = new object();
88 private int httpTimeout = 30000; 88 private int httpTimeout = 30000;
89 private string m_name = "HttpScriptRequests"; 89 private string m_name = "HttpScriptRequests";
90 90
@@ -93,10 +93,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
93 private Scene m_scene; 93 private Scene m_scene;
94 private Queue<HttpRequestClass> rpcQueue = new Queue<HttpRequestClass>(); 94 private Queue<HttpRequestClass> rpcQueue = new Queue<HttpRequestClass>();
95 95
96 public HttpRequestModule()
97 {
98 }
99
100 #region IHttpRequests Members 96 #region IHttpRequests Members
101 97
102 public LLUUID MakeHttpRequest(string url, string parameters, string body) 98 public LLUUID MakeHttpRequest(string url, string parameters, string body)
diff --git a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs
index c828ef0..f39f16d 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs
@@ -120,9 +120,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL
120 120
121 private void MakeHttpRequest(string url, LLUUID requestID) 121 private void MakeHttpRequest(string url, LLUUID requestID)
122 { 122 {
123 WebRequest request = HttpWebRequest.Create(url); 123 WebRequest request = WebRequest.Create(url);
124 RequestState state = new RequestState((HttpWebRequest) request, requestID); 124 RequestState state = new RequestState((HttpWebRequest) request, requestID);
125 IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); 125 IAsyncResult result = request.BeginGetResponse(HttpRequestReturn, state);
126 126
127 TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); 127 TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
128 state.TimeOfRequest = (int) t.TotalSeconds; 128 state.TimeOfRequest = (int) t.TotalSeconds;
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL
131 private void HttpRequestReturn(IAsyncResult result) 131 private void HttpRequestReturn(IAsyncResult result)
132 { 132 {
133 RequestState state = (RequestState) result.AsyncState; 133 RequestState state = (RequestState) result.AsyncState;
134 WebRequest request = (WebRequest) state.Request; 134 WebRequest request = state.Request;
135 HttpWebResponse response = (HttpWebResponse) request.EndGetResponse(result); 135 HttpWebResponse response = (HttpWebResponse) request.EndGetResponse(result);
136 if (response.StatusCode == HttpStatusCode.OK) 136 if (response.StatusCode == HttpStatusCode.OK)
137 { 137 {
@@ -175,9 +175,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL
175 175
176 public class RequestState 176 public class RequestState
177 { 177 {
178 public HttpWebRequest Request = null; 178 public HttpWebRequest Request;
179 public LLUUID RequestID = LLUUID.Zero; 179 public LLUUID RequestID = LLUUID.Zero;
180 public int TimeOfRequest = 0; 180 public int TimeOfRequest;
181 181
182 public RequestState(HttpWebRequest request, LLUUID requestID) 182 public RequestState(HttpWebRequest request, LLUUID requestID)
183 { 183 {
diff --git a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
index 626c60f..8e434c7 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/VectorRender/VectorRenderModule.cs
@@ -48,10 +48,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
48 private Scene m_scene; 48 private Scene m_scene;
49 private IDynamicTextureManager m_textureManager; 49 private IDynamicTextureManager m_textureManager;
50 50
51 public VectorRenderModule()
52 {
53 }
54
55 #region IDynamicTextureRender Members 51 #region IDynamicTextureRender Members
56 52
57 public string GetContentType() 53 public string GetContentType()
@@ -138,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
138 catch (Exception e) 134 catch (Exception e)
139 { 135 {
140//Ckrinke: Add a WriteLine to remove the warning about 'e' defined but not used 136//Ckrinke: Add a WriteLine to remove the warning about 'e' defined but not used
141 Console.WriteLine("Problem with Draw. Please verify parameters." + e.ToString()); 137 Console.WriteLine("Problem with Draw. Please verify parameters." + e);
142 } 138 }
143 139
144 if ((size < 128) || (size > 1024)) 140 if ((size < 128) || (size > 1024))
@@ -260,7 +256,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
260 endPoint.X = (int) x; 256 endPoint.X = (int) x;
261 endPoint.Y = (int) y; 257 endPoint.Y = (int) y;
262 Image image = ImageHttpRequest(nextLine); 258 Image image = ImageHttpRequest(nextLine);
263 graph.DrawImage(image, (float) startPoint.X, (float) startPoint.Y, x, y); 259 graph.DrawImage(image, startPoint.X, startPoint.Y, x, y);
264 startPoint.X += endPoint.X; 260 startPoint.X += endPoint.X;
265 startPoint.Y += endPoint.Y; 261 startPoint.Y += endPoint.Y;
266 } 262 }
@@ -353,7 +349,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.VectorRender
353 349
354 private Bitmap ImageHttpRequest(string url) 350 private Bitmap ImageHttpRequest(string url)
355 { 351 {
356 WebRequest request = HttpWebRequest.Create(url); 352 WebRequest request = WebRequest.Create(url);
357//Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. 353//Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used.
358//Ckrinke Stream str = null; 354//Ckrinke Stream str = null;
359 HttpWebResponse response = (HttpWebResponse) (request).GetResponse(); 355 HttpWebResponse response = (HttpWebResponse) (request).GetResponse();
diff --git a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
index e79b2bd..c4c1718 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/WorldComm/WorldCommModule.cs
@@ -75,10 +75,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
75 private Queue m_pendingQ; 75 private Queue m_pendingQ;
76 private Scene m_scene; 76 private Scene m_scene;
77 77
78 public WorldCommModule()
79 {
80 }
81
82 #region IRegionModule Members 78 #region IRegionModule Members
83 79
84 public void Initialise(Scene scene, IConfigSource config) 80 public void Initialise(Scene scene, IConfigSource config)
@@ -324,8 +320,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
324 public class ListenerManager 320 public class ListenerManager
325 { 321 {
326 //private Dictionary<int, ListenerInfo> m_listeners; 322 //private Dictionary<int, ListenerInfo> m_listeners;
323 private readonly Hashtable m_listeners = Hashtable.Synchronized(new Hashtable());
327 private object ListenersLock = new object(); 324 private object ListenersLock = new object();
328 private Hashtable m_listeners = Hashtable.Synchronized(new Hashtable());
329 private int m_MaxListeners = 100; 325 private int m_MaxListeners = 100;
330 326
331 public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg) 327 public int AddListener(uint localID, LLUUID itemID, LLUUID hostID, int channel, string name, string id, string msg)
@@ -485,6 +481,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
485 481
486 public class ListenerInfo 482 public class ListenerInfo
487 { 483 {
484 private readonly LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message
488 private bool m_active; // Listener is active or not 485 private bool m_active; // Listener is active or not
489 private int m_channel; // Channel 486 private int m_channel; // Channel
490 private int m_handle; // Assigned handle of this listener 487 private int m_handle; // Assigned handle of this listener
@@ -494,7 +491,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
494 private uint m_localID; // Local ID from script engine 491 private uint m_localID; // Local ID from script engine
495 private string m_message; // The message 492 private string m_message; // The message
496 private string m_name; // Object name to filter messages from 493 private string m_name; // Object name to filter messages from
497 private LLUUID m_sourceItemID; // ID of the scenePart or avatar source of the message
498 494
499 public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message) 495 public ListenerInfo(uint localID, int handle, LLUUID ItemID, LLUUID hostID, int channel, string name, LLUUID id, string message)
500 { 496 {
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
index a039d42..4f6808e 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
@@ -78,20 +78,20 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
78 public class XMLRPCModule : IRegionModule, IXMLRPC 78 public class XMLRPCModule : IRegionModule, IXMLRPC
79 { 79 {
80 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 80 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
81 private readonly List<Scene> m_scenes = new List<Scene>();
82 private readonly object XMLRPCListLock = new object();
81 83
82 private string m_name = "XMLRPCModule"; 84 private string m_name = "XMLRPCModule";
83 85
84 // <channel id, RPCChannelInfo> 86 // <channel id, RPCChannelInfo>
85 private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; 87 private Dictionary<LLUUID, RPCChannelInfo> m_openChannels;
86 private Dictionary<LLUUID, SendRemoteDataRequest> m_pendingSRDResponses; 88 private Dictionary<LLUUID, SendRemoteDataRequest> m_pendingSRDResponses;
87 private int m_remoteDataPort = 0; 89 private int m_remoteDataPort;
88 90
89 private Dictionary<LLUUID, RPCRequestInfo> m_rpcPending; 91 private Dictionary<LLUUID, RPCRequestInfo> m_rpcPending;
90 private Dictionary<LLUUID, RPCRequestInfo> m_rpcPendingResponses; 92 private Dictionary<LLUUID, RPCRequestInfo> m_rpcPendingResponses;
91 private List<Scene> m_scenes = new List<Scene>();
92 private int RemoteReplyScriptTimeout = 9000; 93 private int RemoteReplyScriptTimeout = 9000;
93 private int RemoteReplyScriptWait = 300; 94 private int RemoteReplyScriptWait = 300;
94 private object XMLRPCListLock = new object();
95 95
96 #region IRegionModule Members 96 #region IRegionModule Members
97 97
@@ -428,15 +428,15 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
428 428
429 public class RPCRequestInfo 429 public class RPCRequestInfo
430 { 430 {
431 private LLUUID m_ChannelKey; 431 private readonly LLUUID m_ChannelKey;
432 private string m_IntVal; 432 private readonly string m_IntVal;
433 private LLUUID m_ItemID; 433 private readonly LLUUID m_ItemID;
434 private uint m_localID; 434 private readonly uint m_localID;
435 private LLUUID m_MessageID; 435 private readonly LLUUID m_MessageID;
436 private readonly string m_StrVal;
436 private bool m_processed; 437 private bool m_processed;
437 private int m_respInt; 438 private int m_respInt;
438 private string m_respStr; 439 private string m_respStr;
439 private string m_StrVal;
440 440
441 public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal) 441 public RPCRequestInfo(uint localID, LLUUID itemID, LLUUID channelKey, string strVal, string intVal)
442 { 442 {
@@ -514,9 +514,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
514 514
515 public class RPCChannelInfo 515 public class RPCChannelInfo
516 { 516 {
517 private LLUUID m_ChannelKey; 517 private readonly LLUUID m_ChannelKey;
518 private LLUUID m_itemID; 518 private readonly LLUUID m_itemID;
519 private uint m_localID; 519 private readonly uint m_localID;
520 520
521 public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID) 521 public RPCChannelInfo(uint localID, LLUUID itemID, LLUUID channelID)
522 { 522 {
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
index 9ac3cc3..20d02c4 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandChannel.cs
@@ -44,8 +44,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
44 //Land types set with flags in ParcelOverlay. 44 //Land types set with flags in ParcelOverlay.
45 //Only one of these can be used. 45 //Only one of these can be used.
46 public const float BAN_LINE_SAFETY_HIEGHT = 100; 46 public const float BAN_LINE_SAFETY_HIEGHT = 100;
47 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = (byte) 128; //Equals 10000000 47 public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000
48 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = (byte) 64; //Equals 01000000 48 public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000
49 49
50 //RequestResults (I think these are right, they seem to work): 50 //RequestResults (I think these are right, they seem to work):
51 public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land 51 public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land
@@ -55,26 +55,26 @@ namespace OpenSim.Region.Environment.Modules.World.Land
55 public const int LAND_SELECT_OBJECTS_GROUP = 4; 55 public const int LAND_SELECT_OBJECTS_GROUP = 4;
56 public const int LAND_SELECT_OBJECTS_OTHER = 8; 56 public const int LAND_SELECT_OBJECTS_OTHER = 8;
57 public const int LAND_SELECT_OBJECTS_OWNER = 2; 57 public const int LAND_SELECT_OBJECTS_OWNER = 2;
58 public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte) 5; //Equals 00000101 58 public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101
59 public const byte LAND_TYPE_IS_FOR_SALE = (byte) 4; //Equals 00000100 59 public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100
60 public const byte LAND_TYPE_OWNED_BY_GROUP = (byte) 2; //Equals 00000010 60 public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010
61 public const byte LAND_TYPE_OWNED_BY_OTHER = (byte) 1; //Equals 00000001 61 public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001
62 public const byte LAND_TYPE_OWNED_BY_REQUESTER = (byte) 3; //Equals 00000011 62 public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011
63 public const byte LAND_TYPE_PUBLIC = (byte) 0; //Equals 00000000 63 public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000
64 64
65 //These are other constants. Yay! 65 //These are other constants. Yay!
66 public const int START_LAND_LOCAL_ID = 1; 66 public const int START_LAND_LOCAL_ID = 1;
67 67
68 #endregion 68 #endregion
69 69
70 private int[,] landIDList = new int[64,64]; 70 private readonly int[,] landIDList = new int[64,64];
71 private Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); 71 private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>();
72 private readonly Scene m_scene;
72 73
73 private bool landPrimCountTainted = false; 74 private bool landPrimCountTainted;
74 private int lastLandLocalID = START_LAND_LOCAL_ID - 1; 75 private int lastLandLocalID = START_LAND_LOCAL_ID - 1;
75 76
76 private bool m_allowedForcefulBans = true; 77 private bool m_allowedForcefulBans = true;
77 private Scene m_scene;
78 78
79 public LandChannel(Scene scene) 79 public LandChannel(Scene scene)
80 { 80 {
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
192 { 192 {
193 lastLandLocalID++; 193 lastLandLocalID++;
194 new_land.landData.localID = lastLandLocalID; 194 new_land.landData.localID = lastLandLocalID;
195 landList.Add(lastLandLocalID, (LandObject) new_land.Copy()); 195 landList.Add(lastLandLocalID, new_land.Copy());
196 196
197 197
198 bool[,] landBitmap = new_land.getLandBitmap(); 198 bool[,] landBitmap = new_land.getLandBitmap();
@@ -532,7 +532,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
532 { 532 {
533 for (x = 0; x < 64; x++) 533 for (x = 0; x < 64; x++)
534 { 534 {
535 byte tempByte = (byte) 0; //This represents the byte for the current 4x4 535 byte tempByte = 0; //This represents the byte for the current 4x4
536 ILandObject currentParcelBlock = null; 536 ILandObject currentParcelBlock = null;
537 537
538 try 538 try
@@ -611,7 +611,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
611 packet = (ParcelOverlayPacket) PacketPool.Instance.GetPacket(PacketType.ParcelOverlay); 611 packet = (ParcelOverlayPacket) PacketPool.Instance.GetPacket(PacketType.ParcelOverlay);
612 packet.ParcelData.Data = byteArray; 612 packet.ParcelData.Data = byteArray;
613 packet.ParcelData.SequenceID = sequenceID; 613 packet.ParcelData.SequenceID = sequenceID;
614 remote_client.OutPacket((Packet) packet, ThrottleOutPacketType.Task); 614 remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
615 sequenceID++; 615 sequenceID++;
616 byteArray = new byte[LAND_BLOCKS_PER_PACKET]; 616 byteArray = new byte[LAND_BLOCKS_PER_PACKET];
617 } 617 }
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index 877bed5..e6e1ae4 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -45,14 +45,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land
45 45
46 m_scene.EventManager.OnParcelPrimCountAdd += landChannel.addPrimToLandPrimCounts; 46 m_scene.EventManager.OnParcelPrimCountAdd += landChannel.addPrimToLandPrimCounts;
47 m_scene.EventManager.OnParcelPrimCountUpdate += landChannel.updateLandPrimCounts; 47 m_scene.EventManager.OnParcelPrimCountUpdate += landChannel.updateLandPrimCounts;
48 m_scene.EventManager.OnAvatarEnteringNewParcel += new EventManager.AvatarEnteringNewParcel(landChannel.handleAvatarChangingParcel); 48 m_scene.EventManager.OnAvatarEnteringNewParcel += landChannel.handleAvatarChangingParcel;
49 m_scene.EventManager.OnClientMovement += new EventManager.ClientMovement(landChannel.handleAnyClientMovement); 49 m_scene.EventManager.OnClientMovement += landChannel.handleAnyClientMovement;
50 m_scene.EventManager.OnValidateLandBuy += landChannel.handleLandValidationRequest; 50 m_scene.EventManager.OnValidateLandBuy += landChannel.handleLandValidationRequest;
51 m_scene.EventManager.OnLandBuy += landChannel.handleLandBuyRequest; 51 m_scene.EventManager.OnLandBuy += landChannel.handleLandBuyRequest;
52 52
53 lock (m_scene) 53 lock (m_scene)
54 { 54 {
55 m_scene.LandChannel = (ILandChannel) landChannel; 55 m_scene.LandChannel = landChannel;
56 } 56 }
57 } 57 }
58 58
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index e297b10..54fe9ae 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -73,6 +73,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
73 get { return m_scene.RegionInfo.RegionID; } 73 get { return m_scene.RegionInfo.RegionID; }
74 } 74 }
75 75
76 #endregion
77
76 #region Constructors 78 #region Constructors
77 79
78 public LandObject(LLUUID owner_id, bool is_group_owned, Scene scene) 80 public LandObject(LLUUID owner_id, bool is_group_owned, Scene scene)
@@ -98,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
98 { 100 {
99 if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize) 101 if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize)
100 { 102 {
101 return (landBitmap[x / 4, y / 4] == true); 103 return landBitmap[x / 4, y / 4];
102 } 104 }
103 else 105 else
104 { 106 {
@@ -148,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
148 updatePacket.ParcelData.GroupID = landData.groupID; 150 updatePacket.ParcelData.GroupID = landData.groupID;
149 updatePacket.ParcelData.GroupPrims = landData.groupPrims; 151 updatePacket.ParcelData.GroupPrims = landData.groupPrims;
150 updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned; 152 updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned;
151 updatePacket.ParcelData.LandingType = (byte) landData.landingType; 153 updatePacket.ParcelData.LandingType = landData.landingType;
152 updatePacket.ParcelData.LocalID = landData.localID; 154 updatePacket.ParcelData.LocalID = landData.localID;
153 if (landData.area > 0) 155 if (landData.area > 0)
154 { 156 {
@@ -212,7 +214,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
212 landData.selectedPrims; 214 landData.selectedPrims;
213 updatePacket.ParcelData.UserLocation = landData.userLocation; 215 updatePacket.ParcelData.UserLocation = landData.userLocation;
214 updatePacket.ParcelData.UserLookAt = landData.userLookAt; 216 updatePacket.ParcelData.UserLookAt = landData.userLookAt;
215 remote_client.OutPacket((Packet) updatePacket, ThrottleOutPacketType.Task); 217 remote_client.OutPacket(updatePacket, ThrottleOutPacketType.Task);
216 } 218 }
217 219
218 public void updateLandProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client) 220 public void updateLandProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
@@ -355,7 +357,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
355 { 357 {
356 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock(); 358 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock();
357 359
358 listBlock.Flags = (uint) 0; 360 listBlock.Flags = 0;
359 listBlock.ID = entry.AgentID; 361 listBlock.ID = entry.AgentID;
360 listBlock.Time = 0; 362 listBlock.Time = 0;
361 363
@@ -367,7 +369,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
367 { 369 {
368 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock(); 370 ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock();
369 371
370 listBlock.Flags = (uint) 0; 372 listBlock.Flags = 0;
371 listBlock.ID = LLUUID.Zero; 373 listBlock.ID = LLUUID.Zero;
372 listBlock.Time = 0; 374 listBlock.Time = 0;
373 375
@@ -390,7 +392,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
390 replyPacket.Data.SequenceID = 0; 392 replyPacket.Data.SequenceID = 0;
391 393
392 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Access); 394 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Access);
393 remote_client.OutPacket((Packet) replyPacket, ThrottleOutPacketType.Task); 395 remote_client.OutPacket(replyPacket, ThrottleOutPacketType.Task);
394 } 396 }
395 397
396 if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both) 398 if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both)
@@ -402,7 +404,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
402 replyPacket.Data.SequenceID = 0; 404 replyPacket.Data.SequenceID = 0;
403 405
404 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Ban); 406 replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Ban);
405 remote_client.OutPacket((Packet) replyPacket, ThrottleOutPacketType.Task); 407 remote_client.OutPacket(replyPacket, ThrottleOutPacketType.Task);
406 } 408 }
407 } 409 }
408 410
@@ -482,7 +484,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
482 { 484 {
483 for (y = 0; y < 64; y++) 485 for (y = 0; y < 64; y++)
484 { 486 {
485 if (landBitmap[x, y] == true) 487 if (landBitmap[x, y])
486 { 488 {
487 if (min_x > x) min_x = x; 489 if (min_x > x) min_x = x;
488 if (min_y > y) min_y = y; 490 if (min_y > y) min_y = y;
@@ -499,7 +501,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
499 if (ty > 255) 501 if (ty > 255)
500 ty = 255; 502 ty = 255;
501 landData.AABBMin = 503 landData.AABBMin =
502 new LLVector3((float) (min_x * 4), (float) (min_y * 4), 504 new LLVector3((min_x * 4), (min_y * 4),
503 (float) m_scene.Heightmap[tx, ty]); 505 (float) m_scene.Heightmap[tx, ty]);
504 506
505 tx = max_x * 4; 507 tx = max_x * 4;
@@ -509,7 +511,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
509 if (ty > 255) 511 if (ty > 255)
510 ty = 255; 512 ty = 255;
511 landData.AABBMax = 513 landData.AABBMax =
512 new LLVector3((float) (max_x * 4), (float) (max_y * 4), 514 new LLVector3((max_x * 4), (max_y * 4),
513 (float) m_scene.Heightmap[tx, ty]); 515 (float) m_scene.Heightmap[tx, ty]);
514 landData.area = tempArea; 516 landData.area = tempArea;
515 } 517 }
@@ -657,7 +659,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
657 if (i % 8 == 0) 659 if (i % 8 == 0)
658 { 660 {
659 tempConvertArr[byteNum] = tempByte; 661 tempConvertArr[byteNum] = tempByte;
660 tempByte = (byte) 0; 662 tempByte = 0;
661 i = 0; 663 i = 0;
662 byteNum++; 664 byteNum++;
663 } 665 }
@@ -677,7 +679,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
677 tempByte = landData.landBitmapByteArray[i]; 679 tempByte = landData.landBitmapByteArray[i];
678 for (bitNum = 0; bitNum < 8; bitNum++) 680 for (bitNum = 0; bitNum < 8; bitNum++)
679 { 681 {
680 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1); 682 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & 1);
681 tempConvertMap[x, y] = bit; 683 tempConvertMap[x, y] = bit;
682 x++; 684 x++;
683 if (x > 63) 685 if (x > 63)
@@ -751,7 +753,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
751 resultLocalIDs.RemoveAt(0); 753 resultLocalIDs.RemoveAt(0);
752 } 754 }
753 pack.Data = data; 755 pack.Data = data;
754 remote_client.OutPacket((Packet) pack, ThrottleOutPacketType.Task); 756 remote_client.OutPacket(pack, ThrottleOutPacketType.Task);
755 } 757 }
756 } 758 }
757 759
@@ -922,7 +924,5 @@ namespace OpenSim.Region.Environment.Modules.World.Land
922 #endregion 924 #endregion
923 925
924 #endregion 926 #endregion
925
926 #endregion
927 } 927 }
928} \ No newline at end of file 928} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index 4406e17..854d2ee 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -37,10 +37,10 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
37{ 37{
38 public class SerialiserModule : IRegionModule, IRegionSerialiser 38 public class SerialiserModule : IRegionModule, IRegionSerialiser
39 { 39 {
40 private Commander m_commander = new Commander("Export"); 40 private readonly Commander m_commander = new Commander("Export");
41 private List<Scene> m_regions = new List<Scene>(); 41 private readonly List<Scene> m_regions = new List<Scene>();
42 private readonly List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>();
42 private string m_savedir = "exports" + "/"; 43 private string m_savedir = "exports" + "/";
43 private List<IFileSerialiser> m_serialisers = new List<IFileSerialiser>();
44 44
45 #region IRegionModule Members 45 #region IRegionModule Members
46 46
@@ -105,8 +105,8 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
105 105
106 TextWriter regionInfoWriter = new StreamWriter(saveDir + "README.TXT"); 106 TextWriter regionInfoWriter = new StreamWriter(saveDir + "README.TXT");
107 regionInfoWriter.WriteLine("Region Name: " + scene.RegionInfo.RegionName); 107 regionInfoWriter.WriteLine("Region Name: " + scene.RegionInfo.RegionName);
108 regionInfoWriter.WriteLine("Region ID: " + scene.RegionInfo.RegionID.ToString()); 108 regionInfoWriter.WriteLine("Region ID: " + scene.RegionInfo.RegionID);
109 regionInfoWriter.WriteLine("Backup Time: UTC " + DateTime.UtcNow.ToString()); 109 regionInfoWriter.WriteLine("Backup Time: UTC " + DateTime.UtcNow);
110 regionInfoWriter.WriteLine("Serialise Version: 0.1"); 110 regionInfoWriter.WriteLine("Serialise Version: 0.1");
111 regionInfoWriter.Close(); 111 regionInfoWriter.Close();
112 112
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
141 { 141 {
142 if (region.RegionInfo.RegionName == (string) args[0]) 142 if (region.RegionInfo.RegionName == (string) args[0])
143 { 143 {
144 List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); 144 List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID + "/");
145 } 145 }
146 } 146 }
147 } 147 }
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
150 { 150 {
151 foreach (Scene region in m_regions) 151 foreach (Scene region in m_regions)
152 { 152 {
153 List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); 153 List<string> results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID + "/");
154 } 154 }
155 } 155 }
156 156
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index 47ce258..05fae22 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Modules.World.Sun
127 { 127 {
128 long m_addticks = (DateTime.Now.Ticks - m_start) * m_dilation; 128 long m_addticks = (DateTime.Now.Ticks - m_start) * m_dilation;
129 DateTime dt = new DateTime(m_start + m_addticks); 129 DateTime dt = new DateTime(m_start + m_addticks);
130 return (double) dt.Hour + ((double) dt.Minute / 60.0); 130 return dt.Hour + (dt.Minute / 60.0);
131 } 131 }
132 132
133 private LLVector3 SunPos(double hour) 133 private LLVector3 SunPos(double hour)
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs b/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs
index a2e0c40..331c49d 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.Effects
78 { 78 {
79 for (y = 0; y < map.Height; y++) 79 for (y = 0; y < map.Height; y++)
80 { 80 {
81 if (cliffMask[x, y] == true) 81 if (cliffMask[x, y])
82 eroder.PaintEffect(map, x, y, 4, 0.1); 82 eroder.PaintEffect(map, x, y, 4, 0.1);
83 } 83 }
84 } 84 }
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
index 5d6723f..90728da 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
47 { 47 {
48 for (x = 0; x < retval.Width; x++) 48 for (x = 0; x < retval.Width; x++)
49 { 49 {
50 retval[x, y] = (double) bs.ReadByte() * ((double) bs.ReadByte() / 127.0); 50 retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 127.0);
51 bs.ReadBytes(11); // Advance the stream to next bytes. 51 bs.ReadBytes(11); // Advance the stream to next bytes.
52 } 52 }
53 } 53 }
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
76 { 76 {
77 for (j = 0; j < 256; j++) 77 for (j = 0; j < 256; j++)
78 { 78 {
79 lookupHeightTable[i + (j * 256)] = ((double) i * ((double) j / 127.0)); 79 lookupHeightTable[i + (j * 256)] = (i * (j / 127.0));
80 } 80 }
81 } 81 }
82 82
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs
index 7cb4b00..04c3f1a 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs
@@ -50,14 +50,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
50 BinaryReader bs = new BinaryReader(s); 50 BinaryReader bs = new BinaryReader(s);
51 51
52 bool eof = false; 52 bool eof = false;
53 if (ASCIIEncoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ") 53 if (Encoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ")
54 { 54 {
55 // Terragen file 55 // Terragen file
56 while (eof == false) 56 while (eof == false)
57 { 57 {
58 int w = 256; 58 int w = 256;
59 int h = 256; 59 int h = 256;
60 string tmp = ASCIIEncoding.ASCII.GetString(bs.ReadBytes(4)); 60 string tmp = Encoding.ASCII.GetString(bs.ReadBytes(4));
61 switch (tmp) 61 switch (tmp)
62 { 62 {
63 case "SIZE": 63 case "SIZE":
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
84 { 84 {
85 for (y = 0; y < h; y++) 85 for (y = 0; y < h; y++)
86 { 86 {
87 retval[x, y] = (double) baseHeight + (double) bs.ReadInt16() * (double) heightScale / 65536.0; 87 retval[x, y] = baseHeight + bs.ReadInt16() * (double) heightScale / 65536.0;
88 } 88 }
89 } 89 }
90 break; 90 break;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
index dee455f..fa52a00 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
@@ -31,7 +31,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
31{ 31{
32 public class FlattenSphere : ITerrainPaintableEffect 32 public class FlattenSphere : ITerrainPaintableEffect
33 { 33 {
34
35 #region ITerrainPaintableEffect Members 34 #region ITerrainPaintableEffect Members
36 35
37 public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength, double duration) 36 public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength, double duration)
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
index 8ae583e..5037533 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
57 z *= z; 57 z *= z;
58 z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); 58 z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry));
59 59
60 double noise = TerrainUtil.PerlinNoise2D((double) x / (double) Constants.RegionSize, (double) y / (double) Constants.RegionSize, 8, 1.0); 60 double noise = TerrainUtil.PerlinNoise2D(x / (double) Constants.RegionSize, y / (double) Constants.RegionSize, 8, 1.0);
61 61
62 if (z > 0.0) 62 if (z > 0.0)
63 map[x, y] += noise * z * duration; 63 map[x, y] += noise * z * duration;
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs
index b47e041..acce32e 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
32{ 32{
33 public class RevertSphere : ITerrainPaintableEffect 33 public class RevertSphere : ITerrainPaintableEffect
34 { 34 {
35 private ITerrainChannel m_revertmap; 35 private readonly ITerrainChannel m_revertmap;
36 36
37 public RevertSphere(ITerrainChannel revertmap) 37 public RevertSphere(ITerrainChannel revertmap)
38 { 38 {
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs
index f5c0fe4..2411de0 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs
@@ -31,7 +31,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
31{ 31{
32 public class TerrainException : Exception 32 public class TerrainException : Exception
33 { 33 {
34 public TerrainException() : base() 34 public TerrainException()
35 { 35 {
36 } 36 }
37 37
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index eff6159..c105620 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
83 private Dictionary<string, ITerrainEffect> m_plugineffects; 83 private Dictionary<string, ITerrainEffect> m_plugineffects;
84 private ITerrainChannel m_revert; 84 private ITerrainChannel m_revert;
85 private Scene m_scene; 85 private Scene m_scene;
86 private bool m_tainted = false; 86 private bool m_tainted;
87 87
88 #region ICommandableModule Members 88 #region ICommandableModule Members
89 89
@@ -223,6 +223,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
223 } 223 }
224 } 224 }
225 225
226 #endregion
227
226 #region Plugin Loading Methods 228 #region Plugin Loading Methods
227 229
228 private void LoadPlugins() 230 private void LoadPlugins()
@@ -276,8 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
276 278
277 #endregion 279 #endregion
278 280
279 #endregion
280
281 /// <summary> 281 /// <summary>
282 /// Installs into terrain module the standard suite of brushes 282 /// Installs into terrain module the standard suite of brushes
283 /// </summary> 283 /// </summary>
diff --git a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
index 4b22700..d964fe4 100644
--- a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
@@ -66,10 +66,10 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
66 m_trees = new List<LLUUID>(); 66 m_trees = new List<LLUUID>();
67 m_scene = scene; 67 m_scene = scene;
68 68
69 m_scene.EventManager.OnPluginConsole += new EventManager.OnPluginConsoleDelegate(EventManager_OnPluginConsole); 69 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
70 70
71 Timer CalculateTrees = new Timer(m_tree_updates); 71 Timer CalculateTrees = new Timer(m_tree_updates);
72 CalculateTrees.Elapsed += new ElapsedEventHandler(CalculateTrees_Elapsed); 72 CalculateTrees.Elapsed += CalculateTrees_Elapsed;
73 CalculateTrees.Start(); 73 CalculateTrees.Start();
74 m_log.Debug("[TREES]: Initialised tree module"); 74 m_log.Debug("[TREES]: Initialised tree module");
75 } 75 }