29 using System.Collections;
31 using System.Reflection;
35 using OpenSim.Server.Base;
36 using OpenSim.Server.Handlers.Base;
37 using OpenSim.Services.Interfaces;
39 using OpenSim.Framework;
40 using OpenSim.Framework.Servers.HttpServer;
41 using OpenSim.Server.Handlers.Simulation;
45 using OpenMetaverse.StructuredData;
50 namespace OpenSim.Server.Handlers.Hypergrid
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
57 private string m_LoginServerIP;
62 m_UserAgentService = userAgentService;
63 m_LoginServerIP = loginServerIP;
74 base.UnpackData(args, d, request);
78 if (args.ContainsKey(
"gatekeeper_host") && args[
"gatekeeper_host"] != null)
79 data.
host = args[
"gatekeeper_host"].AsString();
80 if (args.ContainsKey(
"gatekeeper_port") && args[
"gatekeeper_port"] != null)
81 Int32.TryParse(args[
"gatekeeper_port"].AsString(), out data.port);
82 if (args.ContainsKey(
"gatekeeper_serveruri") && args[
"gatekeeper_serveruri"] != null)
83 data.gatekeeperServerURI = args[
"gatekeeper_serveruri"];
84 if (args.ContainsKey(
"destination_serveruri") && args[
"destination_serveruri"] != null)
85 data.destinationServerURI = args[
"destination_serveruri"];
88 catch (InvalidCastException)
90 m_log.ErrorFormat(
"[HOME AGENT HANDLER]: Bad cast in UnpackData");
93 string callerIP = GetCallerIP(request);
95 if (callerIP == m_LoginServerIP)
96 data.fromLogin =
true;
104 ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
106 gatekeeper.ServerURI = data.gatekeeperServerURI;
107 gatekeeper.ExternalHostName = data.host;
108 gatekeeper.HttpPort = (uint)data.
port;
109 gatekeeper.
InternalEndPoint =
new IPEndPoint(IPAddress.Parse(
"0.0.0.0"), 0);
114 m_log.WarnFormat(
"[HOME AGENT HANDLER]: Wrong data type");
123 return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason);
HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy)
override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request)
string destinationServerURI
IPEndPoint InternalEndPoint
OpenMetaverse.StructuredData.OSDMap OSDMap
override AgentDestinationData CreateAgentDestinationData()
string gatekeeperServerURI
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
OpenSim.Services.Interfaces.GridRegion GridRegion
override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, EntityTransferContext ctx, out string reason)
OpenSim.Server.Handlers.Simulation.Utils Utils
override GridRegion ExtractGatekeeper(AgentDestinationData d)