* Cleanup and CCC (Code Convention Conformance)

0.6.5-rc1
lbsa71 2009-03-10 20:27:41 +00:00
parent 63a5a01945
commit 91a096dca6
7 changed files with 305 additions and 283 deletions

View File

@ -39,7 +39,7 @@ namespace OpenSim
public class Application public class Application
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static string iniFilePath = ""; public static string iniFilePath = "";
public static bool m_saveCrashDumps = false; public static bool m_saveCrashDumps = false;
@ -51,7 +51,8 @@ namespace OpenSim
public static void Main(string[] args) public static void Main(string[] args)
{ {
// First line // First line
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
XmlConfigurator.Configure(); XmlConfigurator.Configure();
@ -143,7 +144,7 @@ namespace OpenSim
msg += "\r\n"; msg += "\r\n";
msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n"; msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n";
Exception ex = (Exception)e.ExceptionObject; Exception ex = (Exception) e.ExceptionObject;
if (ex.InnerException != null) if (ex.InnerException != null)
{ {
msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; msg += "InnerException: " + ex.InnerException.ToString() + "\r\n";
@ -177,7 +178,7 @@ namespace OpenSim
m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2); m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2);
} }
_IsHandlingException=false; _IsHandlingException = false;
} }
} }
} }

View File

@ -45,10 +45,11 @@ namespace OpenSim
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public ConfigurationLoader() public ConfigurationLoader()
{ {
} }
public OpenSimConfigSource LoadConfigSettings(IConfigSource configSource, out ConfigSettings configSettings, out NetworkServersInfo networkInfo) public OpenSimConfigSource LoadConfigSettings(IConfigSource configSource, out ConfigSettings configSettings,
out NetworkServersInfo networkInfo)
{ {
m_configSettings = configSettings = new ConfigSettings(); m_configSettings = configSettings = new ConfigSettings();
m_networkServersInfo = networkInfo = new NetworkServersInfo(); m_networkServersInfo = networkInfo = new NetworkServersInfo();
@ -70,16 +71,17 @@ namespace OpenSim
m_config.Source.Merge(DefaultConfig()); m_config.Source.Merge(DefaultConfig());
m_log.Info("[CONFIG] Reading configuration settings"); m_log.Info("[CONFIG] Reading configuration settings");
Uri configUri; Uri configUri;
String xmlPath = Path.Combine(Util.configDir(), "OpenSim.xml"); String xmlPath = Path.Combine(Util.configDir(), "OpenSim.xml");
//check for master .INI file (name passed in command line, no default), or XML over http //check for master .INI file (name passed in command line, no default), or XML over http
if (masterFileName.Length > 0) // If a master file name is given ... if (masterFileName.Length > 0) // If a master file name is given ...
{ {
m_log.InfoFormat("[CONFIG] Reading config master file {0}", masterfilePath); m_log.InfoFormat("[CONFIG] Reading config master file {0}", masterfilePath);
bool isMasterUri = Uri.TryCreate(masterFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; bool isMasterUri = Uri.TryCreate(masterFileName, UriKind.Absolute, out configUri) &&
configUri.Scheme == Uri.UriSchemeHttp;
if (!ReadConfig(masterFileName, masterfilePath, m_config, isMasterUri)) if (!ReadConfig(masterFileName, masterfilePath, m_config, isMasterUri))
{ {
@ -100,10 +102,11 @@ namespace OpenSim
} }
} }
} }
// Check for .INI file (either default or name passed on command // Check for .INI file (either default or name passed on command
// line) or XML config source over http // line) or XML config source over http
bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) && configUri.Scheme == Uri.UriSchemeHttp; bool isIniUri = Uri.TryCreate(iniFileName, UriKind.Absolute, out configUri) &&
configUri.Scheme == Uri.UriSchemeHttp;
iniFileExists = ReadConfig(iniFileName, Application.iniFilePath, m_config, isIniUri); iniFileExists = ReadConfig(iniFileName, Application.iniFilePath, m_config, isIniUri);
if (!iniFileExists) if (!iniFileExists)
@ -119,7 +122,7 @@ namespace OpenSim
m_config.Source = new XmlConfigSource(); m_config.Source = new XmlConfigSource();
m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath));
} }
} }
m_config.Source.Merge(configSource); m_config.Source.Merge(configSource);
@ -152,7 +155,7 @@ namespace OpenSim
private bool ReadConfig(string iniName, string iniPath, OpenSimConfigSource m_config, bool isUri) private bool ReadConfig(string iniName, string iniPath, OpenSimConfigSource m_config, bool isUri)
{ {
bool success = false; bool success = false;
if (!isUri && File.Exists(iniPath)) if (!isUri && File.Exists(iniPath))
{ {
m_log.InfoFormat("[CONFIG] Reading configuration file {0}", Path.GetFullPath(iniPath)); m_log.InfoFormat("[CONFIG] Reading configuration file {0}", Path.GetFullPath(iniPath));
@ -235,7 +238,7 @@ namespace OpenSim
config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
config.Set("user_source", ""); config.Set("user_source", "");
config.Set("asset_plugin", "OpenSim.Data.SQLite.dll"); config.Set("asset_plugin", "OpenSim.Data.SQLite.dll");
config.Set("asset_source", ""); config.Set("asset_source", "");
config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar)); config.Set("AssetSetsXMLFile", string.Format(".{0}assets{0}AssetSets.xml", Path.DirectorySeparatorChar));
config.Set("dump_assets_to_file", false); config.Set("dump_assets_to_file", false);
@ -307,11 +310,11 @@ namespace OpenSim
m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile"); m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile");
m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile"); m_configSettings.AssetSetsXMLFile = standaloneConfig.GetString("AssetSetsXMLFile");
m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); m_configSettings.DumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
} }
m_networkServersInfo.loadFromConfiguration(m_config.Source); m_networkServersInfo.loadFromConfiguration(m_config.Source);
} }
} }
} }

