aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/MapImageService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/MapImageService')
-rw-r--r--OpenSim/Services/MapImageService/MapImageService.cs73
-rw-r--r--OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs2
2 files changed, 74 insertions, 1 deletions
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs
index 2db1d14..fcace3a 100644
--- a/OpenSim/Services/MapImageService/MapImageService.cs
+++ b/OpenSim/Services/MapImageService/MapImageService.cs
@@ -54,6 +54,9 @@ namespace OpenSim.Services.MapImageService
54 private static readonly ILog m_log = 54 private static readonly ILog m_log =
55 LogManager.GetLogger( 55 LogManager.GetLogger(
56 MethodBase.GetCurrentMethod().DeclaringType); 56 MethodBase.GetCurrentMethod().DeclaringType);
57#pragma warning disable 414
58 private string LogHeader = "[MAP IMAGE SERVICE]";
59#pragma warning restore 414
57 60
58 private const int ZOOM_LEVELS = 8; 61 private const int ZOOM_LEVELS = 8;
59 private const int IMAGE_WIDTH = 256; 62 private const int IMAGE_WIDTH = 256;
@@ -128,6 +131,16 @@ namespace OpenSim.Services.MapImageService
128 return false; 131 return false;
129 } 132 }
130 } 133 }
134<<<<<<< HEAD
135
136 return UpdateMultiResolutionFilesAsync(x, y, out reason);
137 }
138
139 public bool RemoveMapTile(int x, int y, out string reason)
140 {
141 reason = String.Empty;
142 string fileName = GetFileName(1, x, y);
143=======
131 144
132 return UpdateMultiResolutionFiles(x, y, scopeID, out reason); 145 return UpdateMultiResolutionFiles(x, y, scopeID, out reason);
133 } 146 }
@@ -136,24 +149,40 @@ namespace OpenSim.Services.MapImageService
136 { 149 {
137 reason = String.Empty; 150 reason = String.Empty;
138 string fileName = GetFileName(1, x, y, scopeID); 151 string fileName = GetFileName(1, x, y, scopeID);
152>>>>>>> avn/ubitvar
139 153
140 lock (m_Sync) 154 lock (m_Sync)
141 { 155 {
142 try 156 try
157<<<<<<< HEAD
143 { 158 {
144 File.Delete(fileName); 159 File.Delete(fileName);
145 } 160 }
146 catch (Exception e) 161 catch (Exception e)
147 { 162 {
163=======
164 {
165 File.Delete(fileName);
166 }
167 catch (Exception e)
168 {
169>>>>>>> avn/ubitvar
148 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); 170 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e);
149 reason = e.Message; 171 reason = e.Message;
150 return false; 172 return false;
151 } 173 }
152 } 174 }
175<<<<<<< HEAD
176
177 return UpdateMultiResolutionFilesAsync(x, y, out reason);
178 }
179
180=======
153 181
154 return UpdateMultiResolutionFiles(x, y, scopeID, out reason); 182 return UpdateMultiResolutionFiles(x, y, scopeID, out reason);
155 } 183 }
156 184
185>>>>>>> avn/ubitvar
157 // When large varregions start up, they can send piles of new map tiles. This causes 186 // When large varregions start up, they can send piles of new map tiles. This causes
158 // this multi-resolution routine to be called a zillion times an causes much CPU 187 // this multi-resolution routine to be called a zillion times an causes much CPU
159 // time to be spent creating multi-resolution tiles that will be replaced when 188 // time to be spent creating multi-resolution tiles that will be replaced when
@@ -162,6 +191,25 @@ namespace OpenSim.Services.MapImageService
162 { 191 {
163 public int xx; 192 public int xx;
164 public int yy; 193 public int yy;
194<<<<<<< HEAD
195 public mapToMultiRez(int pX, int pY)
196 {
197 xx = pX;
198 yy = pY;
199 }
200 };
201 private Queue<mapToMultiRez> multiRezToBuild = new Queue<mapToMultiRez>();
202 private bool UpdateMultiResolutionFilesAsync(int x, int y, out string reason)
203 {
204 reason = String.Empty;
205 lock (multiRezToBuild)
206 {
207 // m_log.DebugFormat("{0} UpdateMultiResolutionFilesAsync: scheduling update for <{1},{2}>", LogHeader, x, y);
208 multiRezToBuild.Enqueue(new mapToMultiRez(x, y));
209 if (multiRezToBuild.Count == 1)
210 Util.FireAndForget(
211 DoUpdateMultiResolutionFilesAsync, null, "MapImageService.DoUpdateMultiResolutionFilesAsync");
212=======
165 public UUID scopeID; 213 public UUID scopeID;
166 public mapToMultiRez(int pX, int pY, UUID pscopeID) 214 public mapToMultiRez(int pX, int pY, UUID pscopeID)
167 { 215 {
@@ -183,6 +231,7 @@ namespace OpenSim.Services.MapImageService
183 if (multiRezToBuild.Count == 1) 231 if (multiRezToBuild.Count == 1)
184 Util.FireAndForget( 232 Util.FireAndForget(
185 DoUpdateMultiResolutionFilesAsync); 233 DoUpdateMultiResolutionFilesAsync);
234>>>>>>> avn/ubitvar
186 } 235 }
187 236
188 return true; 237 return true;
@@ -190,8 +239,15 @@ namespace OpenSim.Services.MapImageService
190 239
191 private void DoUpdateMultiResolutionFilesAsync(object o) 240 private void DoUpdateMultiResolutionFilesAsync(object o)
192 { 241 {
242<<<<<<< HEAD
243 // This sleep causes the FireAndForget thread to be different than the invocation thread.
244 // It also allows other tiles to be uploaded so the multi-rez images are more likely
245 // to be correct.
246 Thread.Sleep(1 * 1000);
247=======
193 // let acumulate large region tiles 248 // let acumulate large region tiles
194 Thread.Sleep(60 * 1000); // large regions take time to upload tiles 249 Thread.Sleep(60 * 1000); // large regions take time to upload tiles
250>>>>>>> avn/ubitvar
195 251
196 while (multiRezToBuild.Count > 0) 252 while (multiRezToBuild.Count > 0)
197 { 253 {
@@ -205,22 +261,35 @@ namespace OpenSim.Services.MapImageService
205 { 261 {
206 int x = toMultiRez.xx; 262 int x = toMultiRez.xx;
207 int y = toMultiRez.yy; 263 int y = toMultiRez.yy;
264<<<<<<< HEAD
265 // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y);
266
267=======
208 UUID scopeID = toMultiRez.scopeID; 268 UUID scopeID = toMultiRez.scopeID;
209 // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y); 269 // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y);
210 270
211 int width = 1; 271 int width = 1;
272>>>>>>> avn/ubitvar
212 // Stitch seven more aggregate tiles together 273 // Stitch seven more aggregate tiles together
213 for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) 274 for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++)
214 { 275 {
215 // Calculate the width (in full resolution tiles) and bottom-left 276 // Calculate the width (in full resolution tiles) and bottom-left
216 // corner of the current zoom level 277 // corner of the current zoom level
278<<<<<<< HEAD
279 int width = (int)Math.Pow(2, (double)(zoomLevel - 1));
280=======
217 width *= 2; 281 width *= 2;
282>>>>>>> avn/ubitvar
218 int x1 = x - (x % width); 283 int x1 = x - (x % width);
219 int y1 = y - (y % width); 284 int y1 = y - (y % width);
220 285
221 lock (m_Sync) // must lock the reading and writing of the maptile files 286 lock (m_Sync) // must lock the reading and writing of the maptile files
222 { 287 {
288<<<<<<< HEAD
289 if (!CreateTile(zoomLevel, x1, y1))
290=======
223 if (!CreateTile(zoomLevel, x1, y1, scopeID)) 291 if (!CreateTile(zoomLevel, x1, y1, scopeID))
292>>>>>>> avn/ubitvar
224 { 293 {
225 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); 294 m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel);
226 return; 295 return;
@@ -229,6 +298,10 @@ namespace OpenSim.Services.MapImageService
229 } 298 }
230 } 299 }
231 } 300 }
301<<<<<<< HEAD
302
303=======
304>>>>>>> avn/ubitvar
232 return; 305 return;
233 } 306 }
234 307
diff --git a/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs b/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs
index edadb26..e5f1bf9 100644
--- a/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs
+++ b/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.8.0.*")] 32[assembly: AssemblyVersion("0.8.2.*")]
33 33