diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/HypergridService')
-rw-r--r-- | OpenSim/Services/HypergridService/GatekeeperService.cs | 6 | ||||
-rw-r--r-- | OpenSim/Services/HypergridService/UserAgentService.cs | 22 |
2 files changed, 18 insertions, 10 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 0aa5352..05be7b8 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -87,6 +87,8 @@ namespace OpenSim.Services.HypergridService | |||
87 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); | 87 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); |
88 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | 88 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); |
89 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); | 89 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); |
90 | if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) | ||
91 | m_ExternalName = m_ExternalName + "/"; | ||
90 | 92 | ||
91 | Object[] args = new Object[] { config }; | 93 | Object[] args = new Object[] { config }; |
92 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 94 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
@@ -118,7 +120,7 @@ namespace OpenSim.Services.HypergridService | |||
118 | { | 120 | { |
119 | regionID = UUID.Zero; | 121 | regionID = UUID.Zero; |
120 | regionHandle = 0; | 122 | regionHandle = 0; |
121 | externalName = m_ExternalName; | 123 | externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : ""); |
122 | imageURL = string.Empty; | 124 | imageURL = string.Empty; |
123 | reason = string.Empty; | 125 | reason = string.Empty; |
124 | 126 | ||
@@ -157,7 +159,7 @@ namespace OpenSim.Services.HypergridService | |||
157 | string regionimage = "regionImage" + region.RegionID.ToString(); | 159 | string regionimage = "regionImage" + region.RegionID.ToString(); |
158 | regionimage = regionimage.Replace("-", ""); | 160 | regionimage = regionimage.Replace("-", ""); |
159 | 161 | ||
160 | imageURL = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/index.php?method=" + regionimage; | 162 | imageURL = region.ServerURI + "index.php?method=" + regionimage; |
161 | 163 | ||
162 | return true; | 164 | return true; |
163 | } | 165 | } |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index eb6433c..3519250 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -101,6 +101,8 @@ namespace OpenSim.Services.HypergridService | |||
101 | serverConfig = config.Configs["GatekeeperService"]; | 101 | serverConfig = config.Configs["GatekeeperService"]; |
102 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); | 102 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); |
103 | } | 103 | } |
104 | else if (!m_GridName.EndsWith("/")) | ||
105 | m_GridName = m_GridName + "/"; | ||
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||
@@ -134,23 +136,27 @@ namespace OpenSim.Services.HypergridService | |||
134 | public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason) | 136 | public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason) |
135 | { | 137 | { |
136 | m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", | 138 | m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", |
137 | agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), | 139 | agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); |
138 | gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort); | ||
139 | |||
140 | // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination | 140 | // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination |
141 | GridRegion region = new GridRegion(gatekeeper); | 141 | GridRegion region = new GridRegion(gatekeeper); |
142 | region.ServerURI = gatekeeper.ServerURI; | ||
143 | region.ExternalHostName = finalDestination.ExternalHostName; | ||
144 | region.InternalEndPoint = finalDestination.InternalEndPoint; | ||
142 | region.RegionName = finalDestination.RegionName; | 145 | region.RegionName = finalDestination.RegionName; |
143 | region.RegionID = finalDestination.RegionID; | 146 | region.RegionID = finalDestination.RegionID; |
144 | region.RegionLocX = finalDestination.RegionLocX; | 147 | region.RegionLocX = finalDestination.RegionLocX; |
145 | region.RegionLocY = finalDestination.RegionLocY; | 148 | region.RegionLocY = finalDestination.RegionLocY; |
146 | 149 | ||
147 | // Generate a new service session | 150 | // Generate a new service session |
148 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); | 151 | agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random(); |
149 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); | 152 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); |
150 | 153 | ||
151 | bool success = false; | 154 | bool success = false; |
152 | string myExternalIP = string.Empty; | 155 | string myExternalIP = string.Empty; |
153 | string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; | 156 | string gridName = gatekeeper.ServerURI; |
157 | |||
158 | m_log.DebugFormat("[USER AGENT SERVICE]: m_grid - {0}, gn - {1}", m_GridName, gridName); | ||
159 | |||
154 | if (m_GridName == gridName) | 160 | if (m_GridName == gridName) |
155 | success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); | 161 | success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); |
156 | else | 162 | else |
@@ -159,7 +165,7 @@ namespace OpenSim.Services.HypergridService | |||
159 | if (!success) | 165 | if (!success) |
160 | { | 166 | { |
161 | m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}", | 167 | m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}", |
162 | agentCircuit.firstname, agentCircuit.lastname, region.ExternalHostName + ":" + region.HttpPort, reason); | 168 | agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason); |
163 | 169 | ||
164 | // restore the old travel info | 170 | // restore the old travel info |
165 | lock (m_TravelingAgents) | 171 | lock (m_TravelingAgents) |
@@ -210,7 +216,7 @@ namespace OpenSim.Services.HypergridService | |||
210 | m_TravelingAgents[agentCircuit.SessionID] = travel; | 216 | m_TravelingAgents[agentCircuit.SessionID] = travel; |
211 | } | 217 | } |
212 | travel.UserID = agentCircuit.AgentID; | 218 | travel.UserID = agentCircuit.AgentID; |
213 | travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; | 219 | travel.GridExternalName = region.ServerURI; |
214 | travel.ServiceToken = agentCircuit.ServiceSessionID; | 220 | travel.ServiceToken = agentCircuit.ServiceSessionID; |
215 | if (old != null) | 221 | if (old != null) |
216 | travel.ClientIPAddress = old.ClientIPAddress; | 222 | travel.ClientIPAddress = old.ClientIPAddress; |