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