Fix bug where gathering the clientstack..OutgoingPacketsQueuedCount stat would fail with a casting exception for scenes with NPCs

Present since 51eb8fa (Oct 2 2014)
sedebug
Justin Clark-Casey (justincc) 2015-01-13 19:27:29 +00:00
parent 0794a40378
commit 55e081548c
1 changed files with 6 additions and 2 deletions

View File

@ -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;