diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 16 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 6 |
2 files changed, 5 insertions, 17 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 8ab323a..1aa3282 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -158,17 +158,10 @@ 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); | ||
161 | string name = regionID.ToString(); | 162 | string name = regionID.ToString(); |
162 | filename = Path.Combine(storagePath, name + ".jpg"); | 163 | filename = Path.Combine(storagePath, name + ".jpg"); |
163 | m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename); | 164 | c.DownloadFile(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 | |||
172 | bitmap = new Bitmap(filename); | 165 | bitmap = new Bitmap(filename); |
173 | //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); | 166 | //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); |
174 | byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); | 167 | byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); |
@@ -179,11 +172,10 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
179 | 172 | ||
180 | ass.Data = imageData; | 173 | ass.Data = imageData; |
181 | 174 | ||
182 | mapTile = ass.FullID; | ||
183 | |||
184 | // finally | ||
185 | m_AssetService.Store(ass); | 175 | m_AssetService.Store(ass); |
186 | 176 | ||
177 | // finally | ||
178 | mapTile = ass.FullID; | ||
187 | } | 179 | } |
188 | catch // LEGIT: Catching problems caused by OpenJPEG p/invoke | 180 | catch // LEGIT: Catching problems caused by OpenJPEG p/invoke |
189 | { | 181 | { |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index c40a347..7ddcfa6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -60,9 +60,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
60 | { | 60 | { |
61 | Uri m_Uri = new Uri(m_ServerURL); | 61 | Uri m_Uri = new Uri(m_ServerURL); |
62 | IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); | 62 | IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); |
63 | m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); | 63 | m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ; |
64 | if (!m_ServerURL.EndsWith("/")) | ||
65 | m_ServerURL += "/"; | ||
66 | } | 64 | } |
67 | catch (Exception e) | 65 | catch (Exception e) |
68 | { | 66 | { |
@@ -89,8 +87,6 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
89 | throw new Exception("UserAgent connector init error"); | 87 | throw new Exception("UserAgent connector init error"); |
90 | } | 88 | } |
91 | m_ServerURL = serviceURI; | 89 | m_ServerURL = serviceURI; |
92 | if (!m_ServerURL.EndsWith("/")) | ||
93 | m_ServerURL += "/"; | ||
94 | 90 | ||
95 | m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); | 91 | m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); |
96 | } | 92 | } |