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.
parent
ee7cfc2854
commit
060a53b896
OpenSim/Region/Application
|
@ -792,6 +792,25 @@ namespace OpenSim
|
||||||
regionnum = m_sceneManager.Scenes.Count;
|
regionnum = m_sceneManager.Scenes.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create an estate with an initial region.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regInfo"></param>
|
||||||
|
public void CreateEstate(RegionInfo regInfo)
|
||||||
|
{
|
||||||
|
// Create a new estate
|
||||||
|
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
|
||||||
|
|
||||||
|
regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||||
|
|
||||||
|
// FIXME: Later on, the scene constructor will reload the estate settings no matter what.
|
||||||
|
// Therefore, we need to do an initial save here otherwise the new estate name will be reset
|
||||||
|
// back to the default. The reloading of estate settings by scene could be eliminated if it
|
||||||
|
// 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.
|
||||||
|
regInfo.EstateSettings.Save();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load the estate information for the provided RegionInfo object.
|
/// Load the estate information for the provided RegionInfo object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -804,56 +823,61 @@ namespace OpenSim
|
||||||
if (regInfo.EstateSettings.EstateID == 0) // No record at all
|
if (regInfo.EstateSettings.EstateID == 0) // No record at all
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Output("Your region is not part of an estate.");
|
MainConsole.Instance.Output("Your region is not part of an estate.");
|
||||||
|
|
||||||
|
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() { "yes", "no" });
|
if (estates.Count == 0)
|
||||||
if (response == "no")
|
{
|
||||||
{
|
MainConsole.Instance.Output(
|
||||||
// Create a new estate
|
"There aren't any existing estates. You will need to create a new one for this region.");
|
||||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
|
|
||||||
|
|
||||||
regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
|
||||||
|
|
||||||
// FIXME: Later on, the scene constructor will reload the estate settings no matter what.
|
CreateEstate(regInfo);
|
||||||
// Therefore, we need to do an initial save here otherwise the new estate name will be reset
|
|
||||||
// back to the default. The reloading of estate settings by scene could be eliminated if it
|
|
||||||
// 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.
|
|
||||||
regInfo.EstateSettings.Save();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
|
string response
|
||||||
|
|
||||||
List<string> estateNames = new List<string>();
|
|
||||||
foreach (EstateSettings estate in estates)
|
|
||||||
estateNames.Add(estate.EstateName);
|
|
||||||
|
|
||||||
response
|
|
||||||
= MainConsole.Instance.CmdPrompt(
|
= MainConsole.Instance.CmdPrompt(
|
||||||
string.Format(
|
"Do you wish to join an existing estate (yes/no)?", "no", new List<string>() { "yes", "no" });
|
||||||
"Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
|
|
||||||
"None");
|
|
||||||
|
|
||||||
if (response == "None")
|
if (response == "no")
|
||||||
continue;
|
|
||||||
|
|
||||||
List<int> estateIDs = EstateDataService.GetEstates(response);
|
|
||||||
if (estateIDs.Count < 1)
|
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
|
CreateEstate(regInfo);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int estateID = estateIDs[0];
|
|
||||||
|
|
||||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
|
|
||||||
|
|
||||||
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
else
|
||||||
|
{
|
||||||
|
List<string> estateNames = new List<string>();
|
||||||
|
foreach (EstateSettings estate in estates)
|
||||||
|
estateNames.Add(estate.EstateName);
|
||||||
|
|
||||||
|
response
|
||||||
|
= MainConsole.Instance.CmdPrompt(
|
||||||
|
string.Format(
|
||||||
|
"Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
|
||||||
|
"None");
|
||||||
|
|
||||||
|
if (response == "None")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
List<int> estateIDs = EstateDataService.GetEstates(response);
|
||||||
|
if (estateIDs.Count < 1)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int estateID = estateIDs[0];
|
||||||
|
|
||||||
|
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
|
||||||
|
|
||||||
|
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
|
||||||
|
break;
|
||||||
|
|
||||||
|
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue