本文整理汇总了C#中IConfigSource类的典型用法代码示例。如果您正苦于以下问题:C# IConfigSource类的具体用法?C# IConfigSource怎么用?C# IConfigSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigSource类属于命名空间,在下文中一共展示了IConfigSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
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;
}
}
示例2: Initialize
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();
}
示例3: SimulationServiceInConnector
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));
}
示例4: Initialise
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");
}
示例5: InventoryServiceInConnector
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");
}
示例6: Initialize
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);
}
示例7: LoadLibrary
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);
}
}
}
示例8: PostStart
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);
}
示例9: Initialize
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);
}
}
}
示例10: ThrottleRates
/// <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) { }
}
示例11: Initialise
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;
}
}
示例12: Initialise
// -----------------------------------------------------------------
/// <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");
}
示例13: Initialise
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;
}
}
示例14: Initialise
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);
}
示例15: Initialise
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);
}