aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2011-01-06 12:48:28 -0800
committerDiva Canto2011-01-06 12:48:28 -0800
commit21dedb573be61a52cbbcc519f999f6046e20e070 (patch)
treed8f5d5443140e6f0b2371901ca52d2fb29501d35
parentHG bug fix. Must wait for client's UDP contact before getting scene presence. (diff)
downloadopensim-SC_OLD-21dedb573be61a52cbbcc519f999f6046e20e070.zip
opensim-SC_OLD-21dedb573be61a52cbbcc519f999f6046e20e070.tar.gz
opensim-SC_OLD-21dedb573be61a52cbbcc519f999f6046e20e070.tar.bz2
opensim-SC_OLD-21dedb573be61a52cbbcc519f999f6046e20e070.tar.xz
HG map tile fetch: handle cached images appropriately.
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs16
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs2
2 files changed, 13 insertions, 5 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 1aa3282..8ab323a 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -158,10 +158,17 @@ namespace OpenSim.Services.Connectors.Hypergrid
158 try 158 try
159 { 159 {
160 WebClient c = new WebClient(); 160 WebClient c = new WebClient();
161 //m_log.Debug("JPEG: " + imageURL);
162 string name = regionID.ToString(); 161 string name = regionID.ToString();
163 filename = Path.Combine(storagePath, name + ".jpg"); 162 filename = Path.Combine(storagePath, name + ".jpg");
164 c.DownloadFile(imageURL, filename); 163 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename);
164 if (!File.Exists(filename))
165 {
166 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading...");
167 c.DownloadFile(imageURL, filename);
168 }
169 else
170 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image");
171
165 bitmap = new Bitmap(filename); 172 bitmap = new Bitmap(filename);
166 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 173 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
167 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); 174 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true);
@@ -172,10 +179,11 @@ namespace OpenSim.Services.Connectors.Hypergrid
172 179
173 ass.Data = imageData; 180 ass.Data = imageData;
174 181
175 m_AssetService.Store(ass); 182 mapTile = ass.FullID;
176 183
177 // finally 184 // finally
178 mapTile = ass.FullID; 185 m_AssetService.Store(ass);
186
179 } 187 }
180 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke 188 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
181 { 189 {
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index c02c813..16fcc65 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -324,7 +324,7 @@ namespace OpenSim.Services.GridService
324 regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL, m_MapTileDirectory); 324 regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL, m_MapTileDirectory);
325 325
326 AddHyperlinkRegion(regInfo, handle); 326 AddHyperlinkRegion(regInfo, handle);
327 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); 327 m_log.InfoFormat("[HYPERGRID LINKER]: Successfully linked to region_uuid {0} with image {1}", regInfo.RegionID, regInfo.TerrainImage);
328 return true; 328 return true;
329 } 329 }
330 330