public GatekeeperAgentHandler(IGatekeeperService gatekeeper, ISimulationService service, bool proxy)
     : base("POST", "/foreignagent")
 {
     m_SimulationService = service;
     m_GatekeeperService = gatekeeper;
     m_Proxy = proxy;
 }
        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("GatekeeperInHandler", "") != Name)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("GatekeeperInHandlerPort"));
            m_GatekeeperService = registry.RequestModuleInterface<IGatekeeperService>();
            IConfig gridConfig = config.Configs["GatekeeperService"];

            m_Proxy = gridConfig.GetBoolean("HasProxy", false);

            HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService);
            server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false);
            server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false);

            server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy).Handler);
        }
        public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) :
                base(config, server, String.Empty)
        {
            IConfig gridConfig = config.Configs["GatekeeperService"];
            if (gridConfig != null)
            {
                string serviceDll = gridConfig.GetString("LocalServiceModule", string.Empty);
                Object[] args = new Object[] { config, simService };
                m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(serviceDll, args);

            }
            if (m_GatekeeperService == null)
                throw new Exception("Gatekeeper server connector cannot proceed because of missing service");

            HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService);
            server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false);
            server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false);

            server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService).Handler);
        }
 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy)
 {
     m_GatekeeperService = gatekeeper;
     m_Proxy = proxy;
 }
 public HypergridHandlers(IGatekeeperService gatekeeper)
 {
     m_GatekeeperService = gatekeeper;
     m_log.DebugFormat("[HYPERGRID HANDLERS]: Active");
 }
        public UserAgentService(IConfigSource config)
        {
            if (!m_Initialized)
            {
                m_Initialized = true;

                m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");
                
                IConfig serverConfig = config.Configs["UserAgentService"];
                if (serverConfig == null)
                    throw new Exception(String.Format("No section UserAgentService in config file"));

                string gridService = serverConfig.GetString("GridService", String.Empty);
                string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
                string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty);

                m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);

                if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
                    throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));

                Object[] args = new Object[] { config };
                m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
                m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
                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);
                }
                if (!m_GridName.EndsWith("/"))
                    m_GridName = m_GridName + "/";
            }
        }
 public void FinishedStartup()
 {
     if (m_registry == null)
         return;//Not enabled
     m_GridService = m_registry.RequestModuleInterface<IGridService> ();
     m_asyncPostService = m_registry.RequestModuleInterface<IAsyncMessagePostService> ();
     m_GatekeeperConnector = new GatekeeperServiceConnector (m_registry.RequestModuleInterface<IAssetService> ());
     m_GatekeeperService = m_registry.RequestModuleInterface<IGatekeeperService> ();
     m_FriendsService = m_registry.RequestModuleInterface<IFriendsService> ();
     m_PresenceService = m_registry.RequestModuleInterface<IAgentInfoService> ();
     m_UserAccountService = m_registry.RequestModuleInterface<IUserAccountService> ();
 }
 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy)
 {
     m_GatekeeperService = gatekeeper;
     m_Proxy             = proxy;
 }
 public void PostStart(IConfigSource config, IRegistryCore registry)
 {
     m_GridService = registry.RequestModuleInterface<IGridService>();
     m_GridUserService = registry.RequestModuleInterface<IGridUserService>();
     m_GatekeeperConnector = new GatekeeperServiceConnector();
     m_GatekeeperService = registry.RequestModuleInterface<IGatekeeperService>();
 }
 public HypergridHandlers(IGatekeeperService gatekeeper)
 {
     m_GatekeeperService = gatekeeper;
     MainConsole.Instance.DebugFormat ("[HYPERGRID HANDLERS]: Active");
 }
 public GatekeeperAgentHandler(IGatekeeperService gatekeeper)
 {
     m_GatekeeperService = gatekeeper;
 }
 public HypergridHandlers(IGatekeeperService gatekeeper)
 {
     m_GatekeeperService = gatekeeper;
     m_log.DebugFormat("[HYPERGRID HANDLERS]: Active");
 }
Exemple #13
0
 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy) : base("/foreignagent")
 {
     m_GatekeeperService = gatekeeper;
     m_Proxy             = proxy;
 }
