Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
Melanie
2010-08-18 00:59:20 +01:00
66 changed files with 1121 additions and 595 deletions

View File

@@ -211,7 +211,17 @@ namespace OpenSim
else
{
string basepath = Path.GetFullPath(Util.configDir());
string path = Path.Combine(basepath, file);
// Resolve relative paths with wildcards
string chunkWithoutWildcards = file;
string chunkWithWildcards = string.Empty;
int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
if (wildcardIndex != -1)
{
chunkWithoutWildcards = file.Substring(0, wildcardIndex);
chunkWithWildcards = file.Substring(wildcardIndex);
}
string path = Path.Combine(basepath, chunkWithoutWildcards);
path = Path.GetFullPath(path) + chunkWithWildcards;
string[] paths = Util.Glob(path);
foreach (string p in paths)
{

View File

@@ -418,7 +418,7 @@ namespace OpenSim
{
MainConsole.Instance.Output(
String.Format(
"Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}",
"Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}",
presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName));
// kick client...
@@ -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
{
@@ -861,7 +867,7 @@ namespace OpenSim
MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count));
MainConsole.Instance.Output(
String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", "Firstname", "Lastname",
String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname",
"Agent ID", "Root/Child", "Region", "Position"));
foreach (ScenePresence presence in agents)
@@ -880,7 +886,7 @@ namespace OpenSim
MainConsole.Instance.Output(
String.Format(
"{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}",
"{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}",
presence.Firstname,
presence.Lastname,
presence.UUID,

View File

@@ -395,9 +395,13 @@ namespace OpenSim
scene.SnmpService.BootInfo("Creating region texture", scene);
}
// moved these here as the terrain texture has to be created after the modules are initialized
// moved these here as the map texture has to be created after the modules are initialized
// and has to happen before the region is registered with the grid.
scene.CreateTerrainTexture();
IWorldMapModule mapModule = scene.RequestModuleInterface<IWorldMapModule>();
if (mapModule != null)
mapModule.GenerateMaptile();
else
m_log.WarnFormat("[STARTUP]: No map module available to generate map tile");
// TODO : Try setting resource for region xstats here on scene
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
@@ -867,6 +871,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.");
}
}
}
}
}