In teleports, pass the source region to the destination (similar to an HTTP referrer)

0.8.0.3
Oren Hurvitz 2014-04-09 08:03:25 +03:00
parent cf1686335f
commit 06e0528d0b
18 changed files with 122 additions and 104 deletions

View File

@ -111,6 +111,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// </remarks>
private Stat m_interRegionTeleportFailures;
protected string m_ThisHomeURI;
protected bool m_Enabled = false;
public Scene Scene { get; private set; }
@ -207,6 +209,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
string transferVersionName = "SIMULATION";
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"];
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)
{
GridRegion source = new GridRegion(Scene.RegionInfo);
source.RawServerURI = m_ThisHomeURI;
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)
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
@ -2262,7 +2275,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
Thread.Sleep(500);
Scene scene = sp.Scene;
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
@ -2271,7 +2284,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
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)
{

View File

@ -53,7 +53,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private int m_levelHGTeleport = 0;
private string m_ThisHomeURI;
private GatekeeperServiceConnector m_GatekeeperConnector;
private IUserAgentService m_UAS;
@ -145,14 +144,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
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)
@ -296,7 +287,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
else
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
if (success)

View File

@ -205,7 +205,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
* 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)
{
@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
if (m_scenes.ContainsKey(destination.RegionID))
{
// 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;

View File

@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
* 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)
{
@ -172,13 +172,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
}
// Try local first
if (m_localBackend.CreateAgent(destination, aCircuit, teleportFlags, out reason))
if (m_localBackend.CreateAgent(source, destination, aCircuit, teleportFlags, out reason))
return true;
// else do the remote thing
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;
}

View File

@ -3382,12 +3382,13 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
/// <param name="agent">CircuitData of the agent who is connecting</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>
/// <returns>True if the region accepts this agent. False if it does not. False will
/// 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>
@ -3407,12 +3408,13 @@ namespace OpenSim.Region.Framework.Scenes
/// the LLUDP stack).
/// </remarks>
/// <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="requirePresenceLookup">True for normal presence. False for NPC
/// 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
/// 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 ||
(teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
@ -3431,7 +3433,7 @@ namespace OpenSim.Region.Framework.Scenes
// Don't disable this log message - it's too helpful
string curViewer = Util.GetViewerName(acd);
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,
(acd.child ? "child" : "root"),
acd.firstname,
@ -3441,7 +3443,8 @@ namespace OpenSim.Region.Framework.Scenes
acd.IPAddress,
curViewer,
((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)

View File

@ -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
// 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.
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.GetAgentCircuits().Count, Is.EqualTo(1));

View File

@ -61,9 +61,10 @@ namespace OpenSim.Server.Handlers.Hypergrid
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);
}
}
}

View File

@ -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);
}
}

View File

@ -307,13 +307,29 @@ namespace OpenSim.Server.Handlers.Simulation
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);
string reason = String.Empty;
// This is the meaning of POST agent
//m_regionClient.AdjustUserInformation(aCircuit);
//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["success"] = OSD.FromBoolean(result);
@ -387,9 +403,10 @@ namespace OpenSim.Server.Handlers.Simulation
}
// 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);
}
}

View File

@ -116,7 +116,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
// The Login service calls this interface with fromLogin=true
// Sims call it with fromLogin=false
// 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;
@ -138,56 +138,25 @@ namespace OpenSim.Services.Connectors.Hypergrid
Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI);
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
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_host"] = OSD.FromString(m_Gatekeeper.ExternalHostName);
args["gatekeeper_port"] = OSD.FromString(m_Gatekeeper.HttpPort.ToString());
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)
{
// no-op

View File

@ -79,22 +79,32 @@ namespace OpenSim.Services.Connectors.Simulation
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());
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());
if (source != null)
{
args["source_x"] = OSD.FromString(source.RegionLocX.ToString());
args["source_y"] = OSD.FromString(source.RegionLocY.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;
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);
reason = String.Empty;
@ -111,7 +121,7 @@ namespace OpenSim.Services.Connectors.Simulation
try
{
OSDMap args = aCircuit.PackAgentCircuitData();
PackData(args, aCircuit, destination, flags);
PackData(args, source, aCircuit, destination, flags);
OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
bool success = result["success"].AsBoolean();

View File

@ -230,16 +230,18 @@ namespace OpenSim.Services.HypergridService
}
#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;
string authURL = string.Empty;
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
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,
aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.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}. From region {11}",
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);
@ -428,9 +430,9 @@ namespace OpenSim.Services.HypergridService
// Preserve our TeleportFlags we have gathered so-far
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)

View File

@ -215,7 +215,7 @@ namespace OpenSim.Services.HypergridService
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}",
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);
if (m_GridName == gridName)
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
{
success = m_GatekeeperService.LoginAgent(source, agentCircuit, finalDestination, out reason);
}
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)
// Report them as nowhere
m_PresenceService.ReportAgent(agentCircuit.SessionID, UUID.Zero);
@ -307,10 +309,10 @@ namespace OpenSim.Services.HypergridService
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;
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)

View File

@ -142,7 +142,7 @@ namespace OpenSim.Services.Interfaces
public string ServerURI
{
get {
if ( m_serverURI != string.Empty ) {
if (!String.IsNullOrEmpty(m_serverURI)) {
return m_serverURI;
} else {
if (m_httpPort == 0)
@ -152,7 +152,7 @@ namespace OpenSim.Services.Interfaces
}
}
set {
if ( value.EndsWith("/") ) {
if (value.EndsWith("/")) {
m_serverURI = value;
} else {
m_serverURI = value + '/';
@ -161,6 +161,16 @@ namespace OpenSim.Services.Interfaces
}
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
{
get { return m_regionName; }

View File

@ -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>
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
{
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);
/// <summary>

View File

@ -53,11 +53,13 @@ namespace OpenSim.Services.Interfaces
/// <summary>
/// Ask the simulator hosting the destination to create an agent on that region.
/// </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="aCircuit"></param>
/// <param name="flags"></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>
/// Full child agent update.

View File

@ -905,13 +905,6 @@ namespace OpenSim.Services.LLLoginService
SetServiceURLs(aCircuit, account);
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)
@ -966,13 +959,13 @@ namespace OpenSim.Services.LLLoginService
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)
{
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 false;
}

View File

@ -548,7 +548,7 @@ namespace OpenSim.Tests.Common
string reason;
// 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);
// Stage 2: add the new client as a child agent to the scene