mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/RegionSettings.cs OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs OpenSim/Region/Framework/Interfaces/IInterregionComms.cs OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
This commit is contained in:
@@ -434,6 +434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
return wl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the current Windlight scene
|
||||
/// </summary>
|
||||
@@ -446,13 +447,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSShoutError("LightShare functions are not enabled.");
|
||||
return 0;
|
||||
}
|
||||
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
||||
|
||||
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
|
||||
{
|
||||
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
|
||||
return 0;
|
||||
ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
|
||||
|
||||
if (sp == null || sp.GodLevel < 200)
|
||||
{
|
||||
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int success = 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (LightShareModule.EnableWindlight)
|
||||
{
|
||||
RegionLightShareData wl = getWindlightProfileFromRules(rules);
|
||||
@@ -465,8 +474,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSShoutError("Windlight module is disabled");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
public void lsClearWindlightScene()
|
||||
{
|
||||
if (!m_LSFunctionsEnabled)
|
||||
@@ -474,17 +485,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSShoutError("LightShare functions are not enabled.");
|
||||
return;
|
||||
}
|
||||
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
||||
|
||||
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
|
||||
{
|
||||
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
|
||||
return;
|
||||
ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
|
||||
|
||||
if (sp == null || sp.GodLevel < 200)
|
||||
{
|
||||
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
|
||||
if (m_host.ParentGroup.Scene.SimulationDataService != null)
|
||||
m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
|
||||
|
||||
m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the current Windlight scene to a target avatar
|
||||
/// </summary>
|
||||
@@ -497,13 +516,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSShoutError("LightShare functions are not enabled.");
|
||||
return 0;
|
||||
}
|
||||
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
||||
|
||||
if (!World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_host.OwnerID))
|
||||
{
|
||||
LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
|
||||
return 0;
|
||||
ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
|
||||
|
||||
if (sp == null || sp.GodLevel < 200)
|
||||
{
|
||||
LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int success = 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (LightShareModule.EnableWindlight)
|
||||
{
|
||||
RegionLightShareData wl = getWindlightProfileFromRules(rules);
|
||||
@@ -515,8 +542,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
LSShoutError("Windlight module is disabled");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3005,6 +3005,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");
|
||||
|
||||
@@ -336,6 +336,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);
|
||||
|
||||
@@ -858,6 +858,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)
|
||||
|
||||
Reference in New Issue
Block a user