From 8388fe0669f9d140028d1925284491b21a09a1bf Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 8 Sep 2008 14:30:35 +0000 Subject: * some if inversions and added {}'s for readability --- .../RemoteController/RemoteAdminPlugin.cs | 12 ++++++-- OpenSim/Region/Application/Application.cs | 2 ++ OpenSim/Region/Application/OpenSim.cs | 8 +++-- OpenSim/Region/Application/OpenSimBase.cs | 36 +++++++++++++++++----- .../Region/ClientStack/RegionApplicationBase.cs | 25 +++++++-------- 5 files changed, 57 insertions(+), 26 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 7803d92..9451f00 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -71,8 +71,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_configSource = openSim.ConfigSource.Source; try { - if (m_configSource.Configs["RemoteAdmin"] != null && - m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) + if (m_configSource.Configs["RemoteAdmin"] == null || + !m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) + { + // No config or disabled + } + else { m_config = m_configSource.Configs["RemoteAdmin"]; m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); @@ -110,8 +114,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController checkStringParameters(request, new string[] { "password", "regionID" }); if (requiredPassword != String.Empty && - (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) + (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) + { throw new Exception("wrong password"); + } UUID regionID = new UUID((string) requestData["regionID"]); diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 59ac161..8d2ce55 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -117,7 +117,9 @@ namespace OpenSim msg += "Exception: " + e.ExceptionObject.ToString() + "\r\n"; Exception ex = (Exception)e.ExceptionObject; if (ex.InnerException != null) + { msg += "InnerException: " + ex.InnerException.ToString() + "\r\n"; + } msg += "\r\n"; msg += "Application is terminating: " + e.IsTerminating.ToString() + "\r\n"; diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index edb29db..43c1d26 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -77,6 +77,7 @@ namespace OpenSim m_timedScript = startupConfig.GetString("timer_Script", "disabled"); } + base.ReadConfigSettings(); } @@ -96,13 +97,13 @@ namespace OpenSim base.Startup(); //Run Startup Commands - if (m_startupCommandsFile != String.Empty) + if (String.IsNullOrEmpty( m_startupCommandsFile )) { - RunCommandScript(m_startupCommandsFile); + m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); } else { - m_log.Info("[STARTUP]: No startup command script specified. Moving on..."); + RunCommandScript(m_startupCommandsFile); } // Start timer script (run a script every xx seconds) @@ -365,6 +366,7 @@ namespace OpenSim { m_sceneManager.TrySetCurrentScene(".."); } + m_regionData.Remove(killScene.RegionInfo); m_sceneManager.CloseScene(killScene); } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index e2b2bbc..156d022 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -205,7 +205,10 @@ namespace OpenSim { IConfigSource DefaultConfig = new IniConfigSource(); if (DefaultConfig.Configs["Startup"] == null) + { DefaultConfig.AddConfig("Startup"); + } + IConfig config = DefaultConfig.Configs["Startup"]; if (config != null) { @@ -225,7 +228,9 @@ namespace OpenSim } if (DefaultConfig.Configs["StandAlone"] == null) + { DefaultConfig.AddConfig("StandAlone"); + } config = DefaultConfig.Configs["StandAlone"]; if (config != null) @@ -242,7 +247,10 @@ namespace OpenSim } if (DefaultConfig.Configs["Network"] == null) + { DefaultConfig.AddConfig("Network"); + } + config = DefaultConfig.Configs["Network"]; if (config != null) { @@ -262,7 +270,10 @@ namespace OpenSim } if (DefaultConfig.Configs["RemoteAdmin"] == null) + { DefaultConfig.AddConfig("RemoteAdmin"); + } + config = DefaultConfig.Configs["RemoteAdmin"]; if (config != null) { @@ -270,12 +281,16 @@ namespace OpenSim } if (DefaultConfig.Configs["Voice"] == null) + { DefaultConfig.AddConfig("Voice"); + } + config = DefaultConfig.Configs["Voice"]; if (config != null) { config.Set("enabled", "false"); } + return DefaultConfig; } @@ -741,18 +756,23 @@ namespace OpenSim return; } - if (null != inventoryFolder) + if (null == inventoryFolder) { - m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, invPath); - } - else if (null != inventoryItem) - { - m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID, invPath); + if (null == inventoryItem) + { + m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); + return; + } + else + { + m_log.InfoFormat("[CONSOLE]: Found item {0} {1} at {2}", inventoryItem.Name, inventoryItem.ID, + invPath); + } } else { - m_log.ErrorFormat("[CONSOLE]: Could not find inventory entry at path {0}", invPath); - return; + m_log.InfoFormat("[CONSOLE]: Found folder {0} {1} at {2}", inventoryFolder.Name, inventoryFolder.ID, + invPath); } } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index d1572fd..dfe922b 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -138,30 +138,31 @@ namespace OpenSim.Region.ClientStack // TODO: Remove this cruft once MasterAvatar is fully deprecated //Master Avatar Setup UserProfileData masterAvatar; - if (scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero) - { - masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); - scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName; - scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName; - } - else + if (scene.RegionInfo.MasterAvatarAssignedUUID == UUID.Zero) { masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword); } - - if (masterAvatar != null) + else { - m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName); - scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID; + masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID); + scene.RegionInfo.MasterAvatarFirstName = masterAvatar.FirstName; + scene.RegionInfo.MasterAvatarLastName = masterAvatar.SurName; } - else + + if (masterAvatar == null) { m_log.Info("[PARCEL]: No master avatar found, using null."); scene.RegionInfo.MasterAvatarAssignedUUID = UUID.Zero; } + else + { + m_log.InfoFormat("[PARCEL]: Found master avatar {0} {1} [" + masterAvatar.ID.ToString() + "]", + scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName); + scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.ID; + } scene.LoadPrimsFromStorage(regionInfo.originRegionID); scene.StartTimer(); -- cgit v1.1