本文整理汇总了C#中ISimulationBase类的典型用法代码示例。如果您正苦于以下问题:C# ISimulationBase类的具体用法?C# ISimulationBase怎么用?C# ISimulationBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISimulationBase类属于命名空间,在下文中一共展示了ISimulationBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BaseMain
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);
}
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:67,代码来源:BaseApplication.cs
示例2: Initialize
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);
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:25,代码来源:RemoteConsole.cs
示例3: SetUpConsole
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);
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:28,代码来源:BaseService.cs
示例4: Initialise
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;
}
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:34,代码来源:PhysicsInitializer.cs
示例5: Initialise
public void Initialise(Scene scene, IConfigSource source, ISimulationBase openSimBase)
{
m_config = source;
m_scenes.Add(scene);
//Register the interface
scene.RegisterModuleInterface<IGridRegisterModule>(this);
}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:7,代码来源:RegisterRegionWithGrid.cs
示例6: Initialize
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);
}
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:25,代码来源:RemoteConsole.cs
示例7: 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);
}
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:26,代码来源:RegionLoaderDataBaseSystem.cs
示例8: Initialize
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);
}
}
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:32,代码来源:LocalAgentConnector.cs
示例9: Initialise
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());
}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:28,代码来源:ServicesInitializer.cs
示例10: FinishStartup
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;
}
}
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:35,代码来源:EstateInitializer.cs
示例11: Initialise
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);
}
}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:59,代码来源:DataService.cs
示例12: Initialize
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);
}
}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:8,代码来源:SimianMuteListConnector.cs
示例13: FinishStartup
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);
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:8,代码来源:RegisterRegionWithGrid.cs
示例14: Initialise
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);
}
开发者ID:Gnu32,项目名称:Silverfin,代码行数:9,代码来源:RegionLoaderWebServer.cs
示例15: Initialize
public override void Initialize (IConfigSource source, ISimulationBase simBase)
{
if (source.Configs ["Console"] == null ||
source.Configs ["Console"].GetString ("Console", Name) != Name) {
return;
}
LocalInitialize (source, simBase);
}
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:9,代码来源:LocalConsole.cs
示例16: IncomingCapsRequest
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));
}
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:57,代码来源:InventoryCAPS.cs
示例17: RegionManager
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();
}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:10,代码来源:RegionManager.cs
示例18: Initialise
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);
}
开发者ID:HGExchange,项目名称:Aurora-Sim,代码行数:10,代码来源:RegisterRegionWithGrid.cs
示例19: Initialize
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);
}
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:10,代码来源:RemoteOfflineMessagesConnector.cs
示例20: Initialize
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);
}
}
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:10,代码来源:RemoteGroupsServiceConnector.cs
注:本文中的ISimulationBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论