Merge branch 'master' into varregion

This commit is contained in:
Robert Adams
2014-01-28 08:50:28 -08:00
6 changed files with 109 additions and 45 deletions

View File

@@ -2927,6 +2927,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
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()
{
CheckThreatLevel(ThreatLevel.Moderate, "osGetSimulatorMemory");

View File

@@ -337,6 +337,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
key osGetMapTexture();
key osGetRegionMapTexture(string regionName);
LSL_List osGetRegionStats();
vector osGetRegionSize();
int osGetSimulatorMemory();
void osKickAvatar(string FirstName,string SurName,string alert);

View File

@@ -865,6 +865,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetRegionStats();
}
public vector osGetRegionSize()
{
return m_OSSL_Functions.osGetRegionSize();
}
/// <summary>
/// Returns the amount of memory in use by the Simulator Daemon.
/// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)