* teared out too wide catch clauses. See Code Conventions.

afrisby
lbsa71 2007-06-14 16:14:40 +00:00
parent 16b43b8bff
commit a8646ff159
2 changed files with 104 additions and 150 deletions

View File

@ -123,13 +123,6 @@ namespace OpenSim
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
{
/// Ensure that all sockets have been closed before the process closes. This helps ensure that no

View File

@ -78,15 +78,10 @@ namespace OpenSim
public override void StartUp()
{
this.regionData = new RegionInfo();
try
{
this.localConfig = new XmlConfig(m_config);
this.localConfig.LoadData();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
if (this.configFileSetup)
{
this.SetupFromConfigFile(this.localConfig);
@ -115,16 +110,10 @@ namespace OpenSim
startuptime = DateTime.Now;
try
{
AssetCache = new AssetCache(GridServers.AssetServer);
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);
@ -191,12 +180,12 @@ namespace OpenSim
if (this.m_sandbox)
{
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.");
adminLoginServer.CreateUserAccount(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName, this.regionData.MasterAvatarSandboxPassword);
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");
}
@ -232,16 +221,8 @@ namespace OpenSim
m_console.Notice("Starting in Sandbox mode");
try
{
GridServers.Initialise();
}
catch (Exception e)
{
m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1);
}
}
protected override void SetupRemoteGridServers()
{
@ -257,15 +238,9 @@ namespace OpenSim
m_console.Notice("Starting in Grid mode");
try
{
GridServers.Initialise();
}
catch (Exception e)
{
m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1);
}
}
protected override void SetupLocalWorld()
@ -356,17 +331,12 @@ namespace OpenSim
{
// The grid server has told us who we are
// We must obey the grid server.
try
{
regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].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)
{
try
{
// SandBoxMode
string attri = "";
attri = configData.GetAttribute("SandBox");
@ -463,14 +432,6 @@ namespace OpenSim
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>
/// Performs any last-minute sanity checking and shuts down the region server