making first run more resilient to bad input (loop until good input, rather than crash)
parent
b23ab3ea85
commit
adbdb220df
|
@ -480,9 +480,16 @@ namespace OpenSim.Framework
|
||||||
MainConsole.Instance.Output("=====================================\n");
|
MainConsole.Instance.Output("=====================================\n");
|
||||||
|
|
||||||
if (name == String.Empty)
|
if (name == String.Empty)
|
||||||
name = MainConsole.Instance.CmdPrompt("New region name", name);
|
{
|
||||||
if (name == String.Empty)
|
while (name.Trim() == string.Empty)
|
||||||
throw new Exception("Cannot interactively create region with no name");
|
{
|
||||||
|
name = MainConsole.Instance.CmdPrompt("New region name", name);
|
||||||
|
if (name.Trim() == string.Empty)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Cannot interactively create region with no name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
source.AddConfig(name);
|
source.AddConfig(name);
|
||||||
|
|
||||||
|
@ -513,15 +520,20 @@ namespace OpenSim.Framework
|
||||||
//
|
//
|
||||||
allKeys.Remove("RegionUUID");
|
allKeys.Remove("RegionUUID");
|
||||||
string regionUUID = config.GetString("RegionUUID", string.Empty);
|
string regionUUID = config.GetString("RegionUUID", string.Empty);
|
||||||
if (regionUUID == String.Empty)
|
if (!UUID.TryParse(regionUUID.Trim(), out RegionID))
|
||||||
{
|
{
|
||||||
UUID newID = UUID.Random();
|
UUID newID = UUID.Random();
|
||||||
|
while (RegionID == UUID.Zero)
|
||||||
regionUUID = MainConsole.Instance.CmdPrompt("RegionUUID", newID.ToString());
|
{
|
||||||
|
regionUUID = MainConsole.Instance.CmdPrompt("RegionUUID", newID.ToString());
|
||||||
|
if (!UUID.TryParse(regionUUID.Trim(), out RegionID))
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("RegionUUID must be a valid UUID");
|
||||||
|
}
|
||||||
|
}
|
||||||
config.Set("RegionUUID", regionUUID);
|
config.Set("RegionUUID", regionUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionID = new UUID(regionUUID);
|
|
||||||
originRegionID = RegionID; // What IS this?! (Needed for RegionCombinerModule?)
|
originRegionID = RegionID; // What IS this?! (Needed for RegionCombinerModule?)
|
||||||
|
|
||||||
// Location
|
// Location
|
||||||
|
|
Loading…
Reference in New Issue