Allow gods to terraform without limits. Respect the Allow Others To

Terraform flag in land.
0.6.1-post-fixes
Melanie Thielker 2008-11-11 01:47:40 +00:00
parent 7eda940e7f
commit 302d65569f
5 changed files with 12 additions and 10 deletions

View File

@ -65,7 +65,7 @@ namespace OpenSim.Framework
public delegate void ObjectAttach(
IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent);
public delegate void ModifyTerrain(
public delegate void ModifyTerrain(UUID user,
float height, float seconds, byte size, byte action, float north, float west, float south, float east,
UUID agentId);

View File

@ -4156,7 +4156,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerModifyTerrain != null)
{
modify.ModifyBlock.Height = -1; // Hack, i don't know why the value is wrong
handlerModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
handlerModifyTerrain(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
modify.ModifyBlock.BrushSize,
modify.ModifyBlock.Action, modify.ParcelData[i].North,
modify.ParcelData[i].West, modify.ParcelData[i].South,

View File

@ -28,6 +28,7 @@
using System.IO;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Region.Environment.Modules.World.Terrain
{
@ -35,7 +36,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
{
void LoadFromFile(string filename);
void SaveToFile(string filename);
void ModifyTerrain(Vector3 pos, byte size, byte action, UUID agentId);
void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId);
/// <summary>
/// Load a terrain from a stream.

View File

@ -279,9 +279,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
/// <param name="size">The size of the brush (0=small, 1=medium, 2=large)</param>
/// <param name="action">0=LAND_LEVEL, 1=LAND_RAISE, 2=LAND_LOWER, 3=LAND_SMOOTH, 4=LAND_NOISE, 5=LAND_REVERT</param>
/// <param name="agentId">UUID of script-owner</param>
public void ModifyTerrain(Vector3 pos, byte size, byte action, UUID agentId)
public void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId)
{
client_OnModifyTerrain((float)pos.Z, (float)0.25, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId);
client_OnModifyTerrain(user, (float)pos.Z, (float)0.25, size, action, pos.Y, pos.X, pos.Y, pos.X, agentId);
}
/// <summary>
@ -613,9 +613,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
);
}
private void client_OnModifyTerrain(float height, float seconds, byte size, byte action,
private void client_OnModifyTerrain(UUID user, float height, float seconds, byte size, byte action,
float north, float west, float south, float east, UUID agentId)
{
bool god = m_scene.ExternalChecks.ExternalChecksCanBeGodLike(user);
bool allowed = false;
if (north == south && east == west)
{
@ -653,7 +654,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
m_painteffects[(StandardTerrainEffects) action].PaintEffect(
m_channel, allowMask, west, south, height, size, seconds);
CheckForTerrainUpdates(true); //revert changes outside estate limits
CheckForTerrainUpdates(!god); //revert changes outside estate limits
}
}
else
@ -693,7 +694,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
m_channel, fillArea, size);
CheckForTerrainUpdates(true); //revert changes outside estate limits
CheckForTerrainUpdates(!god); //revert changes outside estate limits
}
}
else
@ -708,7 +709,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
// Not a good permissions check (see client_OnModifyTerrain above), need to check the entire area.
// for now check a point in the centre of the region
if (m_scene.ExternalChecks.ExternalChecksCanTerraformLand(remoteClient.AgentId, new Vector3(127, 127, 0)))
if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remoteClient.AgentId, true))
{
InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter
}

View File

@ -3470,7 +3470,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<ITerrainModule>();
if (tm != null)
{
tm.ModifyTerrain(m_host.AbsolutePosition, (byte) brush, (byte) action, m_host.OwnerID);
tm.ModifyTerrain(m_host.OwnerID, m_host.AbsolutePosition, (byte) brush, (byte) action, m_host.OwnerID);
}
}