aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2010-01-27 08:00:29 -0800
committerDiva Canto2010-01-27 08:00:29 -0800
commit7c00469cd210cfdda3dd835867469159d4c8b9d9 (patch)
tree11dc9aa7d60ce0067c44d37ec3a0638753441cb7
parentAdded image for hyperlink map tiles. (diff)
downloadopensim-SC-7c00469cd210cfdda3dd835867469159d4c8b9d9.zip
opensim-SC-7c00469cd210cfdda3dd835867469159d4c8b9d9.tar.gz
opensim-SC-7c00469cd210cfdda3dd835867469159d4c8b9d9.tar.bz2
opensim-SC-7c00469cd210cfdda3dd835867469159d4c8b9d9.tar.xz
Added ExternalName config on Gatekeeper.
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs9
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs1
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs4
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs7
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs18
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs5
-rw-r--r--OpenSim/Services/Interfaces/IGatekeeperService.cs2
-rw-r--r--bin/config-include/StandaloneHypergrid.ini2
8 files changed, 39 insertions, 9 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index f2f0a53..142ca2c 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -97,6 +97,12 @@ namespace OpenSim.Framework
97 public UUID SessionID; 97 public UUID SessionID;
98 98
99 /// <summary> 99 /// <summary>
100 /// Hypergrid service token; generated by the user domain, consumed by the receiving grid.
101 /// There is one such unique token for each grid visited.
102 /// </summary>
103 public string ServiceSessionID = string.Empty;
104
105 /// <summary>
100 /// Position the Agent's Avatar starts in the region 106 /// Position the Agent's Avatar starts in the region
101 /// </summary> 107 /// </summary>
102 public Vector3 startpos; 108 public Vector3 startpos;
@@ -156,6 +162,7 @@ namespace OpenSim.Framework
156 args["inventory_folder"] = OSD.FromUUID(InventoryFolder); 162 args["inventory_folder"] = OSD.FromUUID(InventoryFolder);
157 args["secure_session_id"] = OSD.FromUUID(SecureSessionID); 163 args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
158 args["session_id"] = OSD.FromUUID(SessionID); 164 args["session_id"] = OSD.FromUUID(SessionID);
165 args["service_session_id"] = OSD.FromString(ServiceSessionID);
159 args["start_pos"] = OSD.FromString(startpos.ToString()); 166 args["start_pos"] = OSD.FromString(startpos.ToString());
160 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); 167 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
161 168
@@ -253,6 +260,8 @@ namespace OpenSim.Framework
253 SecureSessionID = args["secure_session_id"].AsUUID(); 260 SecureSessionID = args["secure_session_id"].AsUUID();
254 if (args["session_id"] != null) 261 if (args["session_id"] != null)
255 SessionID = args["session_id"].AsUUID(); 262 SessionID = args["session_id"].AsUUID();
263 if (args["service_session_id"] != null)
264 ServiceSessionID = args["service_session_id"].AsString();
256 if (args["start_pos"] != null) 265 if (args["start_pos"] != null)
257 Vector3.TryParse(args["start_pos"].AsString(), out startpos); 266 Vector3.TryParse(args["start_pos"].AsString(), out startpos);
258 267
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index a1de57a..4d5844c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -157,6 +157,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
157 if (security != null) 157 if (security != null)
158 security.SetEndPoint(sp.ControllingClient.SessionId, sp.ControllingClient.RemoteEndPoint); 158 security.SetEndPoint(sp.ControllingClient.SessionId, sp.ControllingClient.RemoteEndPoint);
159 159
160 //string token = sp.Scene.AuthenticationService.MakeToken(sp.UUID, reg.ExternalHostName + ":" + reg.HttpPort, 30);
160 // Log them out of this grid 161 // Log them out of this grid
161 sp.Scene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat); 162 sp.Scene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat);
162 163
diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
index 846d1c2..7d31730 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
@@ -63,17 +63,19 @@ namespace OpenSim.Server.Handlers.Hypergrid
63 string name = (string)requestData["region_name"]; 63 string name = (string)requestData["region_name"];
64 64
65 UUID regionID = UUID.Zero; 65 UUID regionID = UUID.Zero;
66 string externalName = string.Empty;
66 string imageURL = string.Empty; 67 string imageURL = string.Empty;
67 ulong regionHandle = 0; 68 ulong regionHandle = 0;
68 string reason = string.Empty; 69 string reason = string.Empty;
69 70
70 bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out imageURL, out reason); 71 bool success = m_GatekeeperService.LinkRegion(name, out regionID, out regionHandle, out externalName, out imageURL, out reason);
71 72
72 Hashtable hash = new Hashtable(); 73 Hashtable hash = new Hashtable();
73 hash["result"] = success.ToString(); 74 hash["result"] = success.ToString();
74 hash["uuid"] = regionID.ToString(); 75 hash["uuid"] = regionID.ToString();
75 hash["handle"] = regionHandle.ToString(); 76 hash["handle"] = regionHandle.ToString();
76 hash["region_image"] = imageURL; 77 hash["region_image"] = imageURL;
78 hash["external_name"] = externalName;
77 79
78 XmlRpcResponse response = new XmlRpcResponse(); 80 XmlRpcResponse response = new XmlRpcResponse();
79 response.Value = hash; 81 response.Value = hash;
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index ae0a0b6..5ad1af2 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -45,11 +45,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
45 return "/foreignobject/"; 45 return "/foreignobject/";
46 } 46 }
47 47
48 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string imageURL, out string reason) 48 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason)
49 { 49 {
50 regionID = UUID.Zero; 50 regionID = UUID.Zero;
51 imageURL = string.Empty; 51 imageURL = string.Empty;
52 realHandle = 0; 52 realHandle = 0;
53 externalName = string.Empty;
53 reason = string.Empty; 54 reason = string.Empty;
54 55
55 Hashtable hash = new Hashtable(); 56 Hashtable hash = new Hashtable();
@@ -97,9 +98,9 @@ namespace OpenSim.Services.Connectors.Hypergrid
97 //m_log.Debug(">> HERE, realHandle: " + realHandle); 98 //m_log.Debug(">> HERE, realHandle: " + realHandle);
98 } 99 }
99 if (hash["region_image"] != null) 100 if (hash["region_image"] != null)
100 {
101 imageURL = (string)hash["region_image"]; 101 imageURL = (string)hash["region_image"];
102 } 102 if (hash["external_name"] != null)
103 externalName = (string)hash["external_name"];
103 } 104 }
104 105
105 } 106 }
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 1289cf6..cda7dae 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -214,8 +214,9 @@ namespace OpenSim.Services.GridService
214 // Finally, link it 214 // Finally, link it
215 ulong handle = 0; 215 ulong handle = 0;
216 UUID regionID = UUID.Zero; 216 UUID regionID = UUID.Zero;
217 string externalName = string.Empty;
217 string imageURL = string.Empty; 218 string imageURL = string.Empty;
218 if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out imageURL, out reason)) 219 if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason))
219 return false; 220 return false;
220 221
221 if (regionID != UUID.Zero) 222 if (regionID != UUID.Zero)
@@ -229,11 +230,22 @@ namespace OpenSim.Services.GridService
229 } 230 }
230 231
231 regInfo.RegionID = regionID; 232 regInfo.RegionID = regionID;
233 Uri uri = null;
234 try
235 {
236 uri = new Uri(externalName);
237 regInfo.ExternalHostName = uri.Host;
238 regInfo.HttpPort = (uint)uri.Port;
239 }
240 catch
241 {
242 m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName);
243 }
232 regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName; 244 regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName;
233 // Try get the map image 245 // Try get the map image
234 regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); 246 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
235 // I need a texture that works for this... the one I tried doesn't seem to be working 247 // I need a texture that works for this... the one I tried doesn't seem to be working
236 //regInfo.TerrainImage = m_HGMapImage; 248 regInfo.TerrainImage = m_HGMapImage;
237 249
238 AddHyperlinkRegion(regInfo, handle); 250 AddHyperlinkRegion(regInfo, handle);
239 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); 251 m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID);
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 283ab3e..3cb5d50 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Services.HypergridService
59 59
60 UUID m_ScopeID; 60 UUID m_ScopeID;
61 bool m_AllowTeleportsToAnyRegion; 61 bool m_AllowTeleportsToAnyRegion;
62 string m_ExternalName;
62 GridRegion m_DefaultGatewayRegion; 63 GridRegion m_DefaultGatewayRegion;
63 64
64 public GatekeeperService(IConfigSource config, ISimulationService simService) 65 public GatekeeperService(IConfigSource config, ISimulationService simService)
@@ -83,6 +84,7 @@ namespace OpenSim.Services.HypergridService
83 UUID.TryParse(scope, out m_ScopeID); 84 UUID.TryParse(scope, out m_ScopeID);
84 //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); 85 //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
85 m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); 86 m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
87 m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
86 88
87 Object[] args = new Object[] { config }; 89 Object[] args = new Object[] { config };
88 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); 90 m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
@@ -109,10 +111,11 @@ namespace OpenSim.Services.HypergridService
109 { 111 {
110 } 112 }
111 113
112 public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason) 114 public bool LinkRegion(string regionName, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason)
113 { 115 {
114 regionID = UUID.Zero; 116 regionID = UUID.Zero;
115 regionHandle = 0; 117 regionHandle = 0;
118 externalName = m_ExternalName;
116 imageURL = string.Empty; 119 imageURL = string.Empty;
117 reason = string.Empty; 120 reason = string.Empty;
118 121
diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs
index 5b5c9d1..f8eb817 100644
--- a/OpenSim/Services/Interfaces/IGatekeeperService.cs
+++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Services.Interfaces
36{ 36{
37 public interface IGatekeeperService 37 public interface IGatekeeperService
38 { 38 {
39 bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string imageURL, out string reason); 39 bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
40 GridRegion GetHyperlinkRegion(UUID regionID); 40 GridRegion GetHyperlinkRegion(UUID regionID);
41 41
42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); 42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini
index 0be7bab..98e37e3 100644
--- a/bin/config-include/StandaloneHypergrid.ini
+++ b/bin/config-include/StandaloneHypergrid.ini
@@ -83,6 +83,8 @@
83 PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" 83 PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
84 GridService = "OpenSim.Services.GridService.dll:GridService" 84 GridService = "OpenSim.Services.GridService.dll:GridService"
85 AuthenticationService = "OpenSim.Services.Connectors.dll:AuthenticationServicesConnector" 85 AuthenticationService = "OpenSim.Services.Connectors.dll:AuthenticationServicesConnector"
86 ; how does the outside world reach me? This acts as public key too.
87 ExternalName = "http://127.0.0.1:9000"
86 88
87[HGEntityTransferModule] 89[HGEntityTransferModule]
88 HomeUsersSecurityService = "OpenSim.Services.HypergridService.dll:HomeUsersSecurityService" 90 HomeUsersSecurityService = "OpenSim.Services.HypergridService.dll:HomeUsersSecurityService"