/// <summary> /// Create a scene and its initial base structures. /// </summary> /// <param name="regionInfo"></param> /// <param name="proxyOffset"></param> /// <param name="configSource"></param> /// <param name="clientServer"> </param> /// <returns></returns> protected Scene SetupScene(RegionInfo regionInfo, IConfigSource configSource) { AgentCircuitManager circuitManager = new AgentCircuitManager(); IPAddress listenIP = regionInfo.InternalEndPoint.Address; if (!IPAddress.TryParse(regionInfo.InternalEndPoint.Address.ToString(), out listenIP)) { listenIP = IPAddress.Parse("0.0.0.0"); } uint port = (uint)regionInfo.InternalEndPoint.Port; string ClientstackDll = m_config.Configs["Startup"].GetString("ClientStackPlugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); IClientNetworkServer clientServer = AuroraModuleLoader.LoadPlugin <IClientNetworkServer> (Util.BasePathCombine(ClientstackDll)); clientServer.Initialise( listenIP, ref port, 0, regionInfo.m_allow_alternate_ports, m_config, circuitManager); regionInfo.InternalEndPoint.Port = (int)port; Scene scene = new Scene(); scene.AddModuleInterfaces(m_OpenSimBase.ApplicationRegistry.GetInterfaces()); scene.Initialize(regionInfo, circuitManager, clientServer); StartModules(scene); m_clientServers.Add(clientServer); //Do this here so that we don't have issues later when startup complete messages start coming in m_localScenes.Add(scene); return(scene); }
public void Configure(IConfigSource config, IRegistryCore registry) { string dllName = String.Empty; string connString = String.Empty; // // Try reading the [AssetService] section first, if it exists // IConfig assetConfig = config.Configs["AssetService"]; if (assetConfig != null) { dllName = assetConfig.GetString("StorageProvider", dllName); connString = assetConfig.GetString("ConnectionString", connString); } // // Try reading the [DatabaseService] section, if it exists // IConfig dbConfig = config.Configs["DatabaseService"]; if (dbConfig != null) { if (dllName == String.Empty) { dllName = dbConfig.GetString("StorageProvider", String.Empty); } if (connString == String.Empty) { connString = dbConfig.GetString("ConnectionString", String.Empty); } } // // We tried, but this doesn't exist. We can't proceed. // if (dllName.Equals(String.Empty)) { throw new Exception("No StorageProvider configured"); } m_Database = AuroraModuleLoader.LoadPlugin <IAssetDataPlugin>(dllName); if (m_Database == null) { throw new Exception("Could not find a storage interface in the given module"); } m_Database.Initialise(connString); registry.RegisterModuleInterface <IAssetService>(this); MainConsole.Instance.Commands.AddCommand("kfs", false, "show digest", "show digest <ID>", "Show asset digest", HandleShowDigest); MainConsole.Instance.Commands.AddCommand("kfs", false, "delete asset", "delete asset <ID>", "Delete asset from database", HandleDeleteAsset); m_log.Debug("[ASSET SERVICE]: Local asset service enabled"); }
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); }