Little green men (aka dots on minimap). Thanks to bushing for

pointing out that it is done by CoarseLocationUpdatePacket.
afrisby
Dalien Talbot 2007-09-09 17:32:03 +00:00
parent 94b03aa09d
commit 907918e68e
5 changed files with 62 additions and 0 deletions

View File

@ -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 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 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 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); 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);

View File

@ -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 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 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 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){} 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){}

View File

@ -941,6 +941,27 @@ namespace OpenSim.Region.ClientStack
this.OutPacket(terse); 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 #endregion
#region Primitive Packet/data Sending Methods #region Primitive Packet/data Sending Methods

View File

@ -64,6 +64,7 @@ namespace OpenSim.Region.Environment.Scenes
private bool newForce = false; private bool newForce = false;
private bool newAvatar = false; private bool newAvatar = false;
private bool newCoarseLocations = false;
protected RegionInfo m_regionInfo; protected RegionInfo m_regionInfo;
protected ulong crossingFromRegion = 0; protected ulong crossingFromRegion = 0;
@ -462,6 +463,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
this.SendPrimUpdates(); this.SendPrimUpdates();
if (this.newCoarseLocations) {
this.SendCoarseLocations();
this.newCoarseLocations = false;
}
if (this.childAgent == false) if (this.childAgent == false)
{ {
if (this.newForce) 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>
/// ///
/// </summary> /// </summary>
@ -638,6 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
if (OnSignificantClientMovement != null) if (OnSignificantClientMovement != null)
{ {
OnSignificantClientMovement(this.ControllingClient); OnSignificantClientMovement(this.ControllingClient);
NotifyMyCoarseLocationChange();
} }
} }
} }

View File

@ -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 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 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 AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { }