diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 68 |
1 files changed, 11 insertions, 57 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index d840527..803cd1b 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -53,7 +53,8 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
53 | 53 | ||
54 | private IAssetService m_AssetService; | 54 | private IAssetService m_AssetService; |
55 | 55 | ||
56 | public GatekeeperServiceConnector() : base() | 56 | public GatekeeperServiceConnector() |
57 | : base() | ||
57 | { | 58 | { |
58 | } | 59 | } |
59 | 60 | ||
@@ -123,11 +124,13 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
123 | realHandle = Convert.ToUInt64((string)hash["handle"]); | 124 | realHandle = Convert.ToUInt64((string)hash["handle"]); |
124 | //m_log.Debug(">> HERE, realHandle: " + realHandle); | 125 | //m_log.Debug(">> HERE, realHandle: " + realHandle); |
125 | } | 126 | } |
126 | if (hash["region_image"] != null) { | 127 | if (hash["region_image"] != null) |
128 | { | ||
127 | imageURL = (string)hash["region_image"]; | 129 | imageURL = (string)hash["region_image"]; |
128 | //m_log.Debug(">> HERE, imageURL: " + imageURL); | 130 | //m_log.Debug(">> HERE, imageURL: " + imageURL); |
129 | } | 131 | } |
130 | if (hash["external_name"] != null) { | 132 | if (hash["external_name"] != null) |
133 | { | ||
131 | externalName = (string)hash["external_name"]; | 134 | externalName = (string)hash["external_name"]; |
132 | //m_log.Debug(">> HERE, externalName: " + externalName); | 135 | //m_log.Debug(">> HERE, externalName: " + externalName); |
133 | } | 136 | } |
@@ -179,7 +182,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
179 | //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); | 182 | //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); |
180 | imageData = OpenJPEG.EncodeFromImage(bitmap, true); | 183 | imageData = OpenJPEG.EncodeFromImage(bitmap, true); |
181 | } | 184 | } |
182 | 185 | ||
183 | AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString()); | 186 | AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString()); |
184 | 187 | ||
185 | // !!! for now | 188 | // !!! for now |
@@ -257,7 +260,8 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
257 | region.RegionName = (string)hash["region_name"]; | 260 | region.RegionName = (string)hash["region_name"]; |
258 | //m_log.Debug(">> HERE, region_name: " + region.RegionName); | 261 | //m_log.Debug(">> HERE, region_name: " + region.RegionName); |
259 | } | 262 | } |
260 | if (hash["hostname"] != null) { | 263 | if (hash["hostname"] != null) |
264 | { | ||
261 | region.ExternalHostName = (string)hash["hostname"]; | 265 | region.ExternalHostName = (string)hash["hostname"]; |
262 | //m_log.Debug(">> HERE, hostname: " + region.ExternalHostName); | 266 | //m_log.Debug(">> HERE, hostname: " + region.ExternalHostName); |
263 | } | 267 | } |
@@ -275,10 +279,10 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
275 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); | 279 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); |
276 | //m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint); | 280 | //m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint); |
277 | } | 281 | } |
278 | 282 | ||
279 | if (hash["server_uri"] != null) | 283 | if (hash["server_uri"] != null) |
280 | { | 284 | { |
281 | region.ServerURI = (string) hash["server_uri"]; | 285 | region.ServerURI = (string)hash["server_uri"]; |
282 | //m_log.Debug(">> HERE, server_uri: " + region.ServerURI); | 286 | //m_log.Debug(">> HERE, server_uri: " + region.ServerURI); |
283 | } | 287 | } |
284 | 288 | ||
@@ -295,55 +299,5 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
295 | 299 | ||
296 | return null; | 300 | return null; |
297 | } | 301 | } |
298 | |||
299 | public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason) | ||
300 | { | ||
301 | // m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: CreateAgent start"); | ||
302 | |||
303 | myipaddress = String.Empty; | ||
304 | reason = String.Empty; | ||
305 | |||
306 | if (destination == null) | ||
307 | { | ||
308 | m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Given destination is null"); | ||
309 | return false; | ||
310 | } | ||
311 | |||
312 | string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; | ||
313 | |||
314 | try | ||
315 | { | ||
316 | OSDMap args = aCircuit.PackAgentCircuitData(); | ||
317 | |||
318 | args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); | ||
319 | args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); | ||
320 | args["destination_name"] = OSD.FromString(destination.RegionName); | ||
321 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); | ||
322 | args["teleport_flags"] = OSD.FromString(flags.ToString()); | ||
323 | |||
324 | OSDMap result = WebUtil.PostToService(uri, args, 80000); | ||
325 | if (result["Success"].AsBoolean()) | ||
326 | { | ||
327 | OSDMap unpacked = (OSDMap)result["_Result"]; | ||
328 | |||
329 | if (unpacked != null) | ||
330 | { | ||
331 | reason = unpacked["reason"].AsString(); | ||
332 | myipaddress = unpacked["your_ip"].AsString(); | ||
333 | return unpacked["success"].AsBoolean(); | ||
334 | } | ||
335 | } | ||
336 | |||
337 | reason = result["Message"] != null ? result["Message"].AsString() : "error"; | ||
338 | return false; | ||
339 | } | ||
340 | catch (Exception e) | ||
341 | { | ||
342 | m_log.Warn("[REMOTE SIMULATION CONNECTOR]: CreateAgent failed with exception: " + e.ToString()); | ||
343 | reason = e.Message; | ||
344 | } | ||
345 | |||
346 | return false; | ||
347 | } | ||
348 | } | 302 | } |
349 | } | 303 | } |