diff options
Diffstat (limited to 'OpenSim/Region')
4 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 47585f9..07f72c3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -2674,7 +2674,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2674 | OutPacket(terse, ThrottleOutPacketType.Task); | 2674 | OutPacket(terse, ThrottleOutPacketType.Task); |
2675 | } | 2675 | } |
2676 | 2676 | ||
2677 | public void SendCoarseLocationUpdate(List<Vector3> CoarseLocations) | 2677 | public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |
2678 | { | 2678 | { |
2679 | if (!IsActive) return; // We don't need to update inactive clients. | 2679 | if (!IsActive) return; // We don't need to update inactive clients. |
2680 | 2680 | ||
@@ -2684,14 +2684,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2684 | CoarseLocationUpdatePacket.IndexBlock ib = | 2684 | CoarseLocationUpdatePacket.IndexBlock ib = |
2685 | new CoarseLocationUpdatePacket.IndexBlock(); | 2685 | new CoarseLocationUpdatePacket.IndexBlock(); |
2686 | loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; | 2686 | loc.Location = new CoarseLocationUpdatePacket.LocationBlock[total]; |
2687 | loc.AgentData = new CoarseLocationUpdatePacket.AgentDataBlock[total]; | ||
2688 | |||
2687 | for (int i = 0; i < total; i++) | 2689 | for (int i = 0; i < total; i++) |
2688 | { | 2690 | { |
2689 | CoarseLocationUpdatePacket.LocationBlock lb = | 2691 | CoarseLocationUpdatePacket.LocationBlock lb = |
2690 | new CoarseLocationUpdatePacket.LocationBlock(); | 2692 | new CoarseLocationUpdatePacket.LocationBlock(); |
2691 | lb.X = (byte)CoarseLocations[i].X; | 2693 | lb.X = (byte)CoarseLocations[i].X; |
2692 | lb.Y = (byte)CoarseLocations[i].Y; | 2694 | lb.Y = (byte)CoarseLocations[i].Y; |
2693 | lb.Z = (byte)(CoarseLocations[i].Z / 4); | 2695 | |
2696 | lb.Z = CoarseLocations[i].Z > 1024 ? (byte)0 : (byte)(CoarseLocations[i].Z * 0.25); | ||
2694 | loc.Location[i] = lb; | 2697 | loc.Location[i] = lb; |
2698 | loc.AgentData[i] = new CoarseLocationUpdatePacket.AgentDataBlock(); | ||
2699 | loc.AgentData[i].AgentID = users[i]; | ||
2695 | } | 2700 | } |
2696 | ib.You = -1; | 2701 | ib.You = -1; |
2697 | ib.Prey = -1; | 2702 | ib.Prey = -1; |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 599236e..c5b6a1e 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -499,7 +499,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
499 | { | 499 | { |
500 | } | 500 | } |
501 | 501 | ||
502 | public virtual void SendCoarseLocationUpdate(List<Vector3> CoarseLocations) | 502 | public virtual void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |
503 | { | 503 | { |
504 | } | 504 | } |
505 | 505 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 42820c4..b059624 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2178,6 +2178,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2178 | m_perfMonMS = System.Environment.TickCount; | 2178 | m_perfMonMS = System.Environment.TickCount; |
2179 | 2179 | ||
2180 | List<Vector3> CoarseLocations = new List<Vector3>(); | 2180 | List<Vector3> CoarseLocations = new List<Vector3>(); |
2181 | List<UUID> AvatarUUIDs = new List<UUID>(); | ||
2181 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 2182 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
2182 | for (int i = 0; i < avatars.Count; i++) | 2183 | for (int i = 0; i < avatars.Count; i++) |
2183 | { | 2184 | { |
@@ -2190,21 +2191,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2190 | if (sop != null) | 2191 | if (sop != null) |
2191 | { | 2192 | { |
2192 | CoarseLocations.Add(sop.AbsolutePosition + avatars[i].m_pos); | 2193 | CoarseLocations.Add(sop.AbsolutePosition + avatars[i].m_pos); |
2194 | AvatarUUIDs.Add(avatars[i].UUID); | ||
2193 | } | 2195 | } |
2194 | else | 2196 | else |
2195 | { | 2197 | { |
2196 | // we can't find the parent.. ! arg! | 2198 | // we can't find the parent.. ! arg! |
2197 | CoarseLocations.Add(avatars[i].m_pos); | 2199 | CoarseLocations.Add(avatars[i].m_pos); |
2200 | AvatarUUIDs.Add(avatars[i].UUID); | ||
2198 | } | 2201 | } |
2199 | } | 2202 | } |
2200 | else | 2203 | else |
2201 | { | 2204 | { |
2202 | CoarseLocations.Add(avatars[i].m_pos); | 2205 | CoarseLocations.Add(avatars[i].m_pos); |
2206 | AvatarUUIDs.Add(avatars[i].UUID); | ||
2203 | } | 2207 | } |
2204 | } | 2208 | } |
2205 | } | 2209 | } |
2206 | 2210 | ||
2207 | m_controllingClient.SendCoarseLocationUpdate(CoarseLocations); | 2211 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); |
2208 | 2212 | ||
2209 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2213 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); |
2210 | } | 2214 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index c182048..e810b4e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -588,7 +588,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
588 | { | 588 | { |
589 | } | 589 | } |
590 | 590 | ||
591 | public virtual void SendCoarseLocationUpdate(List<Vector3> CoarseLocations) | 591 | public virtual void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations) |
592 | { | 592 | { |
593 | } | 593 | } |
594 | 594 | ||