From 22144eb8f74207fedb1042cbcf9f7ade3e2eca59 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 9 Nov 2010 20:18:36 +0100 Subject: Fix parcel bans to work only on the avatars they're supposed to work on instead of pushing all avatars, even the ones that are allowed. --- .../CoreModules/World/Land/LandManagementModule.cs | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 634685a..695202f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -88,7 +88,8 @@ namespace OpenSim.Region.CoreModules.World.Land // caches ExtendedLandData private Cache parcelInfoCache; - private Vector3? forcedPosition = null; + private Dictionary forcedPosition = + new Dictionary(); #region INonSharedRegionModule Members @@ -177,7 +178,7 @@ namespace OpenSim.Region.CoreModules.World.Land void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) { //If we are forcing a position for them to go - if (forcedPosition != null) + if (forcedPosition.ContainsKey(remoteClient.AgentId)) { ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); @@ -187,23 +188,23 @@ namespace OpenSim.Region.CoreModules.World.Land //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines - if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2) + if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) { - Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); - forcedPosition = null; + Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); + forcedPosition.Remove(remoteClient.AgentId); } //if we are far away, teleport - else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) + else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) { - Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); - clientAvatar.Teleport(forcedPosition.Value); - forcedPosition = null; + Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); + clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]); + forcedPosition.Remove(remoteClient.AgentId); } else { //Forces them toward the forced position we want if they aren't there yet agentData.UseClientAgentPosition = true; - agentData.ClientAgentPosition = forcedPosition.Value; + agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; } } } @@ -326,7 +327,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_scene.Permissions.IsGod(avatar.UUID)) return; if (position.HasValue) { - forcedPosition = position; + forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position; } } @@ -457,7 +458,7 @@ namespace OpenSim.Region.CoreModules.World.Land parcel.IsBannedFromLand(clientAvatar.UUID)) { //once we've sent the message once, keep going toward the target until we are done - if (forcedPosition == null) + if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) { SendYouAreBannedNotice(clientAvatar); ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); @@ -466,7 +467,7 @@ namespace OpenSim.Region.CoreModules.World.Land else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) { //once we've sent the message once, keep going toward the target until we are done - if (forcedPosition == null) + if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) { SendYouAreRestrictedNotice(clientAvatar); ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); @@ -475,7 +476,7 @@ namespace OpenSim.Region.CoreModules.World.Land else { //when we are finally in a safe place, lets release the forced position lock - forcedPosition = null; + forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); } } } -- cgit v1.1 From 846198bb9ef6aec8a3f351de8ef4393d6b7f35bd Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 9 Nov 2010 23:54:08 +0000 Subject: Although the Allow Voice setting is per estate rather than per region, apparently it is required in the region handshake to let the client enable parcel voice controls. So, send it. --- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 1bf0d67..6844c60 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -1098,12 +1098,14 @@ namespace OpenSim.Region.CoreModules.World.Estate if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) flags |= RegionFlags.AllowParcelChanges; if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch) - flags |= (RegionFlags)(1 << 29); + flags |= RegionFlags.BlockParcelSearch; if (m_scene.RegionInfo.RegionSettings.FixedSun) flags |= RegionFlags.SunFixed; if (m_scene.RegionInfo.RegionSettings.Sandbox) flags |= RegionFlags.Sandbox; + if (m_scene.RegionInfo.EstateSettings.AllowVoice) + flags |= RegionFlags.AllowVoice; // Fudge these to always on, so the menu options activate // -- cgit v1.1 From ff3e466000f31f76bfbae66bf29f5c4bb030529c Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 10 Nov 2010 01:17:40 +0000 Subject: Remove a debug spam --- OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 8df645d..abd28c8 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -97,7 +97,6 @@ namespace OpenSim.Region.CoreModules.World.Sound else gain = (float)((double)gain * ((radius - dis) / radius)); - m_log.DebugFormat("Play sound, gain {0}", gain); sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags); }); } -- cgit v1.1