On initial opensim setup, don't ask the user whether they want to join an existing opensim estate when there aren't any. Proceed directly to estate setup instead.

0.7.1-dev
Justin Clark-Casey (justincc) 2011-03-21 22:57:20 +00:00
parent ee7cfc2854
commit 060a53b896
1 changed files with 63 additions and 39 deletions

View File

@ -793,21 +793,10 @@ namespace OpenSim
} }
/// <summary> /// <summary>
/// Load the estate information for the provided RegionInfo object. /// Create an estate with an initial region.
/// </summary> /// </summary>
/// <param name="regInfo"></param> /// <param name="regInfo"></param>
public void PopulateRegionEstateInfo(RegionInfo regInfo) public void CreateEstate(RegionInfo regInfo)
{
if (EstateDataService != null)
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
if (regInfo.EstateSettings.EstateID == 0) // No record at all
{
MainConsole.Instance.Output("Your region is not part of an estate.");
while (true)
{
string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() { "yes", "no" });
if (response == "no")
{ {
// Create a new estate // Create a new estate
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true); regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
@ -820,12 +809,46 @@ namespace OpenSim
// knows that the passed in settings in RegionInfo are already valid. Also, it might be // knows that the passed in settings in RegionInfo are already valid. Also, it might be
// possible to eliminate some additional later saves made by callers of this method. // possible to eliminate some additional later saves made by callers of this method.
regInfo.EstateSettings.Save(); regInfo.EstateSettings.Save();
}
/// <summary>
/// Load the estate information for the provided RegionInfo object.
/// </summary>
/// <param name="regInfo"></param>
public void PopulateRegionEstateInfo(RegionInfo regInfo)
{
if (EstateDataService != null)
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
if (regInfo.EstateSettings.EstateID == 0) // No record at all
{
MainConsole.Instance.Output("Your region is not part of an estate.");
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
while (true)
{
if (estates.Count == 0)
{
MainConsole.Instance.Output(
"There aren't any existing estates. You will need to create a new one for this region.");
CreateEstate(regInfo);
break; break;
} }
else else
{ {
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll(); string response
= MainConsole.Instance.CmdPrompt(
"Do you wish to join an existing estate (yes/no)?", "no", new List<string>() { "yes", "no" });
if (response == "no")
{
CreateEstate(regInfo);
break;
}
else
{
List<string> estateNames = new List<string>(); List<string> estateNames = new List<string>();
foreach (EstateSettings estate in estates) foreach (EstateSettings estate in estates)
estateNames.Add(estate.EstateName); estateNames.Add(estate.EstateName);
@ -859,6 +882,7 @@ namespace OpenSim
} }
} }
} }
}
public class OpenSimConfigSource public class OpenSimConfigSource
{ {