aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/PacketQueue.cs
diff options
context:
space:
mode:
authorSean Dague2007-12-11 20:32:22 +0000
committerSean Dague2007-12-11 20:32:22 +0000
commit1fd62bc1afa1043737a738210255e37d66313134 (patch)
treea2cb504a21cf0dca8dc04b42457de5c677d5fec7 /OpenSim/Region/ClientStack/PacketQueue.cs
parentminor restructure of ClientView.cs to get all the attributes (diff)
downloadopensim-SC_OLD-1fd62bc1afa1043737a738210255e37d66313134.zip
opensim-SC_OLD-1fd62bc1afa1043737a738210255e37d66313134.tar.gz
opensim-SC_OLD-1fd62bc1afa1043737a738210255e37d66313134.tar.bz2
opensim-SC_OLD-1fd62bc1afa1043737a738210255e37d66313134.tar.xz
force a flush before client shutdown, so no important packets are lost
Diffstat (limited to 'OpenSim/Region/ClientStack/PacketQueue.cs')
-rw-r--r--OpenSim/Region/ClientStack/PacketQueue.cs41
1 files changed, 39 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/PacketQueue.cs b/OpenSim/Region/ClientStack/PacketQueue.cs
index 193b4d7..747ef18 100644
--- a/OpenSim/Region/ClientStack/PacketQueue.cs
+++ b/OpenSim/Region/ClientStack/PacketQueue.cs
@@ -168,10 +168,47 @@ namespace OpenSim.Region.ClientStack
168 return SendQueue.Dequeue(); 168 return SendQueue.Dequeue();
169 } 169 }
170 170
171 public void Flush()
172 {
173 lock(this) {
174 while (PacketsWaiting())
175 {
176 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up.
177 if (ResendOutgoingPacketQueue.Count > 0)
178 {
179 SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue());
180 }
181 if (LandOutgoingPacketQueue.Count > 0)
182 {
183 SendQueue.Enqueue(LandOutgoingPacketQueue.Dequeue());
184 }
185 if (WindOutgoingPacketQueue.Count > 0)
186 {
187 SendQueue.Enqueue(WindOutgoingPacketQueue.Dequeue());
188 }
189 if (CloudOutgoingPacketQueue.Count > 0)
190 {
191 SendQueue.Enqueue(CloudOutgoingPacketQueue.Dequeue());
192 }
193 if (TaskOutgoingPacketQueue.Count > 0)
194 {
195 SendQueue.Enqueue(TaskOutgoingPacketQueue.Dequeue());
196 }
197 if (TextureOutgoingPacketQueue.Count > 0)
198 {
199 SendQueue.Enqueue(TextureOutgoingPacketQueue.Dequeue());
200 }
201 if (AssetOutgoingPacketQueue.Count > 0)
202 {
203 SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue());
204 }
205 }
206 // MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets");
207 }
208 }
209
171 public void Close() 210 public void Close()
172 { 211 {
173 // one last push
174 ProcessThrottle();
175 throttleTimer.Stop(); 212 throttleTimer.Stop();
176 } 213 }
177 214