aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
authorJeff Ames2008-08-18 00:39:10 +0000
committerJeff Ames2008-08-18 00:39:10 +0000
commit6ef9d4da901a346c232458317cca6268da888e2e (patch)
treedd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/Environment/Modules
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs52
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs22
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs86
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs38
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs54
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs42
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs46
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs18
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs85
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs8
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs12
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs35
34 files changed, 327 insertions, 373 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
index 10ef766..e6ee75f 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
46 { 46 {
47 private static readonly ILog m_log 47 private static readonly ILog m_log
48 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 /// <summary> 50 /// <summary>
51 /// True if the service has been closed, probably because a user with texture requests still queued 51 /// True if the service has been closed, probably because a user with texture requests still queued
52 /// logged out. 52 /// logged out.
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
175 public void TextureCallback(LLUUID textureID, AssetBase texture) 175 public void TextureCallback(LLUUID textureID, AssetBase texture)
176 { 176 {
177 //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false)); 177 //m_log.DebugFormat("[USER TEXTURE DOWNLOAD SERVICE]: Calling TextureCallback with {0}, texture == null is {1}", textureID, (texture == null ? true : false));
178 178
179 // There may still be texture requests pending for a logged out client 179 // There may still be texture requests pending for a logged out client
180 if (closed) 180 if (closed)
181 return; 181 return;
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
247 internal void Close() 247 internal void Close()
248 { 248 {
249 closed = true; 249 closed = true;
250 250
251 lock (m_textureSenders) 251 lock (m_textureSenders)
252 { 252 {
253 foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values) 253 foreach (TextureSender.TextureSender textureSender in m_textureSenders.Values)
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
257 257
258 m_textureSenders.Clear(); 258 m_textureSenders.Clear();
259 } 259 }
260 260
261 // XXX: It might be possible to also remove pending texture requests from the asset cache queues, 261 // XXX: It might be possible to also remove pending texture requests from the asset cache queues,
262 // though this might also be more trouble than it's worth. 262 // though this might also be more trouble than it's worth.
263 } 263 }
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
index c5a4a96..4a98622 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
186 client.OnTerminateFriendship += OnTerminateFriendship; 186 client.OnTerminateFriendship += OnTerminateFriendship;
187 187
188 doFriendListUpdateOnline(client.AgentId); 188 doFriendListUpdateOnline(client.AgentId);
189 189
190 } 190 }
191 191
192 private void doFriendListUpdateOnline(LLUUID AgentId) 192 private void doFriendListUpdateOnline(LLUUID AgentId)
@@ -386,7 +386,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
386 { 386 {
387 m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); 387 m_rootAgents.Add(avatar.UUID, avatar.RegionHandle);
388 m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); 388 m_log.Info("[FRIEND]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + ".");
389 389
390 List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>(); 390 List<StoredFriendListUpdate> updateme = new List<StoredFriendListUpdate>();
391 lock (StoredFriendListUpdates) 391 lock (StoredFriendListUpdates)
392 { 392 {
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends
546 546
547 SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); 547 SceneAgentIn.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
548 SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1); 548 SceneAgentIn.StoreAddFriendship(m_pendingFriendRequests[transactionID], agentID, (uint) 1);
549 549
550 550
551 //LLUUID[] Agents = new LLUUID[1]; 551 //LLUUID[] Agents = new LLUUID[1];
552 //Agents[0] = msg.toAgentID; 552 //Agents[0] = msg.toAgentID;
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
index a83730e..eaa5013 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
62 scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; 62 scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage;
63 lock (m_groupUUIDGroup) 63 lock (m_groupUUIDGroup)
64 { 64 {
65 65
66 GroupData OpenSimulatorGroup = new GroupData(); 66 GroupData OpenSimulatorGroup = new GroupData();
67 OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; 67 OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester";
68 OpenSimulatorGroup.GroupID = opensimulatorGroupID; 68 OpenSimulatorGroup.GroupID = opensimulatorGroupID;
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
136 } 136 }
137 137
138 } 138 }
139 139
140 lock (m_groupmap) 140 lock (m_groupmap)
141 { 141 {
142 if (!m_groupmap.ContainsKey(client.AgentId)) 142 if (!m_groupmap.ContainsKey(client.AgentId))
@@ -159,8 +159,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
159 updateGroups[0] = OpenSimulatorGroup; 159 updateGroups[0] = OpenSimulatorGroup;
160 160
161 client.SendGroupMembership(updateGroups); 161 client.SendGroupMembership(updateGroups);
162
163
164 } 162 }
165 163
166 private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID) 164 private void OnAgentDataUpdateRequest(IClientAPI remoteClient, LLUUID AgentID, LLUUID SessionID)
@@ -275,6 +273,4 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
275 GC.Collect(); 273 GC.Collect();
276 } 274 }
277 } 275 }
278 276}
279
280} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
index a3452ab..15ce584 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -208,7 +208,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
208 SceneObjectPart part = scene.GetSceneObjectPart(PrimID); 208 SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
209 byte[] assetData; 209 byte[] assetData;
210 AssetBase oldAsset = null; 210 AssetBase oldAsset = null;
211 211
212 if (BlendWithOldTexture) 212 if (BlendWithOldTexture)
213 { 213 {
214 LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID; 214 LLUUID lastTextureID = part.Shape.Textures.DefaultTexture.TextureID;
@@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
228 assetData = new byte[data.Length]; 228 assetData = new byte[data.Length];
229 Array.Copy(data, assetData, data.Length); 229 Array.Copy(data, assetData, data.Length);
230 } 230 }
231 231
232 // Create a new asset for user 232 // Create a new asset for user
233 AssetBase asset = new AssetBase(); 233 AssetBase asset = new AssetBase();
234 asset.FullID = LLUUID.Random(); 234 asset.FullID = LLUUID.Random();
@@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
244 244
245 // mostly keep the values from before 245 // mostly keep the values from before
246 LLObject.TextureEntry tmptex = part.Shape.Textures; 246 LLObject.TextureEntry tmptex = part.Shape.Textures;
247 247
248 // remove the old asset from the cache 248 // remove the old asset from the cache
249 LLUUID oldID = tmptex.DefaultTexture.TextureID; 249 LLUUID oldID = tmptex.DefaultTexture.TextureID;
250 scene.AssetCache.ExpireAsset(oldID); 250 scene.AssetCache.ExpireAsset(oldID);
@@ -298,4 +298,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
298 298
299 #endregion 299 #endregion
300 } 300 }
301} \ No newline at end of file 301}
diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs
index 1162c25..bcf3e76 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs
@@ -68,14 +68,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
68 { 68 {
69 m_Config = config; 69 m_Config = config;
70 IConfig SMTPConfig; 70 IConfig SMTPConfig;
71 71
72 //FIXME: RegionName is correct?? 72 //FIXME: RegionName is correct??
73 //m_RegionName = scene.RegionInfo.RegionName; 73 //m_RegionName = scene.RegionInfo.RegionName;
74 74
75 IConfig startupConfig = m_Config.Configs["Startup"]; 75 IConfig startupConfig = m_Config.Configs["Startup"];
76 76
77 m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule"); 77 m_Enabled = (startupConfig.GetString("emailmodule", "DefaultEmailModule") == "DefaultEmailModule");
78 78
79 //Load SMTP SERVER config 79 //Load SMTP SERVER config
80 try 80 try
81 { 81 {
@@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
85 m_Enabled = false; 85 m_Enabled = false;
86 return; 86 return;
87 } 87 }
88 88
89 if (!SMTPConfig.GetBoolean("enabled", false)) 89 if (!SMTPConfig.GetBoolean("enabled", false))
90 { 90 {
91 m_log.InfoFormat("[SMTP] module disabled in configuration"); 91 m_log.InfoFormat("[SMTP] module disabled in configuration");
92 m_Enabled = false; 92 m_Enabled = false;
93 return; 93 return;
94 } 94 }
95 95
96 m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); 96 m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName);
97 SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); 97 SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME);
98 SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); 98 SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT);
99 SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); 99 SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN);
100 SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); 100 SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD);
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
124 m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); 124 m_Scenes.Add(scene.RegionInfo.RegionHandle, scene);
125 } 125 }
126 } 126 }
127 127
128 m_log.Info("[EMAIL] Activated DefaultEmailModule"); 128 m_log.Info("[EMAIL] Activated DefaultEmailModule");
129 } 129 }
130 } 130 }
@@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
146 { 146 {
147 get { return true; } 147 get { return true; }
148 } 148 }
149 149
150 /// <summary> 150 /// <summary>
151 /// 151 ///
152 /// </summary> 152 /// </summary>
153 /// <param name="seconds"></param> 153 /// <param name="seconds"></param>
154 private void DelayInSeconds(int seconds) 154 private void DelayInSeconds(int seconds)
@@ -156,11 +156,11 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
156 TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); 156 TimeSpan DiffDelay = new TimeSpan(0, 0, seconds);
157 DateTime EndDelay = DateTime.Now.Add(DiffDelay); 157 DateTime EndDelay = DateTime.Now.Add(DiffDelay);
158 while (DateTime.Now < EndDelay) 158 while (DateTime.Now < EndDelay)
159 { 159 {
160 ;//Do nothing!! 160 ;//Do nothing!!
161 } 161 }
162 } 162 }
163 163
164 private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) 164 private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName)
165 { 165 {
166 lock (m_Scenes) 166 lock (m_Scenes)
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
187 { 187 {
188 ObjectAbsolutePosition = part.AbsolutePosition.ToString(); 188 ObjectAbsolutePosition = part.AbsolutePosition.ToString();
189 ObjectName = part.Name; 189 ObjectName = part.Name;
190 ObjectRegionName = m_ObjectRegionName; 190 ObjectRegionName = m_ObjectRegionName;
191 return; 191 return;
192 } 192 }
193 ObjectAbsolutePosition = part.AbsolutePosition.ToString(); 193 ObjectAbsolutePosition = part.AbsolutePosition.ToString();
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
195 ObjectRegionName = m_ObjectRegionName; 195 ObjectRegionName = m_ObjectRegionName;
196 return; 196 return;
197 } 197 }
198 198
199 /// <summary> 199 /// <summary>
200 /// SendMail function utilized by llEMail 200 /// SendMail function utilized by llEMail
201 /// </summary> 201 /// </summary>
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
206 public void SendEmail(LLUUID objectID, string address, string subject, string body) 206 public void SendEmail(LLUUID objectID, string address, string subject, string body)
207 { 207 {
208 //Check if address is empty 208 //Check if address is empty
209 if (address == string.Empty) 209 if (address == string.Empty)
210 return; 210 return;
211 211
212 //FIXED:Check the email is correct form in REGEX 212 //FIXED:Check the email is correct form in REGEX
213 string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" 213 string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+"
214 + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" 214 + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"
215 + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" 215 + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
216 + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" 216 + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"
217 + @"[a-zA-Z]{2,}))$"; 217 + @"[a-zA-Z]{2,}))$";
218 Regex EMailreStrict = new Regex(EMailpatternStrict); 218 Regex EMailreStrict = new Regex(EMailpatternStrict);
219 bool isEMailStrictMatch = EMailreStrict.IsMatch(address); 219 bool isEMailStrictMatch = EMailreStrict.IsMatch(address);
@@ -226,9 +226,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
226 if ((subject.Length + body.Length) > 1024) 226 if ((subject.Length + body.Length) > 1024)
227 { 227 {
228 m_log.Error("[EMAIL] subject + body > 1024 Byte"); 228 m_log.Error("[EMAIL] subject + body > 1024 Byte");
229 return; 229 return;
230 } 230 }
231 231
232 try 232 try
233 { 233 {
234 string LastObjectName = string.Empty; 234 string LastObjectName = string.Empty;
@@ -242,21 +242,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
242 //From 242 //From
243 emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); 243 emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName);
244 //To - Only One 244 //To - Only One
245 emailMessage.AddToAddress(new EmailAddress(address)); 245 emailMessage.AddToAddress(new EmailAddress(address));
246 //Subject 246 //Subject
247 emailMessage.Subject = subject; 247 emailMessage.Subject = subject;
248 //TEXT Body 248 //TEXT Body
249 resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); 249 resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName);
250 emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + 250 emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName +
251 "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + 251 "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " +
252 LastObjectPosition+"\r\n\r\n\r\n" + body); 252 LastObjectPosition+"\r\n\r\n\r\n" + body);
253 //HTML Body 253 //HTML Body
254 emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" + 254 emailMessage.HtmlPart = new HtmlAttachment("<html><body><p>" +
255 "<BR>Object-Name: " + LastObjectName + 255 "<BR>Object-Name: " + LastObjectName +
256 "<BR>Region: " + LastObjectRegionName + 256 "<BR>Region: " + LastObjectRegionName +
257 "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>" 257 "<BR>Local-Position: " + LastObjectPosition + "<BR><BR><BR>"
258 +body+"\r\n</p></body><html>"); 258 +body+"\r\n</p></body><html>");
259 259
260 //Set SMTP SERVER config 260 //Set SMTP SERVER config
261 SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); 261 SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT);
262 //Authentication 262 //Authentication
@@ -272,9 +272,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules
272 return; 272 return;
273 } 273 }
274 } 274 }
275 275
276 /// <summary> 276 /// <summary>
277 /// 277 ///
278 /// </summary> 278 /// </summary>
279 /// <param name="objectID"></param> 279 /// <param name="objectID"></param>
280 /// <param name="sender"></param> 280 /// <param name="sender"></param>
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
index a5688ef..a76ff0d 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
@@ -39,33 +39,33 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
39 /// The location of the archive control file 39 /// The location of the archive control file
40 /// </summary> 40 /// </summary>
41 public static readonly string CONTROL_FILE_PATH = "archive.xml"; 41 public static readonly string CONTROL_FILE_PATH = "archive.xml";
42 42
43 /// <summary> 43 /// <summary>
44 /// Path for the assets held in an archive 44 /// Path for the assets held in an archive
45 /// </summary> 45 /// </summary>
46 public static readonly string ASSETS_PATH = "assets/"; 46 public static readonly string ASSETS_PATH = "assets/";
47 47
48 /// <summary> 48 /// <summary>
49 /// Path for the assets metadata file 49 /// Path for the assets metadata file
50 /// </summary> 50 /// </summary>
51 //public static readonly string ASSETS_METADATA_PATH = "assets.xml"; 51 //public static readonly string ASSETS_METADATA_PATH = "assets.xml";
52 52
53 /// <summary> 53 /// <summary>
54 /// Path for the prims file 54 /// Path for the prims file
55 /// </summary> 55 /// </summary>
56 public static readonly string OBJECTS_PATH = "objects/"; 56 public static readonly string OBJECTS_PATH = "objects/";
57 57
58 /// <summary> 58 /// <summary>
59 /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. 59 /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out.
60 /// </summary> 60 /// </summary>
61 public static readonly string TERRAINS_PATH = "terrains/"; 61 public static readonly string TERRAINS_PATH = "terrains/";
62 62
63 /// <summary> 63 /// <summary>
64 /// Extensions used for asset types in the archive 64 /// Extensions used for asset types in the archive
65 /// </summary> 65 /// </summary>
66 public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>(); 66 public static readonly IDictionary<sbyte, string> ASSET_TYPE_TO_EXTENSION = new Dictionary<sbyte, string>();
67 public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>(); 67 public static readonly IDictionary<string, sbyte> EXTENSION_TO_ASSET_TYPE = new Dictionary<string, sbyte>();
68 68
69 static ArchiveConstants() 69 static ArchiveConstants()
70 { 70 {
71 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh"; 71 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Animation] = "_animation.bvh";
@@ -79,11 +79,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
79 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this 79 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = "_lostandfoundfolder.txt"; // Not sure if we'll ever see this
80 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso"; 80 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = "_bytecode.lso";
81 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl"; 81 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = "_script.lsl";
82 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt"; 82 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = "_notecard.txt";
83 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml"; 83 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = "_object.xml";
84 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this 84 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = "_rootfolder.txt"; // Not sure if we'll ever see this
85// disable warning: we know Script is obsolete, but need to support it 85// disable warning: we know Script is obsolete, but need to support it
86// anyhow 86// anyhow
87#pragma warning disable 0612 87#pragma warning disable 0612
88 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this 88 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = "_script.txt"; // Not sure if we'll ever see this
89#pragma warning restore 0612 89#pragma warning restore 0612
@@ -93,8 +93,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
93 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav"; 93 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV] = "_sound.wav";
94 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2"; 94 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = "_texture.jp2";
95 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga"; 95 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = "_texture.tga";
96 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this 96 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = "_trashfolder.txt"; // Not sure if we'll ever see this
97 97
98 EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation; 98 EXTENSION_TO_ASSET_TYPE["_animation.bvh"] = (sbyte)AssetType.Animation;
99 EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart; 99 EXTENSION_TO_ASSET_TYPE["_bodypart.txt"] = (sbyte)AssetType.Bodypart;
100 EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard; 100 EXTENSION_TO_ASSET_TYPE["_callingcard.txt"] = (sbyte)AssetType.CallingCard;
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
110 EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object; 110 EXTENSION_TO_ASSET_TYPE["_object.xml"] = (sbyte)AssetType.Object;
111 EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder; 111 EXTENSION_TO_ASSET_TYPE["_rootfolder.txt"] = (sbyte)AssetType.RootFolder;
112// disable warning: we know Script is obsolete, but need to support it 112// disable warning: we know Script is obsolete, but need to support it
113// anyhow 113// anyhow
114#pragma warning disable 0612 114#pragma warning disable 0612
115 EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script; 115 EXTENSION_TO_ASSET_TYPE["_script.txt"] = (sbyte)AssetType.Script;
116#pragma warning restore 0612 116#pragma warning restore 0612
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 1340f8b..87106fb 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
53 53
54 private Scene m_scene; 54 private Scene m_scene;
55 private string m_loadPath; 55 private string m_loadPath;
56 56
57 /// <summary> 57 /// <summary>
58 /// Used to cache lookups for valid uuids. 58 /// Used to cache lookups for valid uuids.
59 /// </summary> 59 /// </summary>
@@ -68,15 +68,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
68 } 68 }
69 69
70 private void DearchiveRegion() 70 private void DearchiveRegion()
71 { 71 {
72 TarArchiveReader archive 72 TarArchiveReader archive
73 = new TarArchiveReader( 73 = new TarArchiveReader(
74 new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress)); 74 new GZipStream(new FileStream(m_loadPath, FileMode.Open), CompressionMode.Decompress));
75 //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache); 75 //AssetsDearchiver dearchiver = new AssetsDearchiver(m_scene.AssetCache);
76 76
77 List<string> serialisedSceneObjects = new List<string>(); 77 List<string> serialisedSceneObjects = new List<string>();
78 string filePath = "ERROR"; 78 string filePath = "ERROR";
79 79
80 int successfulAssetRestores = 0; 80 int successfulAssetRestores = 0;
81 int failedAssetRestores = 0; 81 int failedAssetRestores = 0;
82 82
@@ -111,30 +111,30 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
111 //m_log.Debug("[ARCHIVER]: Reached end of archive"); 111 //m_log.Debug("[ARCHIVER]: Reached end of archive");
112 112
113 archive.Close(); 113 archive.Close();
114 114
115 m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores); 115 m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores);
116 116
117 if (failedAssetRestores > 0) 117 if (failedAssetRestores > 0)
118 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); 118 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
119 119
120 m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); 120 m_log.Info("[ARCHIVER]: Clearing all existing scene objects");
121 m_scene.DeleteAllSceneObjects(); 121 m_scene.DeleteAllSceneObjects();
122 122
123 // Reload serialized prims 123 // Reload serialized prims
124 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); 124 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
125 125
126 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); 126 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
127 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 127 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
128 128
129 foreach (string serialisedSceneObject in serialisedSceneObjects) 129 foreach (string serialisedSceneObject in serialisedSceneObjects)
130 { 130 {
131 SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject); 131 SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject);
132 132
133 // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned 133 // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned
134 // on the same region server and multiple examples a single object archive to be imported 134 // on the same region server and multiple examples a single object archive to be imported
135 // to the same scene (when this is possible). 135 // to the same scene (when this is possible).
136 sceneObject.ResetIDs(); 136 sceneObject.ResetIDs();
137 137
138 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid 138 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
139 // otherwise, use the master avatar uuid instead 139 // otherwise, use the master avatar uuid instead
140 LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; 140 LLUUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID;
@@ -144,41 +144,41 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
144 { 144 {
145 if (!resolveUserUuid(part.CreatorID)) 145 if (!resolveUserUuid(part.CreatorID))
146 part.CreatorID = masterAvatarId; 146 part.CreatorID = masterAvatarId;
147 147
148 if (!resolveUserUuid(part.OwnerID)) 148 if (!resolveUserUuid(part.OwnerID))
149 part.OwnerID = masterAvatarId; 149 part.OwnerID = masterAvatarId;
150 150
151 if (!resolveUserUuid(part.LastOwnerID)) 151 if (!resolveUserUuid(part.LastOwnerID))
152 part.LastOwnerID = masterAvatarId; 152 part.LastOwnerID = masterAvatarId;
153 153
154 // And zap any troublesome sit target information 154 // And zap any troublesome sit target information
155 part.SitTargetOrientation = new Quaternion(0,0,0,1); 155 part.SitTargetOrientation = new Quaternion(0,0,0,1);
156 part.SitTargetPosition = new Vector3(0,0,0); 156 part.SitTargetPosition = new Vector3(0,0,0);
157 } 157 }
158 158
159 if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) 159 if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
160 { 160 {
161 sceneObjects.Add(sceneObject); 161 sceneObjects.Add(sceneObject);
162 } 162 }
163 } 163 }
164 164
165 m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count); 165 m_log.InfoFormat("[ARCHIVER]: Restored {0} scene objects to the scene", sceneObjects.Count);
166 166
167 int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count; 167 int ignoredObjects = serialisedSceneObjects.Count - sceneObjects.Count;
168 168
169 if (ignoredObjects > 0) 169 if (ignoredObjects > 0)
170 m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects); 170 m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects);
171 171
172 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive"); 172 m_log.InfoFormat("[ARCHIVER]: Successfully loaded archive");
173 173
174 m_log.Debug("[ARCHIVER]: Starting scripts"); 174 m_log.Debug("[ARCHIVER]: Starting scripts");
175 175
176 foreach (SceneObjectGroup sceneObject in sceneObjects) 176 foreach (SceneObjectGroup sceneObject in sceneObjects)
177 { 177 {
178 sceneObject.CreateScriptInstances(0, true); 178 sceneObject.CreateScriptInstances(0, true);
179 } 179 }
180 } 180 }
181 181
182 /// <summary> 182 /// <summary>
183 /// Look up the given user id to check whether it's one that is valid for this grid. 183 /// Look up the given user id to check whether it's one that is valid for this grid.
184 /// </summary> 184 /// </summary>
@@ -194,13 +194,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
194 else 194 else
195 m_validUserUuids.Add(uuid, false); 195 m_validUserUuids.Add(uuid, false);
196 } 196 }
197 197
198 if (m_validUserUuids[uuid]) 198 if (m_validUserUuids[uuid])
199 return true; 199 return true;
200 else 200 else
201 return false; 201 return false;
202 } 202 }
203 203
204 /// <summary> 204 /// <summary>
205 /// Load an asset 205 /// Load an asset
206 /// </summary> 206 /// </summary>
@@ -212,20 +212,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
212 // Right now we're nastily obtaining the lluuid from the filename 212 // Right now we're nastily obtaining the lluuid from the filename
213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
214 string extension = filename.Substring(filename.LastIndexOf("_")); 214 string extension = filename.Substring(filename.LastIndexOf("_"));
215 string uuid = filename.Remove(filename.Length - extension.Length); 215 string uuid = filename.Remove(filename.Length - extension.Length);
216 216
217 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) 217 if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
218 { 218 {
219 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 219 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
220 220
221 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 221 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
222 222
223 AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty); 223 AssetBase asset = new AssetBase(new LLUUID(uuid), String.Empty);
224 asset.Type = assetType; 224 asset.Type = assetType;
225 asset.Data = data; 225 asset.Data = data;
226 226
227 m_scene.AssetCache.AddAsset(asset); 227 m_scene.AssetCache.AddAsset(asset);
228 228
229 return true; 229 return true;
230 } 230 }
231 else 231 else
@@ -233,11 +233,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
233 m_log.ErrorFormat( 233 m_log.ErrorFormat(
234 "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}", 234 "[ARCHIVER]: Tried to dearchive data with path {0} with an unknown type extension {1}",
235 assetPath, extension); 235 assetPath, extension);
236 236
237 return false; 237 return false;
238 } 238 }
239 } 239 }
240 240
241 /// <summary> 241 /// <summary>
242 /// Load terrain data 242 /// Load terrain data
243 /// </summary> 243 /// </summary>
@@ -249,13 +249,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
249 private bool LoadTerrain(string terrainPath, byte[] data) 249 private bool LoadTerrain(string terrainPath, byte[] data)
250 { 250 {
251 ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>(); 251 ITerrainModule terrainModule = m_scene.RequestModuleInterface<ITerrainModule>();
252 252
253 MemoryStream ms = new MemoryStream(data); 253 MemoryStream ms = new MemoryStream(data);
254 terrainModule.LoadFromStream(terrainPath, ms); 254 terrainModule.LoadFromStream(terrainPath, ms);
255 ms.Close(); 255 ms.Close();
256 256
257 m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); 257 m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath);
258 258
259 return true; 259 return true;
260 } 260 }
261 } 261 }
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs
index 0341a70..26d4797 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -61,8 +61,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
61 61
62 public ArchiveWriteRequestExecution( 62 public ArchiveWriteRequestExecution(
63 List<SceneObjectGroup> sceneObjects, 63 List<SceneObjectGroup> sceneObjects,
64 ITerrainModule terrainModule, 64 ITerrainModule terrainModule,
65 IRegionSerialiser serialiser, 65 IRegionSerialiser serialiser,
66 string sceneName, 66 string sceneName,
67 string savePath) 67 string savePath)
68 { 68 {
@@ -79,37 +79,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
79 { 79 {
80 m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); 80 m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid);
81 } 81 }
82 82
83 m_log.InfoFormat( 83 m_log.InfoFormat(
84 "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); 84 "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count);
85 85
86 TarArchiveWriter archive = new TarArchiveWriter(); 86 TarArchiveWriter archive = new TarArchiveWriter();
87 87
88 // Write out control file 88 // Write out control file
89 archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile()); 89 archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile());
90 90
91 // Write out terrain 91 // Write out terrain
92 string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName); 92 string terrainPath = String.Format("{0}{1}.r32", ArchiveConstants.TERRAINS_PATH, m_sceneName);
93 MemoryStream ms = new MemoryStream(); 93 MemoryStream ms = new MemoryStream();
94 m_terrainModule.SaveToStream(terrainPath, ms); 94 m_terrainModule.SaveToStream(terrainPath, ms);
95 archive.AddFile(terrainPath, ms.ToArray()); 95 archive.AddFile(terrainPath, ms.ToArray());
96 ms.Close(); 96 ms.Close();
97 97
98 // Write out scene object metadata 98 // Write out scene object metadata
99 foreach (SceneObjectGroup sceneObject in m_sceneObjects) 99 foreach (SceneObjectGroup sceneObject in m_sceneObjects)
100 { 100 {
101 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); 101 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
102 102
103 LLVector3 position = sceneObject.AbsolutePosition; 103 LLVector3 position = sceneObject.AbsolutePosition;
104 104
105 string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); 105 string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject);
106 string filename 106 string filename
107 = string.Format( 107 = string.Format(
108 "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml", 108 "{0}{1}_{2:000}-{3:000}-{4:000}__{5}.xml",
109 ArchiveConstants.OBJECTS_PATH, sceneObject.Name, 109 ArchiveConstants.OBJECTS_PATH, sceneObject.Name,
110 Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z), 110 Math.Round(position.X), Math.Round(position.Y), Math.Round(position.Z),
111 sceneObject.UUID); 111 sceneObject.UUID);
112 112
113 archive.AddFile(filename, serializedObject); 113 archive.AddFile(filename, serializedObject);
114 } 114 }
115 115
@@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
120 archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); 120 archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress));
121 121
122 m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); 122 m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath);
123 } 123 }
124 124
125 /// <summary> 125 /// <summary>
126 /// Create the control file for this archive 126 /// Create the control file for this archive
127 /// </summary> 127 /// </summary>
@@ -136,13 +136,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
136 xtw.WriteAttributeString("major_version", "0"); 136 xtw.WriteAttributeString("major_version", "0");
137 xtw.WriteAttributeString("minor_version", "1"); 137 xtw.WriteAttributeString("minor_version", "1");
138 xtw.WriteEndElement(); 138 xtw.WriteEndElement();
139 139
140 xtw.Flush(); 140 xtw.Flush();
141 xtw.Close(); 141 xtw.Close();
142 142
143 String s = sw.ToString(); 143 String s = sw.ToString();
144 sw.Close(); 144 sw.Close();
145 145
146 return s; 146 return s;
147 } 147 }
148 } 148 }
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 327808a..20e15ab 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -52,14 +52,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
52 52
53 protected Scene m_scene; 53 protected Scene m_scene;
54 protected string m_savePath; 54 protected string m_savePath;
55 55
56 /// <summary> 56 /// <summary>
57 /// Used for identifying uuids embedded in scripts 57 /// Used for identifying uuids embedded in scripts
58 /// </summary> 58 /// </summary>
59 protected static readonly Regex m_uuidRegex 59 protected static readonly Regex m_uuidRegex
60 = new Regex( 60 = new Regex(
61 "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}", 61 "[0-9a-eA-E]{8}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{4}-[0-9a-eA-E]{12}",
62 RegexOptions.Compiled); 62 RegexOptions.Compiled);
63 63
64 /// <summary> 64 /// <summary>
65 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate 65 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
@@ -93,9 +93,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
93 Monitor.Pulse(this); 93 Monitor.Pulse(this);
94 } 94 }
95 } 95 }
96 96
97 /// <summary> 97 /// <summary>
98 /// Get an asset synchronously, potentially using an asynchronous callback. If the 98 /// Get an asset synchronously, potentially using an asynchronous callback. If the
99 /// asynchronous callback is used, we will wait for it to complete. 99 /// asynchronous callback is used, we will wait for it to complete.
100 /// </summary> 100 /// </summary>
101 /// <param name="uuid"></param> 101 /// <param name="uuid"></param>
@@ -118,11 +118,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
118 Monitor.Wait(this); 118 Monitor.Wait(this);
119 m_waitingForObjectAsset = false; 119 m_waitingForObjectAsset = false;
120 } 120 }
121 } 121 }
122 122
123 return m_requestedObjectAsset; 123 return m_requestedObjectAsset;
124 } 124 }
125 125
126 /// <summary> 126 /// <summary>
127 /// Record the asset uuids embedded within the given script. 127 /// Record the asset uuids embedded within the given script.
128 /// </summary> 128 /// </summary>
@@ -138,16 +138,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
138 //m_log.DebugFormat("[ARCHIVER]: Script {0}", script); 138 //m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
139 MatchCollection uuidMatches = m_uuidRegex.Matches(script); 139 MatchCollection uuidMatches = m_uuidRegex.Matches(script);
140 //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count); 140 //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);
141 141
142 foreach (Match uuidMatch in uuidMatches) 142 foreach (Match uuidMatch in uuidMatches)
143 { 143 {
144 LLUUID uuid = new LLUUID(uuidMatch.Value); 144 LLUUID uuid = new LLUUID(uuidMatch.Value);
145 //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid); 145 //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);
146 assetUuids[uuid] = 1; 146 assetUuids[uuid] = 1;
147 } 147 }
148 } 148 }
149 } 149 }
150 150
151 /// <summary> 151 /// <summary>
152 /// Record the uuids referenced by the given wearable asset 152 /// Record the uuids referenced by the given wearable asset
153 /// </summary> 153 /// </summary>
@@ -159,25 +159,25 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
159 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); 159 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data));
160 AssetWearable wearableAsset = new AssetBodypart(assetBase.Data); 160 AssetWearable wearableAsset = new AssetBodypart(assetBase.Data);
161 wearableAsset.Decode(); 161 wearableAsset.Decode();
162 162
163 //m_log.DebugFormat( 163 //m_log.DebugFormat(
164 // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count); 164 // "[ARCHIVER]: Wearable asset {0} references {1} assets", wearableAssetUuid, wearableAsset.Textures.Count);
165 165
166 foreach (LLUUID uuid in wearableAsset.Textures.Values) 166 foreach (LLUUID uuid in wearableAsset.Textures.Values)
167 { 167 {
168 //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid); 168 //m_log.DebugFormat("[ARCHIVER]: Got bodypart uuid {0}", uuid);
169 assetUuids[uuid] = 1; 169 assetUuids[uuid] = 1;
170 } 170 }
171 } 171 }
172 172
173 /// <summary> 173 /// <summary>
174 /// Get all the asset uuids associated with a given object. This includes both those directly associated with 174 /// Get all the asset uuids associated with a given object. This includes both those directly associated with
175 /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained 175 /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained
176 /// within this object). 176 /// within this object).
177 /// </summary> 177 /// </summary>
178 /// <param name="sceneObject"></param> 178 /// <param name="sceneObject"></param>
179 /// <param name="assetUuids"></param> 179 /// <param name="assetUuids"></param>
180 protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids) 180 protected void GetSceneObjectAssetUuids(LLUUID sceneObjectUuid, IDictionary<LLUUID, int> assetUuids)
181 { 181 {
182 AssetBase objectAsset = GetAsset(sceneObjectUuid); 182 AssetBase objectAsset = GetAsset(sceneObjectUuid);
183 183
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
186 string xml = Helpers.FieldToUTF8String(objectAsset.Data); 186 string xml = Helpers.FieldToUTF8String(objectAsset.Data);
187 SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml); 187 SceneObjectGroup sog = new SceneObjectGroup(m_scene, m_scene.RegionInfo.RegionHandle, xml);
188 GetSceneObjectAssetUuids(sog, assetUuids); 188 GetSceneObjectAssetUuids(sog, assetUuids);
189 } 189 }
190 } 190 }
191 191
192 /// <summary> 192 /// <summary>
@@ -209,10 +209,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
209 try 209 try
210 { 210 {
211 LLObject.TextureEntry textureEntry = part.Shape.Textures; 211 LLObject.TextureEntry textureEntry = part.Shape.Textures;
212 212
213 // Get the prim's default texture. This will be used for faces which don't have their own texture 213 // Get the prim's default texture. This will be used for faces which don't have their own texture
214 assetUuids[textureEntry.DefaultTexture.TextureID] = 1; 214 assetUuids[textureEntry.DefaultTexture.TextureID] = 1;
215 215
216 // XXX: Not a great way to iterate through face textures, but there's no 216 // XXX: Not a great way to iterate through face textures, but there's no
217 // other method available to tell how many faces there actually are 217 // other method available to tell how many faces there actually are
218 //int i = 0; 218 //int i = 0;
@@ -224,15 +224,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
224 assetUuids[texture.TextureID] = 1; 224 assetUuids[texture.TextureID] = 1;
225 } 225 }
226 } 226 }
227 227
228 foreach (TaskInventoryItem tii in part.TaskInventory.Values) 228 foreach (TaskInventoryItem tii in part.TaskInventory.Values)
229 { 229 {
230 //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type); 230 //m_log.DebugFormat("[ARCHIVER]: Analysing item asset type {0}", tii.Type);
231 231
232 if (!assetUuids.ContainsKey(tii.AssetID)) 232 if (!assetUuids.ContainsKey(tii.AssetID))
233 { 233 {
234 assetUuids[tii.AssetID] = 1; 234 assetUuids[tii.AssetID] = 1;
235 235
236 if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type)) 236 if ((int)AssetType.Bodypart == tii.Type || ((int)AssetType.Clothing == tii.Type))
237 { 237 {
238 GetWearableAssetUuids(tii.AssetID, assetUuids); 238 GetWearableAssetUuids(tii.AssetID, assetUuids);
@@ -275,20 +275,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
275 if (entity is SceneObjectGroup) 275 if (entity is SceneObjectGroup)
276 sceneObjects.Add((SceneObjectGroup)entity); 276 sceneObjects.Add((SceneObjectGroup)entity);
277 } 277 }
278 278
279 foreach (SceneObjectGroup sceneObject in sceneObjects) 279 foreach (SceneObjectGroup sceneObject in sceneObjects)
280 { 280 {
281 GetSceneObjectAssetUuids(sceneObject, assetUuids); 281 GetSceneObjectAssetUuids(sceneObject, assetUuids);
282 } 282 }
283 283
284 m_log.DebugFormat( 284 m_log.DebugFormat(
285 "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", 285 "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets",
286 sceneObjects.Count, assetUuids.Count); 286 sceneObjects.Count, assetUuids.Count);
287 287
288 // Asynchronously request all the assets required to perform this archive operation 288 // Asynchronously request all the assets required to perform this archive operation
289 ArchiveWriteRequestExecution awre 289 ArchiveWriteRequestExecution awre
290 = new ArchiveWriteRequestExecution( 290 = new ArchiveWriteRequestExecution(
291 sceneObjects, 291 sceneObjects,
292 m_scene.RequestModuleInterface<ITerrainModule>(), 292 m_scene.RequestModuleInterface<ITerrainModule>(),
293 m_scene.RequestModuleInterface<IRegionSerialiser>(), 293 m_scene.RequestModuleInterface<IRegionSerialiser>(),
294 m_scene.RegionInfo.RegionName, 294 m_scene.RegionInfo.RegionName,
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
index 2704224..708bed3 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
@@ -41,17 +41,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
41 public class AssetsArchiver 41 public class AssetsArchiver
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 /// <summary> 45 /// <summary>
46 /// Archive assets 46 /// Archive assets
47 /// </summary> 47 /// </summary>
48 protected IDictionary<LLUUID, AssetBase> m_assets; 48 protected IDictionary<LLUUID, AssetBase> m_assets;
49 49
50 public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets) 50 public AssetsArchiver(IDictionary<LLUUID, AssetBase> assets)
51 { 51 {
52 m_assets = assets; 52 m_assets = assets;
53 } 53 }
54 54
55 /// <summary> 55 /// <summary>
56 /// Archive the assets given to this archiver to the given archive. 56 /// Archive the assets given to this archiver to the given archive.
57 /// </summary> 57 /// </summary>
@@ -70,44 +70,44 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
70 { 70 {
71 StringWriter sw = new StringWriter(); 71 StringWriter sw = new StringWriter();
72 XmlTextWriter xtw = new XmlTextWriter(sw); 72 XmlTextWriter xtw = new XmlTextWriter(sw);
73 73
74 xtw.Formatting = Formatting.Indented; 74 xtw.Formatting = Formatting.Indented;
75 xtw.WriteStartDocument(); 75 xtw.WriteStartDocument();
76 76
77 xtw.WriteStartElement("assets"); 77 xtw.WriteStartElement("assets");
78 78
79 foreach (LLUUID uuid in m_assets.Keys) 79 foreach (LLUUID uuid in m_assets.Keys)
80 { 80 {
81 AssetBase asset = m_assets[uuid]; 81 AssetBase asset = m_assets[uuid];
82 82
83 if (asset != null) 83 if (asset != null)
84 { 84 {
85 xtw.WriteStartElement("asset"); 85 xtw.WriteStartElement("asset");
86 86
87 string extension = string.Empty; 87 string extension = string.Empty;
88 88
89 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) 89 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type))
90 { 90 {
91 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; 91 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type];
92 } 92 }
93 93
94 xtw.WriteElementString("filename", uuid.ToString() + extension); 94 xtw.WriteElementString("filename", uuid.ToString() + extension);
95 95
96 xtw.WriteElementString("name", asset.Name); 96 xtw.WriteElementString("name", asset.Name);
97 xtw.WriteElementString("description", asset.Description); 97 xtw.WriteElementString("description", asset.Description);
98 xtw.WriteElementString("asset-type", asset.Type.ToString()); 98 xtw.WriteElementString("asset-type", asset.Type.ToString());
99 99
100 xtw.WriteEndElement(); 100 xtw.WriteEndElement();
101 } 101 }
102 } 102 }
103 103
104 xtw.WriteEndElement(); 104 xtw.WriteEndElement();
105 105
106 xtw.WriteEndDocument(); 106 xtw.WriteEndDocument();
107 107
108 archive.AddFile("assets.xml", sw.ToString()); 108 archive.AddFile("assets.xml", sw.ToString());
109 } 109 }
110 110
111 /// <summary> 111 /// <summary>
112 /// Write asset data files to the given archive 112 /// Write asset data files to the given archive
113 /// </summary> 113 /// </summary>
@@ -116,18 +116,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
116 { 116 {
117 // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar 117 // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar
118 //archive.AddDir("assets"); 118 //archive.AddDir("assets");
119 119
120 foreach (LLUUID uuid in m_assets.Keys) 120 foreach (LLUUID uuid in m_assets.Keys)
121 { 121 {
122 AssetBase asset = m_assets[uuid]; 122 AssetBase asset = m_assets[uuid];
123 123
124 string extension = string.Empty; 124 string extension = string.Empty;
125 125
126 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) 126 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type))
127 { 127 {
128 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; 128 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type];
129 } 129 }
130 130
131 archive.AddFile( 131 archive.AddFile(
132 ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, 132 ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension,
133 asset.Data); 133 asset.Data);
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
index 284a39e..17abb24 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
@@ -43,9 +43,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
43 public class AssetsDearchiver 43 public class AssetsDearchiver
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); 47 protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
48 48
49 /// <summary> 49 /// <summary>
50 /// Store for asset data we received before we get the metadata 50 /// Store for asset data we received before we get the metadata
51 /// </summary> 51 /// </summary>
@@ -55,17 +55,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
55 /// Asset metadata. Is null if asset metadata isn't yet available. 55 /// Asset metadata. Is null if asset metadata isn't yet available.
56 /// </summary> 56 /// </summary>
57 protected Dictionary<string, AssetMetadata> m_metadata; 57 protected Dictionary<string, AssetMetadata> m_metadata;
58 58
59 /// <summary> 59 /// <summary>
60 /// Cache to which dearchived assets will be added 60 /// Cache to which dearchived assets will be added
61 /// </summary> 61 /// </summary>
62 protected AssetCache m_cache; 62 protected AssetCache m_cache;
63 63
64 public AssetsDearchiver(AssetCache cache) 64 public AssetsDearchiver(AssetCache cache)
65 { 65 {
66 m_cache = cache; 66 m_cache = cache;
67 } 67 }
68 68
69 /// <summary> 69 /// <summary>
70 /// Add asset data to the dearchiver 70 /// Add asset data to the dearchiver
71 /// </summary> 71 /// </summary>
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
82 ResolveAssetData(assetFilename, data); 82 ResolveAssetData(assetFilename, data);
83 } 83 }
84 } 84 }
85 85
86 /// <summary> 86 /// <summary>
87 /// Add asset metadata xml 87 /// Add asset metadata xml
88 /// </summary> 88 /// </summary>
@@ -90,39 +90,39 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
90 public void AddAssetMetadata(string xml) 90 public void AddAssetMetadata(string xml)
91 { 91 {
92 m_metadata = new Dictionary<string, AssetMetadata>(); 92 m_metadata = new Dictionary<string, AssetMetadata>();
93 93
94 StringReader sr = new StringReader(xml); 94 StringReader sr = new StringReader(xml);
95 XmlTextReader reader = new XmlTextReader(sr); 95 XmlTextReader reader = new XmlTextReader(sr);
96 96
97 reader.ReadStartElement("assets"); 97 reader.ReadStartElement("assets");
98 reader.Read(); 98 reader.Read();
99 99
100 while (reader.Name.Equals("asset")) 100 while (reader.Name.Equals("asset"))
101 { 101 {
102 reader.Read(); 102 reader.Read();
103 103
104 AssetMetadata metadata = new AssetMetadata(); 104 AssetMetadata metadata = new AssetMetadata();
105 105
106 string filename = reader.ReadElementString("filename"); 106 string filename = reader.ReadElementString("filename");
107 m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename); 107 m_log.DebugFormat("[DEARCHIVER]: Reading node {0}", filename);
108 108
109 metadata.Name = reader.ReadElementString("name"); 109 metadata.Name = reader.ReadElementString("name");
110 metadata.Description = reader.ReadElementString("description"); 110 metadata.Description = reader.ReadElementString("description");
111 metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type")); 111 metadata.AssetType = Convert.ToSByte(reader.ReadElementString("asset-type"));
112 112
113 m_metadata[filename] = metadata; 113 m_metadata[filename] = metadata;
114 114
115 // Read asset end tag 115 // Read asset end tag
116 reader.ReadEndElement(); 116 reader.ReadEndElement();
117 117
118 reader.Read(); 118 reader.Read();
119 } 119 }
120 120
121 m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count); 121 m_log.DebugFormat("[DEARCHIVER]: Resolved {0} items of asset metadata", m_metadata.Count);
122 122
123 ResolvePendingAssetData(); 123 ResolvePendingAssetData();
124 } 124 }
125 125
126 /// <summary> 126 /// <summary>
127 /// Resolve asset data that we collected before receiving the metadata 127 /// Resolve asset data that we collected before receiving the metadata
128 /// </summary> 128 /// </summary>
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
133 ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]); 133 ResolveAssetData(filename, m_assetDataAwaitingMetadata[filename]);
134 } 134 }
135 } 135 }
136 136
137 /// <summary> 137 /// <summary>
138 /// Resolve a new piece of asset data against stored metadata 138 /// Resolve a new piece of asset data against stored metadata
139 /// </summary> 139 /// </summary>
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
143 { 143 {
144 // Right now we're nastily obtaining the lluuid from the filename 144 // Right now we're nastily obtaining the lluuid from the filename
145 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 145 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
146 146
147 if (m_metadata.ContainsKey(filename)) 147 if (m_metadata.ContainsKey(filename))
148 { 148 {
149 AssetMetadata metadata = m_metadata[filename]; 149 AssetMetadata metadata = m_metadata[filename];
150 150
151 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType)) 151 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(metadata.AssetType))
152 { 152 {
153 string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType]; 153 string extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[metadata.AssetType];
@@ -166,11 +166,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
166 else 166 else
167 { 167 {
168 m_log.ErrorFormat( 168 m_log.ErrorFormat(
169 "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata", 169 "[DEARCHIVER]: Tried to dearchive data with filename {0} without any corresponding metadata",
170 assetPath); 170 assetPath);
171 } 171 }
172 } 172 }
173 173
174 /// <summary> 174 /// <summary>
175 /// Metadata for an asset 175 /// Metadata for an asset
176 /// </summary> 176 /// </summary>
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs
index 6ffbcbb..2164f7e 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs
@@ -43,12 +43,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
43 class AssetsRequest 43 class AssetsRequest
44 { 44 {
45 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 /// <summary> 47 /// <summary>
48 /// uuids to request 48 /// uuids to request
49 /// </summary> 49 /// </summary>
50 protected ICollection<LLUUID> m_uuids; 50 protected ICollection<LLUUID> m_uuids;
51 51
52 /// <summary> 52 /// <summary>
53 /// Callback used when all the assets requested have been received. 53 /// Callback used when all the assets requested have been received.
54 /// </summary> 54 /// </summary>
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
58 /// Assets retrieved in this request 58 /// Assets retrieved in this request
59 /// </summary> 59 /// </summary>
60 protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); 60 protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>();
61 61
62 /// <summary> 62 /// <summary>
63 /// Maintain a list of assets that could not be found. This will be passed back to the requester. 63 /// Maintain a list of assets that could not be found. This will be passed back to the requester.
64 /// </summary> 64 /// </summary>
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
81 m_assetCache = assetCache; 81 m_assetCache = assetCache;
82 m_repliesRequired = uuids.Count; 82 m_repliesRequired = uuids.Count;
83 } 83 }
84 84
85 protected internal void Execute() 85 protected internal void Execute()
86 { 86 {
87 // We can stop here if there are no assets to fetch 87 // We can stop here if there are no assets to fetch
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
105 m_assets[assetID] = asset; 105 m_assets[assetID] = asset;
106 else 106 else
107 m_notFoundAssetUuids.Add(assetID); 107 m_notFoundAssetUuids.Add(assetID);
108 108
109 //m_log.DebugFormat( 109 //m_log.DebugFormat(
110 // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count); 110 // "[ARCHIVER]: Received {0} assets and notification of {1} missing assets", m_assets.Count, m_notFoundAssetUuids.Count);
111 111
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
index 585d1d4..4e000cc 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
@@ -69,9 +69,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
69 public byte[] ReadEntry(out string filePath) 69 public byte[] ReadEntry(out string filePath)
70 { 70 {
71 filePath = String.Empty; 71 filePath = String.Empty;
72 72
73 TarHeader header = ReadHeader(); 73 TarHeader header = ReadHeader();
74 74
75 if (null == header) 75 if (null == header)
76 return null; 76 return null;
77 77
@@ -98,14 +98,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
98 /// </summary> 98 /// </summary>
99 /// <returns>A tar header struct. null if we have reached the end of the archive.</returns> 99 /// <returns>A tar header struct. null if we have reached the end of the archive.</returns>
100 protected TarHeader ReadHeader() 100 protected TarHeader ReadHeader()
101 { 101 {
102 byte[] header = m_br.ReadBytes(512); 102 byte[] header = m_br.ReadBytes(512);
103 103
104 // If we've reached the end of the archive we'll be in null block territory, which means 104 // If we've reached the end of the archive we'll be in null block territory, which means
105 // the next byte will be 0 105 // the next byte will be 0
106 if (header[0] == 0) 106 if (header[0] == 0)
107 return null; 107 return null;
108 108
109 TarHeader tarHeader = new TarHeader(); 109 TarHeader tarHeader = new TarHeader();
110 110
111 tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); 111 tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100);
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs
index f70a93d..83b9250 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveWriter.cs
@@ -54,10 +54,10 @@ namespace OpenSim.Region.Environment
54 // Directories are signalled by a final / 54 // Directories are signalled by a final /
55 if (!dirName.EndsWith("/")) 55 if (!dirName.EndsWith("/"))
56 dirName += "/"; 56 dirName += "/";
57 57
58 AddFile(dirName, new byte[0]); 58 AddFile(dirName, new byte[0]);
59 } 59 }
60 60
61 /// <summary> 61 /// <summary>
62 /// Add a file to the tar archive 62 /// Add a file to the tar archive
63 /// </summary> 63 /// </summary>
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment
161 if (data.Length % 512 != 0) 161 if (data.Length % 512 != 0)
162 { 162 {
163 int paddingRequired = 512 - (data.Length % 512); 163 int paddingRequired = 512 - (data.Length % 512);
164 164
165 //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired); 165 //m_log.DebugFormat("[TAR ARCHIVE WRITER]: Padding data with {0} bytes", paddingRequired);
166 166
167 byte[] padding = new byte[paddingRequired]; 167 byte[] padding = new byte[paddingRequired];
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index 1e622be..28347d0 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
223 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 223 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId, false) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
224 { 224 {
225 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; 225 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
226 226
227 bool alreadyInList = false; 227 bool alreadyInList = false;
228 228
229 for (int i = 0; i < banlistcheck.Length; i++) 229 for (int i = 0; i < banlistcheck.Length; i++)
@@ -407,8 +407,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
407 args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; 407 args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun;
408 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; 408 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
409 args.simName = m_scene.RegionInfo.RegionName; 409 args.simName = m_scene.RegionInfo.RegionName;
410 410
411
412 remote_client.SendRegionInfoToEstateMenu(args); 411 remote_client.SendRegionInfoToEstateMenu(args);
413 } 412 }
414 413
@@ -416,6 +415,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
416 { 415 {
417 remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant); 416 remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant);
418 } 417 }
418
419 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) 419 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient)
420 { 420 {
421 Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); 421 Dictionary<uint, float> SceneData = new Dictionary<uint,float>();
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
472 continue; 472 continue;
473 } 473 }
474 } 474 }
475 475
476 SceneReport.Add(lsri); 476 SceneReport.Add(lsri);
477 } 477 }
478 } 478 }
@@ -481,7 +481,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
481 } 481 }
482 } 482 }
483 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); 483 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray());
484 484
485 if (uuidNameLookupList.Count > 0) 485 if (uuidNameLookupList.Count > 0)
486 LookupUUID(uuidNameLookupList); 486 LookupUUID(uuidNameLookupList);
487 } 487 }
@@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
502 private void LookupUUIDsAsync(List<LLUUID> uuidLst) 502 private void LookupUUIDsAsync(List<LLUUID> uuidLst)
503 { 503 {
504 LLUUID[] uuidarr = new LLUUID[0]; 504 LLUUID[] uuidarr = new LLUUID[0];
505 505
506 lock (uuidLst) 506 lock (uuidLst)
507 { 507 {
508 uuidarr = uuidLst.ToArray(); 508 uuidarr = uuidLst.ToArray();
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
539 if (EstateManagers[i] == remoteClient.AgentId) 539 if (EstateManagers[i] == remoteClient.AgentId)
540 estatemanager = true; 540 estatemanager = true;
541 } 541 }
542 542
543 args.isEstateManager = estatemanager; 543 args.isEstateManager = estatemanager;
544 544
545 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor; 545 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor;
@@ -729,11 +729,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
729 client.OnLandStatRequest += HandleLandStatRequest; 729 client.OnLandStatRequest += HandleLandStatRequest;
730 sendRegionHandshake(client); 730 sendRegionHandshake(client);
731 } 731 }
732 732
733 public uint GetRegionFlags() 733 public uint GetRegionFlags()
734 { 734 {
735 Simulator.RegionFlags flags = Simulator.RegionFlags.None; 735 Simulator.RegionFlags flags = Simulator.RegionFlags.None;
736 736
737 // Fully implemented 737 // Fully implemented
738 // 738 //
739 if (m_scene.RegionInfo.RegionSettings.AllowDamage) 739 if (m_scene.RegionInfo.RegionSettings.AllowDamage)
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index 9b1b9b5..00994fb 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -47,14 +47,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land
47 { 47 {
48 private static readonly ILog m_log = 48 private static readonly ILog m_log =
49 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 private static readonly string remoteParcelRequestPath = "0009/"; 51 private static readonly string remoteParcelRequestPath = "0009/";
52 52
53 private LandChannel landChannel; 53 private LandChannel landChannel;
54 private Scene m_scene; 54 private Scene m_scene;
55 55
56
57
58 private readonly int[,] landIDList = new int[64, 64]; 56 private readonly int[,] landIDList = new int[64, 64];
59 private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>(); 57 private readonly Dictionary<int, ILandObject> landList = new Dictionary<int, ILandObject>();
60 58
@@ -115,8 +113,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
115 } 113 }
116 } 114 }
117 115
118
119
120 public void PostInitialise() 116 public void PostInitialise()
121 { 117 {
122 } 118 }
@@ -153,8 +149,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
153 } 149 }
154 } 150 }
155 151
156
157
158 public bool AllowedForcefulBans 152 public bool AllowedForcefulBans
159 { 153 {
160 get { return m_allowedForcefulBans; } 154 get { return m_allowedForcefulBans; }
@@ -185,11 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
185 public List<ILandObject> ParcelsNearPoint(LLVector3 position) 179 public List<ILandObject> ParcelsNearPoint(LLVector3 position)
186 { 180 {
187 List<ILandObject> parcelsNear = new List<ILandObject>(); 181 List<ILandObject> parcelsNear = new List<ILandObject>();
188 int x; 182 for (int x = -4; x <= 4; x += 4)
189 for (x = -4; x <= 4; x += 4)
190 { 183 {
191 int y; 184 for (int y = -4; y <= 4; y += 4)
192 for (y = -4; y <= 4; y += 4)
193 { 185 {
194 ILandObject check = GetLandObject(position.X + x, position.Y + y); 186 ILandObject check = GetLandObject(position.X + x, position.Y + y);
195 if (check != null) 187 if (check != null)
@@ -286,7 +278,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
286 ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), 278 ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
287 (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); 279 (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
288 280
289
290 if (over != null) 281 if (over != null)
291 { 282 {
292 if (force) 283 if (force)
@@ -387,6 +378,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
387 Console.WriteLine("INVALID LOCAL LAND ID"); 378 Console.WriteLine("INVALID LOCAL LAND ID");
388 } 379 }
389 } 380 }
381
390 /// <summary> 382 /// <summary>
391 /// Creates a basic Parcel object without an owner (a zeroed key) 383 /// Creates a basic Parcel object without an owner (a zeroed key)
392 /// </summary> 384 /// </summary>
@@ -406,13 +398,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land
406 new_land.landData.LocalID = lastLandLocalID; 398 new_land.landData.LocalID = lastLandLocalID;
407 landList.Add(lastLandLocalID, new_land.Copy()); 399 landList.Add(lastLandLocalID, new_land.Copy());
408 400
409
410 bool[,] landBitmap = new_land.getLandBitmap(); 401 bool[,] landBitmap = new_land.getLandBitmap();
411 int x; 402 for (int x = 0; x < 64; x++)
412 for (x = 0; x < 64; x++)
413 { 403 {
414 int y; 404 for (int y = 0; y < 64; y++)
415 for (y = 0; y < 64; y++)
416 { 405 {
417 if (landBitmap[x, y]) 406 if (landBitmap[x, y])
418 { 407 {
@@ -431,11 +420,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
431 /// <param name="local_id">Land.localID of the peice of land to remove.</param> 420 /// <param name="local_id">Land.localID of the peice of land to remove.</param>
432 public void removeLandObject(int local_id) 421 public void removeLandObject(int local_id)
433 { 422 {
434 int x; 423 for (int x = 0; x < 64; x++)
435 for (x = 0; x < 64; x++)
436 { 424 {
437 int y; 425 for (int y = 0; y < 64; y++)
438 for (y = 0; y < 64; y++)
439 { 426 {
440 if (landIDList[x, y] == local_id) 427 if (landIDList[x, y] == local_id)
441 { 428 {
@@ -451,12 +438,10 @@ namespace OpenSim.Region.Environment.Modules.World.Land
451 438
452 private void performFinalLandJoin(ILandObject master, ILandObject slave) 439 private void performFinalLandJoin(ILandObject master, ILandObject slave)
453 { 440 {
454 int x;
455 bool[,] landBitmapSlave = slave.getLandBitmap(); 441 bool[,] landBitmapSlave = slave.getLandBitmap();
456 for (x = 0; x < 64; x++) 442 for (int x = 0; x < 64; x++)
457 { 443 {
458 int y; 444 for (int y = 0; y < 64; y++)
459 for (y = 0; y < 64; y++)
460 { 445 {
461 if (landBitmapSlave[x, y]) 446 if (landBitmapSlave[x, y])
462 { 447 {
@@ -519,6 +504,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
519 } 504 }
520 return landList[landIDList[x / 4, y / 4]]; 505 return landList[landIDList[x / 4, y / 4]];
521 } 506 }
507
522 #endregion 508 #endregion
523 509
524 #region Parcel Modification 510 #region Parcel Modification
@@ -601,7 +587,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
601 ResetAllLandPrimCounts(); 587 ResetAllLandPrimCounts();
602 lock (m_scene.Entities) 588 lock (m_scene.Entities)
603 { 589 {
604 foreach (EntityBase obj in m_scene.Entities.Values) 590 foreach (EntityBase obj in m_scene.Entities.Values)
605 { 591 {
606 if (obj != null) 592 if (obj != null)
607 { 593 {
@@ -647,11 +633,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
647 { 633 {
648 int totalX = end_x - start_x; 634 int totalX = end_x - start_x;
649 int totalY = end_y - start_y; 635 int totalY = end_y - start_y;
650 int y; 636 for (int y = 0; y < totalY; y++)
651 for (y = 0; y < totalY; y++)
652 { 637 {
653 int x; 638 for (int x = 0; x < totalX; x++)
654 for (x = 0; x < totalX; x++)
655 { 639 {
656 ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y); 640 ILandObject tempLandObject = GetLandObject(start_x + x, start_y + y);
657 if (tempLandObject == null) return; 641 if (tempLandObject == null) return;
@@ -690,9 +674,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
690 ILandObject result = AddLandObject(newLand); 674 ILandObject result = AddLandObject(newLand);
691 UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData); 675 UpdateLandObject(startLandObject.landData.LocalID, startLandObject.landData);
692 result.sendLandUpdateToAvatarsOverMe(); 676 result.sendLandUpdateToAvatarsOverMe();
693
694
695 return;
696 } 677 }
697 678
698 /// <summary> 679 /// <summary>
@@ -730,7 +711,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
730 ILandObject masterLandObject = selectedLandObjects[0]; 711 ILandObject masterLandObject = selectedLandObjects[0];
731 selectedLandObjects.RemoveAt(0); 712 selectedLandObjects.RemoveAt(0);
732 713
733
734 if (selectedLandObjects.Count < 1) 714 if (selectedLandObjects.Count < 1)
735 { 715 {
736 return; 716 return;
@@ -753,12 +733,9 @@ namespace OpenSim.Region.Environment.Modules.World.Land
753 performFinalLandJoin(masterLandObject, slaveLandObject); 733 performFinalLandJoin(masterLandObject, slaveLandObject);
754 } 734 }
755 735
756
757 SetPrimsTainted(); 736 SetPrimsTainted();
758 737
759 masterLandObject.sendLandUpdateToAvatarsOverMe(); 738 masterLandObject.sendLandUpdateToAvatarsOverMe();
760
761 return;
762 } 739 }
763 740
764 #endregion 741 #endregion
@@ -777,17 +754,14 @@ namespace OpenSim.Region.Environment.Modules.World.Land
777 int byteArrayCount = 0; 754 int byteArrayCount = 0;
778 int sequenceID = 0; 755 int sequenceID = 0;
779 756
780 int y; 757 for (int y = 0; y < 64; y++)
781 for (y = 0; y < 64; y++)
782 { 758 {
783 int x; 759 for (int x = 0; x < 64; x++)
784 for (x = 0; x < 64; x++)
785 { 760 {
786 byte tempByte = 0; //This represents the byte for the current 4x4 761 byte tempByte = 0; //This represents the byte for the current 4x4
787 762
788 ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4); 763 ILandObject currentParcelBlock = GetLandObject(x * 4, y * 4);
789 764
790
791 if (currentParcelBlock != null) 765 if (currentParcelBlock != null)
792 { 766 {
793 if (currentParcelBlock.landData.OwnerID == remote_client.AgentId) 767 if (currentParcelBlock.landData.OwnerID == remote_client.AgentId)
@@ -813,7 +787,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
813 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER); 787 tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_OTHER);
814 } 788 }
815 789
816
817 //Now for border control 790 //Now for border control
818 791
819 ILandObject westParcel = null; 792 ILandObject westParcel = null;
@@ -864,14 +837,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
864 { 837 {
865 //Get the land objects within the bounds 838 //Get the land objects within the bounds
866 List<ILandObject> temp = new List<ILandObject>(); 839 List<ILandObject> temp = new List<ILandObject>();
867 int x;
868 int i;
869 int inc_x = end_x - start_x; 840 int inc_x = end_x - start_x;
870 int inc_y = end_y - start_y; 841 int inc_y = end_y - start_y;
871 for (x = 0; x < inc_x; x++) 842 for (int x = 0; x < inc_x; x++)
872 { 843 {
873 int y; 844 for (int y = 0; y < inc_y; y++)
874 for (y = 0; y < inc_y; y++)
875 { 845 {
876 ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); 846 ILandObject currentParcel = GetLandObject(start_x + x, start_y + y);
877 847
@@ -892,12 +862,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
892 requestResult = LandChannel.LAND_RESULT_MULTIPLE; 862 requestResult = LandChannel.LAND_RESULT_MULTIPLE;
893 } 863 }
894 864
895 for (i = 0; i < temp.Count; i++) 865 for (int i = 0; i < temp.Count; i++)
896 { 866 {
897 temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client); 867 temp[i].sendLandProperties(sequence_id, snap_selection, requestResult, remote_client);
898 } 868 }
899 869
900
901 SendParcelOverlay(remote_client); 870 SendParcelOverlay(remote_client);
902 } 871 }
903 872
@@ -921,7 +890,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
921 890
922 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client) 891 public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
923 { 892 {
924
925 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client); 893 landList[local_id].sendForceObjectSelect(local_id, request_type, remote_client);
926 } 894 }
927 895
@@ -954,7 +922,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
954 landList[local_id].sendLandUpdateToClient(remote_client); 922 landList[local_id].sendLandUpdateToClient(remote_client);
955 } 923 }
956 } 924 }
957
958 } 925 }
959 926
960 public void handleParcelReclaim(int local_id, IClientAPI remote_client) 927 public void handleParcelReclaim(int local_id, IClientAPI remote_client)
@@ -972,7 +939,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
972 landList[local_id].sendLandUpdateToClient(remote_client); 939 landList[local_id].sendLandUpdateToClient(remote_client);
973 } 940 }
974 } 941 }
975
976 } 942 }
977 #endregion 943 #endregion
978 944
@@ -1076,7 +1042,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1076 { 1042 {
1077 selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient); 1043 selectedParcel.returnLandObjects(returnType, agentIDs, remoteClient);
1078 } 1044 }
1079
1080 } 1045 }
1081 1046
1082 public void NoLandDataFromStorage() 1047 public void NoLandDataFromStorage()
@@ -1093,11 +1058,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1093 obj.setParcelObjectMaxOverride(overrideDel); 1058 obj.setParcelObjectMaxOverride(overrideDel);
1094 } 1059 }
1095 } 1060 }
1061
1096 public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) 1062 public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
1097 { 1063 {
1098 } 1064 }
1099 1065
1100 #region CAPS handler 1066 #region CAPS handler
1067
1101 private void OnRegisterCaps(LLUUID agentID, Caps caps) 1068 private void OnRegisterCaps(LLUUID agentID, Caps caps)
1102 { 1069 {
1103 string capsBase = "/CAPS/" + caps.CapsObjectPath; 1070 string capsBase = "/CAPS/" + caps.CapsObjectPath;
@@ -1109,7 +1076,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1109 return RemoteParcelRequest(request, path, param, agentID, caps); 1076 return RemoteParcelRequest(request, path, param, agentID, caps);
1110 })); 1077 }));
1111 } 1078 }
1112 1079
1113 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the 1080 // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the
1114 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. 1081 // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to.
1115 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x 1082 // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x
@@ -1171,11 +1138,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1171 { 1138 {
1172 m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); 1139 m_log.ErrorFormat("[LAND] Wrong type in request {0}", request);
1173 } 1140 }
1174 1141
1175 LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); 1142 LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse();
1176 response.parcel_id = parcelID; 1143 response.parcel_id = parcelID;
1177 m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); 1144 m_log.DebugFormat("[LAND] got parcelID {0}", parcelID);
1178 1145
1179 return LLSDHelpers.SerialiseLLSDReply(response); 1146 return LLSDHelpers.SerialiseLLSDReply(response);
1180 } 1147 }
1181 1148
@@ -1191,7 +1158,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1191 uint x, y; 1158 uint x, y;
1192 Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); 1159 Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y);
1193 m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); 1160 m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y);
1194 1161
1195 LandData landData; 1162 LandData landData;
1196 if (regionHandle == m_scene.RegionInfo.RegionHandle) 1163 if (regionHandle == m_scene.RegionInfo.RegionHandle)
1197 landData = this.GetLandObject(x, y).landData; 1164 landData = this.GetLandObject(x, y).landData;
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index 305e236..6388a1c 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
116 return newLand; 116 return newLand;
117 } 117 }
118 118
119 119
120 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount; 120 static overrideParcelMaxPrimCountDelegate overrideParcelMaxPrimCount;
121 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount; 121 static overrideSimulatorMaxPrimCountDelegate overrideSimulatorMaxPrimCount;
122 122
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
156 } 156 }
157 } 157 }
158 #endregion 158 #endregion
159 159
160 #region Packet Request Handling 160 #region Packet Request Handling
161 161
162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 7b05027..09f12b2 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -305,7 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
305 305
306 public event RegionHandleRequest OnRegionHandleRequest; 306 public event RegionHandleRequest OnRegionHandleRequest;
307 public event ParcelInfoRequest OnParcelInfoRequest; 307 public event ParcelInfoRequest OnParcelInfoRequest;
308 308
309#pragma warning restore 67 309#pragma warning restore 67
310 310
311 #endregion 311 #endregion
@@ -368,7 +368,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
368 { 368 {
369 get { return 0; } 369 get { return 0; }
370 } 370 }
371 371
372 public ulong GetGroupPowers(LLUUID groupID) 372 public ulong GetGroupPowers(LLUUID groupID)
373 { 373 {
374 return 0; 374 return 0;
@@ -820,13 +820,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
820 820
821 821
822 public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) 822 public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time)
823 { 823 {
824 } 824 }
825 825
826 public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID, 826 public void SendParcelMediaUpdate(string mediaUrl, LLUUID mediaTextureID,
827 byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, 827 byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight,
828 byte mediaLoop) 828 byte mediaLoop)
829 { 829 {
830 } 830 }
831 831
832 public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters) 832 public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters)
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index 6107f48..071e3af 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
146 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); 146 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true);
147 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); 147 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true);
148 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); 148 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
149 149
150 if (m_bypassPermissions) 150 if (m_bypassPermissions)
151 m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); 151 m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks");
152 else 152 else
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index 0df19d9..22c9b29 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes
44 public class SceneXmlLoader 44 public class SceneXmlLoader
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 47
48 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset) 48 public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, LLVector3 loadOffset)
49 { 49 {
50 XmlDocument doc = new XmlDocument(); 50 XmlDocument doc = new XmlDocument();
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
114 doc.Load(reader); 114 doc.Load(reader);
115 reader.Close(); 115 reader.Close();
116 rootNode = doc.FirstChild; 116 rootNode = doc.FirstChild;
117 117
118 // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene> 118 // This is to deal with neighbouring regions that are still surrounding the group xml with the <scene>
119 // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or 119 // tag. It should be possible to remove the first part of this if statement once we go past 0.5.9 (or
120 // when some other changes forces all regions to upgrade). 120 // when some other changes forces all regions to upgrade).
@@ -127,13 +127,13 @@ namespace OpenSim.Region.Environment.Scenes
127 // There is only ever one prim. This oddity should be removeable post 0.5.9 127 // There is only ever one prim. This oddity should be removeable post 0.5.9
128 return new SceneObjectGroup(aPrimNode.OuterXml); 128 return new SceneObjectGroup(aPrimNode.OuterXml);
129 } 129 }
130 130
131 return null; 131 return null;
132 } 132 }
133 else 133 else
134 { 134 {
135 return new SceneObjectGroup(rootNode.OuterXml); 135 return new SceneObjectGroup(rootNode.OuterXml);
136 } 136 }
137 } 137 }
138 138
139 /// <summary> 139 /// <summary>
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Scenes
171 reader.Close(); 171 reader.Close();
172 XmlNode rootNode = doc.FirstChild; 172 XmlNode rootNode = doc.FirstChild;
173 173
174 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 174 ICollection<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
175 foreach (XmlNode aPrimNode in rootNode.ChildNodes) 175 foreach (XmlNode aPrimNode in rootNode.ChildNodes)
176 { 176 {
177 SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml); 177 SceneObjectGroup obj = CreatePrimFromXml2(scene, aPrimNode.OuterXml);
@@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes
195 { 195 {
196 SceneObjectGroup obj = new SceneObjectGroup(xmlData); 196 SceneObjectGroup obj = new SceneObjectGroup(xmlData);
197 197
198 if (scene.AddRestoredSceneObject(obj, true, false)) 198 if (scene.AddRestoredSceneObject(obj, true, false))
199 return obj; 199 return obj;
200 else 200 else
201 return null; 201 return null;
@@ -254,7 +254,7 @@ namespace OpenSim.Region.Environment.Scenes
254 if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) 254 if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z)
255 continue; 255 continue;
256 } 256 }
257 257
258 stream.WriteLine(g.ToXmlString2()); 258 stream.WriteLine(g.ToXmlString2());
259 primCount++; 259 primCount++;
260 } 260 }
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index 5682de3..9690433 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules
94 private LLVector3 Position = new LLVector3(0,0,0); 94 private LLVector3 Position = new LLVector3(0,0,0);
95 private LLVector3 Velocity = new LLVector3(0,0,0); 95 private LLVector3 Velocity = new LLVector3(0,0,0);
96 private LLQuaternion Tilt = new LLQuaternion(1,0,0,0); 96 private LLQuaternion Tilt = new LLQuaternion(1,0,0,0);
97 97
98 private long LindenHourOffset = 0; 98 private long LindenHourOffset = 0;
99 private bool sunFixed = false; 99 private bool sunFixed = false;
100 100
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Environment.Modules
111 private float GetLindenEstateHourFromCurrentTime() 111 private float GetLindenEstateHourFromCurrentTime()
112 { 112 {
113 float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle); 113 float ticksleftover = ((float)CurrentTime) % ((float)SecondsPerSunCycle);
114 114
115 float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6; 115 float hour = (24 * (ticksleftover / SecondsPerSunCycle)) + 6;
116 116
117 return hour; 117 return hour;
@@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Modules
132 float hour = (24 * (ticksleftover / SecondsPerSunCycle)); 132 float hour = (24 * (ticksleftover / SecondsPerSunCycle));
133 133
134 float offsethours = 0; 134 float offsethours = 0;
135 135
136 if (LindenHour - 6 > hour) 136 if (LindenHour - 6 > hour)
137 { 137 {
138 offsethours = hour + ((LindenHour-6) - hour); 138 offsethours = hour + ((LindenHour-6) - hour);
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Environment.Modules
142 offsethours = hour - (hour - (LindenHour - 6)); 142 offsethours = hour - (hour - (LindenHour - 6));
143 } 143 }
144 //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString()); 144 //m_log.Debug("[OFFSET]: " + hour + " - " + LindenHour + " - " + offsethours.ToString());
145 145
146 LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length)); 146 LindenHourOffset = (long)((float)offsethours * (36000000000/m_day_length));
147 m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString()); 147 m_log.Info("[SUN]: Directive from the Estate Tools to set the sun phase to LindenHour " + GetLindenEstateHourFromCurrentTime().ToString());
148 148
@@ -422,7 +422,7 @@ namespace OpenSim.Region.Environment.Modules
422 } 422 }
423 } 423 }
424 } 424 }
425 425
426 public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour) 426 public void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float LindenHour)
427 { 427 {
428 if (m_scene.RegionInfo.RegionHandle == regionHandle) 428 if (m_scene.RegionInfo.RegionHandle == regionHandle)
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
index 34bbf78..48da96d 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
51 51
52 colours.Save(filename, ImageFormat.Bmp); 52 colours.Save(filename, ImageFormat.Bmp);
53 } 53 }
54 54
55 /// <summary> 55 /// <summary>
56 /// Exports a stream using a System.Drawing exporter. 56 /// Exports a stream using a System.Drawing exporter.
57 /// </summary> 57 /// </summary>
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
62 Bitmap colours = CreateGrayscaleBitmapFromMap(map); 62 Bitmap colours = CreateGrayscaleBitmapFromMap(map);
63 63
64 colours.Save(stream, ImageFormat.Png); 64 colours.Save(stream, ImageFormat.Png);
65 } 65 }
66 66
67 /// <summary> 67 /// <summary>
68 /// The human readable version of the file format(s) this loader handles 68 /// The human readable version of the file format(s) this loader handles
@@ -73,4 +73,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
73 return "BMP"; 73 return "BMP";
74 } 74 }
75 } 75 }
76} \ No newline at end of file 76}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs
index 0cd9000..accffd2 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
40 40
41 colours.Save(filename, ImageFormat.Gif); 41 colours.Save(filename, ImageFormat.Gif);
42 } 42 }
43 43
44 /// <summary> 44 /// <summary>
45 /// Exports a stream using a System.Drawing exporter. 45 /// Exports a stream using a System.Drawing exporter.
46 /// </summary> 46 /// </summary>
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
51 Bitmap colours = CreateGrayscaleBitmapFromMap(map); 51 Bitmap colours = CreateGrayscaleBitmapFromMap(map);
52 52
53 colours.Save(stream, ImageFormat.Gif); 53 colours.Save(stream, ImageFormat.Gif);
54 } 54 }
55 55
56 public override string ToString() 56 public override string ToString()
57 { 57 {
58 return "GIF"; 58 return "GIF";
59 } 59 }
60 } 60 }
61} \ No newline at end of file 61}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index 4d213e0..983ad29 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -58,19 +58,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
58 /// <returns>A terrain channel generated from the image.</returns> 58 /// <returns>A terrain channel generated from the image.</returns>
59 public virtual ITerrainChannel LoadFile(string filename) 59 public virtual ITerrainChannel LoadFile(string filename)
60 { 60 {
61 return LoadBitmap(new Bitmap(filename)); 61 return LoadBitmap(new Bitmap(filename));
62 } 62 }
63 63
64 public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) 64 public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h)
65 { 65 {
66 throw new NotImplementedException(); 66 throw new NotImplementedException();
67 } 67 }
68 68
69 public virtual ITerrainChannel LoadStream(Stream stream) 69 public virtual ITerrainChannel LoadStream(Stream stream)
70 { 70 {
71 return LoadBitmap(new Bitmap(stream)); 71 return LoadBitmap(new Bitmap(stream));
72 } 72 }
73 73
74 protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap) 74 protected virtual ITerrainChannel LoadBitmap(Bitmap bitmap)
75 { 75 {
76 ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height); 76 ITerrainChannel retval = new TerrainChannel(bitmap.Width, bitmap.Height);
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
85 } 85 }
86 } 86 }
87 87
88 return retval; 88 return retval;
89 } 89 }
90 90
91 /// <summary> 91 /// <summary>
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
99 99
100 colours.Save(filename, ImageFormat.Png); 100 colours.Save(filename, ImageFormat.Png);
101 } 101 }
102 102
103 /// <summary> 103 /// <summary>
104 /// Exports a stream using a System.Drawing exporter. 104 /// Exports a stream using a System.Drawing exporter.
105 /// </summary> 105 /// </summary>
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
110 Bitmap colours = CreateGrayscaleBitmapFromMap(map); 110 Bitmap colours = CreateGrayscaleBitmapFromMap(map);
111 111
112 colours.Save(stream, ImageFormat.Png); 112 colours.Save(stream, ImageFormat.Png);
113 } 113 }
114 114
115 #endregion 115 #endregion
116 116
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs
index 9886b81..35576c7 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
51 { 51 {
52 throw new NotImplementedException(); 52 throw new NotImplementedException();
53 } 53 }
54 54
55 public ITerrainChannel LoadStream(Stream stream) 55 public ITerrainChannel LoadStream(Stream stream)
56 { 56 {
57 throw new NotImplementedException(); 57 throw new NotImplementedException();
58 } 58 }
59 59
60 public void SaveFile(string filename, ITerrainChannel map) 60 public void SaveFile(string filename, ITerrainChannel map)
61 { 61 {
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
63 63
64 colours.Save(filename, ImageFormat.Jpeg); 64 colours.Save(filename, ImageFormat.Jpeg);
65 } 65 }
66 66
67 /// <summary> 67 /// <summary>
68 /// Exports a stream using a System.Drawing exporter. 68 /// Exports a stream using a System.Drawing exporter.
69 /// </summary> 69 /// </summary>
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
74 Bitmap colours = CreateBitmapFromMap(map); 74 Bitmap colours = CreateBitmapFromMap(map);
75 75
76 colours.Save(stream, ImageFormat.Jpeg); 76 colours.Save(stream, ImageFormat.Jpeg);
77 } 77 }
78 78
79 #endregion 79 #endregion
80 80
@@ -109,4 +109,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
109 return bmp; 109 return bmp;
110 } 110 }
111 } 111 }
112} \ No newline at end of file 112}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
index 21fba2b..5f13d01 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
74 FileInfo file = new FileInfo(filename); 74 FileInfo file = new FileInfo(filename);
75 FileStream s = file.Open(FileMode.Open, FileAccess.Read); 75 FileStream s = file.Open(FileMode.Open, FileAccess.Read);
76 ITerrainChannel retval = LoadStream(s); 76 ITerrainChannel retval = LoadStream(s);
77 77
78 s.Close(); 78 s.Close();
79 79
80 return retval; 80 return retval;
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
113 // i.e. eat X upto where we start 113 // i.e. eat X upto where we start
114 while (currFileXOffset < offsetX) 114 while (currFileXOffset < offsetX)
115 { 115 {
116 bs.ReadBytes(sectionWidth * 13); 116 bs.ReadBytes(sectionWidth * 13);
117 currFileXOffset++; 117 currFileXOffset++;
118 } 118 }
119 119
@@ -143,11 +143,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
143 143
144 return retval; 144 return retval;
145 } 145 }
146 146
147 public ITerrainChannel LoadStream(Stream s) 147 public ITerrainChannel LoadStream(Stream s)
148 { 148 {
149 TerrainChannel retval = new TerrainChannel(); 149 TerrainChannel retval = new TerrainChannel();
150 150
151 BinaryReader bs = new BinaryReader(s); 151 BinaryReader bs = new BinaryReader(s);
152 int y; 152 int y;
153 for (y = 0; y < retval.Height; y++) 153 for (y = 0; y < retval.Height; y++)
@@ -160,8 +160,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
160 } 160 }
161 } 161 }
162 162
163 bs.Close(); 163 bs.Close();
164 164
165 return retval; 165 return retval;
166 } 166 }
167 167
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
173 173
174 s.Close(); 174 s.Close();
175 } 175 }
176 176
177 public void SaveStream(Stream s, ITerrainChannel map) 177 public void SaveStream(Stream s, ITerrainChannel map)
178 { 178 {
179 BinaryWriter binStream = new BinaryWriter(s); 179 BinaryWriter binStream = new BinaryWriter(s);
@@ -224,9 +224,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
224 } 224 }
225 } 225 }
226 226
227 binStream.Close(); 227 binStream.Close();
228 } 228 }
229 229
230 public string FileExtension 230 public string FileExtension
231 { 231 {
232 get { return ".raw"; } 232 get { return ".raw"; }
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs
index cf95486..19e181e 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/PNG.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
40 40
41 colours.Save(filename, ImageFormat.Png); 41 colours.Save(filename, ImageFormat.Png);
42 } 42 }
43 43
44 /// <summary> 44 /// <summary>
45 /// Exports a stream using a System.Drawing exporter. 45 /// Exports a stream using a System.Drawing exporter.
46 /// </summary> 46 /// </summary>
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
51 Bitmap colours = CreateGrayscaleBitmapFromMap(map); 51 Bitmap colours = CreateGrayscaleBitmapFromMap(map);
52 52
53 colours.Save(stream, ImageFormat.Png); 53 colours.Save(stream, ImageFormat.Png);
54 } 54 }
55 55
56 public override string ToString() 56 public override string ToString()
57 { 57 {
58 return "PNG"; 58 return "PNG";
59 } 59 }
60 } 60 }
61} \ No newline at end of file 61}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs
index bb8b0f7..758821a 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs
@@ -112,11 +112,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
112 112
113 return retval; 113 return retval;
114 } 114 }
115 115
116 public ITerrainChannel LoadStream(Stream s) 116 public ITerrainChannel LoadStream(Stream s)
117 { 117 {
118 TerrainChannel retval = new TerrainChannel(); 118 TerrainChannel retval = new TerrainChannel();
119 119
120 BinaryReader bs = new BinaryReader(s); 120 BinaryReader bs = new BinaryReader(s);
121 int y; 121 int y;
122 for (y = 0; y < retval.Height; y++) 122 for (y = 0; y < retval.Height; y++)
@@ -129,10 +129,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
129 } 129 }
130 130
131 bs.Close(); 131 bs.Close();
132 132
133 return retval; 133 return retval;
134 } 134 }
135 135
136 public void SaveFile(string filename, ITerrainChannel map) 136 public void SaveFile(string filename, ITerrainChannel map)
137 { 137 {
138 FileInfo file = new FileInfo(filename); 138 FileInfo file = new FileInfo(filename);
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
141 141
142 s.Close(); 142 s.Close();
143 } 143 }
144 144
145 public void SaveStream(Stream s, ITerrainChannel map) 145 public void SaveStream(Stream s, ITerrainChannel map)
146 { 146 {
147 BinaryWriter bs = new BinaryWriter(s); 147 BinaryWriter bs = new BinaryWriter(s);
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
156 } 156 }
157 } 157 }
158 158
159 bs.Close(); 159 bs.Close();
160 } 160 }
161 161
162 #endregion 162 #endregion
@@ -166,4 +166,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
166 return "RAW32"; 166 return "RAW32";
167 } 167 }
168 } 168 }
169} \ No newline at end of file 169}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs
index 3f98f40..95b43b0 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/TIFF.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
40 40
41 colours.Save(filename, ImageFormat.Tiff); 41 colours.Save(filename, ImageFormat.Tiff);
42 } 42 }
43 43
44 /// <summary> 44 /// <summary>
45 /// Exports a stream using a System.Drawing exporter. 45 /// Exports a stream using a System.Drawing exporter.
46 /// </summary> 46 /// </summary>
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
51 Bitmap colours = CreateGrayscaleBitmapFromMap(map); 51 Bitmap colours = CreateGrayscaleBitmapFromMap(map);
52 52
53 colours.Save(stream, ImageFormat.Tiff); 53 colours.Save(stream, ImageFormat.Tiff);
54 } 54 }
55 55
56 public override string ToString() 56 public override string ToString()
57 { 57 {
58 return "TIFF"; 58 return "TIFF";
59 } 59 }
60 } 60 }
61} \ No newline at end of file 61}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs
index 5dc2aa5..2bf029e 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
51 51
52 return retval; 52 return retval;
53 } 53 }
54 54
55 public ITerrainChannel LoadStream(Stream s) 55 public ITerrainChannel LoadStream(Stream s)
56 { 56 {
57 TerrainChannel retval = new TerrainChannel(); 57 TerrainChannel retval = new TerrainChannel();
58 58
59 BinaryReader bs = new BinaryReader(s); 59 BinaryReader bs = new BinaryReader(s);
60 60
61 bool eof = false; 61 bool eof = false;
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
107 } 107 }
108 108
109 bs.Close(); 109 bs.Close();
110 110
111 return retval; 111 return retval;
112 } 112 }
113 113
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
115 { 115 {
116 throw new NotImplementedException(); 116 throw new NotImplementedException();
117 } 117 }
118 118
119 public void SaveStream(Stream stream, ITerrainChannel map) 119 public void SaveStream(Stream stream, ITerrainChannel map)
120 { 120 {
121 throw new NotImplementedException(); 121 throw new NotImplementedException();
@@ -138,4 +138,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
138 return "Terragen"; 138 return "Terragen";
139 } 139 }
140 } 140 }
141} \ No newline at end of file 141}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs
index e255515..beeff03 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/ITerrainModule.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
33 { 33 {
34 void LoadFromFile(string filename); 34 void LoadFromFile(string filename);
35 void SaveToFile(string filename); 35 void SaveToFile(string filename);
36 36
37 /// <summary> 37 /// <summary>
38 /// Load a terrain from a stream. 38 /// Load a terrain from a stream.
39 /// </summary> 39 /// </summary>
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
42 /// </param> 42 /// </param>
43 /// <param name="stream"></param> 43 /// <param name="stream"></param>
44 void LoadFromStream(string filename, Stream stream); 44 void LoadFromStream(string filename, Stream stream);
45 45
46 /// <summary> 46 /// <summary>
47 /// Save a terrain to a stream. 47 /// Save a terrain to a stream.
48 /// </summary> 48 /// </summary>
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
51 /// </param> 51 /// </param>
52 /// <param name="stream"></param> 52 /// <param name="stream"></param>
53 void SaveToStream(string filename, Stream stream); 53 void SaveToStream(string filename, Stream stream);
54 54
55 void InstallPlugin(string name, ITerrainEffect plug); 55 void InstallPlugin(string name, ITerrainEffect plug);
56 } 56 }
57} 57}
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index 8fbc62e..4a62446 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
221 throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); 221 throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented"));
222 } 222 }
223 } 223 }
224 224
225 /// <summary> 225 /// <summary>
226 /// Loads a terrain file from a stream and installs it in the scene. 226 /// Loads a terrain file from a stream and installs it in the scene.
227 /// </summary> 227 /// </summary>
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
281 m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented."); 281 m_log.Error("Unable to save to " + filename + ", saving of this file format has not been implemented.");
282 throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented")); 282 throw new TerrainException(String.Format("Unable to save heightmap: saving of this file format not implemented"));
283 } 283 }
284 } 284 }
285 285
286 #region Plugin Loading Methods 286 #region Plugin Loading Methods
287 287
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
450 m_tainted = false; 450 m_tainted = false;
451 m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); 451 m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
452 m_scene.SaveTerrain(); 452 m_scene.SaveTerrain();
453 453
454 // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. 454 // Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
455 //m_scene.CreateTerrainTexture(true); 455 //m_scene.CreateTerrainTexture(true);
456 } 456 }
@@ -517,11 +517,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
517 // fixup and height deltas that don't respect them 517 // fixup and height deltas that don't respect them
518 if (respectEstateSettings && LimitChannelChanges(x, y)) 518 if (respectEstateSettings && LimitChannelChanges(x, y))
519 { 519 {
520 // this has been vetoed, so update 520 // this has been vetoed, so update
521 // what we are going to send to the client 521 // what we are going to send to the client
522 serialised = m_channel.GetFloatsSerialised(); 522 serialised = m_channel.GetFloatsSerialised();
523 } 523 }
524 524
525 SendToClients(serialised, x, y); 525 SendToClients(serialised, x, y);
526 shouldTaint = true; 526 shouldTaint = true;
527 } 527 }
@@ -580,9 +580,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
580 private void SendToClients(float[] serialised, int x, int y) 580 private void SendToClients(float[] serialised, int x, int y)
581 { 581 {
582 m_scene.ForEachClient( 582 m_scene.ForEachClient(
583 delegate(IClientAPI controller) 583 delegate(IClientAPI controller)
584 { controller.SendLayerData( 584 { controller.SendLayerData(
585 x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); 585 x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised);
586 } 586 }
587 ); 587 );
588 } 588 }
@@ -647,7 +647,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
647 { 647 {
648 // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area. 648 // Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area.
649 // for now check a point in the centre of the region 649 // for now check a point in the centre of the region
650 650
651 if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0))) 651 if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new LLVector3(127, 127, 0)))
652 { 652 {
653 InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter 653 InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
index a331d37..9b8dc75 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
162 { 162 {
163 int tc = System.Environment.TickCount; 163 int tc = System.Environment.TickCount;
164 m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain"); 164 m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain");
165 165
166 double[,] hm = whichScene.Heightmap.GetDoubles(); 166 double[,] hm = whichScene.Heightmap.GetDoubles();
167 bool ShadowDebugContinue = true; 167 bool ShadowDebugContinue = true;
168 //Color prim = Color.FromArgb(120, 120, 120); 168 //Color prim = Color.FromArgb(120, 120, 120);
@@ -247,7 +247,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
247 //X 247 //X
248 // . 248 // .
249 // 249 //
250 // Shade the terrain for shadows 250 // Shade the terrain for shadows
251 if ((x - 1 > 0) && (y - 1 > 0)) 251 if ((x - 1 > 0) && (y - 1 > 0))
252 { 252 {
253 hfvalue = (float)hm[x, y]; 253 hfvalue = (float)hm[x, y];
@@ -268,7 +268,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
268 else if (hfdiff < -0.3f) 268 else if (hfdiff < -0.3f)
269 { 269 {
270 // We have to desaturate and blacken the land at the same time 270 // We have to desaturate and blacken the land at the same time
271 // we use floats, colors use bytes, so shrink are space down to 271 // we use floats, colors use bytes, so shrink are space down to
272 // 0-255 272 // 0-255
273 273
274 274
@@ -368,8 +368,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
368 368
369 return mapbmp; 369 return mapbmp;
370 } 370 }
371 371
372 372
373 private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) 373 private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp)
374 { 374 {
375 int tc = 0; 375 int tc = 0;
@@ -570,4 +570,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
570 } 570 }
571 #endregion 571 #endregion
572 } 572 }
573} \ No newline at end of file 573}
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
index 2a7af87..2430822 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
54 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 55
56 private static readonly string m_mapLayerPath = "0001/"; 56 private static readonly string m_mapLayerPath = "0001/";
57 57
58 //private IConfig m_config; 58 //private IConfig m_config;
59 private Scene m_scene; 59 private Scene m_scene;
60 private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); 60 private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>();
61 private int cachedTime = 0; 61 private int cachedTime = 0;
62 private byte[] myMapImageJPEG; 62 private byte[] myMapImageJPEG;
63 63
64 //private int CacheRegionsDistance = 256; 64 //private int CacheRegionsDistance = 256;
65 65
66 #region IRegionModule Members 66 #region IRegionModule Members
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
85 } 85 }
86 public void PostInitialise() 86 public void PostInitialise()
87 { 87 {
88 88
89 } 89 }
90 90
91 public void Close() 91 public void Close()
@@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
102 } 102 }
103 103
104 #endregion 104 #endregion
105
106
107
108
109 105
110 public void OnRegisterCaps(LLUUID agentID, Caps caps) 106 public void OnRegisterCaps(LLUUID agentID, Caps caps)
111 { 107 {
@@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
117 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 113 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
118 { 114 {
119 return MapLayerRequest(request, path, param, 115 return MapLayerRequest(request, path, param,
120 agentID, caps); 116 agentID, caps);
121 })); 117 }));
122
123 } 118 }
124 119
125 /// <summary> 120 /// <summary>
@@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
138 //{ 133 //{
139 //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", 134 //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}",
140 //request, path, param,agentID.ToString()); 135 //request, path, param,agentID.ToString());
141 136
142 // this is here because CAPS map requests work even beyond the 10,000 limit. 137 // this is here because CAPS map requests work even beyond the 10,000 limit.
143 ScenePresence avatarPresence = null; 138 ScenePresence avatarPresence = null;
144 139
145 m_scene.TryGetAvatar(agentID, out avatarPresence); 140 m_scene.TryGetAvatar(agentID, out avatarPresence);
146 141
147 if (avatarPresence != null) 142 if (avatarPresence != null)
148 { 143 {
149 bool lookup = false; 144 bool lookup = false;
@@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
168 163
169 mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); 164 mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8);
170 avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); 165 avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0);
171 166
172 lock (cachedMapBlocks) 167 lock (cachedMapBlocks)
173 cachedMapBlocks = mapBlocks; 168 cachedMapBlocks = mapBlocks;
174 169
@@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
262 MemoryStream imgstream = new MemoryStream(); 257 MemoryStream imgstream = new MemoryStream();
263 Bitmap mapTexture = new Bitmap(1,1); 258 Bitmap mapTexture = new Bitmap(1,1);
264 System.Drawing.Image image = (System.Drawing.Image)mapTexture; 259 System.Drawing.Image image = (System.Drawing.Image)mapTexture;
265 260
266
267 try 261 try
268 { 262 {
269 // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data 263 // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data
270 264
271
272 imgstream = new MemoryStream(); 265 imgstream = new MemoryStream();
273 266
274 // non-async because we know we have the asset immediately. 267 // non-async because we know we have the asset immediately.
275 AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); 268 AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true);
276 269
277 // Decode image to System.Drawing.Image 270 // Decode image to System.Drawing.Image
278 image = OpenJPEG.DecodeToImage(mapasset.Data); 271 image = OpenJPEG.DecodeToImage(mapasset.Data);
279 272
@@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
293 286
294 myEncoderParameter = new EncoderParameter(myEncoder, 95L); 287 myEncoderParameter = new EncoderParameter(myEncoder, 95L);
295 myEncoderParameters.Param[0] = myEncoderParameter; 288 myEncoderParameters.Param[0] = myEncoderParameter;
296 289
297 // Save bitmap to stream 290 // Save bitmap to stream
298 mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); 291 mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters);
299 292
@@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
332 // From msdn 325 // From msdn
333 private static ImageCodecInfo GetEncoderInfo(String mimeType) 326 private static ImageCodecInfo GetEncoderInfo(String mimeType)
334 { 327 {
335 int j;
336 ImageCodecInfo[] encoders; 328 ImageCodecInfo[] encoders;
337 encoders = ImageCodecInfo.GetImageEncoders(); 329 encoders = ImageCodecInfo.GetImageEncoders();
338 for (j = 0; j < encoders.Length; ++j) 330 for (int j = 0; j < encoders.Length; ++j)
339 { 331 {
340 if (encoders[j].MimeType == mimeType) 332 if (encoders[j].MimeType == mimeType)
341 return encoders[j]; 333 return encoders[j];
342 } 334 }
343 return null; 335 return null;
344 } 336 }
345
346 } 337 }
347} 338}