public void Initialize(ISimulationBase openSim) { m_OpenSimBase = openSim; IConfig handlerConfig = openSim.ConfigSource.Configs["ApplicationPlugins"]; if (handlerConfig.GetString("SceneManager", "") != Name) { return; } m_config = openSim.ConfigSource; string name = String.Empty; // Try reading the [SimulationDataStore] section IConfig simConfig = openSim.ConfigSource.Configs["SimulationDataStore"]; if (simConfig != null) { name = simConfig.GetString("DatabaseLoaderName", "FileBasedDatabase"); } ISimulationDataStore[] stores = AuroraModuleLoader.PickupModules <ISimulationDataStore> ().ToArray(); List <string> storeNames = new List <string>(); foreach (ISimulationDataStore store in stores) { if (store.Name.ToLower() == name.ToLower()) { m_simulationDataService = store; break; } storeNames.Add(store.Name); } if (m_simulationDataService == null) { MainConsole.Instance.ErrorFormat("[SceneManager]: FAILED TO LOAD THE SIMULATION SERVICE AT '{0}', ONLY OPTIONS ARE {1}, QUITING...", name, string.Join(", ", storeNames.ToArray())); Console.Read(); //Wait till they see Environment.Exit(0); } m_simulationDataService.Initialise(); AddConsoleCommands(); //Load the startup modules for the region m_startupPlugins = AuroraModuleLoader.PickupModules <ISharedRegionStartupModule>(); //Register us! m_OpenSimBase.ApplicationRegistry.RegisterModuleInterface <SceneManager>(this); m_OpenSimBase.EventManager.RegisterEventHandler("RegionInfoChanged", RegionInfoChanged); }
public void Initialize(ISimulationBase openSim) { m_OpenSimBase = openSim; IConfig handlerConfig = openSim.ConfigSource.Configs["ApplicationPlugins"]; if (handlerConfig.GetString("SceneManager", "") != Name) return; m_localScenes = new List<Scene>(); m_config = openSim.ConfigSource; string StorageDLL = ""; string dllName = String.Empty; string connString = String.Empty; // Try reading the [DatabaseService] section, if it exists IConfig dbConfig = openSim.ConfigSource.Configs["DatabaseService"]; if (dbConfig != null) { dllName = dbConfig.GetString("StorageProvider", String.Empty); connString = dbConfig.GetString("ConnectionString", String.Empty); } // Try reading the [SimulationDataStore] section IConfig simConfig = openSim.ConfigSource.Configs["SimulationDataStore"]; if (simConfig != null) { dllName = simConfig.GetString("StorageProvider", dllName); connString = simConfig.GetString("ConnectionString", connString); } // We tried, but this doesn't exist. We can't proceed if (dllName == String.Empty) dllName = "OpenSim.Data.Null.dll"; m_simulationDataService = AuroraModuleLoader.LoadPlugin<ISimulationDataStore>(dllName); if (m_simulationDataService == null) { m_log.ErrorFormat("[SceneManager]: FAILED TO LOAD THE SIMULATION SERVICE AT '{0}', QUITING...", StorageDLL); System.Threading.Thread.Sleep(10000); Environment.Exit(0); } m_simulationDataService.Initialise(connString); AddConsoleCommands(); //Load the startup modules for the region m_startupPlugins = AuroraModuleLoader.PickupModules<ISharedRegionStartupModule>(); //Register us! m_OpenSimBase.ApplicationRegistry.RegisterModuleInterface<SceneManager>(this); }
public void Initialize(ISimulationBase openSim) { m_OpenSimBase = openSim; IConfig handlerConfig = openSim.ConfigSource.Configs["ApplicationPlugins"]; if (handlerConfig.GetString("SceneManager", "") != Name) { return; } m_localScenes = new List <Scene>(); m_config = openSim.ConfigSource; string StorageDLL = ""; string dllName = String.Empty; string connString = String.Empty; // Try reading the [DatabaseService] section, if it exists IConfig dbConfig = openSim.ConfigSource.Configs["DatabaseService"]; if (dbConfig != null) { dllName = dbConfig.GetString("StorageProvider", String.Empty); connString = dbConfig.GetString("ConnectionString", String.Empty); } // Try reading the [SimulationDataStore] section IConfig simConfig = openSim.ConfigSource.Configs["SimulationDataStore"]; if (simConfig != null) { dllName = simConfig.GetString("StorageProvider", dllName); connString = simConfig.GetString("ConnectionString", connString); } // We tried, but this doesn't exist. We can't proceed if (dllName == String.Empty) { dllName = "OpenSim.Data.Null.dll"; } m_simulationDataService = AuroraModuleLoader.LoadPlugin <ISimulationDataStore>(Util.BasePathCombine(dllName)); if (m_simulationDataService == null) { m_log.ErrorFormat("[SceneManager]: FAILED TO LOAD THE SIMULATION SERVICE AT '{0}', QUITING...", StorageDLL); System.Threading.Thread.Sleep(10000); Environment.Exit(0); } m_simulationDataService.Initialise(connString); AddConsoleCommands(); //Load the startup modules for the region m_startupPlugins = AuroraModuleLoader.PickupModules <ISharedRegionStartupModule>(); //Register us! m_OpenSimBase.ApplicationRegistry.RegisterModuleInterface <SceneManager>(this); }