aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools')
-rw-r--r--OpenSim/Tools/Export/OpenSimExport.cs36
1 files changed, 16 insertions, 20 deletions
diff --git a/OpenSim/Tools/Export/OpenSimExport.cs b/OpenSim/Tools/Export/OpenSimExport.cs
index b0764ff..4a5ba5d 100644
--- a/OpenSim/Tools/Export/OpenSimExport.cs
+++ b/OpenSim/Tools/Export/OpenSimExport.cs
@@ -27,15 +27,11 @@
27*/ 27*/
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Reflection;
31using Nini.Config; 30using Nini.Config;
32using OpenSim;
33using OpenSim.Framework; 31using OpenSim.Framework;
34using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
35using OpenSim.Region.Environment; 33using OpenSim.Region.Environment;
36using OpenSim.Region.Environment.Scenes; 34using OpenSim.Region.Environment.Scenes;
37using Mono.Addins;
38using Mono.Addins.Description;
39 35
40namespace OpenSim.Tools.Export 36namespace OpenSim.Tools.Export
41{ 37{
@@ -43,7 +39,7 @@ namespace OpenSim.Tools.Export
43 { 39 {
44 public IniConfigSource config; 40 public IniConfigSource config;
45 public StorageManager sman; 41 public StorageManager sman;
46 42
47 public OpenSimExport(IniConfigSource config) 43 public OpenSimExport(IniConfigSource config)
48 { 44 {
49 this.config = config; 45 this.config = config;
@@ -53,13 +49,13 @@ namespace OpenSim.Tools.Export
53 49
54 // TODO: this really sucks, but given the way we do 50 // TODO: this really sucks, but given the way we do
55 // logging in OpenSim, we need to establish a log up front 51 // logging in OpenSim, we need to establish a log up front
56 52
57 MainLog.Instance = CreateLog(); 53 MainLog.Instance = CreateLog();
58 54
59 this.sman = new StorageManager( 55 sman = new StorageManager(
60 startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"), 56 startup.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"),
61 startup.GetString("storage_connection_string","") 57 startup.GetString("storage_connection_string", "")
62 ); 58 );
63 } 59 }
64 60
65 public static void Main(string[] args) 61 public static void Main(string[] args)
@@ -67,10 +63,10 @@ namespace OpenSim.Tools.Export
67 OpenSimExport export = new OpenSimExport(InitConfig(args)); 63 OpenSimExport export = new OpenSimExport(InitConfig(args));
68 RegionInfo reg = new RegionInfo("Sara Jane", "Regions/1000-1000.xml"); 64 RegionInfo reg = new RegionInfo("Sara Jane", "Regions/1000-1000.xml");
69 65
70 System.Console.WriteLine("This application does nothing useful yet: " + reg.RegionID); 66 Console.WriteLine("This application does nothing useful yet: " + reg.RegionID);
71 foreach (SceneObjectGroup group in export.sman.DataStore.LoadObjects(reg.RegionID)) 67 foreach (SceneObjectGroup group in export.sman.DataStore.LoadObjects(reg.RegionID))
72 { 68 {
73 System.Console.WriteLine("{0} -> {1}", reg.RegionID, group.UUID); 69 Console.WriteLine("{0} -> {1}", reg.RegionID, group.UUID);
74 } 70 }
75 } 71 }
76 72
@@ -83,25 +79,25 @@ namespace OpenSim.Tools.Export
83 79
84 return new LogBase((Path.Combine(Util.logDir(), "export.log")), "Export", null, true); 80 return new LogBase((Path.Combine(Util.logDir(), "export.log")), "Export", null, true);
85 } 81 }
86 82
87 83
88 private static IniConfigSource InitConfig(string[] args) 84 private static IniConfigSource InitConfig(string[] args)
89 { 85 {
90 System.Console.WriteLine("Good"); 86 Console.WriteLine("Good");
91 ArgvConfigSource configSource = new ArgvConfigSource(args); 87 ArgvConfigSource configSource = new ArgvConfigSource(args);
92 configSource.AddSwitch("Startup", "inifile"); 88 configSource.AddSwitch("Startup", "inifile");
93 89
94 IConfig startupConfig = configSource.Configs["Startup"]; 90 IConfig startupConfig = configSource.Configs["Startup"];
95 string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini"); 91 string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini");
96 System.Console.WriteLine(iniFilePath); 92 Console.WriteLine(iniFilePath);
97 IniConfigSource config = new IniConfigSource(); 93 IniConfigSource config = new IniConfigSource();
98 //check for .INI file (either default or name passed in command line) 94 //check for .INI file (either default or name passed in command line)
99 if(! File.Exists(iniFilePath)) 95 if (! File.Exists(iniFilePath))
100 { 96 {
101 iniFilePath = Path.Combine(Util.configDir(), iniFilePath); 97 iniFilePath = Path.Combine(Util.configDir(), iniFilePath);
102 } 98 }
103 99
104 if(File.Exists(iniFilePath)) 100 if (File.Exists(iniFilePath))
105 { 101 {
106 config.Merge(new IniConfigSource(iniFilePath)); 102 config.Merge(new IniConfigSource(iniFilePath));
107 config.Merge(configSource); 103 config.Merge(configSource);
@@ -109,8 +105,8 @@ namespace OpenSim.Tools.Export
109 else 105 else
110 { 106 {
111 // no default config files, so set default values, and save it 107 // no default config files, so set default values, and save it
112 System.Console.WriteLine("We didn't find a config!"); 108 Console.WriteLine("We didn't find a config!");
113 config.Merge(OpenSim.OpenSimMain.DefaultConfig()); 109 config.Merge(OpenSimMain.DefaultConfig());
114 config.Merge(configSource); 110 config.Merge(configSource);
115 } 111 }
116 112