force a flush before client shutdown, so no important packets are lost
parent
696fb65199
commit
1fd62bc1af
|
@ -60,7 +60,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
//private AgentAssetUpload UploadAssets;
|
//private AgentAssetUpload UploadAssets;
|
||||||
private LLUUID newAssetFolder = LLUUID.Zero;
|
private LLUUID newAssetFolder = LLUUID.Zero;
|
||||||
private int debug = 0;
|
private int debug = 0;
|
||||||
private ClientManager m_clientManager;
|
|
||||||
private AssetCache m_assetCache;
|
private AssetCache m_assetCache;
|
||||||
// private InventoryCache m_inventoryCache;
|
// private InventoryCache m_inventoryCache;
|
||||||
private int cachedtextureserial = 0;
|
private int cachedtextureserial = 0;
|
||||||
|
@ -162,6 +161,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
/* METHODS */
|
/* METHODS */
|
||||||
|
|
||||||
|
/* TODO: pull out clientManager param */
|
||||||
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager,
|
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager,
|
||||||
IScene scene, AssetCache assetCache, PacketServer packServer,
|
IScene scene, AssetCache assetCache, PacketServer packServer,
|
||||||
AgentCircuitManager authenSessions)
|
AgentCircuitManager authenSessions)
|
||||||
|
@ -169,7 +169,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
m_moneyBalance = 1000;
|
m_moneyBalance = 1000;
|
||||||
|
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_clientManager = clientManager;
|
|
||||||
m_assetCache = assetCache;
|
m_assetCache = assetCache;
|
||||||
|
|
||||||
m_networkServer = packServer;
|
m_networkServer = packServer;
|
||||||
|
@ -209,13 +208,18 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
# region Client Methods
|
# region Client Methods
|
||||||
|
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
clientPingTimer.Stop();
|
// FLUSH Packets
|
||||||
|
PacketQueue.Flush();
|
||||||
|
PacketQueue.Close();
|
||||||
|
|
||||||
|
// Pull Client out of Region
|
||||||
m_scene.RemoveClient(AgentId);
|
m_scene.RemoveClient(AgentId);
|
||||||
|
|
||||||
PacketQueue.Close();
|
// Shut down timers
|
||||||
|
clientPingTimer.Stop();
|
||||||
|
|
||||||
ClientThread.Abort();
|
ClientThread.Abort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,10 +168,47 @@ namespace OpenSim.Region.ClientStack
|
||||||
return SendQueue.Dequeue();
|
return SendQueue.Dequeue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Flush()
|
||||||
|
{
|
||||||
|
lock(this) {
|
||||||
|
while (PacketsWaiting())
|
||||||
|
{
|
||||||
|
//Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up.
|
||||||
|
if (ResendOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(ResendOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
if (LandOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(LandOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
if (WindOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(WindOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
if (CloudOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(CloudOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
if (TaskOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(TaskOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
if (TextureOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(TextureOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
if (AssetOutgoingPacketQueue.Count > 0)
|
||||||
|
{
|
||||||
|
SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
// one last push
|
|
||||||
ProcessThrottle();
|
|
||||||
throttleTimer.Stop();
|
throttleTimer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue