aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index b1663ee..e814c45 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -73,13 +73,15 @@ namespace OpenSim.Services.Connectors.Hypergrid
73 return "foreignobject/"; 73 return "foreignobject/";
74 } 74 }
75 75
76 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) 76 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY)
77 { 77 {
78 regionID = UUID.Zero; 78 regionID = UUID.Zero;
79 imageURL = string.Empty; 79 imageURL = string.Empty;
80 realHandle = 0; 80 realHandle = 0;
81 externalName = string.Empty; 81 externalName = string.Empty;
82 reason = string.Empty; 82 reason = string.Empty;
83 sizeX = (int)Constants.RegionSize;
84 sizeY = (int)Constants.RegionSize;
83 85
84 Hashtable hash = new Hashtable(); 86 Hashtable hash = new Hashtable();
85 hash["region_name"] = info.RegionName; 87 hash["region_name"] = info.RegionName;
@@ -134,8 +136,15 @@ namespace OpenSim.Services.Connectors.Hypergrid
134 externalName = (string)hash["external_name"]; 136 externalName = (string)hash["external_name"];
135 //m_log.Debug(">> HERE, externalName: " + externalName); 137 //m_log.Debug(">> HERE, externalName: " + externalName);
136 } 138 }
139 if (hash["size_x"] != null)
140 {
141 Int32.TryParse((string)hash["size_x"], out sizeX);
142 }
143 if (hash["size_y"] != null)
144 {
145 Int32.TryParse((string)hash["size_y"], out sizeY);
146 }
137 } 147 }
138
139 } 148 }
140 catch (Exception e) 149 catch (Exception e)
141 { 150 {
@@ -160,14 +169,15 @@ namespace OpenSim.Services.Connectors.Hypergrid
160 169
161 try 170 try
162 { 171 {
163 WebClient c = new WebClient(); 172 //m_log.Debug("JPEG: " + imageURL);
164 string name = regionID.ToString(); 173 string name = regionID.ToString();
165 filename = Path.Combine(storagePath, name + ".jpg"); 174 filename = Path.Combine(storagePath, name + ".jpg");
166 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename); 175 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename);
167 if (!File.Exists(filename)) 176 if (!File.Exists(filename))
168 { 177 {
169 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading..."); 178 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading...");
170 c.DownloadFile(imageURL, filename); 179 using(WebClient c = new WebClient())
180 c.DownloadFile(imageURL, filename);
171 } 181 }
172 else 182 else
173 { 183 {
@@ -189,11 +199,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
189 199
190 ass.Data = imageData; 200 ass.Data = imageData;
191 201
192 mapTile = ass.FullID;
193
194 // finally
195 m_AssetService.Store(ass); 202 m_AssetService.Store(ass);
196 203
204 // finally
205 mapTile = ass.FullID;
197 } 206 }
198 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke 207 catch // LEGIT: Catching problems caused by OpenJPEG p/invoke
199 { 208 {