aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2008-07-21 16:21:59 +0000
committerMW2008-07-21 16:21:59 +0000
commit6784cebf570b3a47ff2c1868ae30ec644f886ae6 (patch)
tree8f5002c8dbc4c8d58ab7566d987ffcabb3bebee8 /OpenSim
parentadded experimental packet tracker (LLPacketTracker.cs), which can be told to ... (diff)
downloadopensim-SC_OLD-6784cebf570b3a47ff2c1868ae30ec644f886ae6.zip
opensim-SC_OLD-6784cebf570b3a47ff2c1868ae30ec644f886ae6.tar.gz
opensim-SC_OLD-6784cebf570b3a47ff2c1868ae30ec644f886ae6.tar.bz2
opensim-SC_OLD-6784cebf570b3a47ff2c1868ae30ec644f886ae6.tar.xz
added support so that the packet tracker can resend packets itself as well as triggering a event. Next step to change the terrain packet resending to use these feature.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketTracker.cs33
1 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketTracker.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketTracker.cs
index e775a67..ce9c527 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketTracker.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketTracker.cs
@@ -3,6 +3,8 @@ using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.Threading; 4using System.Threading;
5using libsecondlife; 5using libsecondlife;
6using libsecondlife.Packets;
7using OpenSim.Framework;
6 8
7namespace OpenSim.Region.ClientStack.LindenUDP 9namespace OpenSim.Region.ClientStack.LindenUDP
8{ 10{
@@ -36,11 +38,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
36 38
37 public void TrackTerrainPacket(uint sequenceNumber, int patchX, int patchY) 39 public void TrackTerrainPacket(uint sequenceNumber, int patchX, int patchY)
38 { 40 {
41 TrackTerrainPacket(sequenceNumber, patchX, patchY, false, null);
42 }
43
44 public void TrackTerrainPacket(uint sequenceNumber, int patchX, int patchY, bool keepResending, LayerDataPacket packet)
45 {
39 TerrainPacketTracker tracker = new TerrainPacketTracker(); 46 TerrainPacketTracker tracker = new TerrainPacketTracker();
40 tracker.X = patchX; 47 tracker.X = patchX;
41 tracker.Y = patchY; 48 tracker.Y = patchY;
42 tracker.SeqNumber = sequenceNumber; 49 tracker.SeqNumber = sequenceNumber;
43 tracker.TimeSent = DateTime.Now; 50 tracker.TimeSent = DateTime.Now;
51 tracker.KeepResending = keepResending;
52 tracker.Packet = packet;
44 lock (m_sentTerrainPackets) 53 lock (m_sentTerrainPackets)
45 { 54 {
46 m_sentTerrainPackets[patchX, patchY] = tracker; 55 m_sentTerrainPackets[patchX, patchY] = tracker;
@@ -85,7 +94,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
85 94
86 foreach (TerrainPacketTracker tracker in resendList) 95 foreach (TerrainPacketTracker tracker in resendList)
87 { 96 {
88 m_parentClient.TriggerTerrainUnackedEvent(tracker.X, tracker.Y); 97 if (!tracker.KeepResending)
98 {
99 m_parentClient.TriggerTerrainUnackedEvent(tracker.X, tracker.Y);
100 }
101 else
102 {
103 if (tracker.Packet != null)
104 {
105 tracker.Packet.Header.Resent = true;
106 m_parentClient.OutPacket(tracker.Packet, ThrottleOutPacketType.Resend);
107 tracker.TimeSent = DateTime.Now;
108 lock (m_sentTerrainPackets)
109 {
110 if (m_sentTerrainPackets[tracker.X, tracker.Y] == null)
111 {
112 m_sentTerrainPackets[tracker.X, tracker.Y] = tracker;
113 }
114 }
115 }
116 }
89 } 117 }
90 } 118 }
91 119
@@ -220,7 +248,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
220 public int X; 248 public int X;
221 public int Y; 249 public int Y;
222 public DateTime TimeSent; 250 public DateTime TimeSent;
223 251 public LayerDataPacket Packet;
252 public bool KeepResending;
224 } 253 }
225 254
226 public class PrimPacketTracker 255 public class PrimPacketTracker