From 907918e68e9fb0deb0cea2fa9219ceb76dd41ae1 Mon Sep 17 00:00:00 2001 From: Dalien Talbot Date: Sun, 9 Sep 2007 17:32:03 +0000 Subject: Little green men (aka dots on minimap). Thanks to bushing for pointing out that it is done by CoarseLocationUpdatePacket. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index c96d575..8cf0b98 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -64,6 +64,7 @@ namespace OpenSim.Region.Environment.Scenes private bool newForce = false; private bool newAvatar = false; + private bool newCoarseLocations = false; protected RegionInfo m_regionInfo; protected ulong crossingFromRegion = 0; @@ -462,6 +463,11 @@ namespace OpenSim.Region.Environment.Scenes { this.SendPrimUpdates(); + if (this.newCoarseLocations) { + this.SendCoarseLocations(); + this.newCoarseLocations = false; + } + if (this.childAgent == false) { if (this.newForce) @@ -515,6 +521,37 @@ namespace OpenSim.Region.Environment.Scenes } } + + public void SendCoarseLocations() + { + List CoarseLocations = new List(); + List avatars = this.m_scene.RequestAvatarList(); + for (int i = 0; i < avatars.Count; i++) + { + if (avatars[i] != this) { + CoarseLocations.Add(avatars[i].AbsolutePosition); + } + } + this.ControllingClient.SendCoarseLocationUpdate(CoarseLocations); + } + + public void CoarseLocationChange(ScenePresence avatar) + { + newCoarseLocations = true; + } + + private void NotifyMyCoarseLocationChange() + { + List avatars = this.m_scene.RequestAvatarList(); + for (int i = 0; i < avatars.Count; i++) { + if (avatars[i] != this) { + avatars[i].CoarseLocationChange(this); + } + } + + } + + /// /// /// @@ -638,6 +675,7 @@ namespace OpenSim.Region.Environment.Scenes if (OnSignificantClientMovement != null) { OnSignificantClientMovement(this.ControllingClient); + NotifyMyCoarseLocationChange(); } } } -- cgit v1.1