Merge branch 'master' into varregion
commit
8eec717f5f
|
@ -124,7 +124,7 @@ namespace OpenSim
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Application.iniFilePath = Path.GetFullPath(
|
Application.iniFilePath = Path.GetFullPath(
|
||||||
Path.Combine(Util.configDir(), iniFileName));
|
Path.Combine(Util.configDir(), iniFileName));
|
||||||
|
|
||||||
if (!File.Exists(Application.iniFilePath))
|
if (!File.Exists(Application.iniFilePath))
|
||||||
{
|
{
|
||||||
|
@ -139,12 +139,29 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_config = new OpenSimConfigSource();
|
||||||
|
m_config.Source = new IniConfigSource();
|
||||||
|
m_config.Source.Merge(DefaultConfig());
|
||||||
|
|
||||||
|
m_log.Info("[CONFIG]: Reading configuration settings");
|
||||||
|
|
||||||
|
for (int i = 0 ; i < sources.Count ; i++)
|
||||||
|
{
|
||||||
|
if (ReadConfig(m_config, sources[i]))
|
||||||
|
{
|
||||||
|
iniFileExists = true;
|
||||||
|
AddIncludes(m_config, sources);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override distro settings with contents of inidirectory
|
||||||
string iniDirName = startupConfig.GetString("inidirectory", "config");
|
string iniDirName = startupConfig.GetString("inidirectory", "config");
|
||||||
string iniDirPath = Path.Combine(Util.configDir(), iniDirName);
|
string iniDirPath = Path.Combine(Util.configDir(), iniDirName);
|
||||||
|
|
||||||
if (Directory.Exists(iniDirPath))
|
if (Directory.Exists(iniDirPath))
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("Searching folder {0} for config ini files", iniDirPath);
|
m_log.InfoFormat("[CONFIG]: Searching folder {0} for config ini files", iniDirPath);
|
||||||
|
List<string> overrideSources = new List<string>();
|
||||||
|
|
||||||
string[] fileEntries = Directory.GetFiles(iniDirName);
|
string[] fileEntries = Directory.GetFiles(iniDirName);
|
||||||
foreach (string filePath in fileEntries)
|
foreach (string filePath in fileEntries)
|
||||||
|
@ -152,33 +169,38 @@ namespace OpenSim
|
||||||
if (Path.GetExtension(filePath).ToLower() == ".ini")
|
if (Path.GetExtension(filePath).ToLower() == ".ini")
|
||||||
{
|
{
|
||||||
if (!sources.Contains(Path.GetFullPath(filePath)))
|
if (!sources.Contains(Path.GetFullPath(filePath)))
|
||||||
|
{
|
||||||
|
overrideSources.Add(Path.GetFullPath(filePath));
|
||||||
|
// put it in sources too, to avoid circularity
|
||||||
sources.Add(Path.GetFullPath(filePath));
|
sources.Add(Path.GetFullPath(filePath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (overrideSources.Count > 0)
|
||||||
|
{
|
||||||
|
OpenSimConfigSource overrideConfig = new OpenSimConfigSource();
|
||||||
|
overrideConfig.Source = new IniConfigSource();
|
||||||
|
|
||||||
|
for (int i = 0 ; i < overrideSources.Count ; i++)
|
||||||
|
{
|
||||||
|
if (ReadConfig(overrideConfig, overrideSources[i]))
|
||||||
|
{
|
||||||
|
iniFileExists = true;
|
||||||
|
AddIncludes(overrideConfig, overrideSources);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_config.Source.Merge(overrideConfig.Source);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_config = new OpenSimConfigSource();
|
|
||||||
m_config.Source = new IniConfigSource();
|
|
||||||
m_config.Source.Merge(DefaultConfig());
|
|
||||||
|
|
||||||
m_log.Info("[CONFIG]: Reading configuration settings");
|
|
||||||
|
|
||||||
if (sources.Count == 0)
|
if (sources.Count == 0)
|
||||||
{
|
{
|
||||||
m_log.FatalFormat("[CONFIG]: Could not load any configuration");
|
m_log.FatalFormat("[CONFIG]: Could not load any configuration");
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
|
else if (!iniFileExists)
|
||||||
for (int i = 0 ; i < sources.Count ; i++)
|
|
||||||
{
|
|
||||||
if (ReadConfig(sources[i]))
|
|
||||||
{
|
|
||||||
iniFileExists = true;
|
|
||||||
AddIncludes(sources);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!iniFileExists)
|
|
||||||
{
|
{
|
||||||
m_log.FatalFormat("[CONFIG]: Could not load any configuration");
|
m_log.FatalFormat("[CONFIG]: Could not load any configuration");
|
||||||
m_log.FatalFormat("[CONFIG]: Configuration exists, but there was an error loading it!");
|
m_log.FatalFormat("[CONFIG]: Configuration exists, but there was an error loading it!");
|
||||||
|
@ -214,10 +236,10 @@ namespace OpenSim
|
||||||
/// Adds the included files as ini configuration files
|
/// Adds the included files as ini configuration files
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sources">List of URL strings or filename strings</param>
|
/// <param name="sources">List of URL strings or filename strings</param>
|
||||||
private void AddIncludes(List<string> sources)
|
private void AddIncludes(OpenSimConfigSource configSource, List<string> sources)
|
||||||
{
|
{
|
||||||
//loop over config sources
|
//loop over config sources
|
||||||
foreach (IConfig config in m_config.Source.Configs)
|
foreach (IConfig config in configSource.Source.Configs)
|
||||||
{
|
{
|
||||||
// Look for Include-* in the key name
|
// Look for Include-* in the key name
|
||||||
string[] keys = config.GetKeys();
|
string[] keys = config.GetKeys();
|
||||||
|
@ -284,7 +306,7 @@ namespace OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="iniPath">Full path to the ini</param>
|
/// <param name="iniPath">Full path to the ini</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool ReadConfig(string iniPath)
|
private bool ReadConfig(OpenSimConfigSource configSource, string iniPath)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
|
@ -292,7 +314,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[CONFIG]: Reading configuration file {0}", Path.GetFullPath(iniPath));
|
m_log.InfoFormat("[CONFIG]: Reading configuration file {0}", Path.GetFullPath(iniPath));
|
||||||
|
|
||||||
m_config.Source.Merge(new IniConfigSource(iniPath));
|
configSource.Source.Merge(new IniConfigSource(iniPath));
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -305,7 +327,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
XmlReader r = XmlReader.Create(iniPath);
|
XmlReader r = XmlReader.Create(iniPath);
|
||||||
XmlConfigSource cs = new XmlConfigSource(r);
|
XmlConfigSource cs = new XmlConfigSource(r);
|
||||||
m_config.Source.Merge(cs);
|
configSource.Source.Merge(cs);
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1193,22 +1193,36 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
|
// and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
|
||||||
// be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
|
// be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
|
||||||
// not transporting the required data.
|
// not transporting the required data.
|
||||||
lock (m_attachments)
|
//
|
||||||
{
|
// We need to restart scripts here so that they receive the correct changed events (CHANGED_TELEPORT
|
||||||
if (HasAttachments())
|
// and CHANGED_REGION) when the attachments have been rezzed in the new region. This cannot currently
|
||||||
{
|
// be done in AttachmentsModule.CopyAttachments(AgentData ad, IScenePresence sp) itself since we are
|
||||||
m_log.DebugFormat(
|
// not transporting the required data.
|
||||||
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
//
|
||||||
|
// We must take a copy of the attachments list here (rather than locking) to avoid a deadlock where a script in one of
|
||||||
|
// the attachments may start processing an event (which locks ScriptInstance.m_Script) that then calls a method here
|
||||||
|
// which needs to lock m_attachments. ResumeScripts() needs to take a ScriptInstance.m_Script lock to try to unset the Suspend status.
|
||||||
|
//
|
||||||
|
// FIXME: In theory, this deadlock should not arise since scripts should not be processing events until ResumeScripts().
|
||||||
|
// But XEngine starts all scripts unsuspended. Starting them suspended will not currently work because script rezzing
|
||||||
|
// is placed in an asynchronous queue in XEngine and so the ResumeScripts() call will almost certainly execute before the
|
||||||
|
// script is rezzed. This means the ResumeScripts() does absolutely nothing when using XEngine.
|
||||||
|
//
|
||||||
|
// One cannot simply iterate over attachments in a fire and forget thread because this would no longer
|
||||||
|
// be locked, allowing race conditions if other code changes the attachments list.
|
||||||
|
List<SceneObjectGroup> attachments = GetAttachments();
|
||||||
|
|
||||||
// Resume scripts
|
if (attachments.Count > 0)
|
||||||
Util.FireAndForget(delegate(object x) {
|
{
|
||||||
foreach (SceneObjectGroup sog in m_attachments)
|
m_log.DebugFormat(
|
||||||
{
|
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
|
||||||
sog.ScheduleGroupForFullUpdate();
|
|
||||||
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
// Resume scripts
|
||||||
sog.ResumeScripts();
|
foreach (SceneObjectGroup sog in attachments)
|
||||||
}
|
{
|
||||||
});
|
sog.ScheduleGroupForFullUpdate();
|
||||||
|
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
|
||||||
|
sog.ResumeScripts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2912,7 +2926,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Rotation = newRot;
|
Rotation = newRot;
|
||||||
|
|
||||||
// ParentPosition = part.AbsolutePosition;
|
// ParentPosition = part.AbsolutePosition;
|
||||||
part.ParentGroup.AddAvatar(UUID);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2921,13 +2934,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_pos -= part.GroupPosition;
|
m_pos -= part.GroupPosition;
|
||||||
|
|
||||||
// ParentPosition = part.AbsolutePosition;
|
// ParentPosition = part.AbsolutePosition;
|
||||||
part.ParentGroup.AddAvatar(UUID);
|
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target",
|
// "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target",
|
||||||
// Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId);
|
// Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
part.ParentGroup.AddAvatar(UUID);
|
||||||
ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
|
ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
|
||||||
ParentID = m_requestedSitTargetID;
|
ParentID = m_requestedSitTargetID;
|
||||||
m_AngularVelocity = Vector3.Zero;
|
m_AngularVelocity = Vector3.Zero;
|
||||||
|
@ -3231,6 +3244,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// again here... this comes after the cached appearance check because the avatars
|
// again here... this comes after the cached appearance check because the avatars
|
||||||
// appearance goes into the avatar update packet
|
// appearance goes into the avatar update packet
|
||||||
SendAvatarDataToAllAgents();
|
SendAvatarDataToAllAgents();
|
||||||
|
|
||||||
|
// This invocation always shows up in the viewer logs as an error. Is it needed?
|
||||||
SendAppearanceToAgent(this);
|
SendAppearanceToAgent(this);
|
||||||
|
|
||||||
// If we are using the the cached appearance then send it out to everyone
|
// If we are using the the cached appearance then send it out to everyone
|
||||||
|
|
|
@ -110,8 +110,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
// ScenePresence.SendInitialData() to reset our entire appearance.
|
// ScenePresence.SendInitialData() to reset our entire appearance.
|
||||||
m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId));
|
m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId));
|
||||||
|
|
||||||
/*
|
m_afMod.SetAppearance(sp, originalTe, null, null);
|
||||||
m_afMod.SetAppearance(sp, originalTe, null);
|
|
||||||
|
|
||||||
UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance);
|
UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance);
|
||||||
|
|
||||||
|
@ -126,7 +125,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
|
|
||||||
// Have to account for both SP and NPC.
|
// Have to account for both SP and NPC.
|
||||||
Assert.That(m_scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(2));
|
Assert.That(m_scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(2));
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -2927,6 +2927,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Vector osGetRegionSize()
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.None, "osGetRegionSize");
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
bool isMegaregion;
|
||||||
|
IRegionCombinerModule rcMod = World.RequestModuleInterface<IRegionCombinerModule>();
|
||||||
|
if (rcMod != null)
|
||||||
|
isMegaregion = rcMod.IsRootForMegaregion(World.RegionInfo.RegionID);
|
||||||
|
else
|
||||||
|
isMegaregion = false;
|
||||||
|
|
||||||
|
if (isMegaregion)
|
||||||
|
{
|
||||||
|
Vector2 size = rcMod.GetSizeOfMegaregion(World.RegionInfo.RegionID);
|
||||||
|
return new LSL_Vector(size.X, size.Y, Constants.RegionHeight);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new LSL_Vector((float)Constants.RegionSize, (float)Constants.RegionSize, Constants.RegionHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int osGetSimulatorMemory()
|
public int osGetSimulatorMemory()
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");
|
CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");
|
||||||
|
|
|
@ -337,6 +337,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
key osGetMapTexture();
|
key osGetMapTexture();
|
||||||
key osGetRegionMapTexture(string regionName);
|
key osGetRegionMapTexture(string regionName);
|
||||||
LSL_List osGetRegionStats();
|
LSL_List osGetRegionStats();
|
||||||
|
vector osGetRegionSize();
|
||||||
|
|
||||||
int osGetSimulatorMemory();
|
int osGetSimulatorMemory();
|
||||||
void osKickAvatar(string FirstName,string SurName,string alert);
|
void osKickAvatar(string FirstName,string SurName,string alert);
|
||||||
|
|
|
@ -865,6 +865,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return m_OSSL_Functions.osGetRegionStats();
|
return m_OSSL_Functions.osGetRegionStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public vector osGetRegionSize()
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osGetRegionSize();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the amount of memory in use by the Simulator Daemon.
|
/// Returns the amount of memory in use by the Simulator Daemon.
|
||||||
/// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)
|
/// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)
|
||||||
|
|
Loading…
Reference in New Issue