From e7b785f9a010a9661bc8157c36258feec76b282d Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 26 Feb 2008 11:17:52 +0000 Subject: * Updated Voice Chat Server, added support for voice to cross region boundaries providing they are all located on the same simulator. --- .../Region/Environment/Modules/VoiceChat/VoiceChatServer.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/VoiceChat/VoiceChatServer.cs b/OpenSim/Region/Environment/Modules/VoiceChat/VoiceChatServer.cs index de7af3f..3f6e346 100644 --- a/OpenSim/Region/Environment/Modules/VoiceChat/VoiceChatServer.cs +++ b/OpenSim/Region/Environment/Modules/VoiceChat/VoiceChatServer.cs @@ -306,22 +306,23 @@ namespace OpenSim.Region.Environment.Modules.VoiceChat } } - public ScenePresence getScenePresence(LLUUID clientID) + public LLVector3 getScenePresencePosition(LLUUID clientID) { foreach (Scene scene in m_scenes) { ScenePresence x; if ((x = scene.GetScenePresence(clientID)) != null) { - return x; + return x.AbsolutePosition + new LLVector3(Constants.RegionSize * scene.RegionInfo.RegionLocX, + Constants.RegionSize * scene.RegionInfo.RegionLocY, 0); } } - return null; + return LLVector3.Zero; } public void BroadcastVoice(VoicePacket packet) { - libsecondlife.LLVector3 origPos = getScenePresence(packet.m_clientId).AbsolutePosition; + libsecondlife.LLVector3 origPos = getScenePresencePosition(packet.m_clientId); byte[] bytes = packet.GetBytes(); foreach (VoiceClient client in m_clients.Values) @@ -329,9 +330,9 @@ namespace OpenSim.Region.Environment.Modules.VoiceChat if (client.IsEnabled() && client.m_clientId != packet.m_clientId && client.m_authenticated && client.IsCodecSupported(packet.m_codec)) { - ScenePresence presence = getScenePresence(client.m_clientId); + LLVector3 presenceLoc = getScenePresencePosition(client.m_clientId); - if (presence != null && Util.GetDistanceTo(presence.AbsolutePosition, origPos) < 20) + if (presenceLoc != LLVector3.Zero && Util.GetDistanceTo(presenceLoc, origPos) < 20) { client.SendTo(bytes); } -- cgit v1.1