From 2760378f7ae9fc9b804b9a4a2936ea7c38e75876 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 24 Jul 2007 05:54:44 +0000 Subject: * Users doing terraforming should see updates instantly now. * Other viewers in the sim will see updates no more than once every 5 seconds. --- OpenSim/Framework/General/Interfaces/IClientAPI.cs | 2 +- .../ClientStack/ClientView.ProcessPackets.cs | 2 +- .../Environment/Scenes/Scene.PacketHandlers.cs | 4 +-- OpenSim/Region/Environment/Scenes/Scene.cs | 30 +--------------------- 4 files changed, 5 insertions(+), 33 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index c2af2f4..e13016b 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -37,7 +37,7 @@ namespace OpenSim.Framework.Interfaces public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list public delegate void RezObject(AssetBase primAsset, LLVector3 pos); - public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west); + public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, IClientAPI remoteClient); public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); public delegate void StartAnim(LLUUID animID, int seq); public delegate void LinkObjects(uint parent, List children); diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 1613aa1..e5e872a 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -135,7 +135,7 @@ namespace OpenSim.Region.ClientStack if (OnModifyTerrain != null) { OnModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, modify.ModifyBlock.BrushSize, - modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West); + modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West, this); } } break; diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 571cead..b5faad5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.Environment.Scenes /// The action to be performed /// Distance from the north border where the cursor is located /// Distance from the west border where the cursor is located - public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west) + public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser) { // Shiny. double size = (double)(1 << brushsize); @@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Scenes break; } - RegenerateTerrain(true, (int)(north / 16.0f), (int)(west / 16.0f)); + remoteUser.SendLayerData((int)(west / 16), (int)(north / 16), Terrain.GetHeights1D()); return; } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index b2ae87d..9849145 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes } terrainCheckCount++; - if (terrainCheckCount >= 5) + if (terrainCheckCount >= 50) { terrainCheckCount = 0; @@ -373,34 +373,6 @@ namespace OpenSim.Region.Environment.Scenes } } - /// - /// Rebuilds the terrain assuming changes occured at a specified point[?] - /// - /// ??? - /// ??? - /// ??? - public void RegenerateTerrain(bool changes, int pointx, int pointy) - { - try - { - if (changes) - { - /* Dont save here, rely on tainting system instead */ - - float[] terrain = Terrain.GetHeights1D(); - - ForEachScenePresence(delegate(ScenePresence presence) - { - SendLayerData(pointx, pointy, presence.ControllingClient, terrain); - }); - } - } - catch (Exception e) - { - MainLog.Instance.Warn("terrain", "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); - } - } - #endregion #region Load Terrain -- cgit v1.1