diff options
author | Justin Clarke Casey | 2008-07-03 23:04:12 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-03 23:04:12 +0000 |
commit | 8251508412940b3f584f051a860a1bb4ddbfb62e (patch) | |
tree | 8a5e460836a8fe6c945e5a3ac4e54445a6d9cfe4 /OpenSim/Region/Environment | |
parent | Mantis#1661. Thank you kindly, CMickeyb for a patch that: (diff) | |
download | opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.zip opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.tar.gz opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.tar.bz2 opensim-SC_OLD-8251508412940b3f584f051a860a1bb4ddbfb62e.tar.xz |
* On client login, send only one terrain patch at a time (with pauses) instead of 4 at a time
* Certain terrains which are fine went patches are sent singly cause a libsecondlife failure when patches are sent in batches
* See http://opensimulator.org/mantis/view.php?id=1662 for more details
Diffstat (limited to 'OpenSim/Region/Environment')
3 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs index 952ca0a..aa34c45 100644 --- a/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs +++ b/OpenSim/Region/Environment/Interfaces/ITerrainChannel.cs | |||
@@ -32,7 +32,13 @@ namespace OpenSim.Region.Environment.Interfaces | |||
32 | int Height { get; } | 32 | int Height { get; } |
33 | double this[int x, int y] { get; set; } | 33 | double this[int x, int y] { get; set; } |
34 | int Width { get; } | 34 | int Width { get; } |
35 | |||
36 | /// <summary> | ||
37 | /// Squash the entire heightmap into a single dimensioned array | ||
38 | /// </summary> | ||
39 | /// <returns></returns> | ||
35 | float[] GetFloatsSerialised(); | 40 | float[] GetFloatsSerialised(); |
41 | |||
36 | double[,] GetDoubles(); | 42 | double[,] GetDoubles(); |
37 | bool Tainted(int x, int y); | 43 | bool Tainted(int x, int y); |
38 | ITerrainChannel MakeCopy(); | 44 | ITerrainChannel MakeCopy(); |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs index 53d03fc..24a76f7 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainChannel.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
45 | 45 | ||
46 | public TerrainChannel() | 46 | public TerrainChannel() |
47 | { | 47 | { |
48 | map = new double[Constants.RegionSize,Constants.RegionSize]; | 48 | map = new double[Constants.RegionSize, Constants.RegionSize]; |
49 | taint = new bool[Constants.RegionSize / 16,Constants.RegionSize / 16]; | 49 | taint = new bool[Constants.RegionSize / 16,Constants.RegionSize / 16]; |
50 | 50 | ||
51 | int x; | 51 | int x; |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index fb81abc..f47e6c0 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -494,8 +494,9 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
494 | } | 494 | } |
495 | 495 | ||
496 | /// <summary> | 496 | /// <summary> |
497 | /// Checks to see if the terrain has been modified since last check | 497 | /// Checks to see if the terrain has been modified since last check. |
498 | /// if the call is asked to respect the estate settings for terrain_raise_limit and | 498 | /// If it has been modified, every all the terrain patches are sent to the client. |
499 | /// If the call is asked to respect the estate settings for terrain_raise_limit and | ||
499 | /// terrain_lower_limit, it will clamp terrain updates between these values | 500 | /// terrain_lower_limit, it will clamp terrain updates between these values |
500 | /// currently invoked by client_OnModifyTerrain only and not the Commander interfaces | 501 | /// currently invoked by client_OnModifyTerrain only and not the Commander interfaces |
501 | /// <param name="respectEstateSettings">should height map deltas be limited to the estate settings limits</param> | 502 | /// <param name="respectEstateSettings">should height map deltas be limited to the estate settings limits</param> |
@@ -520,6 +521,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
520 | // what we are going to send to the client | 521 | // what we are going to send to the client |
521 | serialised = m_channel.GetFloatsSerialised(); | 522 | serialised = m_channel.GetFloatsSerialised(); |
522 | } | 523 | } |
524 | |||
523 | SendToClients(serialised, x, y); | 525 | SendToClients(serialised, x, y); |
524 | shouldTaint = true; | 526 | shouldTaint = true; |
525 | } | 527 | } |
@@ -578,7 +580,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
578 | private void SendToClients(float[] serialised, int x, int y) | 580 | private void SendToClients(float[] serialised, int x, int y) |
579 | { | 581 | { |
580 | m_scene.ForEachClient( | 582 | m_scene.ForEachClient( |
581 | delegate(IClientAPI controller) { controller.SendLayerData(x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); }); | 583 | delegate(IClientAPI controller) |
584 | { controller.SendLayerData( | ||
585 | x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, serialised); | ||
586 | } | ||
587 | ); | ||
582 | } | 588 | } |
583 | 589 | ||
584 | private void client_OnModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, | 590 | private void client_OnModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, |