diff options
Diffstat (limited to 'OpenSim/Services/HypergridService/UserAgentService.cs')
-rw-r--r-- | OpenSim/Services/HypergridService/UserAgentService.cs | 22 |
1 files changed, 14 insertions, 8 deletions
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; |