<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://osimdev.org/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenSimulator_Internals%2FConnector_Architecture%2FGatekeeper_Connector</id>
	<title>OpenSimulator Internals/Connector Architecture/Gatekeeper Connector - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://osimdev.org/wiki/index.php?action=history&amp;feed=atom&amp;title=OpenSimulator_Internals%2FConnector_Architecture%2FGatekeeper_Connector"/>
	<link rel="alternate" type="text/html" href="http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Connector_Architecture/Gatekeeper_Connector&amp;action=history"/>
	<updated>2026-08-04T15:31:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Connector_Architecture/Gatekeeper_Connector&amp;diff=80&amp;oldid=prev</id>
		<title>Jwbshaw: first</title>
		<link rel="alternate" type="text/html" href="http://osimdev.org/wiki/index.php?title=OpenSimulator_Internals/Connector_Architecture/Gatekeeper_Connector&amp;diff=80&amp;oldid=prev"/>
		<updated>2026-07-07T12:24:34Z</updated>

		<summary type="html">&lt;p&gt;first&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= OpenSimulator Internals/Connector Architecture/Gatekeeper Connector =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
GatekeeperServiceConnector is the client-side connector used to talk to a foreign grid&amp;#039;s GatekeeperService. It handles HG region linking, map tile retrieval, and region lookup. It extends SimulationServiceConnector, inheriting the agent and object transfer paths with overridden URL prefixes.&lt;br /&gt;
&lt;br /&gt;
Source file:&lt;br /&gt;
&lt;br /&gt;
 OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Inheritance ===&lt;br /&gt;
&lt;br /&gt;
Extends SimulationServiceConnector. Overrides:&lt;br /&gt;
* AgentPath() -- returns &amp;quot;foreignagent/&amp;quot; instead of &amp;quot;agent/&amp;quot;&lt;br /&gt;
* ObjectPath() -- returns &amp;quot;foreignobject/&amp;quot; instead of &amp;quot;object/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This means CreateAgent() from the parent sends to destination.ServerURI + &amp;quot;foreignagent/&amp;quot; + agentID + &amp;quot;/&amp;quot; when called through this connector.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Initialisation ===&lt;br /&gt;
&lt;br /&gt;
Two constructors:&lt;br /&gt;
* Default (no args) -- no asset service; GetMapImage() will return the default HG map tile UUID&lt;br /&gt;
* IAssetService argument -- asset service used by GetMapImage() to store downloaded map tiles&lt;br /&gt;
&lt;br /&gt;
No config file reading. The destination URI comes from GridRegion.ServerURI per call.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Transport ===&lt;br /&gt;
&lt;br /&gt;
All non-inherited methods use XML-RPC via Nwc.XmlRpc over HTTP POST to the gatekeeper&amp;#039;s ServerURI. 10-second timeout on all XML-RPC calls.&lt;br /&gt;
&lt;br /&gt;
Agent and object transfer methods are inherited from SimulationServiceConnector and use WebUtil OSD/REST.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== LinkRegion() ===&lt;br /&gt;
&lt;br /&gt;
 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle,&lt;br /&gt;
     out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY)&lt;br /&gt;
&lt;br /&gt;
XML-RPC method: &amp;quot;link_region&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Sends: region_name&lt;br /&gt;
&lt;br /&gt;
On success parses: uuid, handle (as ulong), region_image, external_name, size_x, size_y. All fields checked for null before parsing. Default sizeX/sizeY is Constants.RegionSize if not provided.&lt;br /&gt;
&lt;br /&gt;
Returns false on connection error, XML-RPC fault, or parse exception.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetMapImage() ===&lt;br /&gt;
&lt;br /&gt;
 public UUID GetMapImage(UUID regionID, string imageURL, string storagePath)&lt;br /&gt;
&lt;br /&gt;
Downloads and stores a foreign region&amp;#039;s map tile as an asset.&lt;br /&gt;
&lt;br /&gt;
Sequence:&lt;br /&gt;
# If no AssetService: returns m_HGMapImage (00000000-0000-1111-9999-000000000013) immediately&lt;br /&gt;
# Builds filename: storagePath + regionID + &amp;quot;.jpg&amp;quot;&lt;br /&gt;
# If file not on disk: downloads from imageURL via WebClient.DownloadFile()&lt;br /&gt;
# Opens as Bitmap, encodes to JPEG2000 via OpenJPEG.EncodeFromImage()&lt;br /&gt;
# Stores as AssetType.Texture with random UUID, name &amp;quot;region {regionID}&amp;quot;, creator = regionID&lt;br /&gt;
# Returns the stored asset UUID&lt;br /&gt;
&lt;br /&gt;
Exception handling: entire sequence wrapped in bare catch -- logs &amp;quot;probably already in the cache&amp;quot; and returns m_HGMapImage. This catches OpenJPEG p/invoke failures specifically (comment says &amp;quot;LEGIT&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
m_HGMapImage (00000000-0000-1111-9999-000000000013) is the fallback UUID returned on any failure.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetHyperlinkRegion() ===&lt;br /&gt;
&lt;br /&gt;
 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID, UUID agentID,&lt;br /&gt;
     string agentHomeURI, out string message)&lt;br /&gt;
&lt;br /&gt;
XML-RPC method: &amp;quot;get_region&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Sends: region_uuid; optionally agent_id and agent_home_uri if agentID is non-zero.&lt;br /&gt;
&lt;br /&gt;
On success parses full GridRegion: uuid, x, y, size_x, size_y, region_name, hostname, http_port, internal_port, server_uri. All fields null-checked before parsing.&lt;br /&gt;
&lt;br /&gt;
message handling:&lt;br /&gt;
* If hash[&amp;quot;message&amp;quot;] present: use it&lt;br /&gt;
* If success and no message: set message = null&lt;br /&gt;
* If failure and no message: set message = &amp;quot;The teleport destination could not be found.&amp;quot; (comment notes this is for old grids that don&amp;#039;t send message)&lt;br /&gt;
&lt;br /&gt;
Returns null on connection error, XML-RPC fault, parse exception, or result == false.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
* GetMapImage() uses the deprecated WebClient class for download. The comment &amp;quot;LEGIT&amp;quot; on the bare catch is the only documentation for why all exceptions are swallowed there.&lt;br /&gt;
* The fallback map tile UUID (00000000-0000-1111-9999-000000000013) is a static field -- the same UUID is returned for all failed map tile fetches regardless of region.&lt;br /&gt;
* Agent transfer uses &amp;quot;foreignagent/&amp;quot; path rather than &amp;quot;agent/&amp;quot; -- this is what distinguishes inbound HG agent traffic from local teleport traffic on the receiving simulator.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[OpenSimulator Internals/Connector Architecture]]&lt;br /&gt;
* [[OpenSimulator Internals/Connector Architecture/Simulation Connector]]&lt;br /&gt;
* [[OpenSimulator Internals/Connector Architecture/UserAgent Connector]]&lt;br /&gt;
* [[OpenSimulator Internals/Code Map/ROBUST/GatekeeperService]]&lt;/div&gt;</summary>
		<author><name>Jwbshaw</name></author>
	</entry>
</feed>