aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Framework/IClientAPI.cs2
-rwxr-xr-xOpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs28
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/SmoothArea.cs8
-rwxr-xr-xOpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs51
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs2
6 files changed, 68 insertions, 26 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 2929207..662e470 100755
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Framework
61 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); 61 IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent);
62 62
63 public delegate void ModifyTerrain(UUID user, float height, float seconds, float brushSize, 63 public delegate void ModifyTerrain(UUID user, float height, float seconds, float brushSize,
64 byte action, float north, float west, float south, float east); 64 byte action, float north, float west, float south, float east, int parcelLocalID);
65 65
66 public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes); 66 public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes);
67 67
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index c8af1d1..c395890 100755
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -8990,7 +8990,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8990 OnModifyTerrain?.Invoke(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, 8990 OnModifyTerrain?.Invoke(AgentId, modify.ModifyBlock.Height, modify.ModifyBlock.Seconds,
8991 modify.ModifyBlockExtended[i].BrushSize, modify.ModifyBlock.Action, 8991 modify.ModifyBlockExtended[i].BrushSize, modify.ModifyBlock.Action,
8992 modify.ParcelData[i].North, modify.ParcelData[i].West, 8992 modify.ParcelData[i].North, modify.ParcelData[i].West,
8993 modify.ParcelData[i].South, modify.ParcelData[i].East); 8993 modify.ParcelData[i].South, modify.ParcelData[i].East,
8994 modify.ParcelData[i].LocalID);
8994 } 8995 }
8995 8996
8996 return true; 8997 return true;
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 8069ce2..51bc63d 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -2073,20 +2073,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions
2073 2073
2074 float X = position.X; 2074 float X = position.X;
2075 float Y = position.Y; 2075 float Y = position.Y;
2076 int id = (int)position.Z;
2077 ILandObject parcel;
2076 2078
2077 if (X > ((int)m_scene.RegionInfo.RegionSizeX - 1)) 2079 if(id >= 0 && X < 0 && Y < 0)
2078 X = ((int)m_scene.RegionInfo.RegionSizeX - 1); 2080 parcel = m_scene.LandChannel.GetLandObject(id);
2079 if (Y > ((int)m_scene.RegionInfo.RegionSizeY - 1)) 2081 else
2080 Y = ((int)m_scene.RegionInfo.RegionSizeY - 1); 2082 {
2081 if (X < 0) 2083 if (X < 0)
2082 X = 0; 2084 X = 0;
2083 if (Y < 0) 2085 else if (X > ((int)m_scene.RegionInfo.RegionSizeX - 1))
2084 Y = 0; 2086 X = ((int)m_scene.RegionInfo.RegionSizeX - 1);
2087 if (Y < 0)
2088 Y = 0;
2089 else if (Y > ((int)m_scene.RegionInfo.RegionSizeY - 1))
2090 Y = ((int)m_scene.RegionInfo.RegionSizeY - 1);
2091
2092 parcel = m_scene.LandChannel.GetLandObject(X, Y);
2093 }
2085 2094
2086 ILandObject parcel = m_scene.LandChannel.GetLandObject(X, Y);
2087 if (parcel == null) 2095 if (parcel == null)
2088 return false; 2096 return false;
2089 2097
2090 LandData landdata = parcel.LandData; 2098 LandData landdata = parcel.LandData;
2091 if (landdata == null) 2099 if (landdata == null)
2092 return false; 2100 return false;
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/SmoothArea.cs b/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/SmoothArea.cs
index 64ffd4d..e5e6f4d 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/SmoothArea.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/SmoothArea.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FloodBrushes
40 double step = 1; 40 double step = 1;
41 41
42 strength *= 0.002f; 42 strength *= 0.002f;
43 if(strength > 1.0f)
44 strength = 1.0f;
43 45
44 double[,] manipulate = new double[map.Width,map.Height]; 46 double[,] manipulate = new double[map.Width,map.Height];
45 int x, y; 47 int x, y;
@@ -54,10 +56,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FloodBrushes
54 int avgsteps = 0; 56 int avgsteps = 0;
55 57
56 double n; 58 double n;
57 for (n = 0.0 - area; n < area; n += step) 59 for (n = -area; n < area; n += step)
58 { 60 {
59 double l; 61 double l;
60 for (l = 0.0 - area; l < area; l += step) 62 for (l = -area; l < area; l += step)
61 { 63 {
62 avgsteps++; 64 avgsteps++;
63 average += GetBilinearInterpolate(x + n, y + l, map); 65 average += GetBilinearInterpolate(x + n, y + l, map);
@@ -74,7 +76,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FloodBrushes
74 if (!fillArea[x, y]) 76 if (!fillArea[x, y])
75 continue; 77 continue;
76 78
77 map[x, y] = strength * manipulate[x, y]; 79 map[x, y] = (1.0 - strength) * map[x, y] + strength * manipulate[x, y];
78 } 80 }
79 } 81 }
80 } 82 }
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index a73de46..52386d3 100755
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
521 if (brushSize > 2) 521 if (brushSize > 2)
522 brushSize = 4; 522 brushSize = 4;
523 523
524 client_OnModifyTerrain(user, pos.Z, duration, brushSize, action, pos.Y, pos.X, pos.Y, pos.X); 524 client_OnModifyTerrain(user, pos.Z, duration, brushSize, action, pos.Y, pos.X, pos.Y, pos.X, -1);
525 } 525 }
526 526
527 /// <summary> 527 /// <summary>
@@ -1303,9 +1303,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1303 } 1303 }
1304 1304
1305 private void client_OnModifyTerrain(UUID user, float height, float seconds, float brushSize, byte action, 1305 private void client_OnModifyTerrain(UUID user, float height, float seconds, float brushSize, byte action,
1306 float north, float west, float south, float east) 1306 float north, float west, float south, float east, int parcelLocalID)
1307 { 1307 {
1308 m_log.DebugFormat("brushs {0} seconds {1} height {2}", brushSize, seconds, height); 1308 m_log.DebugFormat("brushs {0} seconds {1} height {2}, parcel {3}", brushSize, seconds, height, parcelLocalID);
1309 bool god = m_scene.Permissions.IsGod(user); 1309 bool god = m_scene.Permissions.IsGod(user);
1310 bool allowed = false; 1310 bool allowed = false;
1311 if (north == south && east == west) 1311 if (north == south && east == west)
@@ -1313,6 +1313,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1313 if (m_painteffects.ContainsKey((StandardTerrainEffects)action)) 1313 if (m_painteffects.ContainsKey((StandardTerrainEffects)action))
1314 { 1314 {
1315 bool[,] allowMask = new bool[m_channel.Width, m_channel.Height]; 1315 bool[,] allowMask = new bool[m_channel.Width, m_channel.Height];
1316
1316 allowMask.Initialize(); 1317 allowMask.Initialize();
1317 1318
1318 int startX = (int)(west - brushSize + 0.5); 1319 int startX = (int)(west - brushSize + 0.5);
@@ -1336,7 +1337,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1336 { 1337 {
1337 for (y = startY; y <= endY; y++) 1338 for (y = startY; y <= endY; y++)
1338 { 1339 {
1339 if (m_scene.Permissions.CanTerraformLand(user, new Vector3(x, y, 0))) 1340 if (m_scene.Permissions.CanTerraformLand(user, new Vector3(x, y, -1)))
1340 { 1341 {
1341 allowMask[x, y] = true; 1342 allowMask[x, y] = true;
1342 allowed = true; 1343 allowed = true;
@@ -1392,20 +1393,48 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1392 else if (endY >= m_channel.Height) 1393 else if (endY >= m_channel.Height)
1393 endY = m_channel.Height - 1; 1394 endY = m_channel.Height - 1;
1394 1395
1395
1396 int x, y; 1396 int x, y;
1397 1397 if (parcelLocalID == -1)
1398 for (x = startX; x <= endX; x++)
1399 { 1398 {
1400 for (y = startY; y <= endY; y++) 1399 for (x = startX; x <= endX; x++)
1401 { 1400 {
1402 if (m_scene.Permissions.CanTerraformLand(user, new Vector3(x, y, 0))) 1401 for (y = startY; y <= endY; y++)
1403 { 1402 {
1404 fillArea[x, y] = true; 1403 if (m_scene.Permissions.CanTerraformLand(user, new Vector3(x, y, -1)))
1405 allowed = true; 1404 {
1405 fillArea[x, y] = true;
1406 allowed = true;
1407 }
1406 } 1408 }
1407 } 1409 }
1408 } 1410 }
1411 else
1412 {
1413 if (!m_scene.Permissions.CanTerraformLand(user, new Vector3(-1, -1, parcelLocalID)))
1414 return;
1415
1416 ILandObject parcel = m_scene.LandChannel.GetLandObject(parcelLocalID);
1417 if(parcel == null)
1418 return;
1419 bool [,] parcelmap = parcel.GetLandBitmap();
1420//ugly
1421 for (x = startX; x <= endX; x++)
1422 {
1423 int px = x >> 2;
1424 y = startY;
1425 while( y <= endY)
1426 {
1427 int py = y >> 2;
1428 bool inp = parcelmap[px, py];
1429 fillArea[x, y++] = inp;
1430 fillArea[x, y++] = inp;
1431 fillArea[x, y++] = inp;
1432 fillArea[x, y++] = inp;
1433 }
1434 }
1435
1436 allowed = true;
1437 }
1409 1438
1410 if (allowed) 1439 if (allowed)
1411 { 1440 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index a75671e..60fb095 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -844,6 +844,8 @@ namespace OpenSim.Region.Framework.Scenes
844 #endregion 844 #endregion
845 845
846 #region TERRAFORM LAND 846 #region TERRAFORM LAND
847 // if pos.x < 0, pos.y <0 and pos.z >=0 pos.z is parcel localID
848 // id pos.z < 0 x a and y identify the parcel
847 public bool CanTerraformLand(UUID user, Vector3 pos) 849 public bool CanTerraformLand(UUID user, Vector3 pos)
848 { 850 {
849 TerraformLandHandler handler = OnTerraformLand; 851 TerraformLandHandler handler = OnTerraformLand;