In teleports, pass the source region to the destination (similar to an HTTP referrer)
parent
cf1686335f
commit
06e0528d0b
|
@ -111,6 +111,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private Stat m_interRegionTeleportFailures;
|
private Stat m_interRegionTeleportFailures;
|
||||||
|
|
||||||
|
protected string m_ThisHomeURI;
|
||||||
|
|
||||||
protected bool m_Enabled = false;
|
protected bool m_Enabled = false;
|
||||||
|
|
||||||
public Scene Scene { get; private set; }
|
public Scene Scene { get; private set; }
|
||||||
|
@ -207,6 +209,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
string transferVersionName = "SIMULATION";
|
string transferVersionName = "SIMULATION";
|
||||||
float maxTransferVersion = 0.2f;
|
float maxTransferVersion = 0.2f;
|
||||||
|
|
||||||
|
IConfig hypergridConfig = source.Configs["Hypergrid"];
|
||||||
|
if (hypergridConfig != null)
|
||||||
|
{
|
||||||
|
m_ThisHomeURI = hypergridConfig.GetString("HomeURI", string.Empty);
|
||||||
|
if (m_ThisHomeURI != string.Empty && !m_ThisHomeURI.EndsWith("/"))
|
||||||
|
m_ThisHomeURI += '/';
|
||||||
|
}
|
||||||
|
|
||||||
IConfig transferConfig = source.Configs["EntityTransfer"];
|
IConfig transferConfig = source.Configs["EntityTransfer"];
|
||||||
if (transferConfig != null)
|
if (transferConfig != null)
|
||||||
{
|
{
|
||||||
|
@ -1296,8 +1306,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
||||||
{
|
{
|
||||||
|
GridRegion source = new GridRegion(Scene.RegionInfo);
|
||||||
|
source.RawServerURI = m_ThisHomeURI;
|
||||||
|
|
||||||
logout = false;
|
logout = false;
|
||||||
bool success = Scene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
|
bool success = Scene.SimulationService.CreateAgent(source, finalDestination, agentCircuit, teleportFlags, out reason);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
|
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
|
||||||
|
@ -2271,7 +2284,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
string reason = String.Empty;
|
string reason = String.Empty;
|
||||||
|
|
||||||
bool regionAccepted = scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
|
bool regionAccepted = scene.SimulationService.CreateAgent(null, reg, a, (uint)TeleportFlags.Default, out reason);
|
||||||
|
|
||||||
if (regionAccepted && newAgent)
|
if (regionAccepted && newAgent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private int m_levelHGTeleport = 0;
|
private int m_levelHGTeleport = 0;
|
||||||
private string m_ThisHomeURI;
|
|
||||||
|
|
||||||
private GatekeeperServiceConnector m_GatekeeperConnector;
|
private GatekeeperServiceConnector m_GatekeeperConnector;
|
||||||
private IUserAgentService m_UAS;
|
private IUserAgentService m_UAS;
|
||||||
|
@ -145,14 +144,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
moduleConfig = source.Configs["Hypergrid"];
|
|
||||||
if (moduleConfig != null)
|
|
||||||
{
|
|
||||||
m_ThisHomeURI = moduleConfig.GetString("HomeURI", string.Empty);
|
|
||||||
if (m_ThisHomeURI != string.Empty && !m_ThisHomeURI.EndsWith("/"))
|
|
||||||
m_ThisHomeURI += '/';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddRegion(Scene scene)
|
public override void AddRegion(Scene scene)
|
||||||
|
@ -296,7 +287,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
else
|
else
|
||||||
connector = new UserAgentServiceConnector(userAgentDriver);
|
connector = new UserAgentServiceConnector(userAgentDriver);
|
||||||
|
|
||||||
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, false, out reason);
|
GridRegion source = new GridRegion(Scene.RegionInfo);
|
||||||
|
source.RawServerURI = m_ThisHomeURI;
|
||||||
|
|
||||||
|
bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason);
|
||||||
logout = success; // flag for later logout from this grid; this is an HG TP
|
logout = success; // flag for later logout from this grid; this is an HG TP
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
* Agent-related communications
|
* Agent-related communications
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
|
public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
|
||||||
{
|
{
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
{
|
{
|
||||||
|
@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
if (m_scenes.ContainsKey(destination.RegionID))
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
|
// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
|
||||||
return m_scenes[destination.RegionID].NewUserConnection(aCircuit, teleportFlags, out reason);
|
return m_scenes[destination.RegionID].NewUserConnection(aCircuit, teleportFlags, source, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
reason = "Did not find region " + destination.RegionName;
|
reason = "Did not find region " + destination.RegionName;
|
||||||
|
|
|
@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
* Agent-related communications
|
* Agent-related communications
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
|
public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
|
||||||
{
|
{
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
{
|
{
|
||||||
|
@ -172,13 +172,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try local first
|
// Try local first
|
||||||
if (m_localBackend.CreateAgent(destination, aCircuit, teleportFlags, out reason))
|
if (m_localBackend.CreateAgent(source, destination, aCircuit, teleportFlags, out reason))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// else do the remote thing
|
// else do the remote thing
|
||||||
if (!m_localBackend.IsLocalRegion(destination.RegionID))
|
if (!m_localBackend.IsLocalRegion(destination.RegionID))
|
||||||
{
|
{
|
||||||
return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
return m_remoteConnector.CreateAgent(source, destination, aCircuit, teleportFlags, out reason);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3382,12 +3382,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="agent">CircuitData of the agent who is connecting</param>
|
/// <param name="agent">CircuitData of the agent who is connecting</param>
|
||||||
/// <param name="teleportFlags"></param>
|
/// <param name="teleportFlags"></param>
|
||||||
|
/// <param name="source">Source region (may be null)</param>
|
||||||
/// <param name="reason">Outputs the reason for the false response on this string</param>
|
/// <param name="reason">Outputs the reason for the false response on this string</param>
|
||||||
/// <returns>True if the region accepts this agent. False if it does not. False will
|
/// <returns>True if the region accepts this agent. False if it does not. False will
|
||||||
/// also return a reason.</returns>
|
/// also return a reason.</returns>
|
||||||
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
|
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, GridRegion source, out string reason)
|
||||||
{
|
{
|
||||||
return NewUserConnection(agent, teleportFlags, out reason, true);
|
return NewUserConnection(agent, teleportFlags, source, out reason, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3407,12 +3408,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// the LLUDP stack).
|
/// the LLUDP stack).
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="acd">CircuitData of the agent who is connecting</param>
|
/// <param name="acd">CircuitData of the agent who is connecting</param>
|
||||||
|
/// <param name="source">Source region (may be null)</param>
|
||||||
/// <param name="reason">Outputs the reason for the false response on this string</param>
|
/// <param name="reason">Outputs the reason for the false response on this string</param>
|
||||||
/// <param name="requirePresenceLookup">True for normal presence. False for NPC
|
/// <param name="requirePresenceLookup">True for normal presence. False for NPC
|
||||||
/// or other applications where a full grid/Hypergrid presence may not be required.</param>
|
/// or other applications where a full grid/Hypergrid presence may not be required.</param>
|
||||||
/// <returns>True if the region accepts this agent. False if it does not. False will
|
/// <returns>True if the region accepts this agent. False if it does not. False will
|
||||||
/// also return a reason.</returns>
|
/// also return a reason.</returns>
|
||||||
public bool NewUserConnection(AgentCircuitData acd, uint teleportFlags, out string reason, bool requirePresenceLookup)
|
public bool NewUserConnection(AgentCircuitData acd, uint teleportFlags, GridRegion source, out string reason, bool requirePresenceLookup)
|
||||||
{
|
{
|
||||||
bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
|
bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
|
||||||
(teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
|
(teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
|
||||||
|
@ -3431,7 +3433,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Don't disable this log message - it's too helpful
|
// Don't disable this log message - it's too helpful
|
||||||
string curViewer = Util.GetViewerName(acd);
|
string curViewer = Util.GetViewerName(acd);
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})",
|
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9}. {10}",
|
||||||
RegionInfo.RegionName,
|
RegionInfo.RegionName,
|
||||||
(acd.child ? "child" : "root"),
|
(acd.child ? "child" : "root"),
|
||||||
acd.firstname,
|
acd.firstname,
|
||||||
|
@ -3441,7 +3443,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
acd.IPAddress,
|
acd.IPAddress,
|
||||||
curViewer,
|
curViewer,
|
||||||
((TPFlags)teleportFlags).ToString(),
|
((TPFlags)teleportFlags).ToString(),
|
||||||
acd.startpos
|
acd.startpos,
|
||||||
|
(source == null) ? "" : string.Format("From region {0} ({1}){2}", source.RegionName, source.RegionID, (source.RawServerURI == null) ? "" : " @ " + source.ServerURI)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!LoginsEnabled)
|
if (!LoginsEnabled)
|
||||||
|
|
|
@ -228,7 +228,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
// *** This is the first stage, when a neighbouring region is told that a viewer is about to try and
|
// *** This is the first stage, when a neighbouring region is told that a viewer is about to try and
|
||||||
// establish a child scene presence. We pass in the circuit code that the client has to connect with ***
|
// establish a child scene presence. We pass in the circuit code that the client has to connect with ***
|
||||||
// XXX: ViaLogin may not be correct here.
|
// XXX: ViaLogin may not be correct here.
|
||||||
scene.SimulationService.CreateAgent(region, acd, (uint)TeleportFlags.ViaLogin, out reason);
|
scene.SimulationService.CreateAgent(null, region, acd, (uint)TeleportFlags.ViaLogin, out reason);
|
||||||
|
|
||||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
|
||||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
|
||||||
|
|
|
@ -61,9 +61,10 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
m_Proxy = proxy;
|
m_Proxy = proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
|
protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
|
||||||
|
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
|
||||||
{
|
{
|
||||||
return m_GatekeeperService.LoginAgent(aCircuit, destination, out reason);
|
return m_GatekeeperService.LoginAgent(source, aCircuit, destination, out reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,9 +117,10 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
|
protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
|
||||||
|
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
|
||||||
{
|
{
|
||||||
return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, fromLogin, out reason);
|
return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,13 +307,29 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridRegion source = null;
|
||||||
|
|
||||||
|
if (args.ContainsKey("source_uuid"))
|
||||||
|
{
|
||||||
|
source = new GridRegion();
|
||||||
|
source.RegionLocX = Int32.Parse(args["source_x"].AsString());
|
||||||
|
source.RegionLocY = Int32.Parse(args["source_y"].AsString());
|
||||||
|
source.RegionName = args["source_name"].AsString();
|
||||||
|
source.RegionID = UUID.Parse(args["source_uuid"].AsString());
|
||||||
|
|
||||||
|
if (args.ContainsKey("source_server_uri"))
|
||||||
|
source.RawServerURI = args["source_server_uri"].AsString();
|
||||||
|
else
|
||||||
|
source.RawServerURI = null;
|
||||||
|
}
|
||||||
|
|
||||||
OSDMap resp = new OSDMap(2);
|
OSDMap resp = new OSDMap(2);
|
||||||
string reason = String.Empty;
|
string reason = String.Empty;
|
||||||
|
|
||||||
// This is the meaning of POST agent
|
// This is the meaning of POST agent
|
||||||
//m_regionClient.AdjustUserInformation(aCircuit);
|
//m_regionClient.AdjustUserInformation(aCircuit);
|
||||||
//bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
//bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
||||||
bool result = CreateAgent(gatekeeper, destination, aCircuit, data.flags, data.fromLogin, out reason);
|
bool result = CreateAgent(source, gatekeeper, destination, aCircuit, data.flags, data.fromLogin, out reason);
|
||||||
|
|
||||||
resp["reason"] = OSD.FromString(reason);
|
resp["reason"] = OSD.FromString(reason);
|
||||||
resp["success"] = OSD.FromBoolean(result);
|
resp["success"] = OSD.FromBoolean(result);
|
||||||
|
@ -387,9 +403,10 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
}
|
}
|
||||||
|
|
||||||
// subclasses can override this
|
// subclasses can override this
|
||||||
protected virtual bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
|
protected virtual bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
|
||||||
|
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
|
||||||
{
|
{
|
||||||
return m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
|
return m_SimulationService.CreateAgent(source, destination, aCircuit, teleportFlags, out reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
// The Login service calls this interface with fromLogin=true
|
// The Login service calls this interface with fromLogin=true
|
||||||
// Sims call it with fromLogin=false
|
// Sims call it with fromLogin=false
|
||||||
// Either way, this is verified by the handler
|
// Either way, this is verified by the handler
|
||||||
public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason)
|
public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason)
|
||||||
{
|
{
|
||||||
reason = String.Empty;
|
reason = String.Empty;
|
||||||
|
|
||||||
|
@ -138,56 +138,25 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI);
|
Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI);
|
||||||
|
|
||||||
uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome;
|
uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome;
|
||||||
return CreateAgent(home, aCircuit, flags, out reason);
|
return CreateAgent(source, home, aCircuit, flags, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The simulators call this interface
|
// The simulators call this interface
|
||||||
public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
|
public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
|
||||||
{
|
{
|
||||||
return LoginAgentToGrid(aCircuit, gatekeeper, destination, false, out reason);
|
return LoginAgentToGrid(source, aCircuit, gatekeeper, destination, false, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PackData(OSDMap args, AgentCircuitData aCircuit, GridRegion destination, uint flags)
|
protected override void PackData(OSDMap args, GridRegion source, AgentCircuitData aCircuit, GridRegion destination, uint flags)
|
||||||
{
|
{
|
||||||
base.PackData(args, aCircuit, destination, flags);
|
base.PackData(args, source, aCircuit, destination, flags);
|
||||||
args["gatekeeper_serveruri"] = OSD.FromString(m_Gatekeeper.ServerURI);
|
args["gatekeeper_serveruri"] = OSD.FromString(m_Gatekeeper.ServerURI);
|
||||||
args["gatekeeper_host"] = OSD.FromString(m_Gatekeeper.ExternalHostName);
|
args["gatekeeper_host"] = OSD.FromString(m_Gatekeeper.ExternalHostName);
|
||||||
args["gatekeeper_port"] = OSD.FromString(m_Gatekeeper.HttpPort.ToString());
|
args["gatekeeper_port"] = OSD.FromString(m_Gatekeeper.HttpPort.ToString());
|
||||||
args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
|
args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress)
|
|
||||||
{
|
|
||||||
OSDMap args = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
args = aCircuit.PackAgentCircuitData();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the input arguments
|
|
||||||
args["gatekeeper_serveruri"] = OSD.FromString(gatekeeper.ServerURI);
|
|
||||||
args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName);
|
|
||||||
args["gatekeeper_port"] = OSD.FromString(gatekeeper.HttpPort.ToString());
|
|
||||||
args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
|
|
||||||
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
|
|
||||||
args["destination_name"] = OSD.FromString(destination.RegionName);
|
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
|
||||||
args["destination_serveruri"] = OSD.FromString(destination.ServerURI);
|
|
||||||
|
|
||||||
// 10/3/2010
|
|
||||||
// I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here.
|
|
||||||
// This need cleaning elsewhere...
|
|
||||||
//if (ipaddress != null)
|
|
||||||
// args["client_ip"] = OSD.FromString(ipaddress.Address.ToString());
|
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetClientToken(UUID sessionID, string token)
|
public void SetClientToken(UUID sessionID, string token)
|
||||||
{
|
{
|
||||||
// no-op
|
// no-op
|
||||||
|
|
|
@ -79,22 +79,32 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
return "agent/";
|
return "agent/";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void PackData(OSDMap args, AgentCircuitData aCircuit, GridRegion destination, uint flags)
|
protected virtual void PackData(OSDMap args, GridRegion source, AgentCircuitData aCircuit, GridRegion destination, uint flags)
|
||||||
{
|
{
|
||||||
args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
|
if (source != null)
|
||||||
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
|
{
|
||||||
args["destination_name"] = OSD.FromString(destination.RegionName);
|
args["source_x"] = OSD.FromString(source.RegionLocX.ToString());
|
||||||
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
args["source_y"] = OSD.FromString(source.RegionLocY.ToString());
|
||||||
args["teleport_flags"] = OSD.FromString(flags.ToString());
|
args["source_name"] = OSD.FromString(source.RegionName);
|
||||||
|
args["source_uuid"] = OSD.FromString(source.RegionID.ToString());
|
||||||
|
if (!String.IsNullOrEmpty(source.RawServerURI))
|
||||||
|
args["source_server_uri"] = OSD.FromString(source.RawServerURI);
|
||||||
|
}
|
||||||
|
|
||||||
|
args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
|
||||||
|
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
|
||||||
|
args["destination_name"] = OSD.FromString(destination.RegionName);
|
||||||
|
args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
|
||||||
|
args["teleport_flags"] = OSD.FromString(flags.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
|
public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
|
||||||
{
|
{
|
||||||
string tmp = String.Empty;
|
string tmp = String.Empty;
|
||||||
return CreateAgent(destination, aCircuit, flags, out tmp, out reason);
|
return CreateAgent(source, destination, aCircuit, flags, out tmp, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
|
public bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI);
|
m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI);
|
||||||
reason = String.Empty;
|
reason = String.Empty;
|
||||||
|
@ -111,7 +121,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OSDMap args = aCircuit.PackAgentCircuitData();
|
OSDMap args = aCircuit.PackAgentCircuitData();
|
||||||
PackData(args, aCircuit, destination, flags);
|
PackData(args, source, aCircuit, destination, flags);
|
||||||
|
|
||||||
OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
|
OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
|
||||||
bool success = result["success"].AsBoolean();
|
bool success = result["success"].AsBoolean();
|
||||||
|
|
|
@ -230,16 +230,18 @@ namespace OpenSim.Services.HypergridService
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Login Agent
|
#region Login Agent
|
||||||
public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason)
|
public bool LoginAgent(GridRegion source, AgentCircuitData aCircuit, GridRegion destination, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
|
|
||||||
string authURL = string.Empty;
|
string authURL = string.Empty;
|
||||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
authURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||||
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9} Teleport Flags {10}",
|
|
||||||
aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName,
|
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login request for {0} {1} @ {2} ({3}) at {4} using viewer {5}, channel {6}, IP {7}, Mac {8}, Id0 {9}, Teleport Flags: {10}. From region {11}",
|
||||||
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString());
|
aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionID,
|
||||||
|
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, (TeleportFlags)aCircuit.teleportFlags,
|
||||||
|
(source == null) ? "Unknown" : string.Format("{0} ({1}){2}", source.RegionName, source.RegionID, (source.RawServerURI == null) ? "" : " @ " + source.ServerURI));
|
||||||
|
|
||||||
string curViewer = Util.GetViewerName(aCircuit);
|
string curViewer = Util.GetViewerName(aCircuit);
|
||||||
|
|
||||||
|
@ -428,9 +430,9 @@ namespace OpenSim.Services.HypergridService
|
||||||
// Preserve our TeleportFlags we have gathered so-far
|
// Preserve our TeleportFlags we have gathered so-far
|
||||||
loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
|
loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
|
||||||
|
|
||||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0} {1}", aCircuit.Name, loginFlag);
|
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag);
|
||||||
|
|
||||||
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
|
return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool Authenticate(AgentCircuitData aCircuit)
|
protected bool Authenticate(AgentCircuitData aCircuit)
|
||||||
|
|
|
@ -215,7 +215,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
return home;
|
return home;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason)
|
public bool LoginAgentToGrid(GridRegion source, AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
|
m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
|
||||||
agentCircuit.firstname, agentCircuit.lastname, (fromLogin ? agentCircuit.IPAddress : "stored IP"), gatekeeper.ServerURI);
|
agentCircuit.firstname, agentCircuit.lastname, (fromLogin ? agentCircuit.IPAddress : "stored IP"), gatekeeper.ServerURI);
|
||||||
|
@ -274,10 +274,12 @@ namespace OpenSim.Services.HypergridService
|
||||||
m_log.DebugFormat("[USER AGENT SERVICE]: this grid: {0}, desired grid: {1}, desired region: {2}", m_GridName, gridName, region.RegionID);
|
m_log.DebugFormat("[USER AGENT SERVICE]: this grid: {0}, desired grid: {1}, desired region: {2}", m_GridName, gridName, region.RegionID);
|
||||||
|
|
||||||
if (m_GridName == gridName)
|
if (m_GridName == gridName)
|
||||||
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
{
|
||||||
|
success = m_GatekeeperService.LoginAgent(source, agentCircuit, finalDestination, out reason);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out myExternalIP, out reason);
|
success = m_GatekeeperConnector.CreateAgent(source, region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out myExternalIP, out reason);
|
||||||
if (success)
|
if (success)
|
||||||
// Report them as nowhere
|
// Report them as nowhere
|
||||||
m_PresenceService.ReportAgent(agentCircuit.SessionID, UUID.Zero);
|
m_PresenceService.ReportAgent(agentCircuit.SessionID, UUID.Zero);
|
||||||
|
@ -307,10 +309,10 @@ namespace OpenSim.Services.HypergridService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, out string reason)
|
public bool LoginAgentToGrid(GridRegion source, AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
return LoginAgentToGrid(agentCircuit, gatekeeper, finalDestination, false, out reason);
|
return LoginAgentToGrid(source, agentCircuit, gatekeeper, finalDestination, false, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
TravelingAgentInfo CreateTravelInfo(AgentCircuitData agentCircuit, GridRegion region, bool fromLogin, out TravelingAgentInfo existing)
|
TravelingAgentInfo CreateTravelInfo(AgentCircuitData agentCircuit, GridRegion region, bool fromLogin, out TravelingAgentInfo existing)
|
||||||
|
|
|
@ -142,7 +142,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
public string ServerURI
|
public string ServerURI
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
if ( m_serverURI != string.Empty ) {
|
if (!String.IsNullOrEmpty(m_serverURI)) {
|
||||||
return m_serverURI;
|
return m_serverURI;
|
||||||
} else {
|
} else {
|
||||||
if (m_httpPort == 0)
|
if (m_httpPort == 0)
|
||||||
|
@ -152,7 +152,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if ( value.EndsWith("/") ) {
|
if (value.EndsWith("/")) {
|
||||||
m_serverURI = value;
|
m_serverURI = value;
|
||||||
} else {
|
} else {
|
||||||
m_serverURI = value + '/';
|
m_serverURI = value + '/';
|
||||||
|
@ -161,6 +161,16 @@ namespace OpenSim.Services.Interfaces
|
||||||
}
|
}
|
||||||
protected string m_serverURI;
|
protected string m_serverURI;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides direct access to the 'm_serverURI' field, without returning a generated URL if m_serverURI is missing.
|
||||||
|
/// </summary>
|
||||||
|
public string RawServerURI
|
||||||
|
{
|
||||||
|
get { return m_serverURI; }
|
||||||
|
set { m_serverURI = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public string RegionName
|
public string RegionName
|
||||||
{
|
{
|
||||||
get { return m_regionName; }
|
get { return m_regionName; }
|
||||||
|
|
|
@ -52,13 +52,14 @@ namespace OpenSim.Services.Interfaces
|
||||||
/// <returns>The region the visitor should enter, or null if no region can be found / is allowed</returns>
|
/// <returns>The region the visitor should enter, or null if no region can be found / is allowed</returns>
|
||||||
GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message);
|
GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message);
|
||||||
|
|
||||||
bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
|
bool LoginAgent(GridRegion source, AgentCircuitData aCircuit, GridRegion destination, out string reason);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IUserAgentService
|
public interface IUserAgentService
|
||||||
{
|
{
|
||||||
bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason);
|
bool LoginAgentToGrid(GridRegion source, AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason);
|
||||||
|
|
||||||
void LogoutAgent(UUID userID, UUID sessionID);
|
void LogoutAgent(UUID userID, UUID sessionID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -53,11 +53,13 @@ namespace OpenSim.Services.Interfaces
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ask the simulator hosting the destination to create an agent on that region.
|
/// Ask the simulator hosting the destination to create an agent on that region.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="source">The region that the user is coming from. Will be null if the user
|
||||||
|
/// logged-in directly, or arrived from a simulator that doesn't send this parameter.</param>
|
||||||
/// <param name="destination"></param>
|
/// <param name="destination"></param>
|
||||||
/// <param name="aCircuit"></param>
|
/// <param name="aCircuit"></param>
|
||||||
/// <param name="flags"></param>
|
/// <param name="flags"></param>
|
||||||
/// <param name="reason">Reason message in the event of a failure.</param>
|
/// <param name="reason">Reason message in the event of a failure.</param>
|
||||||
bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason);
|
bool CreateAgent(GridRegion source, GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Full child agent update.
|
/// Full child agent update.
|
||||||
|
|
|
@ -905,13 +905,6 @@ namespace OpenSim.Services.LLLoginService
|
||||||
SetServiceURLs(aCircuit, account);
|
SetServiceURLs(aCircuit, account);
|
||||||
|
|
||||||
return aCircuit;
|
return aCircuit;
|
||||||
|
|
||||||
//m_UserAgentService.LoginAgentToGrid(aCircuit, GatekeeperServiceConnector, region, out reason);
|
|
||||||
//if (simConnector.CreateAgent(region, aCircuit, 0, out reason))
|
|
||||||
// return aCircuit;
|
|
||||||
|
|
||||||
//return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetServiceURLs(AgentCircuitData aCircuit, UserAccount account)
|
private void SetServiceURLs(AgentCircuitData aCircuit, UserAccount account)
|
||||||
|
@ -966,13 +959,13 @@ namespace OpenSim.Services.LLLoginService
|
||||||
|
|
||||||
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
|
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
|
||||||
{
|
{
|
||||||
return simConnector.CreateAgent(region, aCircuit, (uint)flags, out reason);
|
return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
|
private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
|
||||||
{
|
{
|
||||||
m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
|
m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
|
||||||
if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, true, out reason))
|
if (m_UserAgentService.LoginAgentToGrid(null, aCircuit, gatekeeper, destination, true, out reason))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,7 +548,7 @@ namespace OpenSim.Tests.Common
|
||||||
string reason;
|
string reason;
|
||||||
|
|
||||||
// Stage 1: tell the scene to expect a new user connection
|
// Stage 1: tell the scene to expect a new user connection
|
||||||
if (!scene.NewUserConnection(agentData, (uint)tf, out reason))
|
if (!scene.NewUserConnection(agentData, (uint)tf, null, out reason))
|
||||||
Console.WriteLine("NewUserConnection failed: " + reason);
|
Console.WriteLine("NewUserConnection failed: " + reason);
|
||||||
|
|
||||||
// Stage 2: add the new client as a child agent to the scene
|
// Stage 2: add the new client as a child agent to the scene
|
||||||
|
|
Loading…
Reference in New Issue