本文整理汇总了C#中OpenSim.OpenSimBase类的典型用法代码示例。如果您正苦于以下问题:C# OpenSimBase类的具体用法?C# OpenSimBase怎么用?C# OpenSimBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenSimBase类属于OpenSim命名空间,在下文中一共展示了OpenSimBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
private int m_ttl = 2592000; //1 month
#endregion
#region IApplicationPlugin Members
public void Initialize(OpenSimBase openSim)
{
IConfig config = openSim.ConfigSource.Source.Configs["ChatLogModule"];
if (config == null) return;
m_enabled = config.GetBoolean("Enabled", false) && config.GetString("Backend", "") == "Cassandra12Backend";
m_debug = config.GetBoolean("Debug", m_debug);
m_ttl = config.GetInt("TTL", m_ttl);
Q_INS_TTL = Q_INSERT + m_ttl.ToString() + ";";
if (m_enabled)
{
ExtractSeedNodesFromConfig(config);
var clusterb = Cluster.Builder();
foreach (string node in m_seedNodes)
{
if (m_debug) m_log.DebugFormat("[CHATLOG.Cassandra]: Adding seed node {0}", node);
clusterb.AddContactPoint(node);
}
clusterb.WithDefaultKeyspace(KEYSPACE);
m_cluster = clusterb.Build();
m_session = m_cluster.Connect();
ProviderRegistry.Instance.RegisterInterface<IChatMessageLogBackend>(this);
}
}
示例2: ApplicationPluginInitialiser
public ApplicationPluginInitialiser(OpenSimBase s)
{
if (m_log.IsDebugEnabled) {
m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
}
server = s;
}
示例3: RegionManager
public RegionManager(bool create, OpenSimBase baseOpenSim)
{
m_OpenSimBase = baseOpenSim;
OpenedForCreateRegion = create;
InitializeComponent();
if (create)
tabControl1.SelectedTab = tabPage2;
}
示例4: Initialise
public void Initialise(OpenSimBase openSim)
{
IConfig config = openSim.ConfigSource.Source.Configs["ChatLogModule"];
if (config == null) return;
m_enabled = config.GetString("Backend", "") == "FileBackend";
m_fileName = config.GetString("File", m_fileName);
if (m_enabled)
{
m_fileWriter = TextWriter.Synchronized(new StreamWriter(m_fileName, true));
ProviderRegistry.Instance.RegisterInterface<IChatMessageLogBackend>(this);
}
}
示例5: Initialise
public void Initialise (OpenSimBase openSim)
{
m_log.DebugFormat("[REGIONMODULES]: Initializing...");
m_openSim = openSim;
openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
string id = AddinManager.CurrentAddin.Id;
int pos = id.LastIndexOf(".");
if (pos == -1) m_name = id;
else m_name = id.Substring(pos + 1);
//ExtensionNodeList list = AddinManager.GetExtensionNodes("/OpenSim/RegionModules");
// load all the (new) region-module classes
foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
{
// TODO why does node.Type.isSubclassOf(typeof(ISharedRegionModule)) not work?
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
{
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
m_sharedModules.Add(node.Type);
}
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
{
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
m_nonSharedModules.Add(node.Type);
}
else
m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
}
// now we've got all the region-module classes loaded, create one instance of every ISharedRegionModule,
// initialize and postinitialize it. This Initialise we are in is called before LoadRegion.PostInitialise
// is called (which loads the regions), so we don't have any regions in the server yet.
foreach (Type type in m_sharedModules)
{
ISharedRegionModule module = (ISharedRegionModule)Activator.CreateInstance(type);
m_sharedInstances.Add(module);
module.Initialise(openSim.ConfigSource.Source);
}
foreach (ISharedRegionModule module in m_sharedInstances)
{
module.PostInitialise();
}
}
示例6: Initialise
// List of shared module instances, for adding to Scenes
//private List<ISharedRegionModule> m_sharedInstances =
// new List<ISharedRegionModule>();
#region IApplicationPlugin implementation
public void Initialise (OpenSimBase openSim)
{
m_openSim = openSim;
m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
m_log.DebugFormat("[REGIONMODULES]: Initializing...");
// The [Modules] section in the ini file
IConfig modulesConfig = m_openSim.ConfigSource.Source.Configs["Modules"];
if (modulesConfig == null)
modulesConfig = m_openSim.ConfigSource.Source.AddConfig("Modules");
CompositionContainer moduleContainer = openSim.ModuleContainer;
IEnumerable<Lazy<object, object>> exportEnumerable = moduleContainer.GetExports(typeof(IRegionModuleBase), null, null);
foreach (Lazy<object, object> lazyExport in exportEnumerable)
{
IDictionary<string, object> metadata = (IDictionary<string, object>)lazyExport.Metadata;
object nameObj;
if (metadata.TryGetValue("Name", out nameObj))
{
string name = (string)nameObj;
// TODO: Whitelist before we call lazyExport.Value, which instantiates
if (lazyExport.Value is ISharedRegionModule)
{
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}", name);
m_sharedModules.Add((ISharedRegionModule)lazyExport.Value);
}
else if (lazyExport.Value is INonSharedRegionModule)
{
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}", name);
m_nonSharedModules.Add((INonSharedRegionModule)lazyExport.Value);
}
}
}
foreach (ISharedRegionModule node in m_sharedModules)
{
// OK, we're up and running
node.Initialise(m_openSim.ConfigSource.Source);
}
}
示例7: Startup
public static void Startup(ArgvConfigSource configSource)
{
OpenSimBase m_sim = new OpenSimBase(configSource);
try
{
m_sim.Startup();
}
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
m_sim.Shutdown(false);
//Then let it restart if it needs
return;
}
Environment.Exit(0);
}
示例8: XSimStatusHandler
public XSimStatusHandler(OpenSimBase sim)
: base("GET", "/" + Util.SHA1Hash(sim.osSecret), "XSimStatus", "Simulator XStatus")
{
m_opensim = sim;
}
示例9: XSimStatusHandler
public XSimStatusHandler(OpenSimBase sim)
{
m_opensim = sim;
osXStatsURI = Util.SHA1Hash(sim.osSecret);
}
示例10: DiagnosticsManager
public DiagnosticsManager(IStatsCollector stats, OpenSimBase baseOpenSim)
{
m_OpenSimBase = baseOpenSim;
m_stats = stats;
Timer PeriodicDiagnosticsTimer = new Timer(60 * 60 * 1000); // One hour
PeriodicDiagnosticsTimer.Elapsed += LogDiagnostics;
PeriodicDiagnosticsTimer.Enabled = true;
PeriodicDiagnosticsTimer.Start();
}
示例11: UXAgentStatusHandler
public UXAgentStatusHandler(OpenSimBase sim)
: base("GET", "/" + sim.agentStatsURI, "UXAgentStatus", "Agent UXStatus")
{
// Save reference to OpenSim region server interface
m_opensim = sim;
}
示例12: Startup
public static bool Startup(ArgvConfigSource configSource)
{
try
{
OpenSimBase m_sim = new OpenSimBase(configSource);
m_sim.Startup();
}
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);
}
return false;
}
return true;
}
示例13: ApplicationPluginInitialiser
public ApplicationPluginInitialiser(OpenSimBase s)
{
server = s;
}
示例14: Initialize
public void Initialize (IOpenSimBase openSim)
{
m_openSim = (OpenSimBase)openSim;
m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
//m_log.DebugFormat("[REGIONMODULES]: Initializing...");
// Who we are
/*string id = AddinManager.CurrentAddin.Id;
// Make friendly name
int pos = id.LastIndexOf(".");
if (pos == -1)
m_name = id;
else
m_name = id.Substring(pos + 1);
// The [Modules] section in the ini file
IConfig modulesConfig =
m_openSim.ConfigSource.Configs["Modules"];
if (modulesConfig == null)
modulesConfig = m_openSim.ConfigSource.AddConfig("Modules");*/
// Scan modules and load all that aren't disabled
m_sharedInstances = Aurora.Framework.AuroraModuleLoader.PickupModules<ISharedRegionModule>();
/*foreach (TypeExtensionNode node in
AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
{
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
{
// Get the config string
string moduleString =
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// We have a selector
if (moduleString != String.Empty)
{
// Allow disabling modules even if they don't have
// support for it
if (moduleString == "disabled")
continue;
// Split off port, if present
string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
// Format is [port/][class]
string className = moduleParts[0];
if (moduleParts.Length > 1)
className = moduleParts[1];
// Match the class name if given
if (className != String.Empty &&
node.Type.ToString() != className)
continue;
}
//m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
m_sharedModules.Add(node);
}
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
{
// Get the config string
string moduleString =
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// We have a selector
if (moduleString != String.Empty)
{
// Allow disabling modules even if they don't have
// support for it
if (moduleString == "disabled")
continue;
// Split off port, if present
string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
// Format is [port/][class]
string className = moduleParts[0];
if (moduleParts.Length > 1)
className = moduleParts[1];
// Match the class name if given
if (className != String.Empty &&
node.Type.ToString() != className)
continue;
}
//m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
m_nonSharedModules.Add(node);
}
else
m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
}*/
/*// Load and init the module. We try a constructor with a port
// if a port was given, fall back to one without if there is
// no port or the more specific constructor fails.
// This will be removed, so that any module capable of using a port
// must provide a constructor with a port in the future.
// For now, we do this so migration is easy.
//
foreach (TypeExtensionNode node in m_sharedModules)
{
//.........这里部分代码省略.........
示例15: Initialise
public void Initialise (OpenSimBase openSim)
{
m_openSim = openSim;
m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
m_log.DebugFormat("[REGIONMODULES]: Initializing...");
// Who we are
string id = AddinManager.CurrentAddin.Id;
// Make friendly name
int pos = id.LastIndexOf(".");
if (pos == -1)
m_name = id;
else
m_name = id.Substring(pos + 1);
// The [Modules] section in the ini file
IConfig modulesConfig =
m_openSim.ConfigSource.Source.Configs["Modules"];
if (modulesConfig == null)
modulesConfig = m_openSim.ConfigSource.Source.AddConfig("Modules");
Dictionary<RuntimeAddin, IList<int>> loadedModules = new Dictionary<RuntimeAddin, IList<int>>();
// Scan modules and load all that aren't disabled
foreach (TypeExtensionNode node in
AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
{
IList<int> loadedModuleData;
if (!loadedModules.ContainsKey(node.Addin))
loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
loadedModuleData = loadedModules[node.Addin];
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
{
if (CheckModuleEnabled(node, modulesConfig))
{
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
m_sharedModules.Add(node);
loadedModuleData[0]++;
}
}
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
{
if (CheckModuleEnabled(node, modulesConfig))
{
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
m_nonSharedModules.Add(node);
loadedModuleData[1]++;
}
}
else
{
m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
loadedModuleData[2]++;
}
}
foreach (KeyValuePair<RuntimeAddin, IList<int>> loadedModuleData in loadedModules)
{
m_log.InfoFormat(
"[REGIONMODULES]: From plugin {0}, (version {1}), loaded {2} modules, {3} shared, {4} non-shared {5} unknown",
loadedModuleData.Key.Id,
loadedModuleData.Key.Version,
loadedModuleData.Value[0] + loadedModuleData.Value[1] + loadedModuleData.Value[2],
loadedModuleData.Value[0], loadedModuleData.Value[1], loadedModuleData.Value[2]);
}
// Load and init the module. We try a constructor with a port
// if a port was given, fall back to one without if there is
// no port or the more specific constructor fails.
// This will be removed, so that any module capable of using a port
// must provide a constructor with a port in the future.
// For now, we do this so migration is easy.
//
foreach (TypeExtensionNode node in m_sharedModules)
{
Object[] ctorArgs = new Object[] { (uint)0 };
// Read the config again
string moduleString =
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
// Get the port number, if there is one
if (moduleString != String.Empty)
{
// Get the port number from the string
string[] moduleParts = moduleString.Split(new char[] { '/' },
2);
if (moduleParts.Length > 1)
ctorArgs[0] = Convert.ToUInt32(moduleParts[0]);
}
// Try loading and initilaizing the module, using the
// port if appropriate
ISharedRegionModule module = null;
try
//.........这里部分代码省略.........