aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/Application.cs11
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs29
-rw-r--r--OpenSim/Region/Application/HGOpenSimNode.cs46
-rw-r--r--OpenSim/Region/Application/IApplicationPlugin.cs13
-rw-r--r--OpenSim/Region/Application/OpenSim.cs345
-rw-r--r--OpenSim/Region/Application/OpenSimBackground.cs5
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs153
7 files changed, 312 insertions, 290 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 0c01b02..a7f61ff 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -39,7 +39,7 @@ namespace OpenSim
39 public class Application 39 public class Application
40 { 40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 public static string iniFilePath = ""; 43 public static string iniFilePath = "";
44 44
45 public static bool m_saveCrashDumps = false; 45 public static bool m_saveCrashDumps = false;
@@ -51,7 +51,8 @@ namespace OpenSim
51 public static void Main(string[] args) 51 public static void Main(string[] args)
52 { 52 {
53 // First line 53 // First line
54 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 54 AppDomain.CurrentDomain.UnhandledException +=
55 new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
55 56
56 XmlConfigurator.Configure(); 57 XmlConfigurator.Configure();
57 58
@@ -143,7 +144,7 @@ namespace OpenSim
143 msg += "\r\n"; 144 msg += "\r\n";
144 145
145 msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n"; 146 msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n";
146 Exception ex = (Exception)e.ExceptionObject; 147 Exception ex = (Exception) e.ExceptionObject;
147 if (ex.InnerException != null) 148 if (ex.InnerException != null)
148 { 149 {
149 msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; 150 msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
@@ -177,7 +178,7 @@ namespace OpenSim
177 m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2); 178 m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2);
178 } 179 }
179 180
180 _IsHandlingException=false; 181 _IsHandlingException = false;
181 } 182 }
182 } 183 }
183} 184} \ No newline at end of file
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index ac65e82..6a103bd 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -45,10 +45,11 @@ namespace OpenSim
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 public ConfigurationLoader() 47 public ConfigurationLoader()
48 { 48 {
49 } 49 }
50 50
51 public OpenSimConfigSource LoadConfigSettings(IConfigSource configSource, out ConfigSettings configSettings, out NetworkServersInfo networkInfo) 51 public OpenSimConfigSource LoadConfigSettings(IConfigSource configSource, out ConfigSettings configSettings,
52 out NetworkServersInfo networkInfo)
52 { 53 {
53 m_configSettings = configSettings = new ConfigSettings(); 54 m_configSettings = configSettings = new ConfigSettings();
54 m_networkServersInfo = networkInfo = new NetworkServersInfo(); 55 m_networkServersInfo = networkInfo = new NetworkServersInfo();
@@ -70,16 +71,17 @@ namespace OpenSim
70 m_config.Source.Merge(DefaultConfig()); 71 m_config.Source.Merge(DefaultConfig());
71 72
72 m_log.Info("[CONFIG] Reading configuration settings"); 73 m_log.Info("[CONFIG] Reading configuration settings");
73 74
74 Uri configUri; 75 Uri configUri;
75 String xmlPath = Path.Combine(Util.configDir(), "OpenSim.xml"); 76 String xmlPath = Path.Combine(Util.configDir(), "OpenSim.xml");
76 77
77 //check for master .INI file (name passed in command line, no default), or XML over http 78 //check for master .INI file (name passed in command line, no default), or XML over http
78 if (masterFileName.Length > 0) // If a master file name is given ... 79 if (masterFileName.Length > 0) // If a master file name is given ...
79 { 80 {
80 m_log.InfoFormat("[CONFIG] Reading config master file {0}", masterfilePath); 81 m_log.InfoFormat("[CONFIG] Reading config master file {0}", masterfilePath);
81 82
82 bool isMasterUri = Uri.TryCreate(masterFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; 83 bool isMasterUri = Uri.TryCreate(masterFileName, UriKind.Absolute, out configUri) &&
84 configUri.Scheme == Uri.UriSchemeHttp;
83 85
84 if (!ReadConfig(masterFileName, masterfilePath, m_config, isMasterUri)) 86 if (!ReadConfig(masterFileName, masterfilePath, m_config, isMasterUri))
85 { 87 {
@@ -100,10 +102,11 @@ namespace OpenSim
100 } 102 }
101 } 103 }
102 } 104 }
103 105
104 // Check for .INI file (either default or name passed on command 106 // Check for .INI file (either default or name passed on command
105 // line) or XML config source over http 107 // line) or XML config source over http
106 bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; 108 bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) &&
109 configUri.Scheme == Uri.UriSchemeHttp;
107 iniFileExists = ReadConfig(iniFileName, Application.iniFilePath, m_config, isIniUri); 110 iniFileExists = ReadConfig(iniFileName, Application.iniFilePath, m_config, isIniUri);
108 111
109 if (!iniFileExists) 112 if (!iniFileExists)
@@ -119,7 +122,7 @@ namespace OpenSim
119 m_config.Source = new XmlConfigSource(); 122 m_config.Source = new XmlConfigSource();
120 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); 123 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath));
121 } 124 }
122 } 125 }
123 126
124 m_config.Source.Merge(configSource); 127 m_config.Source.Merge(configSource);
125 128
@@ -152,7 +155,7 @@ namespace OpenSim
152 private bool ReadConfig(string iniName, string iniPath, OpenSimConfigSource m_config, bool isUri) 155 private bool ReadConfig(string iniName, string iniPath, OpenSimConfigSource m_config, bool isUri)
153 { 156 {
154 bool success = false; 157 bool success = false;
155 158
156 if (!isUri && File.Exists(iniPath)) 159 if (!isUri && File.Exists(iniPath))
157 { 160 {
158 m_log.InfoFormat("[CONFIG] Reading configuration file {0}", Path.GetFullPath(iniPath)); 161 m_log.InfoFormat("[CONFIG] Reading configuration file {0}", Path.GetFullPath(iniPath));
@@ -235,7 +238,7 @@ namespace OpenSim
235 config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); 238 config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
236 config.Set("user_source", ""); 239 config.Set("user_source", "");
237 config.Set("asset_plugin", "OpenSim.Data.SQLite.dll"); 240 config.Set("asset_plugin", "OpenSim.Data.SQLite.dll");
238 config.Set("asset_source", ""); 241 config.Set("asset_source", "");
239 config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); 242 config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
240 config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar)); 243 config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar));
241 config.Set("dump_assets_to_file", false); 244 config.Set("dump_assets_to_file", false);
@@ -307,11 +310,11 @@ namespace OpenSim
307 310
308 m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile"); 311 m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile");
309 m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile"); 312 m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile");
310 313
311 m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); 314 m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
312 } 315 }
313 316
314 m_networkServersInfo.loadFromConfiguration(m_config.Source); 317 m_networkServersInfo.loadFromConfiguration(m_config.Source);
315 } 318 }
316 } 319 }
317} 320} \ No newline at end of file
diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs
index 44c1602..6e7f1c5 100644
--- a/OpenSim/Region/Application/HGOpenSimNode.cs
+++ b/OpenSim/Region/Application/HGOpenSimNode.cs
@@ -33,11 +33,7 @@ using log4net;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Communications.Cache;
37using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
38using OpenSim.Framework.Servers;
39using OpenSim.Region.Communications.Hypergrid;
40using OpenSim.Region.Communications.Local;
41using OpenSim.Region.Framework; 37using OpenSim.Region.Framework;
42using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
43using OpenSim.Region.Framework.Scenes.Hypergrid; 39using OpenSim.Region.Framework.Scenes.Hypergrid;
@@ -68,24 +64,26 @@ namespace OpenSim
68 64
69 base.StartupSpecific(); 65 base.StartupSpecific();
70 66
71 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", "Set local coordinate to map HG regions to", RunCommand); 67 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
72 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "Link a hypergrid region", RunCommand); 68 "Set local coordinate to map HG regions to", RunCommand);
73 69 MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
70 "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
71 "Link a hypergrid region", RunCommand);
74 } 72 }
75 73
76 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 74 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
77 AgentCircuitManager circuitManager) 75 AgentCircuitManager circuitManager)
78 { 76 {
79 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices); 77 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices);
80 78
81 return 79 return
82 new HGScene( 80 new HGScene(
83 regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager, 81 regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
84 m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, 82 m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim,
85 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 83 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
86 } 84 }
87 85
88 new void RunCommand(string module, string[] cp) 86 private new void RunCommand(string module, string[] cp)
89 { 87 {
90 List<string> cmdparams = new List<string>(cp); 88 List<string> cmdparams = new List<string>(cp);
91 if (cmdparams.Count < 1) 89 if (cmdparams.Count < 1)
@@ -128,7 +126,8 @@ namespace OpenSim
128 } 126 }
129 127
130 if (cmdparams[2].Contains(":")) 128 if (cmdparams[2].Contains(":"))
131 { // New format 129 {
130 // New format
132 uint xloc, yloc; 131 uint xloc, yloc;
133 string mapName; 132 string mapName;
134 try 133 try
@@ -154,7 +153,8 @@ namespace OpenSim
154 HGHyperlink.TryLinkRegionToCoords(m_sceneManager.CurrentOrFirstScene, null, mapName, xloc, yloc); 153 HGHyperlink.TryLinkRegionToCoords(m_sceneManager.CurrentOrFirstScene, null, mapName, xloc, yloc);
155 } 154 }
156 else 155 else
157 { // old format 156 {
157 // old format
158 RegionInfo regInfo; 158 RegionInfo regInfo;
159 uint xloc, yloc; 159 uint xloc, yloc;
160 uint externalPort; 160 uint externalPort;
@@ -205,7 +205,7 @@ namespace OpenSim
205 { 205 {
206 string excludeString = cmdparams[1].ToLower(); 206 string excludeString = cmdparams[1].ToLower();
207 excludeString = excludeString.Remove(0, 12); 207 excludeString = excludeString.Remove(0, 12);
208 char[] splitter = { ';' }; 208 char[] splitter = {';'};
209 209
210 excludeSections = excludeString.Split(splitter); 210 excludeSections = excludeString.Split(splitter);
211 } 211 }
@@ -236,7 +236,7 @@ namespace OpenSim
236 m_log.Error(e.ToString()); 236 m_log.Error(e.ToString());
237 } 237 }
238 } 238 }
239 239
240 240
241 private void ReadLinkFromConfig(IConfig config) 241 private void ReadLinkFromConfig(IConfig config)
242 { 242 {
@@ -255,19 +255,23 @@ namespace OpenSim
255 255
256 if (m_enableAutoMapping) 256 if (m_enableAutoMapping)
257 { 257 {
258 xloc = (uint)((xloc % 100) + m_autoMappingX); 258 xloc = (uint) ((xloc%100) + m_autoMappingX);
259 yloc = (uint)((yloc % 100) + m_autoMappingY); 259 yloc = (uint) ((yloc%100) + m_autoMappingY);
260 } 260 }
261 261
262 if (((realXLoc == 0) && (realYLoc == 0)) || (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896)))) 262 if (((realXLoc == 0) && (realYLoc == 0)) ||
263 (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) &&
264 ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
263 { 265 {
264 if (HGHyperlink.TryCreateLink(m_sceneManager.CurrentOrFirstScene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo)) 266 if (
267 HGHyperlink.TryCreateLink(m_sceneManager.CurrentOrFirstScene, null, xloc, yloc, "", externalPort,
268 externalHostName, out regInfo))
265 { 269 {
266 regInfo.RegionName = config.GetString("localName", ""); 270 regInfo.RegionName = config.GetString("localName", "");
267 } 271 }
268 } 272 }
269 } 273 }
270 274
271 275
272 private void LinkRegionCmdUsage() 276 private void LinkRegionCmdUsage()
273 { 277 {
@@ -276,4 +280,4 @@ namespace OpenSim
276 m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]"); 280 m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]");
277 } 281 }
278 } 282 }
279} 283} \ No newline at end of file
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs
index 09e3336..2f601e9 100644
--- a/OpenSim/Region/Application/IApplicationPlugin.cs
+++ b/OpenSim/Region/Application/IApplicationPlugin.cs
@@ -38,11 +38,16 @@ namespace OpenSim
38 public class ApplicationPluginInitialiser : PluginInitialiserBase 38 public class ApplicationPluginInitialiser : PluginInitialiserBase
39 { 39 {
40 private OpenSimBase server; 40 private OpenSimBase server;
41 public ApplicationPluginInitialiser (OpenSimBase s) { server = s; } 41
42 public override void Initialise (IPlugin plugin) 42 public ApplicationPluginInitialiser(OpenSimBase s)
43 {
44 server = s;
45 }
46
47 public override void Initialise(IPlugin plugin)
43 { 48 {
44 IApplicationPlugin p = plugin as IApplicationPlugin; 49 IApplicationPlugin p = plugin as IApplicationPlugin;
45 p.Initialise (server); 50 p.Initialise(server);
46 } 51 }
47 } 52 }
48} 53} \ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 920d35c..69dfac5 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -85,7 +85,8 @@ namespace OpenSim
85 m_log.Info("===================================================================="); 85 m_log.Info("====================================================================");
86 m_log.Info("========================= STARTING OPENSIM ========================="); 86 m_log.Info("========================= STARTING OPENSIM =========================");
87 m_log.Info("===================================================================="); 87 m_log.Info("====================================================================");
88 m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (ConfigurationSettings.Standalone ? "sandbox" : "grid")); 88 m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode",
89 (ConfigurationSettings.Standalone ? "sandbox" : "grid"));
89 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); 90 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
90 // http://msdn.microsoft.com/en-us/library/bb384202.aspx 91 // http://msdn.microsoft.com/en-us/library/bb384202.aspx
91 //GCSettings.LatencyMode = GCLatencyMode.Batch; 92 //GCSettings.LatencyMode = GCLatencyMode.Batch;
@@ -100,7 +101,7 @@ namespace OpenSim
100 base.StartupSpecific(); 101 base.StartupSpecific();
101 102
102 //Run Startup Commands 103 //Run Startup Commands
103 if (String.IsNullOrEmpty( m_startupCommandsFile )) 104 if (String.IsNullOrEmpty(m_startupCommandsFile))
104 { 105 {
105 m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); 106 m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
106 } 107 }
@@ -114,7 +115,7 @@ namespace OpenSim
114 { 115 {
115 m_scriptTimer = new Timer(); 116 m_scriptTimer = new Timer();
116 m_scriptTimer.Enabled = true; 117 m_scriptTimer.Enabled = true;
117 m_scriptTimer.Interval = 1200 * 1000; 118 m_scriptTimer.Interval = 1200*1000;
118 m_scriptTimer.Elapsed += RunAutoTimerScript; 119 m_scriptTimer.Elapsed += RunAutoTimerScript;
119 } 120 }
120 121
@@ -122,7 +123,8 @@ namespace OpenSim
122 123
123 // For now, start at the 'root' level by default 124 // For now, start at the 'root' level by default
124 if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it 125 if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
125 ChangeSelectedRegion("region", new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); 126 ChangeSelectedRegion("region",
127 new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
126 else 128 else
127 ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); 129 ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
128 } 130 }
@@ -130,164 +132,164 @@ namespace OpenSim
130 private void RegisterConsoleCommands() 132 private void RegisterConsoleCommands()
131 { 133 {
132 m_console.Commands.AddCommand("region", false, "clear assets", 134 m_console.Commands.AddCommand("region", false, "clear assets",
133 "clear assets", 135 "clear assets",
134 "Clear the asset cache", HandleClearAssets); 136 "Clear the asset cache", HandleClearAssets);
135 137
136 m_console.Commands.AddCommand("region", false, "force update", 138 m_console.Commands.AddCommand("region", false, "force update",
137 "force update", 139 "force update",
138 "Force the update of all objects on clients", 140 "Force the update of all objects on clients",
139 HandleForceUpdate); 141 HandleForceUpdate);
140 142
141 m_console.Commands.AddCommand("region", false, "debug packet", 143 m_console.Commands.AddCommand("region", false, "debug packet",
142 "debug packet <level>", 144 "debug packet <level>",
143 "Turn on packet debugging", Debug); 145 "Turn on packet debugging", Debug);
144 146
145 m_console.Commands.AddCommand("region", false, "debug scene", 147 m_console.Commands.AddCommand("region", false, "debug scene",
146 "debug scene <cripting> <collisions> <physics>", 148 "debug scene <cripting> <collisions> <physics>",
147 "Turn on scene debugging", Debug); 149 "Turn on scene debugging", Debug);
148 150
149 m_console.Commands.AddCommand("region", false, "change region", 151 m_console.Commands.AddCommand("region", false, "change region",
150 "change region <region name>", 152 "change region <region name>",
151 "Change current console region", ChangeSelectedRegion); 153 "Change current console region", ChangeSelectedRegion);
152 154
153 m_console.Commands.AddCommand("region", false, "save xml", 155 m_console.Commands.AddCommand("region", false, "save xml",
154 "save xml", 156 "save xml",
155 "Save a region's data in XML format", SaveXml); 157 "Save a region's data in XML format", SaveXml);
156 158
157 m_console.Commands.AddCommand("region", false, "save xml2", 159 m_console.Commands.AddCommand("region", false, "save xml2",
158 "save xml2", 160 "save xml2",
159 "Save a region's data in XML2 format", SaveXml2); 161 "Save a region's data in XML2 format", SaveXml2);
160 162
161 m_console.Commands.AddCommand("region", false, "load xml", 163 m_console.Commands.AddCommand("region", false, "load xml",
162 "load xml [-newIDs [<x> <y> <z>]]", 164 "load xml [-newIDs [<x> <y> <z>]]",
163 "Load a region's data from XML format", LoadXml); 165 "Load a region's data from XML format", LoadXml);
164 166
165 m_console.Commands.AddCommand("region", false, "load xml2", 167 m_console.Commands.AddCommand("region", false, "load xml2",
166 "load xml2", 168 "load xml2",
167 "Load a region's data from XML2 format", LoadXml2); 169 "Load a region's data from XML2 format", LoadXml2);
168 170
169 m_console.Commands.AddCommand("region", false, "save prims xml2", 171 m_console.Commands.AddCommand("region", false, "save prims xml2",
170 "save prims xml2 [<prim name> <file name>]", 172 "save prims xml2 [<prim name> <file name>]",
171 "Save named prim to XML2", SavePrimsXml2); 173 "Save named prim to XML2", SavePrimsXml2);
172 174
173 m_console.Commands.AddCommand("region", false, "load oar", 175 m_console.Commands.AddCommand("region", false, "load oar",
174 "load oar <oar name>", 176 "load oar <oar name>",
175 "Load a region's data from OAR archive", LoadOar); 177 "Load a region's data from OAR archive", LoadOar);
176 178
177 m_console.Commands.AddCommand("region", false, "save oar", 179 m_console.Commands.AddCommand("region", false, "save oar",
178 "save oar <oar name>", 180 "save oar <oar name>",
179 "Save a region's data to an OAR archive", 181 "Save a region's data to an OAR archive",
180 "More information on forthcoming options here soon", SaveOar); 182 "More information on forthcoming options here soon", SaveOar);
181 183
182 m_console.Commands.AddCommand("region", false, "edit scale", 184 m_console.Commands.AddCommand("region", false, "edit scale",
183 "edit scale <name> <x> <y> <z>", 185 "edit scale <name> <x> <y> <z>",
184 "Change the scale of a named prim", HandleEditScale); 186 "Change the scale of a named prim", HandleEditScale);
185 187
186 m_console.Commands.AddCommand("region", false, "kick user", 188 m_console.Commands.AddCommand("region", false, "kick user",
187 "kick user <first> <last>", 189 "kick user <first> <last>",
188 "Kick a user off the simulator", KickUserCommand); 190 "Kick a user off the simulator", KickUserCommand);
189 191
190 m_console.Commands.AddCommand("region", false, "show assets", 192 m_console.Commands.AddCommand("region", false, "show assets",
191 "show assets", 193 "show assets",
192 "Show asset data", HandleShow); 194 "Show asset data", HandleShow);
193 195
194 m_console.Commands.AddCommand("region", false, "show users", 196 m_console.Commands.AddCommand("region", false, "show users",
195 "show users [full]", 197 "show users [full]",
196 "Show user data", HandleShow); 198 "Show user data", HandleShow);
197 199
198 m_console.Commands.AddCommand("region", false, "show users full", 200 m_console.Commands.AddCommand("region", false, "show users full",
199 "show users full", 201 "show users full",
200 String.Empty, HandleShow); 202 String.Empty, HandleShow);
201 203
202 m_console.Commands.AddCommand("region", false, "show modules", 204 m_console.Commands.AddCommand("region", false, "show modules",
203 "show modules", 205 "show modules",
204 "Show module data", HandleShow); 206 "Show module data", HandleShow);
205 207
206 m_console.Commands.AddCommand("region", false, "show regions", 208 m_console.Commands.AddCommand("region", false, "show regions",
207 "show regions", 209 "show regions",
208 "Show region data", HandleShow); 210 "Show region data", HandleShow);
209 211
210 m_console.Commands.AddCommand("region", false, "show queues", 212 m_console.Commands.AddCommand("region", false, "show queues",
211 "show queues", 213 "show queues",
212 "Show queue data", HandleShow); 214 "Show queue data", HandleShow);
213 215
214 m_console.Commands.AddCommand("region", false, "backup", 216 m_console.Commands.AddCommand("region", false, "backup",
215 "backup", 217 "backup",
216 "Persist objects to the database now", RunCommand); 218 "Persist objects to the database now", RunCommand);
217 219
218 m_console.Commands.AddCommand("region", false, "create region", 220 m_console.Commands.AddCommand("region", false, "create region",
219 "create region", 221 "create region",
220 "Create a new region", HandleCreateRegion); 222 "Create a new region", HandleCreateRegion);
221 223
222 m_console.Commands.AddCommand("region", false, "login enable", 224 m_console.Commands.AddCommand("region", false, "login enable",
223 "login enable", 225 "login enable",
224 "Enable logins to the simulator", HandleLoginEnable); 226 "Enable logins to the simulator", HandleLoginEnable);
225 227
226 m_console.Commands.AddCommand("region", false, "login disable", 228 m_console.Commands.AddCommand("region", false, "login disable",
227 "login disable", 229 "login disable",
228 "Disable logins to the simulator", HandleLoginDisable); 230 "Disable logins to the simulator", HandleLoginDisable);
229 231
230 m_console.Commands.AddCommand("region", false, "login status", 232 m_console.Commands.AddCommand("region", false, "login status",
231 "login status", 233 "login status",
232 "Display status of logins", HandleLoginStatus); 234 "Display status of logins", HandleLoginStatus);
233 235
234 m_console.Commands.AddCommand("region", false, "restart", 236 m_console.Commands.AddCommand("region", false, "restart",
235 "restart", 237 "restart",
236 "Restart all sims in this instance", RunCommand); 238 "Restart all sims in this instance", RunCommand);
237 239
238 m_console.Commands.AddCommand("region", false, "config set", 240 m_console.Commands.AddCommand("region", false, "config set",
239 "config set <section> <field> <value>", 241 "config set <section> <field> <value>",
240 "Set a config option", HandleConfig); 242 "Set a config option", HandleConfig);
241 243
242 m_console.Commands.AddCommand("region", false, "config get", 244 m_console.Commands.AddCommand("region", false, "config get",
243 "config get <section> <field>", 245 "config get <section> <field>",
244 "Read a config option", HandleConfig); 246 "Read a config option", HandleConfig);
245 247
246 m_console.Commands.AddCommand("region", false, "config save", 248 m_console.Commands.AddCommand("region", false, "config save",
247 "config save", 249 "config save",
248 "Save current configuration", HandleConfig); 250 "Save current configuration", HandleConfig);
249 251
250 m_console.Commands.AddCommand("region", false, "command-script", 252 m_console.Commands.AddCommand("region", false, "command-script",
251 "command-script <script>", 253 "command-script <script>",
252 "Run a command script from file", RunCommand); 254 "Run a command script from file", RunCommand);
253 255
254 m_console.Commands.AddCommand("region", false, "remove-region", 256 m_console.Commands.AddCommand("region", false, "remove-region",
255 "remove-region <name>", 257 "remove-region <name>",
256 "Remove a region from this simulator", RunCommand); 258 "Remove a region from this simulator", RunCommand);
257 259
258 m_console.Commands.AddCommand("region", false, "delete-region", 260 m_console.Commands.AddCommand("region", false, "delete-region",
259 "delete-region <name>", 261 "delete-region <name>",
260 "Delete a region from disk", RunCommand); 262 "Delete a region from disk", RunCommand);
261 263
262 m_console.Commands.AddCommand("region", false, "predecode-j2k", 264 m_console.Commands.AddCommand("region", false, "predecode-j2k",
263 "predecode-j2k [<num threads>]>", 265 "predecode-j2k [<num threads>]>",
264 "Precache assets,decode j2k layerdata", RunCommand); 266 "Precache assets,decode j2k layerdata", RunCommand);
265 267
266 m_console.Commands.AddCommand("region", false, "modules list", 268 m_console.Commands.AddCommand("region", false, "modules list",
267 "modules list", 269 "modules list",
268 "List modules", HandleModules); 270 "List modules", HandleModules);
269 271
270 m_console.Commands.AddCommand("region", false, "modules load", 272 m_console.Commands.AddCommand("region", false, "modules load",
271 "modules load <name>", 273 "modules load <name>",
272 "Load a module", HandleModules); 274 "Load a module", HandleModules);
273 275
274 m_console.Commands.AddCommand("region", false, "modules unload", 276 m_console.Commands.AddCommand("region", false, "modules unload",
275 "modules unload <name>", 277 "modules unload <name>",
276 "Unload a module", HandleModules); 278 "Unload a module", HandleModules);
277 279
278 m_console.Commands.AddCommand("region", false, "Add-InventoryHost", 280 m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
279 "Add-InventoryHost <host>", 281 "Add-InventoryHost <host>",
280 String.Empty, RunCommand); 282 String.Empty, RunCommand);
281 283
282 if (ConfigurationSettings.Standalone) 284 if (ConfigurationSettings.Standalone)
283 { 285 {
284 m_console.Commands.AddCommand("region", false, "create user", 286 m_console.Commands.AddCommand("region", false, "create user",
285 "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]", 287 "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
286 "Create a new user", HandleCreateUser); 288 "Create a new user", HandleCreateUser);
287 289
288 m_console.Commands.AddCommand("region", false, "reset user password", 290 m_console.Commands.AddCommand("region", false, "reset user password",
289 "reset user password [<first> [<last> [<password>]]]", 291 "reset user password [<first> [<last> [<password>]]]",
290 "Reset a user password", HandleResetUserPassword); 292 "Reset a user password", HandleResetUserPassword);
291 } 293 }
292 } 294 }
293 295
@@ -321,15 +323,16 @@ namespace OpenSim
321 { 323 {
322 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); 324 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle);
323 325
324 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) 326 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
327 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
325 { 328 {
326 m_console.Notice( 329 m_console.Notice(
327 String.Format( 330 String.Format(
328 "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", 331 "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
329 presence.Firstname, 332 presence.Firstname,
330 presence.Lastname, 333 presence.Lastname,
331 presence.UUID, 334 presence.UUID,
332 regionInfo.RegionName)); 335 regionInfo.RegionName));
333 336
334 presence.Scene.IncomingCloseAgent(presence.UUID); 337 presence.Scene.IncomingCloseAgent(presence.UUID);
335 } 338 }
@@ -458,9 +461,9 @@ namespace OpenSim
458 } 461 }
459 else 462 else
460 { 463 {
461 // IConfig c = DefaultConfig().Configs[cmdparams[1]]; 464 // IConfig c = DefaultConfig().Configs[cmdparams[1]];
462 // if (c == null) 465 // if (c == null)
463 // c = DefaultConfig().AddConfig(cmdparams[1]); 466 // c = DefaultConfig().AddConfig(cmdparams[1]);
464 IConfig c; 467 IConfig c;
465 IConfigSource source = new IniConfigSource(); 468 IConfigSource source = new IniConfigSource();
466 c = source.AddConfig(cmdparams[1]); 469 c = source.AddConfig(cmdparams[1]);
@@ -471,11 +474,11 @@ namespace OpenSim
471 m_config.Source.Merge(source); 474 m_config.Source.Merge(source);
472 475
473 m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + 476 m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
474 _value); 477 _value);
475 } 478 }
476 } 479 }
477 break; 480 break;
478 481
479 case "get": 482 case "get":
480 if (cmdparams.Length < 3) 483 if (cmdparams.Length < 3)
481 { 484 {
@@ -498,7 +501,7 @@ namespace OpenSim
498 } 501 }
499 502
500 break; 503 break;
501 504
502 case "save": 505 case "save":
503 m_console.Notice("Saving configuration file: " + Application.iniFilePath); 506 m_console.Notice("Saving configuration file: " + Application.iniFilePath);
504 m_config.Save(Application.iniFilePath); 507 m_config.Save(Application.iniFilePath);
@@ -541,7 +544,6 @@ namespace OpenSim
541 { 544 {
542 foreach (Scene s in new ArrayList(m_sceneManager.Scenes)) 545 foreach (Scene s in new ArrayList(m_sceneManager.Scenes))
543 { 546 {
544
545 m_console.Notice("Loading module: " + cmdparams[1]); 547 m_console.Notice("Loading module: " + cmdparams[1]);
546 m_moduleLoader.LoadRegionModules(cmdparams[1], s); 548 m_moduleLoader.LoadRegionModules(cmdparams[1], s);
547 } 549 }
@@ -569,58 +571,58 @@ namespace OpenSim
569 571
570 switch (command) 572 switch (command)
571 { 573 {
572 case "command-script": 574 case "command-script":
573 if (cmdparams.Length > 0) 575 if (cmdparams.Length > 0)
574 { 576 {
575 RunCommandScript(cmdparams[0]); 577 RunCommandScript(cmdparams[0]);
576 } 578 }
577 break; 579 break;
578
579 case "backup":
580 m_sceneManager.BackupCurrentScene();
581 break;
582
583 case "remove-region":
584 string regRemoveName = CombineParams(cmdparams, 0);
585
586 Scene removeScene;
587 if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
588 RemoveRegion(removeScene, false);
589 else
590 m_console.Error("no region with that name");
591 break;
592
593 case "delete-region":
594 string regDeleteName = CombineParams(cmdparams, 0);
595
596 Scene killScene;
597 if (m_sceneManager.TryGetScene(regDeleteName, out killScene))
598 RemoveRegion(killScene, true);
599 else
600 m_console.Error("no region with that name");
601 break;
602
603 case "restart":
604 m_sceneManager.RestartCurrentScene();
605 break;
606
607 case "Add-InventoryHost":
608 if (cmdparams.Length > 0)
609 {
610 m_commsManager.AddInventoryService(cmdparams[0]);
611 }
612 break;
613 580
614 case "predecode-j2k": 581 case "backup":
615 if (cmdparams.Length > 0) 582 m_sceneManager.BackupCurrentScene();
616 { 583 break;
617 m_sceneManager.CacheJ2kDecode(Convert.ToInt32(cmdparams[0])); 584
618 } 585 case "remove-region":
619 else 586 string regRemoveName = CombineParams(cmdparams, 0);
620 { 587
621 m_sceneManager.CacheJ2kDecode(1); 588 Scene removeScene;
622 } 589 if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
623 break; 590 RemoveRegion(removeScene, false);
591 else
592 m_console.Error("no region with that name");
593 break;
594
595 case "delete-region":
596 string regDeleteName = CombineParams(cmdparams, 0);
597
598 Scene killScene;
599 if (m_sceneManager.TryGetScene(regDeleteName, out killScene))
600 RemoveRegion(killScene, true);
601 else
602 m_console.Error("no region with that name");
603 break;
604
605 case "restart":
606 m_sceneManager.RestartCurrentScene();
607 break;
608
609 case "Add-InventoryHost":
610 if (cmdparams.Length > 0)
611 {
612 m_commsManager.AddInventoryService(cmdparams[0]);
613 }
614 break;
615
616 case "predecode-j2k":
617 if (cmdparams.Length > 0)
618 {
619 m_sceneManager.CacheJ2kDecode(Convert.ToInt32(cmdparams[0]));
620 }
621 else
622 {
623 m_sceneManager.CacheJ2kDecode(1);
624 }
625 break;
624 } 626 }
625 } 627 }
626 628
@@ -743,10 +745,10 @@ namespace OpenSim
743 } 745 }
744 746
745 // see BaseOpenSimServer 747 // see BaseOpenSimServer
746 override public void HandleShow(string mod, string[] cmd) 748 public override void HandleShow(string mod, string[] cmd)
747 { 749 {
748 base.HandleShow(mod, cmd); 750 base.HandleShow(mod, cmd);
749 751
750 List<string> args = new List<string>(cmd); 752 List<string> args = new List<string>(cmd);
751 args.RemoveAt(0); 753 args.RemoveAt(0);
752 string[] showParams = args.ToArray(); 754 string[] showParams = args.ToArray();
@@ -812,11 +814,12 @@ namespace OpenSim
812 case "regions": 814 case "regions":
813 m_sceneManager.ForEachScene( 815 m_sceneManager.ForEachScene(
814 delegate(Scene scene) 816 delegate(Scene scene)
815 { 817 {
816 m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + 818 m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " +
817 scene.RegionInfo.RegionLocX + " , Region YLoc: " + 819 scene.RegionInfo.RegionLocX + " , Region YLoc: " +
818 scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString()); 820 scene.RegionInfo.RegionLocY + " , Region Port: " +
819 }); 821 scene.RegionInfo.InternalEndPoint.Port.ToString());
822 });
820 break; 823 break;
821 824
822 case "queues": 825 case "queues":
@@ -842,16 +845,16 @@ namespace OpenSim
842 (IStatsCollector) client; 845 (IStatsCollector) client;
843 846
844 report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n", 847 report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n",
845 "Send", 848 "Send",
846 "In", 849 "In",
847 "Out", 850 "Out",
848 "Resend", 851 "Resend",
849 "Land", 852 "Land",
850 "Wind", 853 "Wind",
851 "Cloud", 854 "Cloud",
852 "Task", 855 "Task",
853 "Texture", 856 "Texture",
854 "Asset"); 857 "Asset");
855 report = report + stats.Report() + 858 report = report + stats.Report() +
856 "\n\n"; 859 "\n\n";
857 } 860 }
@@ -878,7 +881,7 @@ namespace OpenSim
878 firstName = MainConsole.Instance.CmdPrompt("First name", "Default"); 881 firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
879 else firstName = cmdparams[2]; 882 else firstName = cmdparams[2];
880 883
881 if ( cmdparams.Length < 4 ) 884 if (cmdparams.Length < 4)
882 lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); 885 lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
883 else lastName = cmdparams[3]; 886 else lastName = cmdparams[3];
884 887
@@ -886,11 +889,11 @@ namespace OpenSim
886 password = MainConsole.Instance.PasswdPrompt("Password"); 889 password = MainConsole.Instance.PasswdPrompt("Password");
887 else password = cmdparams[4]; 890 else password = cmdparams[4];
888 891
889 if ( cmdparams.Length < 6 ) 892 if (cmdparams.Length < 6)
890 regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString())); 893 regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
891 else regX = Convert.ToUInt32(cmdparams[5]); 894 else regX = Convert.ToUInt32(cmdparams[5]);
892 895
893 if ( cmdparams.Length < 7 ) 896 if (cmdparams.Length < 7)
894 regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); 897 regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
895 else regY = Convert.ToUInt32(cmdparams[6]); 898 else regY = Convert.ToUInt32(cmdparams[6]);
896 899
@@ -922,11 +925,11 @@ namespace OpenSim
922 firstName = MainConsole.Instance.CmdPrompt("First name"); 925 firstName = MainConsole.Instance.CmdPrompt("First name");
923 else firstName = cmdparams[3]; 926 else firstName = cmdparams[3];
924 927
925 if ( cmdparams.Length < 5 ) 928 if (cmdparams.Length < 5)
926 lastName = MainConsole.Instance.CmdPrompt("Last name"); 929 lastName = MainConsole.Instance.CmdPrompt("Last name");
927 else lastName = cmdparams[4]; 930 else lastName = cmdparams[4];
928 931
929 if ( cmdparams.Length < 6 ) 932 if (cmdparams.Length < 6)
930 newPassword = MainConsole.Instance.PasswdPrompt("New password"); 933 newPassword = MainConsole.Instance.PasswdPrompt("New password");
931 else newPassword = cmdparams[5]; 934 else newPassword = cmdparams[5];
932 935
@@ -1114,4 +1117,4 @@ namespace OpenSim
1114 1117
1115 #endregion 1118 #endregion
1116 } 1119 }
1117} 1120} \ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs
index 4a2c161..93999ce 100644
--- a/OpenSim/Region/Application/OpenSimBackground.cs
+++ b/OpenSim/Region/Application/OpenSimBackground.cs
@@ -56,7 +56,8 @@ namespace OpenSim
56 m_log.Info("===================================================================="); 56 m_log.Info("====================================================================");
57 m_log.Info("========================= STARTING OPENSIM ========================="); 57 m_log.Info("========================= STARTING OPENSIM =========================");
58 m_log.Info("===================================================================="); 58 m_log.Info("====================================================================");
59 m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", ConfigurationSettings.Standalone ? "sandbox" : "grid"); 59 m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode",
60 ConfigurationSettings.Standalone ? "sandbox" : "grid");
60 61
61 base.Startup(); 62 base.Startup();
62 63
@@ -77,4 +78,4 @@ namespace OpenSim
77 base.Shutdown(); 78 base.Shutdown();
78 } 79 }
79 } 80 }
80} 81} \ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 32b1258..b979bdc 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -41,8 +41,6 @@ using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 41using OpenSim.Framework.Servers;
42using OpenSim.Framework.Statistics; 42using OpenSim.Framework.Statistics;
43using OpenSim.Region.ClientStack; 43using OpenSim.Region.ClientStack;
44using OpenSim.Region.Communications.Local;
45using OpenSim.Region.Communications.OGS1;
46using OpenSim.Region.Framework; 44using OpenSim.Region.Framework;
47using OpenSim.Region.Framework.Interfaces; 45using OpenSim.Region.Framework.Interfaces;
48using OpenSim.Region.Framework.Scenes; 46using OpenSim.Region.Framework.Scenes;
@@ -60,7 +58,7 @@ namespace OpenSim
60 // These are the names of the plugin-points extended by this 58 // These are the names of the plugin-points extended by this
61 // class during system startup. 59 // class during system startup.
62 60
63 private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; 61 private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
64 private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient"; 62 private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
65 63
66 protected string proxyUrl; 64 protected string proxyUrl;
@@ -77,20 +75,21 @@ namespace OpenSim
77 /// The file used to load and save an opensim archive if no filename has been specified 75 /// The file used to load and save an opensim archive if no filename has been specified
78 /// </summary> 76 /// </summary>
79 protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene.oar.tar.gz"; 77 protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene.oar.tar.gz";
80 78
81 public ConfigSettings ConfigurationSettings 79 public ConfigSettings ConfigurationSettings
82 { 80 {
83 get { return m_configSettings; } 81 get { return m_configSettings; }
84 set { m_configSettings = value; } 82 set { m_configSettings = value; }
85 } 83 }
84
86 protected ConfigSettings m_configSettings; 85 protected ConfigSettings m_configSettings;
87 86
88 protected ConfigurationLoader m_configLoader; 87 protected ConfigurationLoader m_configLoader;
89 88
90 protected GridInfoService m_gridInfoService; 89 protected GridInfoService m_gridInfoService;
91 90
92 public ConsoleCommand CreateAccount = null; 91 public ConsoleCommand CreateAccount = null;
93 92
94 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); 93 protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
95 94
96 /// <value> 95 /// <value>
@@ -101,13 +100,15 @@ namespace OpenSim
101 get { return m_config; } 100 get { return m_config; }
102 set { m_config = value; } 101 set { m_config = value; }
103 } 102 }
103
104 protected OpenSimConfigSource m_config; 104 protected OpenSimConfigSource m_config;
105 105
106 public List<IClientNetworkServer> ClientServers 106 public List<IClientNetworkServer> ClientServers
107 { 107 {
108 get { return m_clientServers; } 108 get { return m_clientServers; }
109 } 109 }
110 protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>(); 110
111 protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
111 112
112 public new BaseHttpServer HttpServer 113 public new BaseHttpServer HttpServer
113 { 114 {
@@ -117,13 +118,14 @@ namespace OpenSim
117 public uint HttpServerPort 118 public uint HttpServerPort
118 { 119 {
119 get { return m_httpServerPort; } 120 get { return m_httpServerPort; }
120 } 121 }
121 122
122 public ModuleLoader ModuleLoader 123 public ModuleLoader ModuleLoader
123 { 124 {
124 get { return m_moduleLoader; } 125 get { return m_moduleLoader; }
125 set { m_moduleLoader = value; } 126 set { m_moduleLoader = value; }
126 } 127 }
128
127 protected ModuleLoader m_moduleLoader; 129 protected ModuleLoader m_moduleLoader;
128 130
129 protected IRegistryCore m_applicationRegistry = new RegistryCore(); 131 protected IRegistryCore m_applicationRegistry = new RegistryCore();
@@ -167,17 +169,17 @@ namespace OpenSim
167 loader.Load("/OpenSim/Startup"); 169 loader.Load("/OpenSim/Startup");
168 m_plugins = loader.Plugins; 170 m_plugins = loader.Plugins;
169 } 171 }
170 172
171 protected override List<string> GetHelpTopics() 173 protected override List<string> GetHelpTopics()
172 { 174 {
173 List<string> topics = base.GetHelpTopics(); 175 List<string> topics = base.GetHelpTopics();
174 Scene s = SceneManager.CurrentOrFirstScene; 176 Scene s = SceneManager.CurrentOrFirstScene;
175 if (s != null && s.GetCommanders() != null) 177 if (s != null && s.GetCommanders() != null)
176 topics.AddRange(s.GetCommanders().Keys); 178 topics.AddRange(s.GetCommanders().Keys);
177 179
178 return topics; 180 return topics;
179 } 181 }
180 182
181 /// <summary> 183 /// <summary>
182 /// Performs startup specific to the region server, including initialization of the scene 184 /// Performs startup specific to the region server, including initialization of the scene
183 /// such as loading configuration from disk. 185 /// such as loading configuration from disk.
@@ -185,18 +187,18 @@ namespace OpenSim
185 protected override void StartupSpecific() 187 protected override void StartupSpecific()
186 { 188 {
187 base.StartupSpecific(); 189 base.StartupSpecific();
188 190
189 m_stats = StatsManager.StartCollectingSimExtraStats(); 191 m_stats = StatsManager.StartCollectingSimExtraStats();
190 192
191 // Create a ModuleLoader instance 193 // Create a ModuleLoader instance
192 m_moduleLoader = new ModuleLoader(m_config.Source); 194 m_moduleLoader = new ModuleLoader(m_config.Source);
193 195
194 LoadPlugins(); 196 LoadPlugins();
195 foreach (IApplicationPlugin plugin in m_plugins) 197 foreach (IApplicationPlugin plugin in m_plugins)
196 { 198 {
197 plugin.PostInitialise(); 199 plugin.PostInitialise();
198 } 200 }
199 201
200 // Only enable logins to the regions once we have completely finished starting up (apart from scripts) 202 // Only enable logins to the regions once we have completely finished starting up (apart from scripts)
201 if ((m_commsManager != null) && (m_commsManager.GridService != null)) 203 if ((m_commsManager != null) && (m_commsManager.GridService != null))
202 { 204 {
@@ -216,14 +218,14 @@ namespace OpenSim
216 foreach (string topic in topics) 218 foreach (string topic in topics)
217 { 219 {
218 m_console.Commands.AddCommand("plugin", false, "help " + topic, 220 m_console.Commands.AddCommand("plugin", false, "help " + topic,
219 "help " + topic, 221 "help " + topic,
220 "Get help on plugin command '" + topic + "'", 222 "Get help on plugin command '" + topic + "'",
221 HandleCommanderHelp); 223 HandleCommanderHelp);
222 224
223 m_console.Commands.AddCommand("plugin", false, topic, 225 m_console.Commands.AddCommand("plugin", false, topic,
224 topic, 226 topic,
225 "Execute subcommand for plugin '" + topic + "'", 227 "Execute subcommand for plugin '" + topic + "'",
226 null); 228 null);
227 229
228 ICommander commander = null; 230 ICommander commander = null;
229 231
@@ -241,9 +243,9 @@ namespace OpenSim
241 foreach (string command in commander.Commands.Keys) 243 foreach (string command in commander.Commands.Keys)
242 { 244 {
243 m_console.Commands.AddCommand(topic, false, 245 m_console.Commands.AddCommand(topic, false,
244 topic + " " + command, 246 topic + " " + command,
245 topic + " " + commander.Commands[command].ShortHelp(), 247 topic + " " + commander.Commands[command].ShortHelp(),
246 String.Empty, HandleCommanderCommand); 248 String.Empty, HandleCommanderCommand);
247 } 249 }
248 } 250 }
249 } 251 }
@@ -288,80 +290,82 @@ namespace OpenSim
288 { 290 {
289 LegacyAssetClientPluginInitialiser linit = null; 291 LegacyAssetClientPluginInitialiser linit = null;
290 CryptoAssetClientPluginInitialiser cinit = null; 292 CryptoAssetClientPluginInitialiser cinit = null;
291 AssetClientPluginInitialiser init = null; 293 AssetClientPluginInitialiser init = null;
292 294
293 IAssetServer assetServer = null; 295 IAssetServer assetServer = null;
294 string mode = m_configSettings.AssetStorage; 296 string mode = m_configSettings.AssetStorage;
295 297
296 if (mode == null | mode == String.Empty) 298 if (mode == null | mode == String.Empty)
297 mode = "default"; 299 mode = "default";
298 300
299 // If "default" is specified, then the value is adjusted 301 // If "default" is specified, then the value is adjusted
300 // according to whether or not the server is running in 302 // according to whether or not the server is running in
301 // standalone mode. 303 // standalone mode.
302 if (mode.ToLower() == "default") 304 if (mode.ToLower() == "default")
303 { 305 {
304 if (m_configSettings.Standalone == false) 306 if (m_configSettings.Standalone == false)
305 mode = "grid"; 307 mode = "grid";
306 else 308 else
307 mode = "local"; 309 mode = "local";
308 } 310 }
309 311
310 switch (mode.ToLower()) 312 switch (mode.ToLower())
311 { 313 {
312 // If grid is specified then the grid server is chose regardless 314 // If grid is specified then the grid server is chose regardless
313 // of whether the server is standalone. 315 // of whether the server is standalone.
314 case "grid" : 316 case "grid":
315 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); 317 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
316 assetServer = loadAssetServer("Grid", linit); 318 assetServer = loadAssetServer("Grid", linit);
317 break; 319 break;
318 320
319 // If cryptogrid is specified then the cryptogrid server is chose regardless 321 // If cryptogrid is specified then the cryptogrid server is chose regardless
320 // of whether the server is standalone. 322 // of whether the server is standalone.
321 case "cryptogrid" : 323 case "cryptogrid":
322 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, 324 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
323 Environment.CurrentDirectory, true); 325 Environment.CurrentDirectory, true);
324 assetServer = loadAssetServer("Crypto", cinit); 326 assetServer = loadAssetServer("Crypto", cinit);
325 break; 327 break;
326 328
327 // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless 329 // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless
328 // of whether the server is standalone. 330 // of whether the server is standalone.
329 case "cryptogrid_eou" : 331 case "cryptogrid_eou":
330 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, 332 cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
331 Environment.CurrentDirectory, false); 333 Environment.CurrentDirectory, false);
332 assetServer = loadAssetServer("Crypto", cinit); 334 assetServer = loadAssetServer("Crypto", cinit);
333 break; 335 break;
334 336
335 // If file is specified then the file server is chose regardless 337 // If file is specified then the file server is chose regardless
336 // of whether the server is standalone. 338 // of whether the server is standalone.
337 case "file" : 339 case "file":
338 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); 340 linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
339 assetServer = loadAssetServer("File", linit); 341 assetServer = loadAssetServer("File", linit);
340 break; 342 break;
341 343
342 // If local is specified then we're going to use the local SQL server 344 // If local is specified then we're going to use the local SQL server
343 // implementation. We drop through, because that will be the fallback 345 // implementation. We drop through, because that will be the fallback
344 // for the following default clause too. 346 // for the following default clause too.
345 case "local" : 347 case "local":
346 break; 348 break;
347 349
348 // If the asset_database value is none of the previously mentioned strings, then we 350 // If the asset_database value is none of the previously mentioned strings, then we
349 // try to load a turnkey plugin that matches this value. If not we drop through to 351 // try to load a turnkey plugin that matches this value. If not we drop through to
350 // a local default. 352 // a local default.
351 default : 353 default:
352 try 354 try
353 { 355 {
354 init = new AssetClientPluginInitialiser(m_configSettings); 356 init = new AssetClientPluginInitialiser(m_configSettings);
355 assetServer = loadAssetServer(m_configSettings.AssetStorage, init); 357 assetServer = loadAssetServer(m_configSettings.AssetStorage, init);
356 break; 358 break;
357 } 359 }
358 catch {} 360 catch
361 {
362 }
359 m_log.Info("[OPENSIMBASE] Default assetserver will be used"); 363 m_log.Info("[OPENSIMBASE] Default assetserver will be used");
360 break; 364 break;
361 } 365 }
362 366
363 // Open the local SQL-based database asset server 367 // Open the local SQL-based database asset server
364 if (assetServer == null) 368 if (assetServer == null)
365 { 369 {
366 init = new AssetClientPluginInitialiser(m_configSettings); 370 init = new AssetClientPluginInitialiser(m_configSettings);
367 SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init); 371 SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init);
@@ -426,7 +430,7 @@ namespace OpenSim
426 loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache)); 430 loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache));
427 431
428 loader.Load(PLUGIN_ASSET_CACHE); 432 loader.Load(PLUGIN_ASSET_CACHE);
429 if (loader.Plugins.Count > 0) 433 if (loader.Plugins.Count > 0)
430 assetCache = (IAssetCache) loader.Plugins[0]; 434 assetCache = (IAssetCache) loader.Plugins[0];
431 } 435 }
432 catch (Exception e) 436 catch (Exception e)
@@ -450,8 +454,8 @@ namespace OpenSim
450 else 454 else
451 { 455 {
452 m_log.Info("[Login] Login are now disabled "); 456 m_log.Info("[Login] Login are now disabled ");
453 m_commsManager.GridService.RegionLoginsEnabled = false; 457 m_commsManager.GridService.RegionLoginsEnabled = false;
454 } 458 }
455 } 459 }
456 460
457 /// <summary> 461 /// <summary>
@@ -511,16 +515,16 @@ namespace OpenSim
511 m_log.Info("[MODULES]: Loading Region's modules"); 515 m_log.Info("[MODULES]: Loading Region's modules");
512 516
513 List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, "."); 517 List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
514 518
515 // This needs to be ahead of the script engine load, so the 519 // This needs to be ahead of the script engine load, so the
516 // script module can pick up events exposed by a module 520 // script module can pick up events exposed by a module
517 m_moduleLoader.InitialiseSharedModules(scene); 521 m_moduleLoader.InitialiseSharedModules(scene);
518 522
519 scene.SetModuleInterfaces(); 523 scene.SetModuleInterfaces();
520 524
521 // Prims have to be loaded after module configuration since some modules may be invoked during the load 525 // Prims have to be loaded after module configuration since some modules may be invoked during the load
522 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 526 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
523 527
524 scene.StartTimer(); 528 scene.StartTimer();
525 529
526 // moved these here as the terrain texture has to be created after the modules are initialized 530 // moved these here as the terrain texture has to be created after the modules are initialized
@@ -576,11 +580,11 @@ namespace OpenSim
576 { 580 {
577 m_sceneManager.TrySetCurrentScene(".."); 581 m_sceneManager.TrySetCurrentScene("..");
578 } 582 }
579 583
580 scene.DeleteAllSceneObjects(); 584 scene.DeleteAllSceneObjects();
581 m_sceneManager.CloseScene(scene); 585 m_sceneManager.CloseScene(scene);
582 586
583 if (!cleanup) 587 if (!cleanup)
584 return; 588 return;
585 589
586 if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile)) 590 if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile))
@@ -624,7 +628,7 @@ namespace OpenSim
624 //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP)) 628 //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
625 // listenIP = IPAddress.Parse("0.0.0.0"); 629 // listenIP = IPAddress.Parse("0.0.0.0");
626 630
627 uint port = (uint)regionInfo.InternalEndPoint.Port; 631 uint port = (uint) regionInfo.InternalEndPoint.Port;
628 632
629 if (m_autoCreateClientStack) 633 if (m_autoCreateClientStack)
630 { 634 {
@@ -638,7 +642,7 @@ namespace OpenSim
638 clientServer = null; 642 clientServer = null;
639 } 643 }
640 644
641 regionInfo.InternalEndPoint.Port = (int)port; 645 regionInfo.InternalEndPoint.Port = (int) port;
642 646
643 Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); 647 Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
644 648
@@ -651,7 +655,7 @@ namespace OpenSim
651 655
652 scene.PhysicsScene = GetPhysicsScene(scene.RegionInfo.RegionName); 656 scene.PhysicsScene = GetPhysicsScene(scene.RegionInfo.RegionName);
653 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); 657 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
654 scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight); 658 scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight);
655 659
656 // TODO: Remove this cruft once MasterAvatar is fully deprecated 660 // TODO: Remove this cruft once MasterAvatar is fully deprecated
657 //Master Avatar Setup 661 //Master Avatar Setup
@@ -687,7 +691,8 @@ namespace OpenSim
687 691
688 protected override StorageManager CreateStorageManager() 692 protected override StorageManager CreateStorageManager()
689 { 693 {
690 return CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString); 694 return
695 CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString);
691 } 696 }
692 697
693 protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) 698 protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring)
@@ -704,10 +709,10 @@ namespace OpenSim
704 AgentCircuitManager circuitManager) 709 AgentCircuitManager circuitManager)
705 { 710 {
706 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); 711 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
707 712
708 return new Scene( 713 return new Scene(
709 regionInfo, circuitManager, m_commsManager, sceneGridService, 714 regionInfo, circuitManager, m_commsManager, sceneGridService,
710 storageManager, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, 715 storageManager, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim,
711 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 716 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
712 } 717 }
713 718
@@ -728,7 +733,7 @@ namespace OpenSim
728 break; 733 break;
729 } 734 }
730 } 735 }
731 736
732 if (foundClientServer) 737 if (foundClientServer)
733 { 738 {
734 m_clientServers[clientServerElement].Server.Close(); 739 m_clientServers[clientServerElement].Server.Close();
@@ -793,7 +798,7 @@ namespace OpenSim
793 m_log.Info("[SHUTDOWN]: Closing console and terminating"); 798 m_log.Info("[SHUTDOWN]: Closing console and terminating");
794 799
795 try 800 try
796 { 801 {
797 m_sceneManager.Close(); 802 m_sceneManager.Close();
798 } 803 }
799 catch (Exception e) 804 catch (Exception e)
@@ -840,14 +845,14 @@ namespace OpenSim
840 { 845 {
841 if (Source is IniConfigSource) 846 if (Source is IniConfigSource)
842 { 847 {
843 IniConfigSource iniCon = (IniConfigSource)Source; 848 IniConfigSource iniCon = (IniConfigSource) Source;
844 iniCon.Save(path); 849 iniCon.Save(path);
845 } 850 }
846 else if (Source is XmlConfigSource) 851 else if (Source is XmlConfigSource)
847 { 852 {
848 XmlConfigSource xmlCon = (XmlConfigSource)Source; 853 XmlConfigSource xmlCon = (XmlConfigSource) Source;
849 xmlCon.Save(path); 854 xmlCon.Save(path);
850 } 855 }
851 } 856 }
852 } 857 }
853} 858} \ No newline at end of file