* teared out too wide catch clauses. See Code Conventions.
parent
16b43b8bff
commit
a8646ff159
|
@ -123,13 +123,6 @@ namespace OpenSim
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt();
|
OpenSim.Framework.Console.MainConsole.Instance.MainConsolePrompt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception oException)
|
|
||||||
{
|
|
||||||
Console.WriteLine(oException.Message);
|
|
||||||
Console.WriteLine("Fatal error. Server is shutdown. Press 'Enter' to close.");
|
|
||||||
Console.ReadLine();
|
|
||||||
|
|
||||||
}
|
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
/// Ensure that all sockets have been closed before the process closes. This helps ensure that no
|
/// Ensure that all sockets have been closed before the process closes. This helps ensure that no
|
||||||
|
|
|
@ -78,15 +78,10 @@ namespace OpenSim
|
||||||
public override void StartUp()
|
public override void StartUp()
|
||||||
{
|
{
|
||||||
this.regionData = new RegionInfo();
|
this.regionData = new RegionInfo();
|
||||||
try
|
|
||||||
{
|
|
||||||
this.localConfig = new XmlConfig(m_config);
|
this.localConfig = new XmlConfig(m_config);
|
||||||
this.localConfig.LoadData();
|
this.localConfig.LoadData();
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e.Message);
|
|
||||||
}
|
|
||||||
if (this.configFileSetup)
|
if (this.configFileSetup)
|
||||||
{
|
{
|
||||||
this.SetupFromConfigFile(this.localConfig);
|
this.SetupFromConfigFile(this.localConfig);
|
||||||
|
@ -115,16 +110,10 @@ namespace OpenSim
|
||||||
|
|
||||||
startuptime = DateTime.Now;
|
startuptime = DateTime.Now;
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AssetCache = new AssetCache(GridServers.AssetServer);
|
AssetCache = new AssetCache(GridServers.AssetServer);
|
||||||
InventoryCache = new InventoryCache();
|
InventoryCache = new InventoryCache();
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.Error(e.Message + "\nSorry, could not setup local cache");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler);
|
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler);
|
||||||
|
|
||||||
|
@ -191,12 +180,12 @@ namespace OpenSim
|
||||||
if (this.m_sandbox)
|
if (this.m_sandbox)
|
||||||
{
|
{
|
||||||
OpenSim.Framework.User.UserProfile masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName);
|
OpenSim.Framework.User.UserProfile masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName);
|
||||||
if(masterUser == null)
|
if (masterUser == null)
|
||||||
{
|
{
|
||||||
m_console.Notice("Main.cs:Startup() - Sandbox Mode; Master Avatar is a new user; creating account.");
|
m_console.Notice("Main.cs:Startup() - Sandbox Mode; Master Avatar is a new user; creating account.");
|
||||||
adminLoginServer.CreateUserAccount(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName, this.regionData.MasterAvatarSandboxPassword);
|
adminLoginServer.CreateUserAccount(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName, this.regionData.MasterAvatarSandboxPassword);
|
||||||
masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName);
|
masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName);
|
||||||
if(masterUser == null) //Still NULL?!!?! OMG FAIL!
|
if (masterUser == null) //Still NULL?!!?! OMG FAIL!
|
||||||
{
|
{
|
||||||
throw new Exception("Failure to create master user account");
|
throw new Exception("Failure to create master user account");
|
||||||
}
|
}
|
||||||
|
@ -232,16 +221,8 @@ namespace OpenSim
|
||||||
|
|
||||||
m_console.Notice("Starting in Sandbox mode");
|
m_console.Notice("Starting in Sandbox mode");
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GridServers.Initialise();
|
GridServers.Initialise();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void SetupRemoteGridServers()
|
protected override void SetupRemoteGridServers()
|
||||||
{
|
{
|
||||||
|
@ -257,15 +238,9 @@ namespace OpenSim
|
||||||
|
|
||||||
m_console.Notice("Starting in Grid mode");
|
m_console.Notice("Starting in Grid mode");
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GridServers.Initialise();
|
GridServers.Initialise();
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetupLocalWorld()
|
protected override void SetupLocalWorld()
|
||||||
|
@ -356,17 +331,12 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
// The grid server has told us who we are
|
// The grid server has told us who we are
|
||||||
// We must obey the grid server.
|
// We must obey the grid server.
|
||||||
try
|
|
||||||
{
|
|
||||||
regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
|
regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
|
||||||
regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString());
|
regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString());
|
||||||
regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString();
|
regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString();
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.Error("Did not recieve valid information from the grid server. " + e.ToString());
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,8 +344,7 @@ namespace OpenSim
|
||||||
|
|
||||||
private void SetupFromConfigFile(IGenericConfig configData)
|
private void SetupFromConfigFile(IGenericConfig configData)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
// SandBoxMode
|
// SandBoxMode
|
||||||
string attri = "";
|
string attri = "";
|
||||||
attri = configData.GetAttribute("SandBox");
|
attri = configData.GetAttribute("SandBox");
|
||||||
|
@ -463,14 +432,6 @@ namespace OpenSim
|
||||||
|
|
||||||
configData.Commit();
|
configData.Commit();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.Error(e.Message);
|
|
||||||
m_console.Error("Sorry, a fatal error occurred while trying to initialise the configuration data");
|
|
||||||
m_console.Error("Can not continue starting up");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs any last-minute sanity checking and shuts down the region server
|
/// Performs any last-minute sanity checking and shuts down the region server
|
||||||
|
|
Loading…
Reference in New Issue