Little green men (aka dots on minimap). Thanks to bushing for
pointing out that it is done by CoarseLocationUpdatePacket.afrisby
parent
94b03aa09d
commit
907918e68e
|
@ -216,6 +216,7 @@ namespace OpenSim.Framework.Interfaces
|
|||
|
||||
void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry);
|
||||
void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity, LLQuaternion rotation);
|
||||
void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations);
|
||||
|
||||
void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
|
||||
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem, LLQuaternion rotation);
|
||||
|
|
|
@ -137,6 +137,7 @@ namespace OpenSim.Framework
|
|||
|
||||
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<LLVector3> CoarseLocations) { }
|
||||
|
||||
public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint){}
|
||||
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem, LLQuaternion rotation){}
|
||||
|
|
|
@ -941,6 +941,27 @@ namespace OpenSim.Region.ClientStack
|
|||
this.OutPacket(terse);
|
||||
}
|
||||
|
||||
public void SendCoarseLocationUpdate(List<LLVector3> 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<total; i++) {
|
||||
CoarseLocationUpdatePacket.LocationBlock lb =
|
||||
new CoarseLocationUpdatePacket.LocationBlock();
|
||||
lb.X = (byte)CoarseLocations[i].X;
|
||||
lb.Y = (byte)CoarseLocations[i].Y;
|
||||
lb.Z = (byte)(CoarseLocations[i].Z/4);
|
||||
loc.Location[i] = lb;
|
||||
}
|
||||
ib.You = -1;
|
||||
ib.Prey = -1;
|
||||
loc.Index = ib;
|
||||
this.OutPacket(loc);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Primitive Packet/data Sending Methods
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<LLVector3> CoarseLocations) { }
|
||||
|
||||
public virtual void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { }
|
||||
|
||||
|
|
Loading…
Reference in New Issue