diff options
author | UbitUmarov | 2015-09-02 19:54:53 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-02 19:54:53 +0100 |
commit | a11edceb00b5b86f825bd957bdac9edb91f893dd (patch) | |
tree | c192eae26f3aadf365a66f32fc6d9ade2f0a0c61 /OpenSim/Services/MapImageService/MapImageService.cs | |
parent | bad merge? (diff) | |
download | opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.zip opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.gz opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.bz2 opensim-SC-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.xz |
seems to compile ( tests comented out)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/MapImageService/MapImageService.cs | 74 |
1 files changed, 3 insertions, 71 deletions
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index fcace3a..6728752 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs | |||
@@ -131,16 +131,6 @@ namespace OpenSim.Services.MapImageService | |||
131 | return false; | 131 | return false; |
132 | } | 132 | } |
133 | } | 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 | ======= | ||
144 | 134 | ||
145 | return UpdateMultiResolutionFiles(x, y, scopeID, out reason); | 135 | return UpdateMultiResolutionFiles(x, y, scopeID, out reason); |
146 | } | 136 | } |
@@ -149,40 +139,25 @@ namespace OpenSim.Services.MapImageService | |||
149 | { | 139 | { |
150 | reason = String.Empty; | 140 | reason = String.Empty; |
151 | string fileName = GetFileName(1, x, y, scopeID); | 141 | string fileName = GetFileName(1, x, y, scopeID); |
152 | >>>>>>> avn/ubitvar | ||
153 | 142 | ||
154 | lock (m_Sync) | 143 | lock (m_Sync) |
155 | { | 144 | { |
156 | try | 145 | try |
157 | <<<<<<< HEAD | ||
158 | { | 146 | { |
159 | File.Delete(fileName); | 147 | File.Delete(fileName); |
160 | } | 148 | } |
161 | catch (Exception e) | 149 | catch (Exception e) |
162 | { | 150 | { |
163 | ======= | 151 | |
164 | { | ||
165 | File.Delete(fileName); | ||
166 | } | ||
167 | catch (Exception e) | ||
168 | { | ||
169 | >>>>>>> avn/ubitvar | ||
170 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); | 152 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); |
171 | reason = e.Message; | 153 | reason = e.Message; |
172 | return false; | 154 | return false; |
173 | } | 155 | } |
174 | } | 156 | } |
175 | <<<<<<< HEAD | ||
176 | |||
177 | return UpdateMultiResolutionFilesAsync(x, y, out reason); | ||
178 | } | ||
179 | |||
180 | ======= | ||
181 | |||
182 | return UpdateMultiResolutionFiles(x, y, scopeID, out reason); | 157 | return UpdateMultiResolutionFiles(x, y, scopeID, out reason); |
183 | } | 158 | } |
184 | 159 | ||
185 | >>>>>>> avn/ubitvar | 160 | |
186 | // When large varregions start up, they can send piles of new map tiles. This causes | 161 | // When large varregions start up, they can send piles of new map tiles. This causes |
187 | // this multi-resolution routine to be called a zillion times an causes much CPU | 162 | // this multi-resolution routine to be called a zillion times an causes much CPU |
188 | // time to be spent creating multi-resolution tiles that will be replaced when | 163 | // time to be spent creating multi-resolution tiles that will be replaced when |
@@ -191,25 +166,6 @@ namespace OpenSim.Services.MapImageService | |||
191 | { | 166 | { |
192 | public int xx; | 167 | public int xx; |
193 | public int yy; | 168 | 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 | ======= | ||
213 | public UUID scopeID; | 169 | public UUID scopeID; |
214 | public mapToMultiRez(int pX, int pY, UUID pscopeID) | 170 | public mapToMultiRez(int pX, int pY, UUID pscopeID) |
215 | { | 171 | { |
@@ -231,7 +187,6 @@ namespace OpenSim.Services.MapImageService | |||
231 | if (multiRezToBuild.Count == 1) | 187 | if (multiRezToBuild.Count == 1) |
232 | Util.FireAndForget( | 188 | Util.FireAndForget( |
233 | DoUpdateMultiResolutionFilesAsync); | 189 | DoUpdateMultiResolutionFilesAsync); |
234 | >>>>>>> avn/ubitvar | ||
235 | } | 190 | } |
236 | 191 | ||
237 | return true; | 192 | return true; |
@@ -239,15 +194,8 @@ namespace OpenSim.Services.MapImageService | |||
239 | 194 | ||
240 | private void DoUpdateMultiResolutionFilesAsync(object o) | 195 | private void DoUpdateMultiResolutionFilesAsync(object o) |
241 | { | 196 | { |
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 | ======= | ||
248 | // let acumulate large region tiles | 197 | // let acumulate large region tiles |
249 | Thread.Sleep(60 * 1000); // large regions take time to upload tiles | 198 | Thread.Sleep(60 * 1000); // large regions take time to upload tiles |
250 | >>>>>>> avn/ubitvar | ||
251 | 199 | ||
252 | while (multiRezToBuild.Count > 0) | 200 | while (multiRezToBuild.Count > 0) |
253 | { | 201 | { |
@@ -261,35 +209,23 @@ namespace OpenSim.Services.MapImageService | |||
261 | { | 209 | { |
262 | int x = toMultiRez.xx; | 210 | int x = toMultiRez.xx; |
263 | int y = toMultiRez.yy; | 211 | int y = toMultiRez.yy; |
264 | <<<<<<< HEAD | ||
265 | // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y); | ||
266 | |||
267 | ======= | ||
268 | UUID scopeID = toMultiRez.scopeID; | 212 | UUID scopeID = toMultiRez.scopeID; |
269 | // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y); | 213 | // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y); |
270 | 214 | ||
271 | int width = 1; | 215 | int width = 1; |
272 | >>>>>>> avn/ubitvar | 216 | |
273 | // Stitch seven more aggregate tiles together | 217 | // Stitch seven more aggregate tiles together |
274 | for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) | 218 | for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) |
275 | { | 219 | { |
276 | // Calculate the width (in full resolution tiles) and bottom-left | 220 | // Calculate the width (in full resolution tiles) and bottom-left |
277 | // corner of the current zoom level | 221 | // corner of the current zoom level |
278 | <<<<<<< HEAD | ||
279 | int width = (int)Math.Pow(2, (double)(zoomLevel - 1)); | ||
280 | ======= | ||
281 | width *= 2; | 222 | width *= 2; |
282 | >>>>>>> avn/ubitvar | ||
283 | int x1 = x - (x % width); | 223 | int x1 = x - (x % width); |
284 | int y1 = y - (y % width); | 224 | int y1 = y - (y % width); |
285 | 225 | ||
286 | lock (m_Sync) // must lock the reading and writing of the maptile files | 226 | lock (m_Sync) // must lock the reading and writing of the maptile files |
287 | { | 227 | { |
288 | <<<<<<< HEAD | ||
289 | if (!CreateTile(zoomLevel, x1, y1)) | ||
290 | ======= | ||
291 | if (!CreateTile(zoomLevel, x1, y1, scopeID)) | 228 | if (!CreateTile(zoomLevel, x1, y1, scopeID)) |
292 | >>>>>>> avn/ubitvar | ||
293 | { | 229 | { |
294 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); | 230 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); |
295 | return; | 231 | return; |
@@ -298,10 +234,6 @@ namespace OpenSim.Services.MapImageService | |||
298 | } | 234 | } |
299 | } | 235 | } |
300 | } | 236 | } |
301 | <<<<<<< HEAD | ||
302 | |||
303 | ======= | ||
304 | >>>>>>> avn/ubitvar | ||
305 | return; | 237 | return; |
306 | } | 238 | } |
307 | 239 | ||