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/ClientStack/ClientView.API.cs | 21 ++++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 38 ++++++++++++++++++++++ .../Region/Examples/SimpleApp/MyNpcCharacter.cs | 1 + 3 files changed, 60 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index c5a2284..43eb95a 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -941,6 +941,27 @@ namespace OpenSim.Region.ClientStack this.OutPacket(terse); } + public void SendCoarseLocationUpdate(List CoarseLocations) + { + CoarseLocationUpdatePacket loc = new CoarseLocationUpdatePacket(); + int total = CoarseLocations.Count; + CoarseLocationUpdatePacket.IndexBlock ib = + new CoarseLocationUpdatePacket.IndexBlock(); + loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; + for(int i=0; i 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(); } } } diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 7e1f5c1..7053c84 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -154,6 +154,7 @@ namespace SimpleApp public virtual void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry) { } public virtual void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity, LLQuaternion rotation) { } + public virtual void SendCoarseLocationUpdate(List CoarseLocations) { } public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { } -- cgit v1.1