HG: avoid call on localhost between sim and UAS for standalone.

cpu-performance
Diva Canto 2013-06-22 08:26:59 -07:00
parent 4778d67005
commit ca3ce6da73
1 changed files with 20 additions and 1 deletions

View File

@ -53,8 +53,10 @@ 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;
protected bool m_RestrictAppearanceAbroad; protected bool m_RestrictAppearanceAbroad;
protected string m_AccountName; protected string m_AccountName;
@ -143,6 +145,14 @@ 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)
@ -194,7 +204,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
base.RegionLoaded(scene); base.RegionLoaded(scene);
if (m_Enabled) if (m_Enabled)
{
m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService);
m_UAS = scene.RequestModuleInterface<IUserAgentService>();
}
} }
public override void RemoveRegion(Scene scene) public override void RemoveRegion(Scene scene)
@ -272,7 +285,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (agentCircuit.ServiceURLs.ContainsKey("HomeURI")) if (agentCircuit.ServiceURLs.ContainsKey("HomeURI"))
{ {
string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); IUserAgentService connector;
if (userAgentDriver.Equals(m_ThisHomeURI) && m_UAS != null)
connector = m_UAS;
else
connector = new UserAgentServiceConnector(userAgentDriver);
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, false, out reason); bool success = connector.LoginAgentToGrid(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