protected override void UnpackData(OSDMap args, AgentDestinationData d, string remoteAddress)
        {
            base.UnpackData(args, d, remoteAddress);
            ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;

            try
            {
                if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null)
                {
                    data.host = args["gatekeeper_host"].AsString();
                }
                if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
                {
                    Int32.TryParse(args["gatekeeper_port"].AsString(), out data.port);
                }
                if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] != null)
                {
                    data.gatekeeperServerURI = args["gatekeeper_serveruri"];
                }
                if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] != null)
                {
                    data.destinationServerURI = args["destination_serveruri"];
                }
            }
            catch (InvalidCastException)
            {
                m_log.ErrorFormat("[HOME AGENT HANDLER]: Bad cast in UnpackData");
            }

            // Verify if this call came from the login server
            if (remoteAddress == m_LoginServerIP)
            {
                data.fromLogin = true;
            }
        }
        protected override GridRegion ExtractGatekeeper(AgentDestinationData d)
        {
            if (d is ExtendedAgentDestinationData)
            {
                ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
                GridRegion gatekeeper             = new GridRegion();
                gatekeeper.ServerURI        = data.gatekeeperServerURI;
                gatekeeper.ExternalHostName = data.host;
                gatekeeper.HttpPort         = (uint)data.port;
                gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);

                return(gatekeeper);
            }
            else
            {
                m_log.WarnFormat("[HOME AGENT HANDLER]: Wrong data type");
            }

            return(null);
        }