private static bool _IsHandlingException; // Make sure we don't go recursive on ourself #endregion Fields #region Methods //could move our main function into OpenSimMain and kill this class public static void BaseMain(string[] args, string defaultIniFile, ISimulationBase simBase) { // First line, hook the appdomain to the crash reporter AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // Add the arguments supplied when running the application to the configuration ArgvConfigSource configSource = new ArgvConfigSource(args); if (!args.Contains("-skipconfig")) Configure(false); // Increase the number of IOCP threads available. Mono defaults to a tragically low number int workerThreads, iocpThreads; ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads); //MainConsole.Instance.InfoFormat("[OPENSIM MAIN]: Runtime gave us {0} worker threads and {1} IOCP threads", workerThreads, iocpThreads); if (workerThreads < 500 || iocpThreads < 1000) { workerThreads = 500; iocpThreads = 1000; //MainConsole.Instance.Info("[OPENSIM MAIN]: Bumping up to 500 worker threads and 1000 IOCP threads"); ThreadPool.SetMaxThreads(workerThreads, iocpThreads); } BinMigratorService service = new BinMigratorService(); service.MigrateBin(); // Configure nIni aliases and localles Culture.SetCurrentCulture(); configSource.Alias.AddAlias("On", true); configSource.Alias.AddAlias("Off", false); configSource.Alias.AddAlias("True", true); configSource.Alias.AddAlias("False", false); //Command line switches configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "inimaster"); configSource.AddSwitch("Startup", "inigrid"); configSource.AddSwitch("Startup", "inisim"); configSource.AddSwitch("Startup", "inidirectory"); configSource.AddSwitch("Startup", "oldoptions"); configSource.AddSwitch("Startup", "inishowfileloading"); configSource.AddSwitch("Startup", "mainIniDirectory"); configSource.AddSwitch("Startup", "mainIniFileName"); configSource.AddSwitch("Startup", "secondaryIniFileName"); configSource.AddSwitch("Startup", "RegionDataFileName"); configSource.AddSwitch("Console", "Console"); configSource.AddSwitch("Console", "LogAppendName"); configSource.AddSwitch("Network", "http_listener_port"); IConfigSource m_configSource = Configuration(configSource, defaultIniFile); // Check if we're saving crashes m_saveCrashDumps = m_configSource.Configs["Startup"].GetBoolean("save_crashes", m_saveCrashDumps); // load Crash directory config m_crashDir = m_configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); //Initialize the sim base now Startup(configSource, m_configSource, simBase.Copy(), args); }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase openSimBase) { IConfig PhysConfig = source.Configs["Physics"]; IConfig MeshingConfig = source.Configs["Meshing"]; string engine = ""; string meshEngine = ""; string Path = "Physics"; if (PhysConfig != null) { Path = PhysConfig.GetString("PathToPhysicsAssemblies", Path); engine = PhysConfig.GetString("DefaultPhysicsEngine", "WhiteCoreOpenDynamicsEngine"); meshEngine = MeshingConfig.GetString("DefaultMeshingEngine", "Meshmerizer"); string regionName = scene.RegionInfo.RegionName.Trim().Replace(' ', '_'); string RegionPhysicsEngine = PhysConfig.GetString("Region_" + regionName + "_PhysicsEngine", String.Empty); if (RegionPhysicsEngine != "") engine = RegionPhysicsEngine; string RegionMeshingEngine = MeshingConfig.GetString("Region_" + regionName + "_MeshingEngine", String.Empty); if (RegionMeshingEngine != "") meshEngine = RegionMeshingEngine; } else { //Load Sane defaults engine = "WhiteCoreOpenDynamicsEngine"; meshEngine = "Meshmerizer"; } PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssemblies(Util.BasePathCombine(Path)); PhysicsScene pScene = physicsPluginManager.GetPhysicsScene(engine, meshEngine, source, scene); scene.PhysicsScene = pScene; }
void SetUpConsole (IConfigSource config, ISimulationBase simbase) { List<ICommandConsole> Plugins = UniverseModuleLoader.PickupModules<ICommandConsole> (); foreach (ICommandConsole plugin in Plugins) { plugin.Initialize (config, simbase); } if (MainConsole.Instance == null) { Console.WriteLine ("[Console]: No Console configured, falling back to 'LocalConsole'"); new LocalConsole ().LocalInitialize (config, simbase); } MainConsole.Instance.Threshold = Level.Info; MainConsole.Instance.Fatal (string.Format ("[Console]: Console log level is {0}", MainConsole.Instance.Threshold)); MainConsole.Instance.Commands.AddCommand ( "set log level", "set log level [level]", "Set the console logging level", HandleLogLevel, false, true); MainConsole.Instance.Commands.AddCommand ( "get log level", "get log level", "Returns the current console logging level", HandleGetLogLevel, false, true); }
public void Initialise(Scene scene, IConfigSource source, ISimulationBase openSimBase) { m_config = source; m_scenes.Add(scene); //Register the interface scene.RegisterModuleInterface<IGridRegisterModule>(this); }
public override void Initialize(string defaultPrompt, IConfigSource source, ISimulationBase baseOpenSim) { uint m_consolePort = 0; if (source.Configs["Console"] != null) { if (source.Configs["Console"].GetString("Console", String.Empty) != Name) return; m_consolePort = (uint)source.Configs["Console"].GetInt("remote_console_port", 0); m_UserName = source.Configs["Console"].GetString("RemoteConsoleUser", String.Empty); m_Password = source.Configs["Console"].GetString("RemoteConsolePass", String.Empty); } else return; baseOpenSim.ApplicationRegistry.RegisterModuleInterface<ICommandConsole> (this); if (m_consolePort == 0) SetServer(MainServer.Instance); else SetServer(baseOpenSim.GetHttpServer(m_consolePort)); m_Commands.AddCommand("help", "help", "Get a general command list", base.Help); }
public void Initialize(IGenericData GenericData, ISimulationBase simBase, string defaultConnectionString) { IConfigSource source = simBase.ConfigSource; if (source.Configs["AuroraConnectors"].GetString("AgentConnector", "LocalConnector") == "LocalConnector") { GD = GenericData; if (source.Configs[Name] != null) defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString); GD.ConnectToDatabase(defaultConnectionString); DataManager.DataManager.RegisterPlugin(Name, this); } else { //Check to make sure that something else exists string m_ServerURI = simBase.ApplicationRegistry.RequestModuleInterface<IAutoConfigurationService>().FindValueOf("RemoteServerURI", "AuroraData"); if (m_ServerURI == "") //Blank, not set up { OpenSim.Framework.Console.MainConsole.Instance.Output("[AuroraDataService]: Falling back on local connector for " + "AgentConnector", "None"); GD = GenericData; if (source.Configs[Name] != null) defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString); GD.ConnectToDatabase(defaultConnectionString); DataManager.DataManager.RegisterPlugin(Name, this); } } }
public override void Initialize (IConfigSource source, ISimulationBase simBase) { uint m_consolePort = 0; if (source.Configs ["Console"] != null) { if (source.Configs ["Console"].GetString ("Console", string.Empty) != Name) return; m_consolePort = (uint)source.Configs ["Console"].GetInt ("remote_console_port", 0); m_UserName = source.Configs ["Console"].GetString ("RemoteConsoleUser", string.Empty); m_Password = source.Configs ["Console"].GetString ("RemoteConsolePass", string.Empty); } else return; simBase.ApplicationRegistry.RegisterModuleInterface<ICommandConsole> (this); MainConsole.Instance = this; SetServer (m_consolePort == 0 ? MainServer.Instance : simBase.GetHttpServer (m_consolePort)); m_Commands.AddCommand ( "help", "help", "Get a general command list", Help, false, true); }
public void Initialise(Scene scene, IConfigSource source, ISimulationBase openSimBase) { if (serviceConnectors == null) { serviceConnectors = AuroraModuleLoader.PickupModules<IService>(); foreach (IService connector in serviceConnectors) { try { connector.Initialize(source, openSimBase.ApplicationRegistry); } catch { } } foreach (IService connector in serviceConnectors) { try { connector.PostInitialize(source, openSimBase.ApplicationRegistry); } catch { } } } scene.AddModuleInterfaces(openSimBase.ApplicationRegistry.GetInterfaces()); }
public void FinishStartup(IScene scene, IConfigSource source, ISimulationBase openSimBase) { IEstateConnector EstateConnector = Framework.Utilities.DataManager.RequestPlugin<IEstateConnector>(); if (EstateConnector != null) { EstateSettings ES = EstateConnector.GetEstateSettings(scene.RegionInfo.RegionID); if (ES == null) { //It could not find the estate service, wait until it can find it MainConsole.Instance.Warn( "We could not find the estate service for this sim. Please make sure that your URLs are correct in grid mode."); while (true) { MainConsole.Instance.Prompt("Press enter to try again."); if ((ES = EstateConnector.GetEstateSettings(scene.RegionInfo.RegionID)) == null || ES.EstateID == 0) { ES = CreateEstateInfo(scene); break; } if (ES != null) break; } } else if (ES.EstateID == 0) { //It found the estate service, but found no estates for this region, make a new one MainConsole.Instance.Warn("[EstateInitializer]: Your region " + scene.RegionInfo.RegionName + " is not part of an estate."); ES = CreateEstateInfo(scene); } scene.RegionInfo.EstateSettings = ES; } }
public void Initialise(IConfigSource configSource, ISimulationBase openSim) { m_configSource = configSource; m_openSim = openSim; IConfig config = configSource.Configs["RegionStartup"]; if (config != null) { m_enabled = config.GetBoolean(Name + "_Enabled", m_enabled); if (!m_enabled) return; if (MainConsole.Instance != null) MainConsole.Instance.Commands.AddCommand("open region manager", "open region manager", "Opens the region manager", OpenRegionManager); m_default = config.GetString("Default") == Name; //Add the console command if it is the default if (m_default) if (MainConsole.Instance != null) MainConsole.Instance.Commands.AddCommand ("create region", "create region", "Create a new region.", AddRegion); } IConfig startupconfig = configSource.Configs["Startup"]; if (startupconfig != null) m_noGUI = startupconfig.GetBoolean("NoGUI", false); m_openSim.ApplicationRegistry.StackModuleInterface<IRegionLoader>(this); }
public void Initialise(ISimulationBase simBase) { IConfigSource source = simBase.ConfigSource; // // Try reading the [DatabaseService] section, if it exists // IConfig dbConfig = source.Configs["DatabaseService"]; if (dbConfig != null) { StorageProvider = dbConfig.GetString("StorageProvider", String.Empty); ConnectionString = dbConfig.GetString("ConnectionString", String.Empty); } // // [AuroraData] section overrides [DatabaseService], if it exists // IConfig m_config = source.Configs["AuroraData"]; if (m_config != null) { StorageProvider = m_config.GetString("StorageProvider", StorageProvider); ConnectionString = m_config.GetString("ConnectionString", ConnectionString); } IGenericData DataConnector = null; if (StorageProvider == "MySQL" || StorageProvider == "OpenSim.Data.MySQL.dll") //Allow for fallback when AuroraData isn't set { DataManager.DataSessionProviderConnector.DataSessionProvider = new DataSessionProvider(DataManagerTechnology.MySql, ConnectionString); MySQLDataLoader GenericData = new MySQLDataLoader(); DataConnector = GenericData; } else if (StorageProvider == "MSSQL2008") { DataManager.DataSessionProviderConnector.DataSessionProvider = new DataSessionProvider(DataManagerTechnology.MSSQL2008, ConnectionString); MSSQLDataLoader GenericData = new MSSQLDataLoader(); DataConnector = GenericData; } else if (StorageProvider == "MSSQL7") { DataManager.DataSessionProviderConnector.DataSessionProvider = new DataSessionProvider(DataManagerTechnology.MSSQL7, ConnectionString); MSSQLDataLoader GenericData = new MSSQLDataLoader(); DataConnector = GenericData; } else if (StorageProvider == "SQLite" || StorageProvider == "OpenSim.Data.SQLite.dll") //Allow for fallback when AuroraData isn't set { DataManager.DataSessionProviderConnector.DataSessionProvider = new DataSessionProvider(DataManagerTechnology.SQLite, ConnectionString); SQLiteLoader GenericData = new SQLiteLoader(); DataConnector = GenericData; } List<IAuroraDataPlugin> Plugins = AuroraModuleLoader.PickupModules<IAuroraDataPlugin>(); foreach (IAuroraDataPlugin plugin in Plugins) { plugin.Initialize(DataConnector.Copy(), simBase, ConnectionString); } }
public void Initialize(IGenericData unneeded, ISimulationBase simBase, string DefaultConnectionString) { if (simBase.ConfigSource.Configs["AuroraConnectors"].GetString("MuteListConnector", "LocalConnector") == "SimianConnector") { m_ServerURIs = simBase.ApplicationRegistry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI"); DataManager.DataManager.RegisterPlugin(Name, this); } }
public void FinishStartup(Scene scene, IConfigSource source, ISimulationBase openSimBase) { m_scenes.Add(scene); //Register the interface scene.RegisterModuleInterface<IGridRegisterModule>(this); //Now register our region with the grid RegisterRegionWithGrid(scene); }
public override void Initialize (IConfigSource source, ISimulationBase simBase) { if (source.Configs ["Console"] == null || source.Configs ["Console"].GetString ("Console", Name) != Name) { return; } LocalInitialize (source, simBase); }
public void IncomingCapsRequest (UUID agentID, Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_agentID = agentID; m_moneyModule = simbase.ApplicationRegistry.RequestModuleInterface<IMoneyModule> (); m_assetService = simbase.ApplicationRegistry.RequestModuleInterface<IAssetService> (); m_inventoryService = simbase.ApplicationRegistry.RequestModuleInterface<IInventoryService> (); m_libraryService = simbase.ApplicationRegistry.RequestModuleInterface<ILibraryService> (); m_inventoryData = Framework.Utilities.DataManager.RequestPlugin<IInventoryData> (); HttpServerHandle method; string uri; method = (path, request, httpRequest, httpResponse) => HandleFetchInventoryDescendents (request, m_agentID); uri = "/CAPS/FetchInventoryDescendents/" + UUID.Random () + "/"; capURLs ["WebFetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri; capURLs ["FetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri; capURLs ["FetchInventoryDescendents2"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method)); method = (path, request, httpRequest, httpResponse) => HandleFetchLibDescendents (request, m_agentID); uri = "/CAPS/FetchLibDescendents/" + UUID.Random () + "/"; capURLs ["FetchLibDescendents"] = MainServer.Instance.ServerURI + uri; capURLs ["FetchLibDescendents2"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method)); method = (path, request, httpRequest, httpResponse) => HandleFetchInventory (request, m_agentID); uri = "/CAPS/FetchInventory/" + UUID.Random () + "/"; capURLs ["FetchInventory"] = MainServer.Instance.ServerURI + uri; capURLs ["FetchInventory2"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method)); method = (path, request, httpRequest, httpResponse) => HandleFetchLib (request, m_agentID); uri = "/CAPS/FetchLib/" + UUID.Random () + "/"; capURLs ["FetchLib"] = MainServer.Instance.ServerURI + uri; capURLs ["FetchLib2"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, method)); uri = "/CAPS/NewFileAgentInventory/" + UUID.Random () + "/"; capURLs ["NewFileAgentInventory"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, NewAgentInventoryRequest)); uri = "/CAPS/NewFileAgentInventoryVariablePrice/" + UUID.Random () + "/"; capURLs ["NewFileAgentInventoryVariablePrice"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, NewAgentInventoryRequestVariablePrice)); uri = "/CAPS/CreateInventoryCategory/" + UUID.Random () + "/"; capURLs ["CreateInventoryCategory"] = MainServer.Instance.ServerURI + uri; m_uris.Add (uri); MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", uri, CreateInventoryCategory)); }
public void Initialise(IConfigSource configSource, ISimulationBase openSim) { m_configSource = configSource; IConfig config = configSource.Configs["RegionStartup"]; if (config != null) m_enabled = config.GetBoolean(Name + "_Enabled", m_enabled); if (m_enabled) openSim.ApplicationRegistry.StackModuleInterface<IRegionLoader>(this); }
public void Initialize(IGenericData GenericData, ISimulationBase simBase, string defaultConnectionString) { IConfigSource source = simBase.ConfigSource; if (source.Configs["AuroraConnectors"].GetString("GroupsConnector", "LocalConnector") == "RemoteConnector") { m_ServerURIs = simBase.ApplicationRegistry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI"); if (m_ServerURIs.Count != 0) DataManager.DataManager.RegisterPlugin(Name, this); } }
public RegionManager(bool killOnCreate, bool openCreatePageFirst, ISimulationBase baseOpenSim) { m_OpenSimBase = baseOpenSim; m_connector = Aurora.DataManager.DataManager.RequestPlugin<IRegionInfoConnector>(); KillAfterRegionCreation = killOnCreate; InitializeComponent(); if (openCreatePageFirst) tabControl1.SelectedTab = tabPage2; RefreshCurrentRegions(); }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase openSimBase) { m_scenes.Add(scene); //Register the interface m_config = source; scene.RegisterModuleInterface<IGridRegisterModule>(this); openSimBase.EventManager.RegisterEventHandler("GridRegionRegistered", OnGenericEvent); //Now register our region with the grid RegisterRegionWithGrid(scene, false); }
public void Initialize(IGenericData unneeded, ISimulationBase simBase, string defaultConnectionString) { IConfigSource source = simBase.ConfigSource; if (source.Configs["AuroraConnectors"].GetString("OfflineMessagesConnector", "LocalConnector") == "RemoteConnector") { m_ServerURI = simBase.ApplicationRegistry.RequestModuleInterface<IAutoConfigurationService>().FindValueOf("RemoteServerURI", "AuroraData"); if (m_ServerURI != "") DataManager.DataManager.RegisterPlugin(Name, this); } }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase openSimBase) { if (MainConsole.Instance != null && m_backup.Count == 0)//Only add them once { MainConsole.Instance.Commands.AddCommand ("backup", "backup", "Persist objects to the database now, if [all], will force the persistence of all prims", RunCommand); MainConsole.Instance.Commands.AddCommand ("disable backup", "disable backup", "Disables persistance until reenabled", DisableBackup); MainConsole.Instance.Commands.AddCommand ("enable backup", "disable backup", "Enables persistance after 'disable persistance' has been run", EnableBackup); } //Set up the backup for the scene m_backup[scene] = new InternalSceneBackup(scene); }
public override void Initialize (IConfigSource source, ISimulationBase simBase) { if (source.Configs ["Console"] == null || source.Configs ["Console"].GetString ("Console", string.Empty) != "MockConsole") { return; } simBase.ApplicationRegistry.RegisterModuleInterface<ICommandConsole> (this); MainConsole.Instance = this; m_Commands.AddCommand ("help", "help", "Get a general command list", Help, false, true); }
public void Initialize(ISimulationBase simBase) { m_simBase = simBase; m_configSource = simBase.ConfigSource; bool enabled = true; if (m_simBase.ConfigSource.Configs["SceneLoader"] != null) enabled = m_simBase.ConfigSource.Configs["SceneLoader"].GetBoolean("SceneLoader", true); if (enabled) m_simBase.ApplicationRegistry.RegisterModuleInterface<ISceneLoader>(this); }
public void Initialize(ISimulationBase openSim) { m_openSimBase = openSim; m_configSource = openSim.ConfigSource; bool enabled = false; if (m_openSimBase.ConfigSource.Configs["SceneLoader"] != null) enabled = m_openSimBase.ConfigSource.Configs["SceneLoader"].GetBoolean("AsyncSceneLoader", false); if (enabled) m_openSimBase.ApplicationRegistry.RegisterModuleInterface<ISceneLoader>(this); }
public void Initialize(ISimulationBase openSim) { m_config = openSim.ConfigSource; IConfig handlerConfig = m_config.Configs["Handlers"]; if (handlerConfig.GetString("ConfigurationHandler", "") != Name) return; //Register us openSim.ApplicationRegistry.RegisterModuleInterface<IConfigurationService>(this); FindConfiguration(m_config.Configs["Configuration"]); }
public void Initialize(IGenericData GenericData, ISimulationBase simBase, string defaultConnectionString) { IConfigSource source = simBase.ConfigSource; if (source.Configs["AuroraConnectors"].GetString("AvatarArchiverConnector", "LocalConnector") == "LocalConnector") { GD = GenericData; if (source.Configs[Name] != null) defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString); GD.ConnectToDatabase(defaultConnectionString); DataManager.DataManager.RegisterPlugin(Name, this); } }
public virtual void Initialize(IConfigSource source, ISimulationBase baseOpenSim) { if (source.Configs["Console"] == null || source.Configs["Console"].GetString("Console", String.Empty) != Name) { return; } baseOpenSim.ApplicationRegistry.RegisterModuleInterface<ICommandConsole>(this); MainConsole.Instance = this; m_Commands.AddCommand("help", "help", "Get a general command list", Help); MainConsole.Instance.Info("[GUIConsole] initialised."); }
public void IncomingCapsRequest (UUID agentID, GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_syncMessage = simbase.ApplicationRegistry.RequestModuleInterface<ISyncMessagePosterService> (); m_appearanceService = simbase.ApplicationRegistry.RequestModuleInterface<IAgentAppearanceService> (); m_region = region; m_agentID = agentID; if (m_appearanceService == null) return;//Can't bake! m_uri = "/CAPS/UpdateAvatarAppearance/" + UUID.Random () + "/"; MainServer.Instance.AddStreamHandler (new GenericStreamHandler ("POST", m_uri, UpdateAvatarAppearance)); capURLs ["UpdateAvatarAppearance"] = MainServer.Instance.ServerURI + m_uri; }
public override void Initialize(string defaultPrompt, IConfigSource source, ISimulationBase baseOpenSim) { if (source.Configs["Console"] != null) { if (source.Configs["Console"].GetString("Console", Name) != Name) return; } else return; baseOpenSim.ApplicationRegistry.RegisterModuleInterface<ICommandConsole>(this); m_Commands.AddCommand("console", false, "help", "help [<command>]", "Get general command list or more detailed help on a specific command", base.Help); }
public void Initialise(Scene scene, IConfigSource source, ISimulationBase openSimBase) { MainConsole.Instance.Commands.AddCommand("region", false, "backup", "backup [all]", "Persist objects to the database now, if [all], will force the persistence of all prims", RunCommand); //Set up the backup for the scene m_backup[scene] = new InternalSceneBackup(scene); IConfig persistanceConfig = source.Configs["Persistance"]; if (persistanceConfig != null) { m_dontPersistBefore = persistanceConfig.GetLong("MinimumTimeBeforePersistenceConsidered", m_dontPersistBefore); m_persistAfter = persistanceConfig.GetLong("MaximumTimeBeforePersistenceConsidered", m_persistAfter); } }
public virtual void Initialize(IConfigSource source, ISimulationBase baseOpenSim) { if (source.Configs["Console"] != null) { if (source.Configs["Console"].GetString("Console", String.Empty) != Name) { return; } } else { return; } baseOpenSim.ApplicationRegistry.RegisterModuleInterface <ICommandConsole>(this); MainConsole.Instance = this; m_Commands.AddCommand("help", "help", "Get a general command list", Help); }
public static void Startup(ArgvConfigSource originalConfigSource, IConfigSource configSource, ISimulationBase simBase, string[] cmdParameters) { //Get it ready to run simBase.Initialize(originalConfigSource, configSource, cmdParameters, m_configLoader); try { //Start it. This starts ALL modules and completes the startup of the application simBase.Startup(); //Run the console now that we are done simBase.Run(); } catch (Exception ex) { if (ex.Message != "Restart") //Internal needs a restart message { UnhandledException(false, ex); //Just clean it out as good as we can simBase.Shutdown(false); IRegionLoader[] regionLoaders = simBase.ApplicationRegistry.RequestModuleInterfaces <IRegionLoader>(); #if (!ISWIN) foreach (IRegionLoader loader in regionLoaders) { if (loader != null && loader.Default) { loader.FailedToStartRegions(ex.Message); } } #else foreach (IRegionLoader loader in regionLoaders.Where(loader => loader != null && loader.Default)) { loader.FailedToStartRegions(ex.Message); } #endif } //Then let it restart if it needs by sending it back up to 'while (AutoRestart || Running)' above return; } //If it didn't throw an error, it wants to quit Environment.Exit(0); }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase simBase) { IConfig PhysConfig = source.Configs["Physics"]; IConfig MeshingConfig = source.Configs["Meshing"]; string engine = ""; string meshEngine = ""; string Path = "Physics"; if (PhysConfig != null) { Path = PhysConfig.GetString("PathToPhysicsAssemblies", Path); engine = PhysConfig.GetString("DefaultPhysicsEngine", "OpenDynamicsEngine"); meshEngine = MeshingConfig.GetString("DefaultMeshingEngine", "Meshmerizer"); string regionName = scene.RegionInfo.RegionName.Trim().Replace(' ', '_'); string RegionPhysicsEngine = PhysConfig.GetString("Region_" + regionName + "_PhysicsEngine", String.Empty); if (RegionPhysicsEngine != "") { engine = RegionPhysicsEngine; } string RegionMeshingEngine = MeshingConfig.GetString("Region_" + regionName + "_MeshingEngine", String.Empty); if (RegionMeshingEngine != "") { meshEngine = RegionMeshingEngine; } } else { //Load Sane defaults engine = "OpenDynamicsEngine"; meshEngine = "Meshmerizer"; } PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssemblies(Util.BasePathCombine(Path)); PhysicsScene pScene = physicsPluginManager.GetPhysicsScene(engine, meshEngine, source, scene); scene.PhysicsScene = pScene; }
public void Initialize(ISimulationBase simulationBase) { m_simulationBase = simulationBase; Timer PeriodicDiagnosticsTimer = new Timer(60 * 60 * 1000); // One hour PeriodicDiagnosticsTimer.Elapsed += LogDiagnostics; PeriodicDiagnosticsTimer.Enabled = true; PeriodicDiagnosticsTimer.Start(); if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("show threads", "show threads", "List tracked threads", HandleShowThreads, false, true); MainConsole.Instance.Commands.AddCommand("show uptime", "show uptime", "Show server startup time and uptime", HandleShowUptime, false, true); MainConsole.Instance.Commands.AddCommand("show queues", "show queues [full]", "Shows the queues for the given agent (if full is given as a parameter, child agents are displayed as well)", HandleShowQueues, false, true); MainConsole.Instance.Commands.AddCommand("show stats", "show stats", "Show statistical information for this server", HandleShowStats, false, true); MainConsole.Instance.Commands.AddCommand("stats report", "stats report", "Returns a variety of statistics about the current region and/or simulator", DebugMonitors, false, true); } m_simulationBase.ApplicationRegistry.RegisterModuleInterface <IMonitorModule>(this); m_registry = new MonitorRegistry(this); }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase openSimBase) { if (MainConsole.Instance != null && m_backup.Count == 0)//Only add them once { MainConsole.Instance.Commands.AddCommand("backup", "backup", "Persist objects to the database now, if [all], will force the persistence of all prims", RunCommand); MainConsole.Instance.Commands.AddCommand("disable backup", "disable backup", "Disables persistance until reenabled", DisableBackup); MainConsole.Instance.Commands.AddCommand("enable backup", "disable backup", "Enables persistance after 'disable persistance' has been run", EnableBackup); } //Set up the backup for the scene m_backup[scene] = new InternalSceneBackup(scene); IConfig persistanceConfig = source.Configs["Persistance"]; if (persistanceConfig != null) { m_dontPersistBefore = persistanceConfig.GetLong("MinimumTimeBeforePersistenceConsidered", m_dontPersistBefore); m_persistAfter = persistanceConfig.GetLong("MaximumTimeBeforePersistenceConsidered", m_persistAfter); } }
public void IncomingCapsRequest(UUID agentID, GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_agentID = agentID; m_region = region; m_userScopeIDs = simbase.ApplicationRegistry.RequestModuleInterface <IUserAccountService> ().GetUserAccount(null, m_agentID).AllScopeIDs; m_gridService = simbase.ApplicationRegistry.RequestModuleInterface <IGridService> (); IConfig config = simbase.ConfigSource.Configs ["MapCAPS"]; if (config != null) { m_allowCapsMessage = config.GetBoolean("AllowCapsMessage", m_allowCapsMessage); } HttpServerHandle method = (path, request, httpRequest, httpResponse) => MapLayerRequest(HttpServerHandlerHelpers.ReadString(request), httpRequest, httpResponse); m_uri = "/CAPS/MapLayer/" + UUID.Random() + "/"; capURLs ["MapLayer"] = MainServer.Instance.ServerURI + m_uri; capURLs ["MapLayerGod"] = MainServer.Instance.ServerURI + m_uri; MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", m_uri, method)); }
public void FinishStartup(IScene scene, IConfigSource source, ISimulationBase openSimBase) { if (scene.RegionInfo.EstateSettings != null) { return; } IEstateConnector EstateConnector = Aurora.DataManager.DataManager.RequestPlugin <IEstateConnector>(); if (EstateConnector != null) { EstateSettings ES = EstateConnector.GetEstateSettings(scene.RegionInfo.RegionID); if (ES == null) { //It could not find the estate service, wait until it can find it MainConsole.Instance.Warn("We could not find the estate service for this sim. Please make sure that your URLs are correct in grid mode."); while (true) { MainConsole.Instance.Prompt("Press enter to try again."); if ((ES = EstateConnector.GetEstateSettings(scene.RegionInfo.RegionID)) == null || ES.EstateID == 0) { ES = CreateEstateInfo(scene); break; } if (ES != null) { break; } } } else if (ES.EstateID == 0) { //It found the estate service, but found no estates for this region, make a new one MainConsole.Instance.Warn("Your region " + scene.RegionInfo.RegionName + " is not part of an estate."); ES = CreateEstateInfo(scene); } scene.RegionInfo.EstateSettings = ES; } }
public void Start(IConfigSource config, IRegistryCore registry) { m_registry = registry; IConfig handlerConfig = config.Configs["Handlers"]; string name = handlerConfig.GetString(Name, ""); if (name != Name) { MainConsole.Instance.Warn("[MapAPI] module not loaded"); return; } MainConsole.Instance.Info("[MapAPI] module loaded"); ISimulationBase simBase = registry.RequestModuleInterface <ISimulationBase>(); m_textureServer = simBase.GetHttpServer(handlerConfig.GetUInt(Name + "TextureServerPort", 8002)); m_textureServer.AddHTTPHandler(urlMapTexture, OnHTTPGetMapImage); m_server = simBase.GetHttpServer(handlerConfig.GetUInt(Name + "Port", 8007)); m_server.AddStreamHandler(new MapAPIHTTPHandler_GET(this, registry, m_textureServer)); }
/// <summary> /// Read the config for the data loader /// </summary> /// <param name="simBase"></param> protected virtual void ReadConfig(ISimulationBase simBase) { IConfig config = simBase.ConfigSource.Configs["FileBasedSimulationData"]; if (config != null) { m_saveChanges = config.GetBoolean("SaveChanges", m_saveChanges); m_timeBetweenSaves = config.GetInt("TimeBetweenSaves", m_timeBetweenSaves); m_keepOldSave = config.GetBoolean("SavePreviousBackup", m_keepOldSave); m_oldSaveDirectory = PathHelpers.ComputeFullPath(config.GetString("PreviousBackupDirectory", m_oldSaveDirectory)); m_storeDirectory = PathHelpers.ComputeFullPath(config.GetString("StoreBackupDirectory", m_storeDirectory)); m_saveBackupChanges = config.GetBoolean("SaveTimedPreviousBackup", m_keepOldSave); m_timeBetweenBackupSaves = config.GetInt("TimeBetweenBackupSaves", m_timeBetweenBackupSaves); } if (m_saveChanges && m_timeBetweenSaves != 0) { m_saveTimer = new Timer(m_timeBetweenSaves * 60 * 1000); m_saveTimer.Elapsed += m_saveTimer_Elapsed; m_saveTimer.Start(); } if (m_saveChanges && m_timeBetweenBackupSaves != 0) { m_backupSaveTimer = new Timer(m_timeBetweenBackupSaves * 60 * 1000); m_backupSaveTimer.Elapsed += m_backupSaveTimer_Elapsed; m_backupSaveTimer.Start(); } config = simBase.ConfigSource.Configs["Startup"]; m_fileName = "sim"; if (config != null) { m_fileName = config.GetString("RegionDataFileName", m_fileName); } }
public void Initialise(IConfigSource configSource, ISimulationBase openSim) { m_configSource = configSource; m_openSim = openSim; IConfig config = configSource.Configs["RegionStartup"]; if (config != null) { m_enabled = config.GetBoolean(Name + "_Enabled", m_enabled); if (!m_enabled) { return; } if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("open region manager", "open region manager", "Opens the region manager", OpenRegionManager); } m_default = config.GetString("Default") == Name; //Add the console command if it is the default if (m_default) { if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("create region", "create region", "Create a new region.", AddRegion); } } } IConfig startupconfig = configSource.Configs["Startup"]; if (startupconfig != null) { m_noGUI = startupconfig.GetBoolean("NoGUI", false); } m_openSim.ApplicationRegistry.StackModuleInterface <IRegionLoader>(this); }
public void FinishStartup(IScene scene, IConfigSource source, ISimulationBase simBase) { IEstateConnector estateConnector = Framework.Utilities.DataManager.RequestPlugin <IEstateConnector> (); if (estateConnector != null) { EstateSettings ES = estateConnector.GetRegionEstateSettings(scene.RegionInfo.RegionID); if (ES == null) { //Could not locate the estate service, wait until it can find it MainConsole.Instance.Warn( "We could not find the estate service for this region. Please make sure that your URLs are correct in grid mode."); while (true) { MainConsole.Instance.Prompt("Press enter to try again."); if ((ES = estateConnector.GetRegionEstateSettings(scene.RegionInfo.RegionID)) == null || ES.EstateID == 0) { ES = CreateEstateInfo(scene); break; } if (ES != null) { break; } } } else if (ES.EstateID == 0) { //This region does not belong to an estate, make a new one or join and existing one MainConsole.Instance.Warn("[EstateInitializer]: Your region '" + scene.RegionInfo.RegionName + "' is not part of an estate."); ES = CreateEstateInfo(scene); } scene.RegionInfo.EstateSettings = ES; } }
// local initialization and override when all else fails public void LocalInitialize(IConfigSource source, ISimulationBase simBase) { simBase.ApplicationRegistry.RegisterModuleInterface <ICommandConsole> (this); MainConsole.Instance = this; m_Commands.AddCommand( "help", "help", "Get a general command list", Help, false, true); string logName = ""; string logPath = ""; logName = source.Configs ["Console"].GetString("LogAppendName", logName); logPath = source.Configs ["Console"].GetString("LogPath", logPath); if (logPath == "") { logPath = Path.Combine(simBase.DefaultDataPath, Constants.DEFAULT_LOG_DIR); } InitializeLog(logPath, logName, simBase); }
public virtual void Initialize(IConfigSource source, ISimulationBase baseOpenSim) { if (source.Configs["Console"] == null || source.Configs["Console"].GetString("Console", String.Empty) != Name) { return; } baseOpenSim.ApplicationRegistry.RegisterModuleInterface <ICommandConsole>(this); MainConsole.Instance = this; m_Commands.AddCommand("help", "help", "Get a general command list", Help, false, true); string logName = ""; string logPath = LogPath; if (source.Configs ["Console"] != null) { logName = source.Configs ["Console"].GetString("LogAppendName", logName); logPath = source.Configs ["Console"].GetString("LogPath", logPath); } InitializeLog(logPath, logName); }
public virtual RegionInfo LoadRegionInfo(ISimulationBase simBase, out bool newRegion) { newRegion = false; ReadConfig(simBase); ReadBackup(); RegionInfo info; if (_regionData == null || _regionData.RegionInfo == null) { retry: info = CreateRegionFromConsole(null); if (info == null) { goto retry; } newRegion = true; } else { info = _regionData.RegionInfo; } return(info); }
public void RegionLoaded(IScene scene) { if (!m_Enabled) { return; } m_Generator = scene.RequestModuleInterface <IMapImageGenerator>(); if (m_Generator == null) { m_Enabled = false; return; } MainConsole.Instance.Info("[WORLDVIEW]: Configured and enabled"); ISimulationBase simulationBase = scene.RequestModuleInterface <ISimulationBase>(); if (simulationBase != null) { IHttpServer server = simulationBase.GetHttpServer(0); server.AddStreamHandler(new WorldViewRequestHandler(this, scene.RegionInfo.RegionID.ToString())); } }
public void Initialize(IConfigSource config, IRegistryCore registry) { registry.RegisterModuleInterface <IGridRegistrationService>(this); m_registry = registry; m_simulationBase = registry.RequestModuleInterface <ISimulationBase>(); m_configurationConfig = config.Configs["Configuration"]; m_loadBalancer.SetConfig(config, this); if (m_configurationConfig != null) { m_useSessionTime = m_configurationConfig.GetBoolean("UseSessionTime", m_useSessionTime); } if (m_configurationConfig != null) { m_useRegistrationService = m_configurationConfig.GetBoolean("UseRegistrationService", m_useRegistrationService); } m_permissionConfig = config.Configs["RegionPermissions"]; if (m_permissionConfig != null) { ReadConfiguration(m_permissionConfig); } }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase simBase) { if (MainConsole.Instance != null && m_backup.Count == 0) //Only add them once { MainConsole.Instance.Commands.AddCommand( "edit scale", "edit scale <name> <X> <Y> <Z>", "Change the scale of a named prim", EditScale, true, false); MainConsole.Instance.Commands.AddCommand( "offset region prims", "offset region prims <X> <Y> <Z>", "Offset all prims by the same amount", OffsetPrims, true, false); MainConsole.Instance.Commands.AddCommand( "backup", "backup", "Persist objects to the database now, if [all], will force the persistence of all prims", RunCommand, true, false); MainConsole.Instance.Commands.AddCommand( "disable backup", "disable backup", "Disables persistence until re-enabled", DisableBackup, true, false); MainConsole.Instance.Commands.AddCommand( "enable backup", "enable backup", "Enables persistence after 'disable backup' has been run", EnableBackup, true, false); } //Set up the backup for the scene m_backup [scene] = new InternalSceneBackup(scene); }
public void Initialize(ISimulationBase simBase) { LocalDataService service = new LocalDataService(); service.Initialise(simBase.ConfigSource, simBase.ApplicationRegistry); }
public void PreStartup(ISimulationBase simBase) { }
public static void Startup(ArgvConfigSource originalConfigSource, IConfigSource configSource, ISimulationBase simBase) { //Get it ready to run simBase.Initialize(originalConfigSource, configSource); try { //Start it. This starts ALL modules and completes the startup of the application simBase.Startup(); //Run the console now that we are done simBase.Run(); } catch (Exception ex) { if (ex.Message != "Restart") //Internal needs a restart message { string mes = "[AURORA]: Aurora has crashed! Error: " + ex + ", Stack trace: " + ex.StackTrace; m_log.Error(mes); handleException(mes, ex); //Just clean it out as good as we can simBase.Shutdown(false); } //Then let it restart if it needs by sending it back up to 'while (AutoRestart || Running)' above return; } //If it didn't throw an error, it wants to quit Environment.Exit(0); }
public void PostFinishStartup(Scene scene, IConfigSource source, ISimulationBase openSimBase) { }
public void IncomingCapsRequest(UUID agentID, Aurora.Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_AgentID = agentID; m_assetService = simbase.ApplicationRegistry.RequestModuleInterface <IAssetService>(); m_j2kDecoder = simbase.ApplicationRegistry.RequestModuleInterface <IJ2KDecoder>(); m_getTextureURI = "/CAPS/GetTexture/" + UUID.Random() + "/"; capURLs["GetTexture"] = MainServer.Instance.ServerURI + m_getTextureURI; MainServer.Instance.AddStreamHandler(new GenericStreamHandler("GET", m_getTextureURI, ProcessGetTexture)); m_bakedTextureURI = "/CAPS/UploadBakedTexture/" + UUID.Random() + "/"; capURLs["UploadBakedTexture"] = MainServer.Instance.ServerURI + m_bakedTextureURI; MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", m_bakedTextureURI, UploadBakedTexture)); m_getMeshURI = "/CAPS/GetMesh/" + UUID.Random() + "/"; capURLs["GetMesh"] = MainServer.Instance.ServerURI + m_getMeshURI; MainServer.Instance.AddStreamHandler(new GenericStreamHandler("GET", m_getMeshURI, ProcessGetMesh)); }
public void Initialise(IScene scene, IConfigSource source, ISimulationBase simBase) { scene.StackModuleInterface <IUniverseBackupModule>(this); m_registry = simBase.ApplicationRegistry; }
public void IncomingCapsRequest(UUID agentID, Aurora.Framework.Services.GridRegion region, ISimulationBase simbase, ref OSDMap capURLs) { m_agentID = agentID; m_moneyModule = simbase.ApplicationRegistry.RequestModuleInterface <IMoneyModule>(); m_assetService = simbase.ApplicationRegistry.RequestModuleInterface <IAssetService>(); m_inventoryService = simbase.ApplicationRegistry.RequestModuleInterface <IInventoryService>(); m_libraryService = simbase.ApplicationRegistry.RequestModuleInterface <ILibraryService>(); m_inventoryData = Framework.Utilities.DataManager.RequestPlugin <IInventoryData>(); HttpServerHandle method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleWebFetchInventoryDescendents(request, m_agentID)); }; string uri = "/CAPS/FetchInventoryDescendents/" + UUID.Random() + "/"; capURLs["WebFetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri; capURLs["FetchInventoryDescendents"] = MainServer.Instance.ServerURI + uri; capURLs["FetchInventoryDescendents2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchLibDescendents(request, m_agentID)); }; uri = "/CAPS/FetchLibDescendents/" + UUID.Random() + "/"; capURLs["FetchLibDescendents"] = MainServer.Instance.ServerURI + uri; capURLs["FetchLibDescendents2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchInventory(request, m_agentID)); }; uri = "/CAPS/FetchInventory/" + UUID.Random() + "/"; capURLs["FetchInventory"] = MainServer.Instance.ServerURI + uri; capURLs["FetchInventory2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); method = delegate(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { return(HandleFetchLib(request, m_agentID)); }; uri = "/CAPS/FetchLib/" + UUID.Random() + "/"; capURLs["FetchLib"] = MainServer.Instance.ServerURI + uri; capURLs["FetchLib2"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, method)); uri = "/CAPS/NewFileAgentInventory/" + UUID.Random() + "/"; capURLs["NewFileAgentInventory"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, NewAgentInventoryRequest)); uri = "/CAPS/NewFileAgentInventoryVariablePrice/" + UUID.Random() + "/"; capURLs["NewFileAgentInventoryVariablePrice"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, NewAgentInventoryRequestVariablePrice)); uri = "/CAPS/CreateInventoryCategory/" + UUID.Random() + "/"; capURLs["CreateInventoryCategory"] = MainServer.Instance.ServerURI + uri; m_uris.Add(uri); MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uri, CreateInventoryCategory)); }
static bool _IsHandlingException; // Make sure we don't go recursive on ourself //could move our main function into AuroraMain and kill this class public static void BaseMain(string[] args, string defaultIniFile, ISimulationBase simBase) { // First line, hook the appdomain to the crash reporter AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // Add the arguments supplied when running the application to the configuration ArgvConfigSource configSource = new ArgvConfigSource(args); if (!args.Contains("-skipconfig")) { Configure(false); } // Increase the number of IOCP threads available. Mono defaults to a tragically low number int workerThreads, iocpThreads; ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads); //MainConsole.Instance.InfoFormat("[AURORA MAIN]: Runtime gave us {0} worker threads and {1} IOCP threads", workerThreads, iocpThreads); if (workerThreads < 500 || iocpThreads < 1000) { workerThreads = 500; iocpThreads = 1000; //MainConsole.Instance.Info("[AURORA MAIN]: Bumping up to 500 worker threads and 1000 IOCP threads"); ThreadPool.SetMaxThreads(workerThreads, iocpThreads); } BinMigratorService service = new BinMigratorService(); service.MigrateBin(); // Configure nIni aliases and localles Culture.SystemCultureInfo = CultureInfo.CurrentCulture; Culture.SetCurrentCulture(); configSource.Alias.AddAlias("On", true); configSource.Alias.AddAlias("Off", false); configSource.Alias.AddAlias("True", true); configSource.Alias.AddAlias("False", false); //Command line switches configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "inimaster"); configSource.AddSwitch("Startup", "inigrid"); configSource.AddSwitch("Startup", "inisim"); configSource.AddSwitch("Startup", "inidirectory"); configSource.AddSwitch("Startup", "oldoptions"); configSource.AddSwitch("Startup", "inishowfileloading"); configSource.AddSwitch("Startup", "mainIniDirectory"); configSource.AddSwitch("Startup", "mainIniFileName"); configSource.AddSwitch("Startup", "secondaryIniFileName"); configSource.AddSwitch("Startup", "RegionDataFileName"); configSource.AddSwitch("Console", "Console"); configSource.AddSwitch("Console", "LogAppendName"); configSource.AddSwitch("Console", "LogPath"); configSource.AddSwitch("Network", "http_listener_port"); IConfigSource m_configSource = Configuration(configSource, defaultIniFile); // Check if we're saving crashes m_saveCrashDumps = m_configSource.Configs["Startup"].GetBoolean("save_crashes", m_saveCrashDumps); // load Crash directory config m_crashDir = m_configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); //Initialize the sim base now Startup(configSource, m_configSource, simBase.Copy(), args); }
public void FinishStartup(IScene scene, IConfigSource source, ISimulationBase simBase) { }
public void PostInitialise(Scene scene, IConfigSource source, ISimulationBase openSimBase) { }
public void PostFinishStartup(IScene scene, IConfigSource source, ISimulationBase openSimBase) { scene.RequestModuleInterface <IAsyncMessageRecievedService>().OnMessageReceived += RegisterRegionWithGridModule_OnMessageReceived; }
public void Initialise(Scene scene, IConfigSource source, ISimulationBase openSimBase) { scene.StackModuleInterface <IAuroraBackupModule>(this); }
//could move our main function into OpenSimMain and kill this class public static void BaseMain(string[] args, string defaultIniFile, ISimulationBase simBase) { // First line, hook the appdomain to the crash reporter AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); // Add the arguments supplied when running the application to the configuration ArgvConfigSource configSource = new ArgvConfigSource(args); // Configure Log4Net configSource.AddSwitch("Startup", "logconfig"); string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); if (logConfigFile != String.Empty) { XmlConfigurator.Configure(new System.IO.FileInfo(logConfigFile)); //m_log.InfoFormat("[OPENSIM MAIN]: configured log4net using \"{0}\" as configuration file", // logConfigFile); } else { XmlConfigurator.Configure(); //m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); } // Increase the number of IOCP threads available. Mono defaults to a tragically low number int workerThreads, iocpThreads; System.Threading.ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads); //m_log.InfoFormat("[OPENSIM MAIN]: Runtime gave us {0} worker threads and {1} IOCP threads", workerThreads, iocpThreads); if (workerThreads < 500 || iocpThreads < 1000) { workerThreads = 500; iocpThreads = 1000; //m_log.Info("[OPENSIM MAIN]: Bumping up to 500 worker threads and 1000 IOCP threads"); System.Threading.ThreadPool.SetMaxThreads(workerThreads, iocpThreads); } // Check if the system is compatible with OpenSimulator. // Ensures that the minimum system requirements are met m_log.Info("[Setup]: Performing compatibility checks... \n"); string supported = String.Empty; if (Util.IsEnvironmentSupported(ref supported)) { m_log.Info("[Setup]: Environment is compatible.\n"); } else { m_log.Warn("[Setup]: Environment is unsupported (" + supported + ")\n"); #if BlockUnsupportedVersions Thread.Sleep(10000); //Sleep 10 seconds return; #endif } // Configure nIni aliases and localles Culture.SetCurrentCulture(); configSource.Alias.AddAlias("On", true); configSource.Alias.AddAlias("Off", false); configSource.Alias.AddAlias("True", true); configSource.Alias.AddAlias("False", false); ///Command line switches configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "inimaster"); configSource.AddSwitch("Startup", "inidirectory"); configSource.AddSwitch("Console", "Console"); configSource.AddSwitch("Startup", "inidbg"); configSource.AddConfig("Network"); IConfigSource m_configSource = Configuration(configSource, defaultIniFile); // Check if we're saving crashes m_saveCrashDumps = m_configSource.Configs["Startup"].GetBoolean("save_crashes", m_saveCrashDumps); // load Crash directory config m_crashDir = m_configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); // check auto restart bool AutoRestart = m_configSource.Configs["Startup"].GetBoolean("AutoRestartOnCrash", true); //Set up the error reporting if (m_configSource.Configs["ErrorReporting"] != null) { m_sendErrorReport = m_configSource.Configs["ErrorReporting"].GetBoolean("SendErrorReports", true); m_urlToPostErrors = m_configSource.Configs["ErrorReporting"].GetString("ErrorReportingURL", m_urlToPostErrors); } bool Running = true; //If auto restart is set, then we always run. // otherwise, just run the first time that Running == true while (AutoRestart || Running) { //Always run once, then disable this Running = false; //Initialize the sim base now Startup(configSource, m_configSource, simBase.Copy()); } }