public Config() { //check if there is any config file, if not create a new one with some defaults... if (File.Exists(AppPath + "\\dufftv.ini")) { //declare new source ini file source = new IniConfigSource(AppPath + "\\dufftv.ini"); //turn on autosaving, no need to save manually source.AutoSave = true; // Creates two Boolean aliases. source.Alias.AddAlias("On", true); source.Alias.AddAlias("Off", false); _Version = source.Configs["defaults"].GetString("Version"); _AutoUpdate = source.Configs["defaults"].GetBoolean("AutoUpdate", false); _ConnectionCheckURI = source.Configs["defaults"].GetString("ConnectionCheckURI", "http://www.google.se"); _LastUpdate = _Version = source.Configs["defaults"].GetString("LastUpdate"); _IconSize = source.Configs["defaults"].GetInt("IconSize"); _XMLTVSourceURI = source.Configs["xmltv"].GetString("SourceURI"); _Country = source.Configs["xmltv"].GetString("Country"); _ChannelList = source.Configs["xmltv"].Get("ChannelList").Split('|'); _CreatedNewFile = false; } else { CreateNewConfigFile(); } }
public void Initialise(IConfigSource config) { try { m_config = config.Configs["SimianGrid"]; if (m_config != null) { m_simianURL = m_config.GetString("SimianServiceURL"); if (String.IsNullOrEmpty(m_simianURL)) { // m_log.DebugFormat("[SimianGrid] service URL is not defined"); return; } InitialiseSimCap(); SimulatorCapability = SimulatorCapability.Trim(); m_log.InfoFormat("[SimianExternalCaps] using {0} as simulator capability",SimulatorCapability); } } catch (Exception e) { m_log.ErrorFormat("[SimianExternalCaps] initialization error: {0}",e.Message); return; } }
public void Initialize(IConfigSource source) { IConfig config = source.Configs["SimulatorFeatures"]; if (config != null) { m_MapImageServerURL = config.GetString("MapImageServerURI", string.Empty); if (m_MapImageServerURL != string.Empty) { m_MapImageServerURL = m_MapImageServerURL.Trim(); if (!m_MapImageServerURL.EndsWith("/")) m_MapImageServerURL = m_MapImageServerURL + "/"; } m_SearchURL = config.GetString("SearchServerURI", string.Empty); m_MeshEnabled = config.GetBoolean("MeshEnabled", m_MeshEnabled); m_PhysicsMaterialsEnabled = config.GetBoolean("PhysicsMaterialsEnabled", m_MeshEnabled); m_DynamicPathfindingEnabled = config.GetBoolean("DynamicPathfindingEnabled", m_DynamicPathfindingEnabled); m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported); } // Now the chat params to be returned by the SimulatorFeatures response config = source.Configs["Chat"]; if (config != null) { m_whisperdistance = config.GetInt("whisper_distance", m_whisperdistance); m_saydistance = config.GetInt("say_distance", m_saydistance); m_shoutdistance = config.GetInt("shout_distance", m_shoutdistance); } AddDefaultFeatures(); }
public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : base(config, server, String.Empty) { //IConfig serverConfig = config.Configs["SimulationService"]; //if (serverConfig == null) // throw new Exception("No section 'SimulationService' in config file"); //string simService = serverConfig.GetString("LocalServiceModule", // String.Empty); //if (simService == String.Empty) // throw new Exception("No SimulationService in config file"); //Object[] args = new Object[] { config }; m_LocalSimulationService = scene.RequestModuleInterface<ISimulationService>(); m_LocalSimulationService = m_LocalSimulationService.GetInnerService(); //ServerUtils.LoadPlugin<ISimulationService>(simService, args); //System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no")); //server.AddStreamHandler(new AgentGetHandler(m_SimulationService, m_AuthenticationService)); //server.AddStreamHandler(new AgentPostHandler(m_SimulationService, m_AuthenticationService)); //server.AddStreamHandler(new AgentPutHandler(m_SimulationService, m_AuthenticationService)); //server.AddStreamHandler(new AgentDeleteHandler(m_SimulationService, m_AuthenticationService)); server.AddHTTPHandler("/agent/", new AgentHandler(m_LocalSimulationService).Handler); server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService).Handler); //server.AddStreamHandler(new ObjectPostHandler(m_SimulationService, authentication)); }
public void Initialise(IConfigSource config) { IConfig conf = config.Configs["TSU.CCIR.OpenSim"]; m_enabled = (conf != null && conf.GetBoolean("Enabled", false)); m_log.Info(m_enabled ? "Enabled" : "Disabled"); }
public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) : base(config, server, configName) { if (configName != string.Empty) m_ConfigName = configName; IConfig serverConfig = config.Configs[m_ConfigName]; if (serverConfig == null) throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); string inventoryService = serverConfig.GetString("LocalServiceModule", String.Empty); if (inventoryService == String.Empty) throw new Exception("No LocalServiceModule in config file"); Object[] args = new Object[] { config }; m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(inventoryService, args); m_userserver_url = serverConfig.GetString("UserServerURI", String.Empty); m_doLookup = serverConfig.GetBoolean("SessionAuthentication", false); AddHttpHandlers(server); m_log.Debug("[INVENTORY HANDLER]: handlers initialized"); }
public virtual void Initialize(Scene scene, IConfigSource config) { if (!initialized) { initialized = true; IConfig netConfig = config.Configs["Network"]; if (netConfig != null) { _gridSendKey = netConfig.GetString("grid_send_key"); } IConfig startupConfig = config.Configs["Communications"]; if ((startupConfig == null) || (startupConfig != null) && (startupConfig.GetString("InterregionComms", "RESTComms") == "RESTComms")) { m_log.Info("[REST COMMS]: Enabling InterregionComms RESTComms module"); m_enabled = true; InitOnce(scene); } } if (!m_enabled) return; InitEach(scene); }
public void LoadLibrary(ILibraryService service, IConfigSource source, IRegistryCore registry) { m_service = service; m_registry = registry; m_Database = Framework.Utilities.DataManager.RequestPlugin<IInventoryData>(); IConfig libConfig = source.Configs["InventoryIARLoader"]; const string pLibrariesLocation = "DefaultInventory/"; AddDefaultAssetTypes(); if (libConfig != null) { if (libConfig.GetBoolean("WipeLibrariesOnNextLoad", false)) { service.ClearDefaultInventory(); //Nuke it libConfig.Set("WipeLibrariesOnNextLoad", false); source.Save(); } if (libConfig.GetBoolean("PreviouslyLoaded", false)) return; //If it is loaded, don't reload foreach (string iarFileName in Directory.GetFiles(pLibrariesLocation, "*.iar")) { LoadLibraries(iarFileName); } } }
public void PostStart(IConfigSource config, IRegistryCore registry) { IConfig handlerConfig = config.Configs["Handlers"]; if (handlerConfig.GetString("SimulationInHandler", "") != Name) return; bool secure = handlerConfig.GetBoolean("SecureSimulation", true); IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("SimulationInHandlerPort")); m_LocalSimulationService = registry.RequestModuleInterface<ISimulationService>(); string path = "/" + UUID.Random().ToString() + "/agent/"; IGridRegisterModule registerModule = registry.RequestModuleInterface<IGridRegisterModule>(); if (registerModule != null && secure) registerModule.AddGenericInfo("SimulationAgent", path); else { secure = false; path = "/agent/"; } server.AddHTTPHandler(path, new AgentHandler(m_LocalSimulationService.GetInnerService(), secure).Handler); server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService.GetInnerService()).Handler); }
public void Initialize(IGenericData GenericData, IConfigSource source, string defaultConnectionString) { if (source.Configs["AuroraConnectors"].GetString("ProfileConnector", "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 = source.Configs["AuroraData"].GetString("RemoteServerURI", ""); if (m_ServerURI == "") //Blank, not set up { OpenSim.Framework.Console.MainConsole.Instance.Output("[AuroraDataService]: Falling back on local connector for " + "ProfileConnector", "None"); GD = GenericData; if (source.Configs[Name] != null) defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString); GD.ConnectToDatabase(defaultConnectionString); DataManager.DataManager.RegisterPlugin(Name, this); } } }
/// <summary> /// Default constructor /// </summary> /// <param name="config">Config source to load defaults from</param> public ThrottleRates(IConfigSource config) { try { IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"]; // Current default total is 66750 Resend = throttleConfig.GetInt("resend_default", 6625); Land = throttleConfig.GetInt("land_default", 9125); Wind = throttleConfig.GetInt("wind_default", 1750); Cloud = throttleConfig.GetInt("cloud_default", 1750); Task = throttleConfig.GetInt("task_default", 18500); Texture = throttleConfig.GetInt("texture_default", 18500); Asset = throttleConfig.GetInt("asset_default", 10500); Total = throttleConfig.GetInt("client_throttle_max_bps", 0); AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false); MinimumAdaptiveThrottleRate = throttleConfig.GetInt("adaptive_throttle_min_bps", 32000); CannibalizeTextureRate = (double)throttleConfig.GetFloat("CannibalizeTextureRate", 0.0f); CannibalizeTextureRate = Util.Clamp<double>(CannibalizeTextureRate,0.0, 0.9); } catch (Exception) { } }
public virtual void Initialise(Scene scene, IConfigSource config) { m_gConfig = config; IConfig startupConfig = m_gConfig.Configs["Startup"]; ReadConfigAndPopulate(scene, startupConfig, "Startup"); if (enabledYN) { m_scene = scene; scene.RegisterModuleInterface<IEventQueue>(this); // Register fallback handler // Why does EQG Fail on region crossings! //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); scene.EventManager.OnNewClient += OnNewClient; // TODO: Leaving these open, or closing them when we // become a child is incorrect. It messes up TP in a big // way. CAPS/EQ need to be active as long as the UDP // circuit is there. scene.EventManager.OnClientClosed += ClientClosed; scene.EventManager.OnMakeChildAgent += MakeChildAgent; scene.EventManager.OnRegisterCaps += OnRegisterCaps; } else { m_gConfig = null; } }
// ----------------------------------------------------------------- /// <summary> /// Initialise this shared module /// </summary> /// <param name="scene">this region is getting initialised</param> /// <param name="source">nini config, we are not using this</param> // ----------------------------------------------------------------- public void Initialise(IConfigSource config) { try { if ((m_config = config.Configs["JsonStore"]) == null) { // There is no configuration, the module is disabled // m_log.InfoFormat("[JsonStore] no configuration info"); return; } m_enabled = m_config.GetBoolean("Enabled", m_enabled); m_enableObjectStore = m_config.GetBoolean("EnableObjectStore", m_enableObjectStore); m_maxStringSpace = m_config.GetInt("MaxStringSpace", m_maxStringSpace); if (m_maxStringSpace == 0) m_maxStringSpace = Int32.MaxValue; } catch (Exception e) { m_log.Error("[JsonStore]: initialization error: {0}", e); return; } if (m_enabled) m_log.DebugFormat("[JsonStore]: module is enabled"); }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { // Do not run this module by default. return; } else { // if groups aren't enabled, we're not needed. // if we're not specified as the connector to use, then we're not wanted if ((groupsConfig.GetBoolean("Enabled", false) == false) || (groupsConfig.GetString("ServicesConnectorModule", "Default") != Name)) { m_connectorEnabled = false; return; } //m_log.InfoFormat("[AURORA-GROUPS-CONNECTOR]: Initializing {0}", this.Name); m_connectorEnabled = true; } }
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(IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; if (cnf == null) { enabled = false; return; } if (cnf != null && cnf.GetString("OfflineMessageModule", "None") != "OfflineMessageModule") { enabled = false; return; } m_RestURL = cnf.GetString("OfflineMessageURL", ""); if (m_RestURL == "") { m_log.Error("[OFFLINE MESSAGING] Module was enabled, but no URL is given, disabling"); enabled = false; return; } m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages); }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { // Do not run this module by default. return; } else { m_groupsEnabled = groupsConfig.GetBoolean("Enabled", false); if (!m_groupsEnabled) { return; } if (groupsConfig.GetString("Module", "Default") != Name) { m_groupsEnabled = false; return; } m_log.InfoFormat("[Groups]: Initializing {0}", this.Name); m_groupNoticesEnabled = groupsConfig.GetBoolean("NoticesEnabled", true); m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false); m_levelGroupCreate = groupsConfig.GetInt("LevelGroupCreate", 0); } }
public void Initialize(IConfigSource config, IRegistryCore registry) { if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand( "save archive", "save archive", "Saves a WhiteCore '.abackup' archive (deprecated)", SaveWhiteCoreArchive, true, false); MainConsole.Instance.Commands.AddCommand( "load archive", "load archive", "Loads a WhiteCore '.abackupArchive", LoadWhiteCoreArchive, true, false); } //Register the extension const string ext = ".abackup"; try { if(Util.IsWindows()) { RegistryKey key = Registry.ClassesRoot.CreateSubKey(ext + "\\DefaultIcon"); key.SetValue("", Application.StartupPath + "\\CrateDownload.ico"); key.Close(); } } catch { } //Register the interface registry.RegisterModuleInterface<IWhiteCoreBackupArchiver>(this); }
public virtual void Initialise(IConfigSource source) { IConfig config = source.Configs["InventoryService"]; if (config == null) { m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); throw new Exception("Inventory connector init error"); } string serviceURI = config.GetString("InventoryServerURI", String.Empty); if (serviceURI == String.Empty) { m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); throw new Exception("Inventory connector init error"); } m_ServerURI = serviceURI; m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); StatsManager.RegisterStat( new Stat( "RequestsMade", "Requests made", "Number of requests made to the remove inventory service", "requests", "inventory", serviceURI, StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, s => s.Value = RequestsMade, StatVerbosity.Debug)); }
private bool m_enabled = false; // Module is only enabled if running in grid mode #region IRegionModule Members public void Initialize(Scene scene, IConfigSource source) { if (m_firstScene == null) { m_firstScene = scene; IConfig startupConfig = source.Configs["Startup"]; if (startupConfig != null) { m_enabled = startupConfig.GetBoolean("gridmode", false); } IConfig netConfig = source.Configs["Network"]; if (netConfig != null) { _gridSendKey = netConfig.GetString("grid_send_key"); } else { throw new Exception("LLProxyLoginModule: Network configuration not found"); } if (m_enabled) { AddHttpHandlers(); } } if (m_enabled) { AddScene(scene); } }
public TomlTable Load(IConfigSource source) { #pragma warning disable SA1312 IPersistableConfig _; return this.LoadInternal(source, out _); #pragma warning restore SA1312 }
public virtual void Initialize(IConfigSource config, IRegistryCore registry) { _config = config; m_registry = registry; IConfig agentConfig = config.Configs["AgentProcessing"]; if (agentConfig != null) { m_enabled = agentConfig.GetString("Module", "AgentProcessing") == "AgentProcessing"; VariableRegionSight = agentConfig.GetBoolean("UseVariableRegionSightDistance", VariableRegionSight); MaxVariableRegionSight = agentConfig.GetInt("MaxDistanceVariableRegionSightDistance", MaxVariableRegionSight); } if (m_enabled) { m_registry.RegisterModuleInterface<IAgentProcessing>(this); IConfig auroraConfig = _config.Configs["AuroraConnectors"]; IGenericsConnector genericsConnector = Aurora.DataManager.DataManager.RequestPlugin<IGenericsConnector>(); if (!auroraConfig.GetBoolean("CapsServiceDoRemoteCalls", false)) { genericsConnector.AddGeneric(UUID.Zero, "CapsServiceURL", "CapsURL", new OSDWrapper { Info = MainServer.Instance.ServerURI }.ToOSD()); genericsConnector.AddGeneric(UUID.Zero, "CapsServiceURL", "CapsPassword", new OSDWrapper { Info = new System.Random().NextDouble() * 1000 }.ToOSD()); } Init(registry, "CapsService"); } }
public UserAccountServiceBase(IConfigSource config) : base(config) { string dllName = String.Empty; string connString = String.Empty; string realm = "UserAccounts"; IConfig dbConfig = config.Configs["DatabaseService"]; if (dbConfig != null) { dllName = dbConfig.GetString("StorageProvider", String.Empty); connString = dbConfig.GetString("ConnectionString", String.Empty); } IConfig userConfig = config.Configs["UserAccountService"]; if (userConfig == null) throw new Exception("No UserAccountService configuration"); dllName = userConfig.GetString("StorageProvider", dllName); if (dllName == String.Empty) throw new Exception("No StorageProvider configured"); connString = userConfig.GetString("ConnectionString", connString); realm = userConfig.GetString("Realm", realm); m_Database = LoadPlugin<IUserAccountData>(dllName, new Object[] {connString, realm}); if (m_Database == null) throw new Exception("Could not find a storage interface in the given module"); }
public virtual void Initialise(IConfigSource config) { IConfig cnfg = config.Configs["WebStats"]; if (cnfg != null) enabled = cnfg.GetBoolean("enabled", false); }
public void Initialize(IConfigSource config, IRegistryCore registry) { ReadConfig(config); IConfig handlers = config.Configs["Handlers"]; if (handlers.GetString("NeighborHandler", "") == Name) registry.RegisterModuleInterface<INeighborService>(this); }
public void Initialize(IConfigSource config, IRegistryCore registry) { registry.RegisterModuleInterface<IAuthorizationService>(this); m_registry = registry; MainConsole.Instance.Debug("[Authorization Service]: Local Authorization service enabled"); }
public void Initialise(IConfigSource source) { try { IConfig statConfig = source.Configs["Statistics.Binary"]; if (statConfig != null) { if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled")) { if (statConfig.Contains("collect_region_stats")) { if (statConfig.GetBoolean("collect_region_stats")) { m_collectStats = true; } } if (statConfig.Contains("region_stats_period_seconds")) { m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds")); } if (statConfig.Contains("stats_dir")) { m_statsDir = statConfig.GetString("stats_dir"); } } } } catch { // if it doesn't work, we don't collect anything } }
public SimulationDataService(IConfigSource config) : base(config) { string dllName = String.Empty; string connString = String.Empty; // Try reading the [DatabaseService] section, if it exists IConfig dbConfig = config.Configs["DatabaseService"]; if (dbConfig != null) { dllName = dbConfig.GetString("StorageProvider", String.Empty); connString = dbConfig.GetString("ConnectionString", String.Empty); } // Try reading the [SimulationDataStore] section IConfig simConfig = config.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) throw new Exception("No StorageProvider configured"); m_database = LoadPlugin<ISimulationDataStore>(dllName, new Object[] { connString }); if (m_database == null) throw new Exception("Could not find a storage interface in the given module"); }
public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; if (groupsConfig == null) { m_Enabled = false; //m_log.Info("[GROUPS]: No configuration found. Using defaults"); } else { if (!groupsConfig.GetBoolean("Enabled", false)) { m_Enabled = false; //m_log.Info("[GROUPS]: Groups disabled in configuration"); return; } if (groupsConfig.GetString("Module", "Default") != "Default") { m_Enabled = false; return; } } m_Enabled = true; }
public ObjectHandler(ISimulationService sim, IConfigSource source) { IConfig simulationConfig = source.Configs["Handlers"]; if(simulationConfig != null) m_allowForeignIncomingObjects = simulationConfig.GetBoolean("AllowIncomingForeignObjects", m_allowForeignIncomingObjects ); m_SimulationService = sim; }