View File

@ -33,11 +33,7 @@ using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications; using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Servers;
using OpenSim.Region.Communications.Hypergrid;
using OpenSim.Region.Communications.Local;
using OpenSim.Region.Framework; using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Hypergrid; using OpenSim.Region.Framework.Scenes.Hypergrid;
@ -68,24 +64,26 @@ namespace OpenSim
base.StartupSpecific(); base.StartupSpecific();
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", "Set local coordinate to map HG regions to", RunCommand); MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "Link a hypergrid region", RunCommand); "Set local coordinate to map HG regions to", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
"link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>",
"Link a hypergrid region", RunCommand);
} }
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
AgentCircuitManager circuitManager) AgentCircuitManager circuitManager)
{ {
HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices); HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices);
return return
new HGScene( new HGScene(
regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager, regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim,
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
} }
new void RunCommand(string module, string[] cp) private new void RunCommand(string module, string[] cp)
{ {
List<string> cmdparams = new List<string>(cp); List<string> cmdparams = new List<string>(cp);
if (cmdparams.Count < 1) if (cmdparams.Count < 1)
@ -128,7 +126,8 @@ namespace OpenSim
} }
if (cmdparams[2].Contains(":")) if (cmdparams[2].Contains(":"))
{ // New format {
// New format
uint xloc, yloc; uint xloc, yloc;
string mapName; string mapName;
try try
@ -154,7 +153,8 @@ namespace OpenSim
HGHyperlink.TryLinkRegionToCoords(m_sceneManager.CurrentOrFirstScene, null, mapName, xloc, yloc); HGHyperlink.TryLinkRegionToCoords(m_sceneManager.CurrentOrFirstScene, null, mapName, xloc, yloc);
} }
else else
{ // old format {
// old format
RegionInfo regInfo; RegionInfo regInfo;
uint xloc, yloc; uint xloc, yloc;
uint externalPort; uint externalPort;
@ -205,7 +205,7 @@ namespace OpenSim
{ {
string excludeString = cmdparams[1].ToLower(); string excludeString = cmdparams[1].ToLower();
excludeString = excludeString.Remove(0, 12); excludeString = excludeString.Remove(0, 12);
char[] splitter = { ';' }; char[] splitter = {';'};
excludeSections = excludeString.Split(splitter); excludeSections = excludeString.Split(splitter);
} }
@ -236,7 +236,7 @@ namespace OpenSim
m_log.Error(e.ToString()); m_log.Error(e.ToString());
} }
} }
private void ReadLinkFromConfig(IConfig config) private void ReadLinkFromConfig(IConfig config)
{ {
@ -255,19 +255,23 @@ namespace OpenSim
if (m_enableAutoMapping) if (m_enableAutoMapping)
{ {
xloc = (uint)((xloc % 100) + m_autoMappingX); xloc = (uint) ((xloc%100) + m_autoMappingX);
yloc = (uint)((yloc % 100) + m_autoMappingY); yloc = (uint) ((yloc%100) + m_autoMappingY);
} }
if (((realXLoc == 0) && (realYLoc == 0)) || (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896)))) if (((realXLoc == 0) && (realYLoc == 0)) ||
(((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) &&
((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896))))
{ {
if (HGHyperlink.TryCreateLink(m_sceneManager.CurrentOrFirstScene, null, xloc, yloc, "", externalPort, externalHostName, out regInfo)) if (
HGHyperlink.TryCreateLink(m_sceneManager.CurrentOrFirstScene, null, xloc, yloc, "", externalPort,
externalHostName, out regInfo))
{ {
regInfo.RegionName = config.GetString("localName", ""); regInfo.RegionName = config.GetString("localName", "");
} }
} }
} }
private void LinkRegionCmdUsage() private void LinkRegionCmdUsage()
{ {
@ -276,4 +280,4 @@ namespace OpenSim
m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]"); m_log.Info("Usage: link-region <URI_of_xml> [<exclude>]");
} }
} }
} }

View File

@ -38,11 +38,16 @@ namespace OpenSim
public class ApplicationPluginInitialiser : PluginInitialiserBase public class ApplicationPluginInitialiser : PluginInitialiserBase
{ {
private OpenSimBase server; private OpenSimBase server;
public ApplicationPluginInitialiser (OpenSimBase s) { server = s; }
public override void Initialise (IPlugin plugin) public ApplicationPluginInitialiser(OpenSimBase s)
{
server = s;
}
public override void Initialise(IPlugin plugin)
{ {
IApplicationPlugin p = plugin as IApplicationPlugin; IApplicationPlugin p = plugin as IApplicationPlugin;
p.Initialise (server); p.Initialise(server);
} }
} }
} }

View File

