Allow gods to terraform without limits. Respect the Allow Others To
Terraform flag in land.0.6.1-post-fixes
parent
7eda940e7f
commit
302d65569f
|
@ -65,7 +65,7 @@ namespace OpenSim.Framework
|
||||||
public delegate void ObjectAttach(
|
public delegate void ObjectAttach(
|
||||||
IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent);
|
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,
|
float height, float seconds, byte size, byte action, float north, float west, float south, float east,
|
||||||
UUID agentId);
|
UUID agentId);
|
||||||
|
|
||||||
|
|
|
@ -4156,7 +4156,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (handlerModifyTerrain != null)
|
if (handlerModifyTerrain != null)
|
||||||
{
|
{
|
||||||
modify.ModifyBlock.Height = -1; // Hack, i don't know why the value is wrong
|
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.BrushSize,
|
||||||
modify.ModifyBlock.Action, modify.ParcelData[i].North,
|
modify.ModifyBlock.Action, modify.ParcelData[i].North,
|
||||||
modify.ParcelData[i].West, modify.ParcelData[i].South,
|
modify.ParcelData[i].West, modify.ParcelData[i].South,
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules.World.Terrain
|
namespace OpenSim.Region.Environment.Modules.World.Terrain
|
||||||
{
|
{
|
||||||
|
@ -35,7 +36,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
||||||
{
|
{
|
||||||
void LoadFromFile(string filename);
|
void LoadFromFile(string filename);
|
||||||
void SaveToFile(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>
|
/// <summary>
|
||||||
/// Load a terrain from a stream.
|
/// Load a terrain from a stream.
|
||||||
|
|
|
@ -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="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="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>
|
/// <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>
|
/// <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)
|
float north, float west, float south, float east, UUID agentId)
|
||||||
{
|
{
|
||||||
|
bool god = m_scene.ExternalChecks.ExternalChecksCanBeGodLike(user);
|
||||||
bool allowed = false;
|
bool allowed = false;
|
||||||
if (north == south && east == west)
|
if (north == south && east == west)
|
||||||
{
|
{
|
||||||
|
@ -653,7 +654,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
||||||
m_painteffects[(StandardTerrainEffects) action].PaintEffect(
|
m_painteffects[(StandardTerrainEffects) action].PaintEffect(
|
||||||
m_channel, allowMask, west, south, height, size, seconds);
|
m_channel, allowMask, west, south, height, size, seconds);
|
||||||
|
|
||||||
CheckForTerrainUpdates(true); //revert changes outside estate limits
|
CheckForTerrainUpdates(!god); //revert changes outside estate limits
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -693,7 +694,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
||||||
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
|
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
|
||||||
m_channel, fillArea, size);
|
m_channel, fillArea, size);
|
||||||
|
|
||||||
CheckForTerrainUpdates(true); //revert changes outside estate limits
|
CheckForTerrainUpdates(!god); //revert changes outside estate limits
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
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.
|
// 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
|
// 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
|
InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter
|
||||||
}
|
}
|
||||||
|
|
|
@ -3470,7 +3470,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<ITerrainModule>();
|
ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<ITerrainModule>();
|
||||||
if (tm != null)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue