From 71ab7a1e2d4b613c1d897e26b518c0316b723f95 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 12 Jul 2009 02:16:49 +0000 Subject: * Workaround for a bug in Vivox Server r2978, whereby channel-search.channels.count returns 0 instead of the actual channel count. Should not affect more recent versions of Vivox where this issue has been fixed. --- .../Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice') diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 98c39cc..f9d6bd2 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -921,6 +921,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice if (XmlFind(resp, "response.level0.channel-search.count", out count)) { int channels = Convert.ToInt32(count); + + // Bug in Vivox Server r2978 where count returns 0 + // Found by Adam + if(channels == 0) + { + for(int j=0;j<100;j++) + { + string tmpId; + if (!XmlFind(resp, "response.level0.channel-search.channels.channels.level4.id", j, out tmpId)) + break; + + channels = j + 1; + } + } + for (int i = 0; i < channels; i++) { string name; @@ -974,13 +989,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice } else { - m_log.Debug("[VivoxVoice] No channels registered."); + m_log.Debug("[VivoxVoice] No count element?"); } channelId = String.Empty; channelUri = String.Empty; - m_log.Debug("[VivoxVoice] Could not find channel in XMLRESP: " + resp.InnerXml); + // Useful incase something goes wrong. + //m_log.Debug("[VivoxVoice] Could not find channel in XMLRESP: " + resp.InnerXml); return false; } -- cgit v1.1