aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/Application.cs14
-rw-r--r--OpenSim/Region/Application/OpenSim.cs20
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs122
3 files changed, 101 insertions, 55 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index d120f03..7e320e6 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -250,9 +250,7 @@ namespace OpenSim
250 m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); 250 m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false);
251 251
252 // load Crash directory config 252 // load Crash directory config
253 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); 253 m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
254
255
256 254
257 if (background) 255 if (background)
258 { 256 {
@@ -260,15 +258,9 @@ namespace OpenSim
260 m_sim.Startup(); 258 m_sim.Startup();
261 } 259 }
262 else 260 else
263 { 261 {
264
265
266
267
268 m_sim = new OpenSim(configSource); 262 m_sim = new OpenSim(configSource);
269 263
270
271
272 m_sim.Startup(); 264 m_sim.Startup();
273 265
274 while (true) 266 while (true)
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 4081888..39004d4 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -123,7 +123,7 @@ namespace OpenSim
123 m_log.Info("===================================================================="); 123 m_log.Info("====================================================================");
124 m_log.Info("========================= STARTING OPENSIM ========================="); 124 m_log.Info("========================= STARTING OPENSIM =========================");
125 m_log.Info("===================================================================="); 125 m_log.Info("====================================================================");
126 m_log.InfoFormat("[OPENSIM MAIN]: Running "); 126
127 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); 127 //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
128 // http://msdn.microsoft.com/en-us/library/bb384202.aspx 128 // http://msdn.microsoft.com/en-us/library/bb384202.aspx
129 //GCSettings.LatencyMode = GCLatencyMode.Batch; 129 //GCSettings.LatencyMode = GCLatencyMode.Batch;
@@ -341,10 +341,15 @@ namespace OpenSim
341 341
342 m_console.Commands.AddCommand("region", false, "config get", 342 m_console.Commands.AddCommand("region", false, "config get",
343 "config get [<section>] [<key>]", 343 "config get [<section>] [<key>]",
344 "Show a config option", 344 "Synonym for config show",
345 HandleConfig);
346
347 m_console.Commands.AddCommand("region", false, "config show",
348 "config show [<section>] [<key>]",
349 "Show config information",
345 "If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine 350 "If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine
346 + "If a section is given but not a field, then all fields in that section are printed.", 351 + "If a section is given but not a field, then all fields in that section are printed.",
347 HandleConfig); 352 HandleConfig);
348 353
349 m_console.Commands.AddCommand("region", false, "config save", 354 m_console.Commands.AddCommand("region", false, "config save",
350 "config save <path>", 355 "config save <path>",
@@ -593,7 +598,9 @@ namespace OpenSim
593 598
594 if (cmdparams.Length > 0) 599 if (cmdparams.Length > 0)
595 { 600 {
596 switch (cmdparams[0].ToLower()) 601 string firstParam = cmdparams[0].ToLower();
602
603 switch (firstParam)
597 { 604 {
598 case "set": 605 case "set":
599 if (cmdparams.Length < 4) 606 if (cmdparams.Length < 4)
@@ -618,6 +625,7 @@ namespace OpenSim
618 break; 625 break;
619 626
620 case "get": 627 case "get":
628 case "show":
621 if (cmdparams.Length == 1) 629 if (cmdparams.Length == 1)
622 { 630 {
623 foreach (IConfig config in m_config.Source.Configs) 631 foreach (IConfig config in m_config.Source.Configs)
@@ -654,8 +662,8 @@ namespace OpenSim
654 } 662 }
655 else 663 else
656 { 664 {
657 Notice("Syntax: config get [<section>] [<key>]"); 665 Notice("Syntax: config {0} [<section>] [<key>]", firstParam);
658 Notice("Example: config get ScriptEngine.DotNetEngine NumberOfScriptThreads"); 666 Notice("Example: config {0} ScriptEngine.DotNetEngine NumberOfScriptThreads", firstParam);
659 } 667 }
660 668
661 break; 669 break;
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index e950613..ea9edf6 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -793,66 +793,112 @@ namespace OpenSim
793 } 793 }
794 794
795 /// <summary> 795 /// <summary>
796 /// Load the estate information for the provided RegionInfo object. 796 /// Create an estate with an initial region.
797 /// </summary> 797 /// </summary>
798 /// <remarks>
799 /// This method doesn't allow an estate to be created with the same name as existing estates.
800 /// </remarks>
798 /// <param name="regInfo"></param> 801 /// <param name="regInfo"></param>
799 public void PopulateRegionEstateInfo(RegionInfo regInfo) 802 /// <param name="existingName">A list of estate names that already exist.</param>
803 /// <returns>true if the estate was created, false otherwise</returns>
804 public bool CreateEstate(RegionInfo regInfo, List<string> existingNames)
800 { 805 {
801 IEstateDataService estateDataService = EstateDataService; 806 // Create a new estate
807 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
808 string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
802 809
803 if (estateDataService != null) 810 if (existingNames.Contains(newName))
804 { 811 {
805 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false); 812 MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
813 return false;
806 } 814 }
815
816 regInfo.EstateSettings.EstateName = newName;
817
818 // FIXME: Later on, the scene constructor will reload the estate settings no matter what.
819 // Therefore, we need to do an initial save here otherwise the new estate name will be reset
820 // back to the default. The reloading of estate settings by scene could be eliminated if it
821 // knows that the passed in settings in RegionInfo are already valid. Also, it might be
822 // possible to eliminate some additional later saves made by callers of this method.
823 regInfo.EstateSettings.Save();
824
825 return true;
826 }
827
828 /// <summary>
829 /// Load the estate information for the provided RegionInfo object.
830 /// </summary>
831 /// <param name="regInfo"></param>
832 public void PopulateRegionEstateInfo(RegionInfo regInfo)
833 {
834 if (EstateDataService != null)
835 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
807 836
808 if (regInfo.EstateSettings.EstateID == 0) // No record at all 837 if (regInfo.EstateSettings.EstateID == 0) // No record at all
809 { 838 {
810 MainConsole.Instance.Output("Your region is not part of an estate."); 839 MainConsole.Instance.OutputFormat("Region {0} is not part of an estate.", regInfo.RegionName);
840
841 List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
842 List<string> estateNames = new List<string>();
843 foreach (EstateSettings estate in estates)
844 estateNames.Add(estate.EstateName);
845
811 while (true) 846 while (true)
812 { 847 {
813 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() { "yes", "no" }); 848 if (estates.Count == 0)
814 if (response == "no") 849 {
815 { 850 MainConsole.Instance.Output("No existing estates found. You must create a new one.");
816 // Create a new estate
817 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true);
818
819 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
820 851
821 // FIXME: Later on, the scene constructor will reload the estate settings no matter what. 852 if (CreateEstate(regInfo, estateNames))
822 // Therefore, we need to do an initial save here otherwise the new estate name will be reset 853 break;
823 // back to the default. The reloading of estate settings by scene could be eliminated if it 854 else
824 // knows that the passed in settings in RegionInfo are already valid. Also, it might be 855 continue;
825 // possible to eliminate some additional later saves made by callers of this method.
826 regInfo.EstateSettings.Save();
827 break;
828 } 856 }
829 else 857 else
830 { 858 {
831 response = MainConsole.Instance.CmdPrompt("Estate name to join", "None"); 859 string response
832 if (response == "None") 860 = MainConsole.Instance.CmdPrompt(
833 continue; 861 string.Format(
834 862 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
835 List<int> estateIDs = estateDataService.GetEstates(response); 863 "yes",
836 if (estateIDs.Count < 1) 864 new List<string>() { "yes", "no" });
865
866 if (response == "no")
837 { 867 {
838 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); 868 if (CreateEstate(regInfo, estateNames))
839 continue; 869 break;
870 else
871 continue;
872 }
873 else
874 {
875 response
876 = MainConsole.Instance.CmdPrompt(
877 string.Format(
878 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
879 estateNames[0]);
880
881 List<int> estateIDs = EstateDataService.GetEstates(response);
882 if (estateIDs.Count < 1)
883 {
884 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
885 continue;
886 }
887
888 int estateID = estateIDs[0];
889
890 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
891
892 if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
893 break;
894
895 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
840 } 896 }
841
842 int estateID = estateIDs[0];
843
844 regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID);
845
846 if (estateDataService.LinkRegion(regInfo.RegionID, estateID))
847 break;
848
849 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
850 } 897 }
851 } 898 }
852 } 899 }
853 } 900 }
854 } 901 }
855
856 902
857 public class OpenSimConfigSource 903 public class OpenSimConfigSource
858 { 904 {