update to OpenSimExport to test loading of a Region

afrisby
Sean Dague 2007-12-14 22:37:51 +00:00
parent fa35101b71
commit a7320acac1
1 changed files with 22 additions and 7 deletions

View File

@ -27,6 +27,7 @@
*/ */
using System; using System;
using System.IO; using System.IO;
using System.Reflection;
using Nini.Config; using Nini.Config;
using OpenSim; using OpenSim;
using OpenSim.Framework; using OpenSim.Framework;
@ -39,27 +40,44 @@ namespace OpenSim.Tools.Export
{ {
public class OpenSimExport public class OpenSimExport
{ {
private IniConfigSource config; public IniConfigSource config;
private StorageManager sman; private StorageManager sman;
public OpenSimExport(IniConfigSource config) public OpenSimExport(IniConfigSource config)
{ {
this.config = config; this.config = config;
IConfig startup = config.Configs["Startup"]; IConfig startup = config.Configs["Startup"];
sman = new StorageManager( // AddinManager.Initialize(".");
// AddinManager.Registry.Update(null);
// TODO: this really sucks, but given the way we do
// logging in OpenSim, we need to establish a log up front
MainLog.Instance = CreateLog();
this.sman = new StorageManager(
startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"), startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"),
startup.GetString("storage_connection_string","") startup.GetString("storage_connection_string","")
); );
} }
public static void Main(string[] args) public static void Main(string[] args)
{ {
OpenSimExport export = new OpenSimExport(InitConfig(args)); OpenSimExport export = new OpenSimExport(InitConfig(args));
RegionInfo reg = new RegionInfo("Sara Jane", "Regions/1000-1000.xml");
System.Console.WriteLine("This application does nothing useful yet"); System.Console.WriteLine("This application does nothing useful yet: " + reg.RegionID);
} }
protected LogBase CreateLog()
{
if (!Directory.Exists(Util.logDir()))
{
Directory.CreateDirectory(Util.logDir());
}
return new LogBase((Path.Combine(Util.logDir(), "export.log")), "Export", null, true);
}
private static IniConfigSource InitConfig(string[] args) private static IniConfigSource InitConfig(string[] args)
@ -68,9 +86,6 @@ namespace OpenSim.Tools.Export
ArgvConfigSource configSource = new ArgvConfigSource(args); ArgvConfigSource configSource = new ArgvConfigSource(args);
configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "inifile");
// AddinManager.Initialize(".");
// AddinManager.Registry.Update(null);
IConfig startupConfig = configSource.Configs["Startup"]; IConfig startupConfig = configSource.Configs["Startup"];
string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini"); string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini");