diff options
author | Sean Dague | 2007-12-11 20:32:22 +0000 |
---|---|---|
committer | Sean Dague | 2007-12-11 20:32:22 +0000 |
commit | 1fd62bc1afa1043737a738210255e37d66313134 (patch) | |
tree | a2cb504a21cf0dca8dc04b42457de5c677d5fec7 /OpenSim | |
parent | minor restructure of ClientView.cs to get all the attributes (diff) | |
download | opensim-SC-1fd62bc1afa1043737a738210255e37d66313134.zip opensim-SC-1fd62bc1afa1043737a738210255e37d66313134.tar.gz opensim-SC-1fd62bc1afa1043737a738210255e37d66313134.tar.bz2 opensim-SC-1fd62bc1afa1043737a738210255e37d66313134.tar.xz |
force a flush before client shutdown, so no important packets are lost
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketQueue.cs | 41 |
2 files changed, 48 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 1a30619..e199f30 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -60,7 +60,6 @@ namespace OpenSim.Region.ClientStack | |||
60 | //private AgentAssetUpload UploadAssets; | 60 | //private AgentAssetUpload UploadAssets; |
61 | private LLUUID newAssetFolder = LLUUID.Zero; | 61 | private LLUUID newAssetFolder = LLUUID.Zero; |
62 | private int debug = 0; | 62 | private int debug = 0; |
63 | private ClientManager m_clientManager; | ||
64 | private AssetCache m_assetCache; | 63 | private AssetCache m_assetCache; |
65 | // private InventoryCache m_inventoryCache; | 64 | // private InventoryCache m_inventoryCache; |
66 | private int cachedtextureserial = 0; | 65 | private int cachedtextureserial = 0; |
@@ -162,6 +161,7 @@ namespace OpenSim.Region.ClientStack | |||
162 | 161 | ||
163 | /* METHODS */ | 162 | /* METHODS */ |
164 | 163 | ||
164 | /* TODO: pull out clientManager param */ | ||
165 | public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, | 165 | public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, |
166 | IScene scene, AssetCache assetCache, PacketServer packServer, | 166 | IScene scene, AssetCache assetCache, PacketServer packServer, |
167 | AgentCircuitManager authenSessions) | 167 | AgentCircuitManager authenSessions) |
@@ -169,7 +169,6 @@ namespace OpenSim.Region.ClientStack | |||
169 | m_moneyBalance = 1000; | 169 | m_moneyBalance = 1000; |
170 | 170 | ||
171 | m_scene = scene; | 171 | m_scene = scene; |
172 | m_clientManager = clientManager; | ||
173 | m_assetCache = assetCache; | 172 | m_assetCache = assetCache; |
174 | 173 | ||
175 | m_networkServer = packServer; | 174 | m_networkServer = packServer; |
@@ -209,13 +208,18 @@ namespace OpenSim.Region.ClientStack | |||
209 | 208 | ||
210 | # region Client Methods | 209 | # region Client Methods |
211 | 210 | ||
211 | |||
212 | public void Close() | 212 | public void Close() |
213 | { | 213 | { |
214 | clientPingTimer.Stop(); | 214 | // FLUSH Packets |
215 | PacketQueue.Flush(); | ||
216 | PacketQueue.Close(); | ||
215 | 217 | ||
218 | // Pull Client out of Region | ||
216 | m_scene.RemoveClient(AgentId); | 219 | m_scene.RemoveClient(AgentId); |
217 | 220 | ||
218 | PacketQueue.Close(); | 221 | // Shut down timers |
222 | clientPingTimer.Stop(); | ||
219 | 223 | ||
220 | ClientThread.Abort(); | 224 | ClientThread.Abort(); |
221 | } | 225 | } |
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 | ||