diff options
author | Justin Clark-Casey (justincc) | 2014-03-18 20:09:15 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-03-18 20:09:15 +0000 |
commit | d5f5649750c9f22d2d160d581fa35f422a9ad760 (patch) | |
tree | 2ee197c5d60894663388047839ee9fa0e143d6d9 /OpenSim/Services/MapImageService/MapImageService.cs | |
parent | Lock m_syncRoot on DoubleQueue.Count. This is not documented as a thread-saf... (diff) | |
parent | Add delete maptile ability to MapImageService - yet untested (diff) | |
download | opensim-SC-d5f5649750c9f22d2d160d581fa35f422a9ad760.zip opensim-SC-d5f5649750c9f22d2d160d581fa35f422a9ad760.tar.gz opensim-SC-d5f5649750c9f22d2d160d581fa35f422a9ad760.tar.bz2 opensim-SC-d5f5649750c9f22d2d160d581fa35f422a9ad760.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/MapImageService/MapImageService.cs')
-rw-r--r-- | OpenSim/Services/MapImageService/MapImageService.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index 9ba5dab..31e147b 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs | |||
@@ -112,9 +112,38 @@ namespace OpenSim.Services.MapImageService | |||
112 | reason = e.Message; | 112 | reason = e.Message; |
113 | return false; | 113 | return false; |
114 | } | 114 | } |
115 | } | ||
116 | |||
117 | return UpdateMultiResolutionFiles(x, y, out reason); | ||
118 | } | ||
119 | |||
120 | public bool RemoveMapTile(int x, int y, out string reason) | ||
121 | { | ||
122 | reason = String.Empty; | ||
123 | string fileName = GetFileName(1, x, y); | ||
124 | |||
125 | lock (m_Sync) | ||
126 | { | ||
127 | try | ||
128 | { | ||
129 | File.Delete(fileName); | ||
130 | } | ||
131 | catch (Exception e) | ||
132 | { | ||
133 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); | ||
134 | reason = e.Message; | ||
135 | return false; | ||
136 | } | ||
137 | } | ||
115 | 138 | ||
116 | // Also save in png format? | 139 | return UpdateMultiResolutionFiles(x, y, out reason); |
140 | } | ||
117 | 141 | ||
142 | private bool UpdateMultiResolutionFiles(int x, int y, out string reason) | ||
143 | { | ||
144 | reason = String.Empty; | ||
145 | lock (m_Sync) | ||
146 | { | ||
118 | // Stitch seven more aggregate tiles together | 147 | // Stitch seven more aggregate tiles together |
119 | for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) | 148 | for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) |
120 | { | 149 | { |
@@ -126,7 +155,7 @@ namespace OpenSim.Services.MapImageService | |||
126 | 155 | ||
127 | if (!CreateTile(zoomLevel, x1, y1)) | 156 | if (!CreateTile(zoomLevel, x1, y1)) |
128 | { | 157 | { |
129 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0} at zoom level {1}", fileName, zoomLevel); | 158 | m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); |
130 | reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); | 159 | reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); |
131 | return false; | 160 | return false; |
132 | } | 161 | } |