From 63383bf3c5f5923b33e43ddd6b24b5616288ff4f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 14 Apr 2017 21:55:37 +0100
Subject: add functions to send entity updates imediatly, except for avatars
(or now) they should be use to bypass normal delayed updates, for debug
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 64 +++++++++++++++++++---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 45 +++++++++++++--
.../Server/IRCClientView.cs | 7 ++-
.../Region/OptionalModules/World/NPC/NPCAvatar.cs | 6 +-
4 files changed, 108 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 410ac00..4c77c18 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3950,24 +3950,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP
///
/// Send an ObjectUpdate packet with information about an avatar
///
- public void SendAvatarDataImmediate(ISceneEntity avatar)
+ public void SendEntityFullUpdateImmediate(ISceneEntity ent)
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
// avatar.Name, avatar.UUID, Name, AgentId);
- ScenePresence presence = avatar as ScenePresence;
- if (presence == null)
+ if (ent == null)
return;
ObjectUpdatePacket objupdate = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
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.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);
@@ -4021,7 +4065,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Primitive Packet/Data Sending Methods
-
///
/// Generate one of the object update packets based on PrimUpdateFlags
/// and broadcast the packet to clients
@@ -4157,8 +4200,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
SceneObjectPart part = (SceneObjectPart)update.Entity;
SceneObjectGroup grp = part.ParentGroup;
- if (grp.inTransit)
+ if (grp.inTransit && !update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
continue;
+ if (update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
+ {
+
+
+ }
if (grp.IsDeleted)
{
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a5af7e1..d50de27 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1778,6 +1778,20 @@ namespace OpenSim.Region.Framework.Scenes
private Dictionary m_knownChildRegionsSizeInfo = new Dictionary();
+ 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)
{
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 oldRegions)
{
foreach (ulong handle in oldRegions)
@@ -2010,6 +2030,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+
m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
if(!haveGroupInformation && !IsChildAgent && !IsNPC)
@@ -2069,6 +2090,16 @@ namespace OpenSim.Region.Framework.Scenes
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
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
// then hide if necessary
+
SendInitialAvatarDataToAllAgents(allpresences);
// send this look
@@ -2237,13 +2269,18 @@ namespace OpenSim.Region.Framework.Scenes
m_lastChildAgentUpdateDrawDistance = DrawDistance;
m_lastChildAgentUpdatePosition = AbsolutePosition;
m_childUpdatesBusy = false; // allow them
+
+
}
m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
+
+
// send the rest of the world
if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide)
SendInitialDataToMe();
+
// priority uses avatar position only
// m_reprioritizationLastPosition = AbsolutePosition;
@@ -3979,7 +4016,7 @@ namespace OpenSim.Region.Framework.Scenes
int count = 0;
foreach (ScenePresence p in presences)
{
- p.ControllingClient.SendAvatarDataImmediate(this);
+ p.ControllingClient.SendEntityFullUpdateImmediate(this);
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
// either just kill the object
// p.ControllingClient.SendKillObject(new List {LocalId});
@@ -3992,7 +4029,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendInitialAvatarDataToAgent(ScenePresence p)
{
- p.ControllingClient.SendAvatarDataImmediate(this);
+ p.ControllingClient.SendEntityFullUpdateImmediate(this);
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
// either just kill the object
// p.ControllingClient.SendKillObject(new List {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);
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod)
return;
- avatar.ControllingClient.SendAvatarDataImmediate(this);
+ avatar.ControllingClient.SendEntityFullUpdateImmediate(this);
}
public void SendAvatarDataToAgentNF(ScenePresence avatar)
{
- avatar.ControllingClient.SendAvatarDataImmediate(this);
+ avatar.ControllingClient.SendEntityFullUpdateImmediate(this);
}
///
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 83b534b..d39c224 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -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)
{
}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 6a7c735..151a202 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -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)
{
}
--
cgit v1.1