Exemple #14
0
        public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector)
        {
            // Let's set this always, because we don't know the sequence
            // of instantiations
            if (friendsConnector != null)
                m_FriendsLocalSimConnector = friendsConnector;

            if (!m_Initialized)
            {
                m_Initialized = true;

                m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");

                m_FriendsSimConnector = new FriendsSimConnector();

                IConfig serverConfig = config.Configs["UserAgentService"];
                if (serverConfig == null)
                    throw new Exception(String.Format("No section UserAgentService in config file"));

                string gridService = serverConfig.GetString("GridService", String.Empty);
                string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
                string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty);
                string friendsService = serverConfig.GetString("FriendsService", String.Empty);
                string presenceService = serverConfig.GetString("PresenceService", String.Empty);
                string userAccountService = serverConfig.GetString("UserAccountService", String.Empty);

                m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);

                if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
                    throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));

                Object[] args = new Object[] { config };
                m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
                m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
                m_GatekeeperConnector = new GatekeeperServiceConnector();
                m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args);
                m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
                m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
                m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountService, args);

                m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0);

                LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed");
                LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions);
                LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions);

                m_GridName = serverConfig.GetString("ExternalName", string.Empty);
                if (m_GridName == string.Empty)
                {
                    serverConfig = config.Configs["GatekeeperService"];
                    m_GridName = serverConfig.GetString("ExternalName", string.Empty);
                }
                if (!m_GridName.EndsWith("/"))
                    m_GridName = m_GridName + "/";

            }
        }
 public HypergridHandlers(IGatekeeperService gatekeeper)
 {
     m_GatekeeperService = gatekeeper;
 }
Exemple #16
0
 public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy) : base("/foreignagent")
 {
     m_GatekeeperService = gatekeeper;
     m_Proxy = proxy;
 }
        public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector)
            : base(config)
        {
            // Let's set this always, because we don't know the sequence
            // of instantiations
            if (friendsConnector != null)
            {
                m_FriendsLocalSimConnector = friendsConnector;
            }

            if (!m_Initialized)
            {
                m_Initialized = true;

                m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");

                m_FriendsSimConnector = new FriendsSimConnector();

                IConfig serverConfig = config.Configs["UserAgentService"];
                if (serverConfig == null)
                {
                    throw new Exception(String.Format("No section UserAgentService in config file"));
                }

                string gridService        = serverConfig.GetString("GridService", String.Empty);
                string gridUserService    = serverConfig.GetString("GridUserService", String.Empty);
                string gatekeeperService  = serverConfig.GetString("GatekeeperService", String.Empty);
                string friendsService     = serverConfig.GetString("FriendsService", String.Empty);
                string presenceService    = serverConfig.GetString("PresenceService", String.Empty);
                string userAccountService = serverConfig.GetString("UserAccountService", String.Empty);

                m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);

                if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
                {
                    throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
                }

                Object[] args = new Object[] { config };
                m_GridService         = ServerUtils.LoadPlugin <IGridService>(gridService, args);
                m_GridUserService     = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args);
                m_GatekeeperConnector = new GatekeeperServiceConnector();
                m_GatekeeperService   = ServerUtils.LoadPlugin <IGatekeeperService>(gatekeeperService, args);
                m_FriendsService      = ServerUtils.LoadPlugin <IFriendsService>(friendsService, args);
                m_PresenceService     = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args);
                m_UserAccountService  = ServerUtils.LoadPlugin <IUserAccountService>(userAccountService, args);

                m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0);

                LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed");
                LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions);
                LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions);

                m_GridName = Util.GetConfigVarFromSections <string>(config, "GatekeeperURI",
                                                                    new string[] { "Startup", "Hypergrid", "UserAgentService" }, String.Empty);
                if (string.IsNullOrEmpty(m_GridName)) // Legacy. Remove soon.
                {
                    m_GridName = serverConfig.GetString("ExternalName", string.Empty);
                    if (m_GridName == string.Empty)
                    {
                        serverConfig = config.Configs["GatekeeperService"];
                        m_GridName   = serverConfig.GetString("ExternalName", string.Empty);
                    }
                }

                if (!m_GridName.EndsWith("/"))
                {
                    m_GridName = m_GridName + "/";
                }

                // Finally some cleanup
                m_Database.DeleteOld();
            }
        }