@ -85,7 +85,8 @@ namespace OpenSim
m_log.Info("===================================================================="); m_log.Info("====================================================================");
m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("========================= STARTING OPENSIM =========================");
m_log.Info("===================================================================="); m_log.Info("====================================================================");
m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode", (ConfigurationSettings.Standalone ? "sandbox" : "grid")); m_log.InfoFormat("[OPENSIM MAIN]: Running in {0} mode",
(ConfigurationSettings.Standalone ? "sandbox" : "grid"));
//m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
// http://msdn.microsoft.com/en-us/library/bb384202.aspx // http://msdn.microsoft.com/en-us/library/bb384202.aspx
//GCSettings.LatencyMode = GCLatencyMode.Batch; //GCSettings.LatencyMode = GCLatencyMode.Batch;
@ -100,7 +101,7 @@ namespace OpenSim
base.StartupSpecific(); base.StartupSpecific();
//Run Startup Commands //Run Startup Commands
if (String.IsNullOrEmpty( m_startupCommandsFile )) if (String.IsNullOrEmpty(m_startupCommandsFile))
{ {
m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
} }
@ -114,7 +115,7 @@ namespace OpenSim
{ {
m_scriptTimer = new Timer(); m_scriptTimer = new Timer();
m_scriptTimer.Enabled = true; m_scriptTimer.Enabled = true;
m_scriptTimer.Interval = 1200 * 1000; m_scriptTimer.Interval = 1200*1000;
m_scriptTimer.Elapsed += RunAutoTimerScript; m_scriptTimer.Elapsed += RunAutoTimerScript;
} }
@ -122,7 +123,8 @@ namespace OpenSim
// For now, start at the 'root' level by default // For now, start at the 'root' level by default
if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
ChangeSelectedRegion("region", new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName}); ChangeSelectedRegion("region",
new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
else else
ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
} }
@ -130,164 +132,164 @@ namespace OpenSim
private void RegisterConsoleCommands() private void RegisterConsoleCommands()
{ {
m_console.Commands.AddCommand("region", false, "clear assets", m_console.Commands.AddCommand("region", false, "clear assets",
"clear assets", "clear assets",
"Clear the asset cache", HandleClearAssets); "Clear the asset cache", HandleClearAssets);
m_console.Commands.AddCommand("region", false, "force update", m_console.Commands.AddCommand("region", false, "force update",
"force update", "force update",
"Force the update of all objects on clients", "Force the update of all objects on clients",
HandleForceUpdate); HandleForceUpdate);
m_console.Commands.AddCommand("region", false, "debug packet", m_console.Commands.AddCommand("region", false, "debug packet",
"debug packet <level>", "debug packet <level>",
"Turn on packet debugging", Debug); "Turn on packet debugging", Debug);
m_console.Commands.AddCommand("region", false, "debug scene", m_console.Commands.AddCommand("region", false, "debug scene",
"debug scene <cripting> <collisions> <physics>", "debug scene <cripting> <collisions> <physics>",
"Turn on scene debugging", Debug); "Turn on scene debugging", Debug);
m_console.Commands.AddCommand("region", false, "change region", m_console.Commands.AddCommand("region", false, "change region",
"change region <region name>", "change region <region name>",
"Change current console region", ChangeSelectedRegion); "Change current console region", ChangeSelectedRegion);
m_console.Commands.AddCommand("region", false, "save xml", m_console.Commands.AddCommand("region", false, "save xml",
"save xml", "save xml",
"Save a region's data in XML format", SaveXml); "Save a region's data in XML format", SaveXml);
m_console.Commands.AddCommand("region", false, "save xml2", m_console.Commands.AddCommand("region", false, "save xml2",
"save xml2", "save xml2",
"Save a region's data in XML2 format", SaveXml2); "Save a region's data in XML2 format", SaveXml2);
m_console.Commands.AddCommand("region", false, "load xml", m_console.Commands.AddCommand("region", false, "load xml",
"load xml [-newIDs [<x> <y> <z>]]", "load xml [-newIDs [<x> <y> <z>]]",
"Load a region's data from XML format", LoadXml); "Load a region's data from XML format", LoadXml);
m_console.Commands.AddCommand("region", false, "load xml2", m_console.Commands.AddCommand("region", false, "load xml2",
"load xml2", "load xml2",
"Load a region's data from XML2 format", LoadXml2); "Load a region's data from XML2 format", LoadXml2);
m_console.Commands.AddCommand("region", false, "save prims xml2", m_console.Commands.AddCommand("region", false, "save prims xml2",
"save prims xml2 [<prim name> <file name>]", "save prims xml2 [<prim name> <file name>]",
"Save named prim to XML2", SavePrimsXml2); "Save named prim to XML2", SavePrimsXml2);
m_console.Commands.AddCommand("region", false, "load oar", m_console.Commands.AddCommand("region", false, "load oar",
"load oar <oar name>", "load oar <oar name>",
"Load a region's data from OAR archive", LoadOar); "Load a region's data from OAR archive", LoadOar);
m_console.Commands.AddCommand("region", false, "save oar", m_console.Commands.AddCommand("region", false, "save oar",
"save oar <oar name>", "save oar <oar name>",
"Save a region's data to an OAR archive", "Save a region's data to an OAR archive",
"More information on forthcoming options here soon", SaveOar); "More information on forthcoming options here soon", SaveOar);
m_console.Commands.AddCommand("region", false, "edit scale", m_console.Commands.AddCommand("region", false, "edit scale",
"edit scale <name> <x> <y> <z>", "edit scale <name> <x> <y> <z>",
"Change the scale of a named prim", HandleEditScale); "Change the scale of a named prim", HandleEditScale);
m_console.Commands.AddCommand("region", false, "kick user", m_console.Commands.AddCommand("region", false, "kick user",
"kick user <first> <last>", "kick user <first> <last>",
"Kick a user off the simulator", KickUserCommand); "Kick a user off the simulator", KickUserCommand);
m_console.Commands.AddCommand("region", false, "show assets", m_console.Commands.AddCommand("region", false, "show assets",
"show assets", "show assets",
"Show asset data", HandleShow); "Show asset data", HandleShow);
m_console.Commands.AddCommand("region", false, "show users", m_console.Commands.AddCommand("region", false, "show users",
"show users [full]", "show users [full]",
"Show user data", HandleShow); "Show user data", HandleShow);
m_console.Commands.AddCommand("region", false, "show users full", m_console.Commands.AddCommand("region", false, "show users full",
"show users full", "show users full",
String.Empty, HandleShow); String.Empty, HandleShow);
m_console.Commands.AddCommand("region", false, "show modules", m_console.Commands.AddCommand("region", false, "show modules",
"show modules", "show modules",
"Show module data", HandleShow); "Show module data", HandleShow);
m_console.Commands.AddCommand("region", false, "show regions", m_console.Commands.AddCommand("region", false, "show regions",
"show regions", "show regions",
"Show region data", HandleShow); "Show region data", HandleShow);
m_console.Commands.AddCommand("region", false, "show queues", m_console.Commands.AddCommand("region", false, "show queues",
"show queues", "show queues",
"Show queue data", HandleShow); "Show queue data", HandleShow);
m_console.Commands.AddCommand("region", false, "backup", m_console.Commands.AddCommand("region", false, "backup",
"backup", "backup",
"Persist objects to the database now", RunCommand); "Persist objects to the database now", RunCommand);
m_console.Commands.AddCommand("region", false, "create region", m_console.Commands.AddCommand("region", false, "create region",
"create region", "create region",
"Create a new region", HandleCreateRegion); "Create a new region", HandleCreateRegion);
m_console.Commands.AddCommand("region", false, "login enable", m_console.Commands.AddCommand("region", false, "login enable",
"login enable", "login enable",
"Enable logins to the simulator", HandleLoginEnable); "Enable logins to the simulator", HandleLoginEnable);
m_console.Commands.AddCommand("region", false, "login disable", m_console.Commands.AddCommand("region", false, "login disable",
"login disable", "login disable",
"Disable logins to the simulator", HandleLoginDisable); "Disable logins to the simulator", HandleLoginDisable);
m_console.Commands.AddCommand("region", false, "login status", m_console.Commands.AddCommand("region", false, "login status",
"login status", "login status",
"Display status of logins", HandleLoginStatus); "Display status of logins", HandleLoginStatus);
m_console.Commands.AddCommand("region", false, "restart", m_console.Commands.AddCommand("region", false, "restart",
"restart", "restart",
"Restart all sims in this instance", RunCommand); "Restart all sims in this instance", RunCommand);
m_console.Commands.AddCommand("region", false, "config set", m_console.Commands.AddCommand("region", false, "config set",
"config set <section> <field> <value>", "config set <section> <field> <value>",
"Set a config option", HandleConfig); "Set a config option", HandleConfig);
m_console.Commands.AddCommand("region", false, "config get", m_console.Commands.AddCommand("region", false, "config get",
"config get <section> <field>", "config get <section> <field>",
"Read a config option", HandleConfig); "Read a config option", HandleConfig);
m_console.Commands.AddCommand("region", false, "config save", m_console.Commands.AddCommand("region", false, "config save",
"config save", "config save",
"Save current configuration", HandleConfig); "Save current configuration", HandleConfig);
m_console.Commands.AddCommand("region", false, "command-script", m_console.Commands.AddCommand("region", false, "command-script",
"command-script <script>", "command-script <script>",
"Run a command script from file", RunCommand); "Run a command script from file", RunCommand);
m_console.Commands.AddCommand("region", false, "remove-region", m_console.Commands.AddCommand("region", false, "remove-region",
"remove-region <name>", "remove-region <name>",
"Remove a region from this simulator", RunCommand); "Remove a region from this simulator", RunCommand);
m_console.Commands.AddCommand("region", false, "delete-region", m_console.Commands.AddCommand("region", false, "delete-region",
"delete-region <name>", "delete-region <name>",
"Delete a region from disk", RunCommand); "Delete a region from disk", RunCommand);
m_console.Commands.AddCommand("region", false, "predecode-j2k", m_console.Commands.AddCommand("region", false, "predecode-j2k",
"predecode-j2k [<num threads>]>", "predecode-j2k [<num threads>]>",
"Precache assets,decode j2k layerdata", RunCommand); "Precache assets,decode j2k layerdata", RunCommand);
m_console.Commands.AddCommand("region", false, "modules list", m_console.Commands.AddCommand("region", false, "modules list",
"modules list", "modules list",
"List modules", HandleModules); "List modules", HandleModules);
m_console.Commands.AddCommand("region", false, "modules load", m_console.Commands.AddCommand("region", false, "modules load",
"modules load <name>", "modules load <name>",
"Load a module", HandleModules); "Load a module", HandleModules);
m_console.Commands.AddCommand("region", false, "modules unload", m_console.Commands.AddCommand("region", false, "modules unload",
"modules unload <name>", "modules unload <name>",
"Unload a module", HandleModules); "Unload a module", HandleModules);
m_console.Commands.AddCommand("region", false, "Add-InventoryHost", m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
"Add-InventoryHost <host>", "Add-InventoryHost <host>",
String.Empty, RunCommand); String.Empty, RunCommand);
if (ConfigurationSettings.Standalone) if (ConfigurationSettings.Standalone)
{ {
m_console.Commands.AddCommand("region", false, "create user", m_console.Commands.AddCommand("region", false, "create user",
"create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]", "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
"Create a new user", HandleCreateUser); "Create a new user", HandleCreateUser);
m_console.Commands.AddCommand("region", false, "reset user password", m_console.Commands.AddCommand("region", false, "reset user password",
"reset user password [<first> [<last> [<password>]]]", "reset user password [<first> [<last> [<password>]]]",
"Reset a user password", HandleResetUserPassword); "Reset a user password", HandleResetUserPassword);
} }
} }
@ -321,15 +323,16 @@ namespace OpenSim
{ {
RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle); RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle);
if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
{ {
m_console.Notice( m_console.Notice(
String.Format( String.Format(
"Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
presence.Firstname, presence.Firstname,
presence.Lastname, presence.Lastname,
presence.UUID, presence.UUID,
regionInfo.RegionName)); regionInfo.RegionName));
presence.Scene.IncomingCloseAgent(presence.UUID); presence.Scene.IncomingCloseAgent(presence.UUID);
} }
@ -458,9 +461,9 @@ namespace OpenSim
} }
else else
{ {
// IConfig c = DefaultConfig().Configs[cmdparams[1]]; // IConfig c = DefaultConfig().Configs[cmdparams[1]];
// if (c == null) // if (c == null)
// c = DefaultConfig().AddConfig(cmdparams[1]); // c = DefaultConfig().AddConfig(cmdparams[1]);
IConfig c; IConfig c;
IConfigSource source = new IniConfigSource(); IConfigSource source = new IniConfigSource();
c = source.AddConfig(cmdparams[1]); c = source.AddConfig(cmdparams[1]);
@ -471,11 +474,11 @@ namespace OpenSim
m_config.Source.Merge(source); m_config.Source.Merge(source);
m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
_value); _value);
} }
} }
break; break;
case "get": case "get":
if (cmdparams.Length < 3) if (cmdparams.Length < 3)
{ {
@ -498,7 +501,7 @@ namespace OpenSim
} }
break; break;
case "save": case "save":
m_console.Notice("Saving configuration file: " + Application.iniFilePath); m_console.Notice("Saving configuration file: " + Application.iniFilePath);
m_config.Save(Application.iniFilePath); m_config.Save(Application.iniFilePath);
@ -541,7 +544,6 @@ namespace OpenSim
{ {
foreach (Scene s in new ArrayList(m_sceneManager.Scenes)) foreach (Scene s in new ArrayList(m_sceneManager.Scenes))
{ {
m_console.Notice("Loading module: " + cmdparams[1]); m_console.Notice("Loading module: " + cmdparams[1]);
m_moduleLoader.LoadRegionModules(cmdparams[1], s); m_moduleLoader.LoadRegionModules(cmdparams[1], s);
} }
@ -569,58 +571,58 @@ namespace OpenSim
switch (command) switch (command)
{ {
case "command-script": case "command-script":
if (cmdparams.Length > 0) if (cmdparams.Length > 0)
{ {
RunCommandScript(cmdparams[0]); RunCommandScript(cmdparams[0]);
} }
break; break;
case "backup": case "backup":
m_sceneManager.BackupCurrentScene(); m_sceneManager.BackupCurrentScene();
break; break;
case "remove-region": case "remove-region":
string regRemoveName = CombineParams(cmdparams, 0); string regRemoveName = CombineParams(cmdparams, 0);
Scene removeScene; Scene removeScene;
if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
RemoveRegion(removeScene, false); RemoveRegion(removeScene, false);
else else
m_console.Error("no region with that name"); m_console.Error("no region with that name");
break; break;
case "delete-region": case "delete-region":
string regDeleteName = CombineParams(cmdparams, 0); string regDeleteName = CombineParams(cmdparams, 0);
Scene killScene; Scene killScene;
if (m_sceneManager.TryGetScene(regDeleteName, out killScene)) if (m_sceneManager.TryGetScene(regDeleteName, out killScene))
RemoveRegion(killScene, true); RemoveRegion(killScene, true);
else else
m_console.Error("no region with that name"); m_console.Error("no region with that name");
break; break;
case "restart": case "restart":
m_sceneManager.RestartCurrentScene(); m_sceneManager.RestartCurrentScene();
break; break;
case "Add-InventoryHost": case "Add-InventoryHost":
if (cmdparams.Length > 0) if (cmdparams.Length > 0)
{ {
m_commsManager.AddInventoryService(cmdparams[0]); m_commsManager.AddInventoryService(cmdparams[0]);
} }
break; break;
case "predecode-j2k": case "predecode-j2k":
if (cmdparams.Length > 0) if (cmdparams.Length > 0)
{ {
m_sceneManager.CacheJ2kDecode(Convert.ToInt32(cmdparams[0])); m_sceneManager.CacheJ2kDecode(Convert.ToInt32(cmdparams[0]));
} }
else else
{ {
m_sceneManager.CacheJ2kDecode(1); m_sceneManager.CacheJ2kDecode(1);
} }
break; break;
} }
} }
@ -743,10 +745,10 @@ namespace OpenSim
} }
// see BaseOpenSimServer // see BaseOpenSimServer
override public void HandleShow(string mod, string[] cmd) public override void HandleShow(string mod, string[] cmd)
{ {
base.HandleShow(mod, cmd); base.HandleShow(mod, cmd);
List<string> args = new List<string>(cmd); List<string> args = new List<string>(cmd);
args.RemoveAt(0); args.RemoveAt(0);
string[] showParams = args.ToArray(); string[] showParams = args.ToArray();
@ -812,11 +814,12 @@ namespace OpenSim
case "regions": case "regions":
m_sceneManager.ForEachScene( m_sceneManager.ForEachScene(
delegate(Scene scene) delegate(Scene scene)
{ {
m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " +
scene.RegionInfo.RegionLocX + " , Region YLoc: " + scene.RegionInfo.RegionLocX + " , Region YLoc: " +
scene.RegionInfo.RegionLocY + " , Region Port: " + scene.RegionInfo.InternalEndPoint.Port.ToString()); scene.RegionInfo.RegionLocY + " , Region Port: " +
}); scene.RegionInfo.InternalEndPoint.Port.ToString());
});
break; break;
case "queues": case "queues":
@ -842,16 +845,16 @@ namespace OpenSim
(IStatsCollector) client; (IStatsCollector) client;
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", 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",
"Send", "Send",
"In", "In",
"Out", "Out",
"Resend", "Resend",
"Land", "Land",
"Wind", "Wind",
"Cloud", "Cloud",
"Task", "Task",
"Texture", "Texture",
"Asset"); "Asset");
report = report + stats.Report() + report = report + stats.Report() +
"\n\n"; "\n\n";
} }
@ -878,7 +881,7 @@ namespace OpenSim
firstName = MainConsole.Instance.CmdPrompt("First name", "Default"); firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
else firstName = cmdparams[2]; else firstName = cmdparams[2];
if ( cmdparams.Length < 4 ) if (cmdparams.Length < 4)
lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
else lastName = cmdparams[3]; else lastName = cmdparams[3];
@ -886,11 +889,11 @@ namespace OpenSim
password = MainConsole.Instance.PasswdPrompt("Password"); password = MainConsole.Instance.PasswdPrompt("Password");
else password = cmdparams[4]; else password = cmdparams[4];
if ( cmdparams.Length < 6 ) if (cmdparams.Length < 6)
regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString())); regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
else regX = Convert.ToUInt32(cmdparams[5]); else regX = Convert.ToUInt32(cmdparams[5]);
if ( cmdparams.Length < 7 ) if (cmdparams.Length < 7)
regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
else regY = Convert.ToUInt32(cmdparams[6]); else regY = Convert.ToUInt32(cmdparams[6]);
@ -922,11 +925,11 @@ namespace OpenSim
firstName = MainConsole.Instance.CmdPrompt("First name"); firstName = MainConsole.Instance.CmdPrompt("First name");
else firstName = cmdparams[3]; else firstName = cmdparams[3];
if ( cmdparams.Length < 5 ) if (cmdparams.Length < 5)
lastName = MainConsole.Instance.CmdPrompt("Last name"); lastName = MainConsole.Instance.CmdPrompt("Last name");
else lastName = cmdparams[4]; else lastName = cmdparams[4];
if ( cmdparams.Length < 6 ) if (cmdparams.Length < 6)
newPassword = MainConsole.Instance.PasswdPrompt("New password"); newPassword = MainConsole.Instance.PasswdPrompt("New password");
else newPassword = cmdparams[5]; else newPassword = cmdparams[5];
@ -1114,4 +1117,4 @@ namespace OpenSim
#endregion #endregion
} }
} }

