mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
|
||||
private bool GetBoolResponse(XmlRpcRequest request, out string reason)
|
||||
{
|
||||
//m_log.Debug("[HGrid]: Linking to " + uri);
|
||||
//m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);
|
||||
XmlRpcResponse response = null;
|
||||
try
|
||||
{
|
||||
@@ -366,14 +366,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server ");
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
|
||||
m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
return false;
|
||||
}
|
||||
@@ -383,15 +383,29 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
// m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
|
||||
try
|
||||
{
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
return false;
|
||||
}
|
||||
bool success = false;
|
||||
reason = string.Empty;
|
||||
Boolean.TryParse((string)hash["result"], out success);
|
||||
if (hash.ContainsKey("result"))
|
||||
Boolean.TryParse((string)hash["result"], out success);
|
||||
else
|
||||
{
|
||||
reason = "Internal error 2";
|
||||
m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL);
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace);
|
||||
m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response.");
|
||||
if (hash.ContainsKey("result") && hash["result"] != null)
|
||||
m_log.ErrorFormat("Reply was ", (string)hash["result"]);
|
||||
reason = "Exception: " + e.Message;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace OpenSim.Services.HypergridService
|
||||
throw new Exception(String.Format("No section GatekeeperService in config file"));
|
||||
|
||||
string accountService = serverConfig.GetString("UserAccountService", String.Empty);
|
||||
string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty);
|
||||
string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty);
|
||||
string gridService = serverConfig.GetString("GridService", String.Empty);
|
||||
string presenceService = serverConfig.GetString("PresenceService", String.Empty);
|
||||
string simulationService = serverConfig.GetString("SimulationService", String.Empty);
|
||||
@@ -283,18 +283,23 @@ namespace OpenSim.Services.HypergridService
|
||||
return false;
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { userURL };
|
||||
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin<IUserAgentService>(m_AuthDll, args);
|
||||
if (userAgentService != null)
|
||||
if (userURL == m_ExternalName)
|
||||
return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
|
||||
else
|
||||
{
|
||||
try
|
||||
Object[] args = new Object[] { userURL };
|
||||
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL);
|
||||
if (userAgentService != null)
|
||||
{
|
||||
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
|
||||
return false;
|
||||
try
|
||||
{
|
||||
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,9 +61,11 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
protected static IGridUserService m_GridUserService;
|
||||
protected static IGridService m_GridService;
|
||||
//protected static GatekeeperServiceConnector m_GatekeeperConnector;
|
||||
protected static GatekeeperServiceConnector m_GatekeeperConnector;
|
||||
protected static IGatekeeperService m_GatekeeperService;
|
||||
|
||||
protected static string m_GridName;
|
||||
|
||||
protected static bool m_BypassClientVerification;
|
||||
|
||||
public UserAgentService(IConfigSource config)
|
||||
@@ -90,8 +92,15 @@ namespace OpenSim.Services.HypergridService
|
||||
Object[] args = new Object[] { config };
|
||||
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
|
||||
m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
|
||||
//m_GatekeeperConnector = new GatekeeperServiceConnector();
|
||||
m_GatekeeperConnector = new GatekeeperServiceConnector();
|
||||
m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args);
|
||||
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
if (m_GridName == string.Empty)
|
||||
{
|
||||
serverConfig = config.Configs["GatekeeperService"];
|
||||
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +148,12 @@ namespace OpenSim.Services.HypergridService
|
||||
TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
|
||||
|
||||
//bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
|
||||
bool success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
||||
bool success = false;
|
||||
string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
|
||||
if (m_GridName == gridName)
|
||||
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
||||
else
|
||||
success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -179,7 +193,7 @@ namespace OpenSim.Services.HypergridService
|
||||
m_TravelingAgents[agentCircuit.SessionID] = travel;
|
||||
}
|
||||
travel.UserID = agentCircuit.AgentID;
|
||||
travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort;
|
||||
travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
|
||||
travel.ServiceToken = agentCircuit.ServiceSessionID;
|
||||
if (old != null)
|
||||
travel.ClientToken = old.ClientToken;
|
||||
@@ -215,6 +229,7 @@ namespace OpenSim.Services.HypergridService
|
||||
return false;
|
||||
|
||||
TravelingAgentInfo travel = m_TravelingAgents[sessionID];
|
||||
|
||||
return travel.GridExternalName == thisGridExternalName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user