From 55e081548c73988d3d0f7a438dd2c822dde20ed9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 13 Jan 2015 19:27:29 +0000 Subject: Fix bug where gathering the clientstack..OutgoingPacketsQueuedCount stat would fail with a casting exception for scenes with NPCs Present since 51eb8fa (Oct 2 2014) --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 7bd16e6..4fec91f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -770,8 +770,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (ScenePresence sp in Scene.GetScenePresences()) { - LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; - total += udpClient.GetTotalPacketsQueuedCount(); + // XXX: Need a better way to determine which IClientAPIs have UDPClients (NPCs do not, for instance). + if (sp.ControllingClient is LLClientView) + { + LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; + total += udpClient.GetTotalPacketsQueuedCount(); + } } return total; -- cgit v1.1