mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -87,6 +87,8 @@ namespace OpenSim.Services.HypergridService
|
||||
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
|
||||
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
|
||||
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/"))
|
||||
m_ExternalName = m_ExternalName + "/";
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||
@@ -118,7 +120,7 @@ namespace OpenSim.Services.HypergridService
|
||||
{
|
||||
regionID = UUID.Zero;
|
||||
regionHandle = 0;
|
||||
externalName = m_ExternalName;
|
||||
externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : "");
|
||||
imageURL = string.Empty;
|
||||
reason = string.Empty;
|
||||
|
||||
@@ -157,7 +159,7 @@ namespace OpenSim.Services.HypergridService
|
||||
string regionimage = "regionImage" + region.RegionID.ToString();
|
||||
regionimage = regionimage.Replace("-", "");
|
||||
|
||||
imageURL = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/index.php?method=" + regionimage;
|
||||
imageURL = region.ServerURI + "index.php?method=" + regionimage;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ namespace OpenSim.Services.HypergridService
|
||||
serverConfig = config.Configs["GatekeeperService"];
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
}
|
||||
else if (!m_GridName.EndsWith("/"))
|
||||
m_GridName = m_GridName + "/";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,23 +136,27 @@ namespace OpenSim.Services.HypergridService
|
||||
public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason)
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
|
||||
agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()),
|
||||
gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort);
|
||||
|
||||
agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI);
|
||||
// Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
|
||||
GridRegion region = new GridRegion(gatekeeper);
|
||||
region.ServerURI = gatekeeper.ServerURI;
|
||||
region.ExternalHostName = finalDestination.ExternalHostName;
|
||||
region.InternalEndPoint = finalDestination.InternalEndPoint;
|
||||
region.RegionName = finalDestination.RegionName;
|
||||
region.RegionID = finalDestination.RegionID;
|
||||
region.RegionLocX = finalDestination.RegionLocX;
|
||||
region.RegionLocY = finalDestination.RegionLocY;
|
||||
|
||||
// Generate a new service session
|
||||
agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random();
|
||||
agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random();
|
||||
TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
|
||||
|
||||
|
||||
bool success = false;
|
||||
string myExternalIP = string.Empty;
|
||||
string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
|
||||
string gridName = gatekeeper.ServerURI;
|
||||
|
||||
m_log.DebugFormat("[USER AGENT SERVICE]: m_grid - {0}, gn - {1}", m_GridName, gridName);
|
||||
|
||||
if (m_GridName == gridName)
|
||||
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
||||
else
|
||||
@@ -159,7 +165,7 @@ namespace OpenSim.Services.HypergridService
|
||||
if (!success)
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}",
|
||||
agentCircuit.firstname, agentCircuit.lastname, region.ExternalHostName + ":" + region.HttpPort, reason);
|
||||
agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason);
|
||||
|
||||
// restore the old travel info
|
||||
lock (m_TravelingAgents)
|
||||
@@ -210,7 +216,7 @@ namespace OpenSim.Services.HypergridService
|
||||
m_TravelingAgents[agentCircuit.SessionID] = travel;
|
||||
}
|
||||
travel.UserID = agentCircuit.AgentID;
|
||||
travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
|
||||
travel.GridExternalName = region.ServerURI;
|
||||
travel.ServiceToken = agentCircuit.ServiceSessionID;
|
||||
if (old != null)
|
||||
travel.ClientIPAddress = old.ClientIPAddress;
|
||||
|
||||
Reference in New Issue
Block a user