View File

@ -56,7 +56,8 @@ namespace OpenSim
m_log.Info("===================================================================="); m_log.Info("====================================================================");
m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("========================= STARTING OPENSIM =========================");
m_log.Info("===================================================================="); m_log.Info("====================================================================");
m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode", ConfigurationSettings.Standalone ? "sandbox" : "grid"); m_log.InfoFormat("[OPENSIM MAIN]: Running in background {0} mode",
ConfigurationSettings.Standalone ? "sandbox" : "grid");
base.Startup(); base.Startup();
@ -77,4 +78,4 @@ namespace OpenSim
base.Shutdown(); base.Shutdown();
} }
} }
} }

View File

@ -41,8 +41,6 @@ using OpenSim.Framework.Console;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Framework.Statistics; using OpenSim.Framework.Statistics;
using OpenSim.Region.ClientStack; using OpenSim.Region.ClientStack;
using OpenSim.Region.Communications.Local;
using OpenSim.Region.Communications.OGS1;
using OpenSim.Region.Framework; using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
@ -60,7 +58,7 @@ namespace OpenSim
// These are the names of the plugin-points extended by this // These are the names of the plugin-points extended by this
// class during system startup. // class during system startup.
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient"; private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
protected string proxyUrl; protected string proxyUrl;
@ -77,20 +75,21 @@ namespace OpenSim
/// The file used to load and save an opensim archive if no filename has been specified /// The file used to load and save an opensim archive if no filename has been specified
/// </summary> /// </summary>
protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene.oar.tar.gz"; protected const string DEFAULT_OAR_BACKUP_FILENAME = "scene.oar.tar.gz";
public ConfigSettings ConfigurationSettings public ConfigSettings ConfigurationSettings
{ {
get { return m_configSettings; } get { return m_configSettings; }
set { m_configSettings = value; } set { m_configSettings = value; }
} }
protected ConfigSettings m_configSettings; protected ConfigSettings m_configSettings;
protected ConfigurationLoader m_configLoader; protected ConfigurationLoader m_configLoader;
protected GridInfoService m_gridInfoService; protected GridInfoService m_gridInfoService;
public ConsoleCommand CreateAccount = null; public ConsoleCommand CreateAccount = null;
protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
/// <value> /// <value>
@ -101,13 +100,15 @@ namespace OpenSim
get { return m_config; } get { return m_config; }
set { m_config = value; } set { m_config = value; }
} }
protected OpenSimConfigSource m_config; protected OpenSimConfigSource m_config;
public List<IClientNetworkServer> ClientServers public List<IClientNetworkServer> ClientServers
{ {
get { return m_clientServers; } get { return m_clientServers; }
} }
protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
public new BaseHttpServer HttpServer public new BaseHttpServer HttpServer
{ {
@ -117,13 +118,14 @@ namespace OpenSim
public uint HttpServerPort public uint HttpServerPort
{ {
get { return m_httpServerPort; } get { return m_httpServerPort; }
} }
public ModuleLoader ModuleLoader public ModuleLoader ModuleLoader
{ {
get { return m_moduleLoader; } get { return m_moduleLoader; }
set { m_moduleLoader = value; } set { m_moduleLoader = value; }
} }
protected ModuleLoader m_moduleLoader; protected ModuleLoader m_moduleLoader;
protected IRegistryCore m_applicationRegistry = new RegistryCore(); protected IRegistryCore m_applicationRegistry = new RegistryCore();
@ -167,17 +169,17 @@ namespace OpenSim
loader.Load("/OpenSim/Startup"); loader.Load("/OpenSim/Startup");
m_plugins = loader.Plugins; m_plugins = loader.Plugins;
} }
protected override List<string> GetHelpTopics() protected override List<string> GetHelpTopics()
{ {
List<string> topics = base.GetHelpTopics(); List<string> topics = base.GetHelpTopics();
Scene s = SceneManager.CurrentOrFirstScene; Scene s = SceneManager.CurrentOrFirstScene;
if (s != null && s.GetCommanders() != null) if (s != null && s.GetCommanders() != null)
topics.AddRange(s.GetCommanders().Keys); topics.AddRange(s.GetCommanders().Keys);
return topics; return topics;
} }
/// <summary> /// <summary>
/// Performs startup specific to the region server, including initialization of the scene /// Performs startup specific to the region server, including initialization of the scene
/// such as loading configuration from disk. /// such as loading configuration from disk.
@ -185,18 +187,18 @@ namespace OpenSim
protected override void StartupSpecific() protected override void StartupSpecific()
{ {
base.StartupSpecific(); base.StartupSpecific();
m_stats = StatsManager.StartCollectingSimExtraStats(); m_stats = StatsManager.StartCollectingSimExtraStats();
// Create a ModuleLoader instance // Create a ModuleLoader instance
m_moduleLoader = new ModuleLoader(m_config.Source); m_moduleLoader = new ModuleLoader(m_config.Source);
LoadPlugins(); LoadPlugins();
foreach (IApplicationPlugin plugin in m_plugins) foreach (IApplicationPlugin plugin in m_plugins)
{ {
plugin.PostInitialise(); plugin.PostInitialise();
} }
// Only enable logins to the regions once we have completely finished starting up (apart from scripts) // Only enable logins to the regions once we have completely finished starting up (apart from scripts)
if ((m_commsManager != null) && (m_commsManager.GridService != null)) if ((m_commsManager != null) && (m_commsManager.GridService != null))
{ {
@ -216,14 +218,14 @@ namespace OpenSim
foreach (string topic in topics) foreach (string topic in topics)
{ {
m_console.Commands.AddCommand("plugin", false, "help " + topic, m_console.Commands.AddCommand("plugin", false, "help " + topic,
"help " + topic, "help " + topic,
"Get help on plugin command '" + topic + "'", "Get help on plugin command '" + topic + "'",
HandleCommanderHelp); HandleCommanderHelp);
m_console.Commands.AddCommand("plugin", false, topic, m_console.Commands.AddCommand("plugin", false, topic,
topic, topic,
"Execute subcommand for plugin '" + topic + "'", "Execute subcommand for plugin '" + topic + "'",
null); null);
ICommander commander = null; ICommander commander = null;
@ -241,9 +243,9 @@ namespace OpenSim
foreach (string command in commander.Commands.Keys) foreach (string command in commander.Commands.Keys)
{ {
m_console.Commands.AddCommand(topic, false, m_console.Commands.AddCommand(topic, false,
topic + " " + command, topic + " " + command,
topic + " " + commander.Commands[command].ShortHelp(), topic + " " + commander.Commands[command].ShortHelp(),
String.Empty, HandleCommanderCommand); String.Empty, HandleCommanderCommand);
} }
} }
} }
@ -288,80 +290,82 @@ namespace OpenSim
{ {
LegacyAssetClientPluginInitialiser linit = null; LegacyAssetClientPluginInitialiser linit = null;
CryptoAssetClientPluginInitialiser cinit = null; CryptoAssetClientPluginInitialiser cinit = null;
AssetClientPluginInitialiser init = null; AssetClientPluginInitialiser init = null;
IAssetServer assetServer = null; IAssetServer assetServer = null;
string mode = m_configSettings.AssetStorage; string mode = m_configSettings.AssetStorage;
if (mode == null | mode == String.Empty) if (mode == null | mode == String.Empty)
mode = "default"; mode = "default";
// If "default" is specified, then the value is adjusted // If "default" is specified, then the value is adjusted
// according to whether or not the server is running in // according to whether or not the server is running in
// standalone mode. // standalone mode.
if (mode.ToLower() == "default") if (mode.ToLower() == "default")
{ {
if (m_configSettings.Standalone == false) if (m_configSettings.Standalone == false)
mode = "grid"; mode = "grid";
else else
mode = "local"; mode = "local";
} }
switch (mode.ToLower()) switch (mode.ToLower())
{ {
// If grid is specified then the grid server is chose regardless // If grid is specified then the grid server is chose regardless
// of whether the server is standalone. // of whether the server is standalone.
case "grid" : case "grid":
linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
assetServer = loadAssetServer("Grid", linit); assetServer = loadAssetServer("Grid", linit);
break; break;
// If cryptogrid is specified then the cryptogrid server is chose regardless // If cryptogrid is specified then the cryptogrid server is chose regardless
// of whether the server is standalone. // of whether the server is standalone.
case "cryptogrid" : case "cryptogrid":
cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
Environment.CurrentDirectory, true); Environment.CurrentDirectory, true);
assetServer = loadAssetServer("Crypto", cinit); assetServer = loadAssetServer("Crypto", cinit);
break; break;
// If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless // If cryptogrid_eou is specified then the cryptogrid_eou server is chose regardless
// of whether the server is standalone. // of whether the server is standalone.
case "cryptogrid_eou" : case "cryptogrid_eou":
cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL, cinit = new CryptoAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL,
Environment.CurrentDirectory, false); Environment.CurrentDirectory, false);
assetServer = loadAssetServer("Crypto", cinit); assetServer = loadAssetServer("Crypto", cinit);
break; break;
// If file is specified then the file server is chose regardless // If file is specified then the file server is chose regardless
// of whether the server is standalone. // of whether the server is standalone.
case "file" : case "file":
linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL); linit = new LegacyAssetClientPluginInitialiser(m_configSettings, m_networkServersInfo.AssetURL);
assetServer = loadAssetServer("File", linit); assetServer = loadAssetServer("File", linit);
break; break;
// If local is specified then we're going to use the local SQL server // If local is specified then we're going to use the local SQL server
// implementation. We drop through, because that will be the fallback // implementation. We drop through, because that will be the fallback
// for the following default clause too. // for the following default clause too.
case "local" : case "local":
break; break;
// If the asset_database value is none of the previously mentioned strings, then we // If the asset_database value is none of the previously mentioned strings, then we
// try to load a turnkey plugin that matches this value. If not we drop through to // try to load a turnkey plugin that matches this value. If not we drop through to
// a local default. // a local default.
default : default:
try try
{ {
init = new AssetClientPluginInitialiser(m_configSettings); init = new AssetClientPluginInitialiser(m_configSettings);
assetServer = loadAssetServer(m_configSettings.AssetStorage, init); assetServer = loadAssetServer(m_configSettings.AssetStorage, init);
break; break;
} }
catch {} catch
{
}
m_log.Info("[OPENSIMBASE] Default assetserver will be used"); m_log.Info("[OPENSIMBASE] Default assetserver will be used");
break; break;
} }
// Open the local SQL-based database asset server // Open the local SQL-based database asset server
if (assetServer == null) if (assetServer == null)
{ {
init = new AssetClientPluginInitialiser(m_configSettings); init = new AssetClientPluginInitialiser(m_configSettings);
SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init); SQLAssetServer sqlAssetServer = (SQLAssetServer) loadAssetServer("SQL", init);
@ -426,7 +430,7 @@ namespace OpenSim
loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache)); loader.AddFilter(PLUGIN_ASSET_CACHE, new PluginProviderFilter(m_configSettings.AssetCache));
loader.Load(PLUGIN_ASSET_CACHE); loader.Load(PLUGIN_ASSET_CACHE);
if (loader.Plugins.Count > 0) if (loader.Plugins.Count > 0)
assetCache = (IAssetCache) loader.Plugins[0]; assetCache = (IAssetCache) loader.Plugins[0];
} }
catch (Exception e) catch (Exception e)
@ -450,8 +454,8 @@ namespace OpenSim
else else
{ {
m_log.Info("[Login] Login are now disabled "); m_log.Info("[Login] Login are now disabled ");
m_commsManager.GridService.RegionLoginsEnabled = false; m_commsManager.GridService.RegionLoginsEnabled = false;
} }
} }
/// <summary> /// <summary>
@ -511,16 +515,16 @@ namespace OpenSim
m_log.Info("[MODULES]: Loading Region's modules"); m_log.Info("[MODULES]: Loading Region's modules");
List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, "."); List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
// This needs to be ahead of the script engine load, so the // This needs to be ahead of the script engine load, so the
// script module can pick up events exposed by a module // script module can pick up events exposed by a module
m_moduleLoader.InitialiseSharedModules(scene); m_moduleLoader.InitialiseSharedModules(scene);
scene.SetModuleInterfaces(); scene.SetModuleInterfaces();
// Prims have to be loaded after module configuration since some modules may be invoked during the load // Prims have to be loaded after module configuration since some modules may be invoked during the load
scene.LoadPrimsFromStorage(regionInfo.originRegionID); scene.LoadPrimsFromStorage(regionInfo.originRegionID);
scene.StartTimer(); scene.StartTimer();
// moved these here as the terrain texture has to be created after the modules are initialized // moved these here as the terrain texture has to be created after the modules are initialized
@ -576,11 +580,11 @@ namespace OpenSim
{ {
m_sceneManager.TrySetCurrentScene(".."); m_sceneManager.TrySetCurrentScene("..");
} }
scene.DeleteAllSceneObjects(); scene.DeleteAllSceneObjects();
m_sceneManager.CloseScene(scene); m_sceneManager.CloseScene(scene);
if (!cleanup) if (!cleanup)
return; return;
if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile)) if (!String.IsNullOrEmpty(scene.RegionInfo.RegionFile))
@ -624,7 +628,7 @@ namespace OpenSim
//if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP)) //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP))
// listenIP = IPAddress.Parse("0.0.0.0"); // listenIP = IPAddress.Parse("0.0.0.0");
uint port = (uint)regionInfo.InternalEndPoint.Port; uint port = (uint) regionInfo.InternalEndPoint.Port;
if (m_autoCreateClientStack) if (m_autoCreateClientStack)
{ {
@ -638,7 +642,7 @@ namespace OpenSim
clientServer = null; clientServer = null;
} }
regionInfo.InternalEndPoint.Port = (int)port; regionInfo.InternalEndPoint.Port = (int) port;
Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
@ -651,7 +655,7 @@ namespace OpenSim
scene.PhysicsScene = GetPhysicsScene(scene.RegionInfo.RegionName); scene.PhysicsScene = GetPhysicsScene(scene.RegionInfo.RegionName);
scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
scene.PhysicsScene.SetWaterLevel((float)regionInfo.RegionSettings.WaterHeight); scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight);
// TODO: Remove this cruft once MasterAvatar is fully deprecated // TODO: Remove this cruft once MasterAvatar is fully deprecated
//Master Avatar Setup //Master Avatar Setup
@ -687,7 +691,8 @@ namespace OpenSim
protected override StorageManager CreateStorageManager() protected override StorageManager CreateStorageManager()
{ {
return CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString); return
CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString);
} }
protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring)
@ -704,10 +709,10 @@ namespace OpenSim
AgentCircuitManager circuitManager) AgentCircuitManager circuitManager)
{ {
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
return new Scene( return new Scene(
regionInfo, circuitManager, m_commsManager, sceneGridService, regionInfo, circuitManager, m_commsManager, sceneGridService,
storageManager, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, storageManager, m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim,
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
} }
@ -728,7 +733,7 @@ namespace OpenSim
break; break;
} }
} }
if (foundClientServer) if (foundClientServer)
{ {
m_clientServers[clientServerElement].Server.Close(); m_clientServers[clientServerElement].Server.Close();
@ -793,7 +798,7 @@ namespace OpenSim
m_log.Info("[SHUTDOWN]: Closing console and terminating"); m_log.Info("[SHUTDOWN]: Closing console and terminating");
try try
{ {
m_sceneManager.Close(); m_sceneManager.Close();
} }
catch (Exception e) catch (Exception e)
@ -840,14 +845,14 @@ namespace OpenSim
{ {
if (Source is IniConfigSource) if (Source is IniConfigSource)
{ {
IniConfigSource iniCon = (IniConfigSource)Source; IniConfigSource iniCon = (IniConfigSource) Source;
iniCon.Save(path); iniCon.Save(path);
} }
else if (Source is XmlConfigSource) else if (Source is XmlConfigSource)
{ {
XmlConfigSource xmlCon = (XmlConfigSource)Source; XmlConfigSource xmlCon = (XmlConfigSource) Source;
xmlCon.Save(path); xmlCon.Save(path);
} }
} }
} }
} }