mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
Little green men (aka dots on minimap). Thanks to bushing for
pointing out that it is done by CoarseLocationUpdatePacket.
This commit is contained in:
@@ -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<LLVector3> CoarseLocations = new List<LLVector3>();
|
||||
List<ScenePresence> 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<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
||||
for (int i = 0; i < avatars.Count; i++) {
|
||||
if (avatars[i] != this) {
|
||||
avatars[i].CoarseLocationChange(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -638,6 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
if (OnSignificantClientMovement != null)
|
||||
{
|
||||
OnSignificantClientMovement(this.ControllingClient);
|
||||
NotifyMyCoarseLocationChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user