From c75d4156487b35aac47aa6818144862a99bb841c Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 27 Oct 2009 00:26:56 -0700 Subject: * Converts ClientManager.ForEach() (and as a result, Scene.ForEachClient()) to use a non-blocking parallel method when operating in async mode * Minor code readability cleanup --- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index cfe32d0..1a91f0c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -394,7 +394,7 @@ namespace OpenSim.Region.Framework.Scenes void ProcessViewerEffect(IClientAPI remoteClient, List args) { // TODO: don't create new blocks if recycling an old packet - List effectBlock = new List(); + ViewerEffectPacket.EffectBlock[] effectBlockArray = new ViewerEffectPacket.EffectBlock[args.Count]; for (int i = 0; i < args.Count; i++) { ViewerEffectPacket.EffectBlock effect = new ViewerEffectPacket.EffectBlock(); @@ -404,9 +404,8 @@ namespace OpenSim.Region.Framework.Scenes effect.ID = args[i].ID; effect.Type = args[i].Type; effect.TypeData = args[i].TypeData; - effectBlock.Add(effect); + effectBlockArray[i] = effect; } - ViewerEffectPacket.EffectBlock[] effectBlockArray = effectBlock.ToArray(); ForEachClient( delegate(IClientAPI client) -- cgit v1.1