From 8ba8b0300ad8cb98714597bac8c83bf7f77b7f64 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 15 Oct 2008 14:41:12 +0000 Subject: * Create a new ViewerEffectPacket for each viewer rather than reusing the packet structure * This would have been a source of out_of_order messages for different sequences, which still appear to be happening --- OpenSim/Framework/ClientManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/ClientManager.cs') diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index e99001b..68c4dea 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -178,10 +178,9 @@ namespace OpenSim.Framework } public void ViewerEffectHandler(IClientAPI sender, List args) - { - ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); + { // TODO: don't create new blocks if recycling an old packet - List effectBlock = new List(); + List effectBlock = new List(); for (int i = 0; i < args.Count; i++) { ViewerEffectPacket.EffectBlock effect = new ViewerEffectPacket.EffectBlock(); @@ -193,7 +192,7 @@ namespace OpenSim.Framework effect.TypeData = args[i].TypeData; effectBlock.Add(effect); } - packet.Effect = effectBlock.ToArray(); + ViewerEffectPacket.EffectBlock[] effectBlockArray = effectBlock.ToArray(); IClientAPI[] LocalClients; lock (m_clients) @@ -206,6 +205,9 @@ namespace OpenSim.Framework { if (LocalClients[i].AgentId != sender.AgentId) { + ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); + packet.Effect = effectBlockArray; + packet.AgentData.AgentID = LocalClients[i].AgentId; packet.AgentData.SessionID = LocalClients[i].SessionId; packet.Header.Reliable = false; -- cgit v1.1