aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs14
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs8
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs5
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs5
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs5
7 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index b2786d4..f5fd5f5 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1143,6 +1143,8 @@ namespace OpenSim.Framework
1143 void SendGenericMessage(string method, UUID invoice, List<string> message); 1143 void SendGenericMessage(string method, UUID invoice, List<string> message);
1144 void SendGenericMessage(string method, UUID invoice, List<byte[]> message); 1144 void SendGenericMessage(string method, UUID invoice, List<byte[]> message);
1145 1145
1146 bool CanSendLayerData();
1147
1146 void SendLayerData(float[] map); 1148 void SendLayerData(float[] map);
1147 void SendLayerData(int px, int py, float[] map); 1149 void SendLayerData(int px, int py, float[] map);
1148 1150
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 36c3780..46836b1 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -1199,6 +1199,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1199 OutPacket(GATRP, ThrottleOutPacketType.Task); 1199 OutPacket(GATRP, ThrottleOutPacketType.Task);
1200 } 1200 }
1201 1201
1202
1203 public virtual bool CanSendLayerData()
1204 {
1205 int n = m_udpClient.GetCatBytesInSendQueue(ThrottleOutPacketType.Land);
1206 if ( n > 100000)
1207 return false;
1208 return true;
1209 }
1210
1202 /// <summary> 1211 /// <summary>
1203 /// Send the region heightmap to the client 1212 /// Send the region heightmap to the client
1204 /// This method is only called when not doing intellegent terrain patch sending and 1213 /// This method is only called when not doing intellegent terrain patch sending and
@@ -9151,7 +9160,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9151 if ((locX >= m_scene.RegionInfo.WorldLocX) 9160 if ((locX >= m_scene.RegionInfo.WorldLocX)
9152 && (locX < (m_scene.RegionInfo.WorldLocX + m_scene.RegionInfo.RegionSizeX)) 9161 && (locX < (m_scene.RegionInfo.WorldLocX + m_scene.RegionInfo.RegionSizeX))
9153 && (locY >= m_scene.RegionInfo.WorldLocY) 9162 && (locY >= m_scene.RegionInfo.WorldLocY)
9154 && (locY < (m_scene.RegionInfo.WorldLocY + m_scene.RegionInfo.RegionSizeY)) ) 9163 && (locY < (m_scene.RegionInfo.WorldLocY + m_scene.RegionInfo.RegionSizeY)))
9155 { 9164 {
9156 tpLocReq.Info.RegionHandle = m_scene.RegionInfo.RegionHandle; 9165 tpLocReq.Info.RegionHandle = m_scene.RegionInfo.RegionHandle;
9157 tpLocReq.Info.Position.X += locX - m_scene.RegionInfo.WorldLocX; 9166 tpLocReq.Info.Position.X += locX - m_scene.RegionInfo.WorldLocX;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 0ae7617..4b541e6 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -474,6 +474,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
474 474
475 return data; 475 return data;
476 } 476 }
477
478 public int GetCatBytesInSendQueue(ThrottleOutPacketType cat)
479 {
480 ;
481 int icat = (int)cat;
482 if (icat > 0 && icat < THROTTLE_CATEGORY_COUNT)
483 {
484 TokenBucket bucket = m_throttleCategories[icat];
485 return m_packetOutboxes[icat].Count;
486 }
487 else
488 return 0;
489 }
490
477 491
478 public int GetCatBytesCanSend(ThrottleOutPacketType cat, int timeMS) 492 public int GetCatBytesCanSend(ThrottleOutPacketType cat, int timeMS)
479 { 493 {
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index dfafcad..118c8f8 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -229,11 +229,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
229 } 229 }
230 230
231 m_scene.RegisterModuleInterface<ITerrainModule>(this); 231 m_scene.RegisterModuleInterface<ITerrainModule>(this);
232 m_scene.EventManager.OnFrame += EventManager_OnFrame;
232 m_scene.EventManager.OnNewClient += EventManager_OnNewClient; 233 m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
233 m_scene.EventManager.OnClientClosed += EventManager_OnClientClosed; 234 m_scene.EventManager.OnClientClosed += EventManager_OnClientClosed;
234 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; 235 m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
235 m_scene.EventManager.OnTerrainTick += EventManager_OnTerrainTick; 236 m_scene.EventManager.OnTerrainTick += EventManager_OnTerrainTick;
236 m_scene.EventManager.OnFrame += EventManager_OnFrame;
237 } 237 }
238 238
239 InstallDefaultEffects(); 239 InstallDefaultEffects();
@@ -767,6 +767,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
767 /// </summary> 767 /// </summary>
768 private void EventManager_OnFrame() 768 private void EventManager_OnFrame()
769 { 769 {
770 // this needs fixing
770 TerrainData terrData = m_channel.GetTerrainData(); 771 TerrainData terrData = m_channel.GetTerrainData();
771 772
772 bool shouldTaint = false; 773 bool shouldTaint = false;
@@ -792,6 +793,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
792 m_scene.EventManager.TriggerTerrainTainted(); 793 m_scene.EventManager.TriggerTerrainTainted();
793 m_tainted = true; 794 m_tainted = true;
794 } 795 }
796
795 } 797 }
796 798
797 /// <summary> 799 /// <summary>
@@ -993,6 +995,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
993 { 995 {
994 foreach (PatchUpdates pups in m_perClientPatchUpdates.Values) 996 foreach (PatchUpdates pups in m_perClientPatchUpdates.Values)
995 { 997 {
998 // throught acording to land queue free to send bytes
999 if (!pups.Presence.ControllingClient.CanSendLayerData())
1000 continue;
1001
996 if (pups.HasUpdates()) 1002 if (pups.HasUpdates())
997 { 1003 {
998 // There is something that could be sent to this client. 1004 // There is something that could be sent to this client.
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 51ecc8d..89e18b0 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -997,6 +997,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
997 997
998 } 998 }
999 999
1000 public virtual bool CanSendLayerData()
1001 {
1002 return false;
1003 }
1004
1000 public void SendLayerData(float[] map) 1005 public void SendLayerData(float[] map)
1001 { 1006 {
1002 1007
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 0b4d03a..dcd2a52 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -671,6 +671,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
671 671
672 } 672 }
673 673
674 public virtual bool CanSendLayerData()
675 {
676 return false;
677 }
678
674 public virtual void SendLayerData(float[] map) 679 public virtual void SendLayerData(float[] map)
675 { 680 {
676 } 681 }
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 96bccd2..5daca1e 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -590,6 +590,11 @@ namespace OpenSim.Tests.Common.Mock
590 590
591 } 591 }
592 592
593 public virtual bool CanSendLayerData()
594 {
595 return false;
596 }
597
593 public virtual void SendLayerData(float[] map) 598 public virtual void SendLayerData(float[] map)
594 { 599 {
595 } 600 }