add functions to send entity updates imediatly, except for avatars (or now) they should be use to bypass normal delayed updates, for debug
parent
22e9647748
commit
63383bf3c5
OpenSim
Framework
Region
ClientStack/Linden/UDP
Framework/Scenes
OptionalModules
Agent/InternetRelayClientView/Server
World/NPC
Tests/Common/Mock
|
@ -685,9 +685,10 @@ namespace OpenSim.Framework
|
||||||
ExtraData = 1 << 20,
|
ExtraData = 1 << 20,
|
||||||
Sound = 1 << 21,
|
Sound = 1 << 21,
|
||||||
Joint = 1 << 22,
|
Joint = 1 << 22,
|
||||||
FullUpdate = 0x3fffffff,
|
FullUpdate = 0x0fffffff,
|
||||||
CancelKill = 0x7fffffff,
|
SendInTransit = 1 << 30,
|
||||||
Kill = 0x80000000
|
CancelKill = 0x4fffffff, // 1 << 31
|
||||||
|
Kill = 0x80000000 // 1 << 32
|
||||||
}
|
}
|
||||||
|
|
||||||
/* included in .net 4.0
|
/* included in .net 4.0
|
||||||
|
@ -1187,7 +1188,8 @@ namespace OpenSim.Framework
|
||||||
void SetAgentThrottleSilent(int throttle, int setting);
|
void SetAgentThrottleSilent(int throttle, int setting);
|
||||||
int GetAgentThrottleSilent(int throttle);
|
int GetAgentThrottleSilent(int throttle);
|
||||||
|
|
||||||
void SendAvatarDataImmediate(ISceneEntity avatar);
|
void SendEntityFullUpdateImmediate(ISceneEntity entity);
|
||||||
|
void SendEntityTerseUpdateImmediate(ISceneEntity entity);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send a positional, velocity, etc. update to the viewer for a given entity.
|
/// Send a positional, velocity, etc. update to the viewer for a given entity.
|
||||||
|
|
|
@ -3950,24 +3950,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Send an ObjectUpdate packet with information about an avatar
|
/// Send an ObjectUpdate packet with information about an avatar
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendAvatarDataImmediate(ISceneEntity avatar)
|
public void SendEntityFullUpdateImmediate(ISceneEntity ent)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
|
// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
|
||||||
// avatar.Name, avatar.UUID, Name, AgentId);
|
// avatar.Name, avatar.UUID, Name, AgentId);
|
||||||
|
|
||||||
ScenePresence presence = avatar as ScenePresence;
|
if (ent == null)
|
||||||
if (presence == null)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ObjectUpdatePacket objupdate = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
ObjectUpdatePacket objupdate = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
||||||
objupdate.Header.Zerocoded = true;
|
objupdate.Header.Zerocoded = true;
|
||||||
|
|
||||||
objupdate.RegionData.RegionHandle = presence.RegionHandle;
|
|
||||||
// objupdate.RegionData.TimeDilation = ushort.MaxValue;
|
|
||||||
objupdate.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
|
objupdate.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
|
||||||
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
|
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
|
||||||
objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
|
|
||||||
|
if(ent is ScenePresence)
|
||||||
|
{
|
||||||
|
ScenePresence presence = ent as ScenePresence;
|
||||||
|
objupdate.RegionData.RegionHandle = presence.RegionHandle;
|
||||||
|
objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
|
||||||
|
}
|
||||||
|
else if(ent is SceneObjectPart)
|
||||||
|
{
|
||||||
|
SceneObjectPart part = ent as SceneObjectPart;
|
||||||
|
objupdate.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||||
|
objupdate.ObjectData[0] = CreatePrimUpdateBlock(part, (ScenePresence)SceneAgent);
|
||||||
|
}
|
||||||
|
|
||||||
|
OutPacket(objupdate, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
|
||||||
|
|
||||||
|
// We need to record the avatar local id since the root prim of an attachment points to this.
|
||||||
|
// m_attachmentsSent.Add(avatar.LocalId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
|
||||||
|
// avatar.Name, avatar.UUID, Name, AgentId);
|
||||||
|
|
||||||
|
if (ent == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ImprovedTerseObjectUpdatePacket objupdate =
|
||||||
|
(ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
|
||||||
|
objupdate.Header.Zerocoded = true;
|
||||||
|
|
||||||
|
objupdate.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
|
||||||
|
objupdate.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
|
||||||
|
|
||||||
|
if(ent is ScenePresence)
|
||||||
|
{
|
||||||
|
ScenePresence presence = ent as ScenePresence;
|
||||||
|
objupdate.RegionData.RegionHandle = presence.RegionHandle;
|
||||||
|
objupdate.ObjectData[0] = CreateImprovedTerseBlock(ent, false);
|
||||||
|
}
|
||||||
|
else if(ent is SceneObjectPart)
|
||||||
|
{
|
||||||
|
SceneObjectPart part = ent as SceneObjectPart;
|
||||||
|
objupdate.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||||
|
objupdate.ObjectData[0] = CreateImprovedTerseBlock(ent, false);
|
||||||
|
}
|
||||||
|
|
||||||
OutPacket(objupdate, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
|
OutPacket(objupdate, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
|
||||||
|
|
||||||
|
@ -4021,7 +4065,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#region Primitive Packet/Data Sending Methods
|
#region Primitive Packet/Data Sending Methods
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generate one of the object update packets based on PrimUpdateFlags
|
/// Generate one of the object update packets based on PrimUpdateFlags
|
||||||
/// and broadcast the packet to clients
|
/// and broadcast the packet to clients
|
||||||
|
@ -4157,8 +4200,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
||||||
SceneObjectGroup grp = part.ParentGroup;
|
SceneObjectGroup grp = part.ParentGroup;
|
||||||
if (grp.inTransit)
|
if (grp.inTransit && !update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
|
||||||
continue;
|
continue;
|
||||||
|
if (update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (grp.IsDeleted)
|
if (grp.IsDeleted)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1778,6 +1778,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>();
|
private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>();
|
||||||
|
|
||||||
|
public void AddNeighbourRegion(GridRegion region, string capsPath)
|
||||||
|
{
|
||||||
|
lock (m_knownChildRegions)
|
||||||
|
{
|
||||||
|
ulong regionHandle = region.RegionHandle;
|
||||||
|
m_knownChildRegions.Add(regionHandle,capsPath);
|
||||||
|
|
||||||
|
spRegionSizeInfo sizeInfo = new spRegionSizeInfo();
|
||||||
|
sizeInfo.sizeX = region.RegionSizeX;
|
||||||
|
sizeInfo.sizeY = region.RegionSizeY;
|
||||||
|
m_knownChildRegionsSizeInfo[regionHandle] = sizeInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void AddNeighbourRegionSizeInfo(GridRegion region)
|
public void AddNeighbourRegionSizeInfo(GridRegion region)
|
||||||
{
|
{
|
||||||
lock (m_knownChildRegions)
|
lock (m_knownChildRegions)
|
||||||
|
@ -1826,6 +1840,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool knowsNeighbourRegion(ulong regionHandle)
|
||||||
|
{
|
||||||
|
lock (m_knownChildRegions)
|
||||||
|
return m_knownChildRegions.ContainsKey(regionHandle);
|
||||||
|
}
|
||||||
|
|
||||||
public void DropOldNeighbours(List<ulong> oldRegions)
|
public void DropOldNeighbours(List<ulong> oldRegions)
|
||||||
{
|
{
|
||||||
foreach (ulong handle in oldRegions)
|
foreach (ulong handle in oldRegions)
|
||||||
|
@ -2010,6 +2030,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||||
|
|
||||||
if(!haveGroupInformation && !IsChildAgent && !IsNPC)
|
if(!haveGroupInformation && !IsChildAgent && !IsNPC)
|
||||||
|
@ -2069,6 +2090,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (!IsChildAgent)
|
if (!IsChildAgent)
|
||||||
{
|
{
|
||||||
|
if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
// SceneObjectPart root = ParentPart.ParentGroup.RootPart;
|
||||||
|
// if(root.LocalId != ParentPart.LocalId)
|
||||||
|
// ControllingClient.SendEntityTerseUpdateImmediate(root);
|
||||||
|
// ControllingClient.SendEntityTerseUpdateImmediate(ParentPart);
|
||||||
|
ParentPart.ParentGroup.SendFullUpdateToClient(ControllingClient);
|
||||||
|
}
|
||||||
|
|
||||||
// verify baked textures and cache
|
// verify baked textures and cache
|
||||||
bool cachedbaked = false;
|
bool cachedbaked = false;
|
||||||
|
|
||||||
|
@ -2130,6 +2161,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// send avatar object to all presences including us, so they cross it into region
|
// send avatar object to all presences including us, so they cross it into region
|
||||||
// then hide if necessary
|
// then hide if necessary
|
||||||
|
|
||||||
SendInitialAvatarDataToAllAgents(allpresences);
|
SendInitialAvatarDataToAllAgents(allpresences);
|
||||||
|
|
||||||
// send this look
|
// send this look
|
||||||
|
@ -2237,14 +2269,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_lastChildAgentUpdateDrawDistance = DrawDistance;
|
m_lastChildAgentUpdateDrawDistance = DrawDistance;
|
||||||
m_lastChildAgentUpdatePosition = AbsolutePosition;
|
m_lastChildAgentUpdatePosition = AbsolutePosition;
|
||||||
m_childUpdatesBusy = false; // allow them
|
m_childUpdatesBusy = false; // allow them
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// send the rest of the world
|
// send the rest of the world
|
||||||
if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide)
|
if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide)
|
||||||
SendInitialDataToMe();
|
SendInitialDataToMe();
|
||||||
|
|
||||||
|
|
||||||
// priority uses avatar position only
|
// priority uses avatar position only
|
||||||
// m_reprioritizationLastPosition = AbsolutePosition;
|
// m_reprioritizationLastPosition = AbsolutePosition;
|
||||||
// m_reprioritizationLastDrawDistance = DrawDistance;
|
// m_reprioritizationLastDrawDistance = DrawDistance;
|
||||||
|
@ -3979,7 +4016,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int count = 0;
|
int count = 0;
|
||||||
foreach (ScenePresence p in presences)
|
foreach (ScenePresence p in presences)
|
||||||
{
|
{
|
||||||
p.ControllingClient.SendAvatarDataImmediate(this);
|
p.ControllingClient.SendEntityFullUpdateImmediate(this);
|
||||||
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
||||||
// either just kill the object
|
// either just kill the object
|
||||||
// p.ControllingClient.SendKillObject(new List<uint> {LocalId});
|
// p.ControllingClient.SendKillObject(new List<uint> {LocalId});
|
||||||
|
@ -3992,7 +4029,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void SendInitialAvatarDataToAgent(ScenePresence p)
|
public void SendInitialAvatarDataToAgent(ScenePresence p)
|
||||||
{
|
{
|
||||||
p.ControllingClient.SendAvatarDataImmediate(this);
|
p.ControllingClient.SendEntityFullUpdateImmediate(this);
|
||||||
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
|
||||||
// either just kill the object
|
// either just kill the object
|
||||||
// p.ControllingClient.SendKillObject(new List<uint> {LocalId});
|
// p.ControllingClient.SendKillObject(new List<uint> {LocalId});
|
||||||
|
@ -4009,12 +4046,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
|
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
|
||||||
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod)
|
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod)
|
||||||
return;
|
return;
|
||||||
avatar.ControllingClient.SendAvatarDataImmediate(this);
|
avatar.ControllingClient.SendEntityFullUpdateImmediate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAvatarDataToAgentNF(ScenePresence avatar)
|
public void SendAvatarDataToAgentNF(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
avatar.ControllingClient.SendAvatarDataImmediate(this);
|
avatar.ControllingClient.SendEntityFullUpdateImmediate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1097,7 +1097,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAvatarDataImmediate(ISceneEntity avatar)
|
public void SendEntityFullUpdateImmediate(ISceneEntity ent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -813,7 +813,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAvatarDataImmediate(ISceneEntity avatar)
|
public void SendEntityFullUpdateImmediate(ISceneEntity avatar)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -760,7 +760,11 @@ namespace OpenSim.Tests.Common
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAvatarDataImmediate(ISceneEntity avatar)
|
public void SendEntityFullUpdateImmediate(ISceneEntity ent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue