mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Updated the create_region command in the RemoteAdmin plugin to properly support estates without seeking further input on the console.
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
8acb401a14
commit
8eeb3f2fd2
@@ -530,7 +530,10 @@ namespace OpenSim
|
||||
regionFile = cmd[3];
|
||||
|
||||
IScene scene;
|
||||
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene);
|
||||
RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source);
|
||||
PopulateRegionEstateInfo(regInfo);
|
||||
CreateRegion(regInfo, true, out scene);
|
||||
regInfo.EstateSettings.Save();
|
||||
}
|
||||
else if (cmd[3].EndsWith(".ini"))
|
||||
{
|
||||
@@ -541,7 +544,10 @@ namespace OpenSim
|
||||
regionFile = cmd[3];
|
||||
|
||||
IScene scene;
|
||||
CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene);
|
||||
RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]);
|
||||
PopulateRegionEstateInfo(regInfo);
|
||||
CreateRegion(regInfo, true, out scene);
|
||||
regInfo.EstateSettings.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -790,6 +790,60 @@ namespace OpenSim
|
||||
{
|
||||
regionnum = m_sceneManager.Scenes.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the estate information for the provided RegionInfo object.
|
||||
/// </summary>
|
||||
/// <param name="regInfo">
|
||||
/// A <see cref="RegionInfo"/>
|
||||
/// </param>
|
||||
public void PopulateRegionEstateInfo(RegionInfo regInfo)
|
||||
{
|
||||
if (m_storageManager.EstateDataStore != null)
|
||||
{
|
||||
regInfo.EstateSettings = m_storageManager.EstateDataStore.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
|
||||
regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true);
|
||||
|
||||
regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||
//regInfo.EstateSettings.Save();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
|
||||
if (response == "None")
|
||||
continue;
|
||||
|
||||
List<int> estateIDs = m_storageManager.EstateDataStore.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 = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
|
||||
|
||||
if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user