예제 #1
0
        public CommunicationsLocal(
            ConfigSettings configSettings,
            NetworkServersInfo serversInfo,
            BaseHttpServer httpServer,
            IAssetCache assetCache,
            LibraryRootFolder libraryRootFolder)
            : base(serversInfo, httpServer, assetCache, libraryRootFolder)
        {
            PluginLoader <IInventoryStoragePlugin> loader = new PluginLoader <IInventoryStoragePlugin>();

            loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin));
            loader.Load();

            loader.Plugin.Initialize(configSettings);


            LocalUserServices lus
                = new LocalUserServices(
                      serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);

            //lus.AddPlugin(new TemporaryUserProfilePlugin());
            lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
            m_userService      = lus;
            m_userAdminService = lus;
            m_avatarService    = lus;
            m_messageService   = lus;

            m_gridService = new LocalBackEndServices();
        }
        public CommunicationsOGS1(
            NetworkServersInfo serversInfo, BaseHttpServer httpServer,
            IAssetCache assetCache, LibraryRootFolder libraryRootFolder,
            ConfigSettings configSettings)
            : base(serversInfo, httpServer, assetCache, libraryRootFolder)
        {
            OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);

            m_gridService = gridInterComms;

            // This plugin arrangement could eventually be configurable rather than hardcoded here.
            OGS1UserServices userServices = new OGS1UserServices(this);

            //userServices.AddPlugin(new TemporaryUserProfilePlugin());
            userServices.AddPlugin(new OGS1UserDataPlugin(this, configSettings));

            m_userService    = userServices;
            m_messageService = userServices;
            m_avatarService  = (IAvatarService)m_userService;

            PluginLoader <IInventoryStoragePlugin> loader = new PluginLoader <IInventoryStoragePlugin>();

            loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin));
            loader.Load();

            loader.Plugin.Initialize(configSettings);
        }
예제 #3
0
파일: Main.cs 프로젝트: swipswaps/halcyon
        protected virtual void StartupCoreComponents()
        {
            Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));

            m_httpServer = new BaseHttpServer(Cfg.HttpPort, null);

            RegisterInterface <CommandConsole>(m_console);
            RegisterInterface <UserConfig>(Cfg);

            IConfigSource defaultConfig   = new IniConfigSource("Halcyon.ini");
            IConfig       startupConfig   = defaultConfig.Configs["Startup"];
            IConfig       inventoryConfig = defaultConfig.Configs["Inventory"];
            IConfig       jwtConfig       = defaultConfig.Configs["JWT"];

            m_useJwt = jwtConfig?.GetBoolean("enabled") ?? false;

            OpenSim.Framework.ConfigSettings settings = new ConfigSettings();
            settings.InventoryPlugin          = inventoryConfig.GetString("inventory_plugin");
            settings.InventoryCluster         = inventoryConfig.GetString("inventory_cluster");
            settings.LegacyInventorySource    = inventoryConfig.GetString("legacy_inventory_source");
            settings.InventoryMigrationActive = inventoryConfig.GetBoolean("migration_active");
            settings.LegacyInventorySource    = inventoryConfig.GetString("legacy_inventory_source");
            settings.CoreConnectionString     = startupConfig.GetString("core_connection_string");

            PluginLoader <IInventoryStoragePlugin> loader = new PluginLoader <IInventoryStoragePlugin>();

            loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(settings.InventoryPlugin));
            loader.Load();

            if (loader.Plugin != null)
            {
                loader.Plugin.Initialize(settings);
            }
        }
예제 #4
0
        public CommunicationsLocal(
            ConfigSettings configSettings,                                   
            NetworkServersInfo serversInfo,
            BaseHttpServer httpServer,
            IAssetCache assetCache,
            LibraryRootFolder libraryRootFolder) 
            : base(serversInfo, httpServer, assetCache, libraryRootFolder)
        {
            PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>();
            loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin));
            loader.Load();

            loader.Plugin.Initialize(configSettings);
            

            LocalUserServices lus 
                = new LocalUserServices(
                    serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
            //lus.AddPlugin(new TemporaryUserProfilePlugin());
            lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);            
            m_userService = lus;
            m_userAdminService = lus;            
            m_avatarService = lus;
            m_messageService = lus;

            m_gridService = new LocalBackEndServices();                   
        }
예제 #5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var config  = new LoggingConfiguration();
            var console = new ColoredConsoleTarget();

            config.AddTarget("console", console);
            config.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, console));

            LogManager.Configuration = config;

            var bus = new MappingBus();

            bus.Subscribe <PluginErrorMessage>(m => Console.WriteLine(m.Message));
            bus.Subscribe <DisplayDialogMessage>(m => m.Display());

            var plugins = new PluginLoader(bus);

            plugins.Add(@"plugins\DeveloperToolsPlugin.dll");
            //plugins.Add(@"plugins\BroadcastPlugin.dll");
            //plugins.Add(@"plugins\ReceiverPlugin.dll");

            plugins.Load();

            Console.WriteLine("Done.");
            Console.ReadKey();
        }
예제 #6
0
        /// <summary>
        /// Returns a list of new <typeparamref name="T" /> data plugins.
        /// Plugins will be requested in the order they were added.
        /// </summary>
        /// <param name="provider">
        /// The filename of the inventory server plugin DLL.
        /// </param>
        /// <param name="connect">
        /// The connection string for the storage backend.
        /// </param>
        /// <typeparam name="T">
        /// The type of data plugin requested.
        /// </typeparam>
        /// <returns>
        /// A list of all loaded plugins matching <typeparamref name="T" />.
        /// </returns>
        public static List <T> LoadDataPlugins <T>(string provider, string connect) where T : IPlugin
        {
            PluginInitialiserBase pluginInitialiser;
            string extensionPointPath;

            PluginLoaderParamFactory <T>(connect, out pluginInitialiser, out extensionPointPath);

            PluginLoader <T> loader = new PluginLoader <T>(pluginInitialiser);

            // loader will try to load all providers (MySQL, MSSQL, etc)
            // unless it is constrainted to the correct "Provider" entry in the addin.xml
            loader.Add(extensionPointPath, new PluginProviderFilter(provider));
            loader.Load();

            return(loader.Plugins);
        }
예제 #7
0
        private List <IAssetInventoryServerPlugin> LoadAssetInventoryServerPlugins(string addinPath, string configParam)
        {
            PluginLoader <IAssetInventoryServerPlugin> loader = new PluginLoader <IAssetInventoryServerPlugin>(new AssetInventoryServerPluginInitialiser(this));

            loader.Add(addinPath, new PluginIdFilter(ConfigFile.Configs["Plugins"].GetString(configParam)));

            try
            {
                loader.Load();
            }
            catch (PluginNotInitialisedException e)
            {
                m_log.ErrorFormat("[ASSETINVENTORY]: Error initialising plugin '{0}' for extension point '{1}'.", e.Message, addinPath);
                Shutdown();
                Environment.Exit(0);
            }

            return(loader.Plugins);
        }
예제 #8
0
        public CommunicationsOGS1(
            NetworkServersInfo serversInfo, BaseHttpServer httpServer, 
            IAssetCache assetCache, LibraryRootFolder libraryRootFolder,
            ConfigSettings configSettings)
            : base(serversInfo, httpServer, assetCache, libraryRootFolder)
        {
            OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
            m_gridService = gridInterComms;

            // This plugin arrangement could eventually be configurable rather than hardcoded here.           
            OGS1UserServices userServices = new OGS1UserServices(this);
            //userServices.AddPlugin(new TemporaryUserProfilePlugin());
            userServices.AddPlugin(new OGS1UserDataPlugin(this, configSettings));
            
            m_userService = userServices;
            m_messageService = userServices;
            m_avatarService = (IAvatarService)m_userService;

            PluginLoader<IInventoryStoragePlugin> loader = new PluginLoader<IInventoryStoragePlugin>();
            loader.Add("/OpenSim/InventoryStorage", new PluginProviderFilter(configSettings.InventoryPlugin));
            loader.Load();

            loader.Plugin.Initialize(configSettings);
        }
예제 #9
0
        private List<IAssetInventoryServerPlugin> LoadAssetInventoryServerPlugins(string addinPath, string configParam)
        {
            PluginLoader<IAssetInventoryServerPlugin> loader = new PluginLoader<IAssetInventoryServerPlugin>(new AssetInventoryServerPluginInitialiser(this));
            loader.Add(addinPath, new PluginIdFilter(ConfigFile.Configs["Plugins"].GetString(configParam)));

            try
            {
                loader.Load();
            }
            catch (PluginNotInitialisedException e)
            {
                m_log.ErrorFormat("[ASSETINVENTORY]: Error initialising plugin '{0}' for extension point '{1}'.", e.Message, addinPath);
                Shutdown();
                Environment.Exit(0);
            }

            return loader.Plugins;
        }