changes on updates

0.9.1.0-post-fixes
UbitUmarov 2018-12-29 19:04:39 +00:00
parent 333aa0d67c
commit b156378819
5 changed files with 54 additions and 191 deletions

View File

@ -156,7 +156,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup sog = GetGroupByPrim(primLocalID);
if (sog != null)
sog.SendFullUpdateToClient(remoteClient);
sog.SendFullAnimUpdateToClient(remoteClient);
}
/// <summary>

View File

@ -626,6 +626,8 @@ namespace OpenSim.Region.Framework.Scenes
for (int i = 0; i < updates.Count; i++)
{
SceneObjectGroup sog = updates[i];
if (sog.IsDeleted)
continue;
// Don't abort the whole update if one entity happens to give us an exception.
try

View File

@ -2506,24 +2506,6 @@ namespace OpenSim.Region.Framework.Scenes
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
{
if (m_rootPart.PhysActor != null &&
(!m_rootPart.PhysActor.IsPhysical))
{
// Possible ghost prim
if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
{
foreach (SceneObjectPart part in m_parts.GetArray())
{
// Re-set physics actor positions and
// orientations
part.GroupPosition = m_rootPart.GroupPosition;
}
}
}
// m_log.DebugFormat(
// "[SCENE]: Storing {0}, {1} in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0)
{
RootPart.Shape.LastAttachPoint = RootPart.Shape.State;
@ -2557,12 +2539,6 @@ namespace OpenSim.Region.Framework.Scenes
backup_group.Clear();
backup_group = null;
}
// else
// {
// m_log.DebugFormat(
// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
// Name, UUID, IsSelected);
// }
}
}
catch (Exception e)
@ -2582,35 +2558,20 @@ namespace OpenSim.Region.Framework.Scenes
/// Used when the client initially connects and when client sends RequestPrim packet
/// </remarks>
/// <param name="remoteClient"></param>
public void SendFullUpdateToClient(IClientAPI remoteClient)
{
PrimUpdateFlags update = PrimUpdateFlags.FullUpdate;
RootPart.SendFullUpdate(remoteClient, update);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part != RootPart)
part.SendFullUpdate(remoteClient, update);
}
}
public void SendFullAnimUpdateToClient(IClientAPI remoteClient)
{
PrimUpdateFlags update = PrimUpdateFlags.FullUpdate;
if (RootPart.Shape.MeshFlagEntry)
update = PrimUpdateFlags.FullUpdatewithAnim;
RootPart.SendFullUpdate(remoteClient, update);
RootPart.SendUpdate(remoteClient, update);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part != RootPart)
part.SendFullUpdate(remoteClient, update);
part.SendUpdate(remoteClient, update);
}
}
@ -3034,28 +2995,13 @@ namespace OpenSim.Region.Framework.Scenes
if (IsDeleted || inTransit)
return;
// Even temporary objects take part in physics (e.g. temp-on-rez bullets)
//if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
// return;
// If we somehow got here to updating the SOG and its root part is not scheduled for update,
// check to see if the physical position or rotation warrant an update.
/*
if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
{
// rootpart SendScheduledUpdates will check if a update is needed
m_rootPart.UpdateFlag = UpdateRequired.TERSE;
}
*/
if (IsAttachment)
{
ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
if (sp != null)
{
sp.SendAttachmentScheduleUpdate(this);
return;
}
}
// while physics doesn't suports LookAt, we do it in RootPart
if (!IsSelected)
@ -3134,13 +3080,13 @@ namespace OpenSim.Region.Framework.Scenes
}
}
RootPart.SendFullUpdateToAllClientsInternal();
RootPart.SendFullUpdateToAllClientsNoAttachment();
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part != RootPart)
part.SendFullUpdateToAllClientsInternal();
part.SendFullUpdateToAllClientsNoAttachment();
}
}
@ -5465,7 +5411,6 @@ namespace OpenSim.Region.Framework.Scenes
private string GetLinkNumber_lastname;
private int GetLinkNumber_lastnumber;
// this scales bad but so does GetLinkNumPart
public int GetLinkNumber(string name)
{
if(String.IsNullOrEmpty(name) || name == "Object" || name == "Primitive")

View File

@ -660,7 +660,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public Dictionary<int, string> CollisionFilter
{
get { return m_CollisionFilter; }
@ -3282,8 +3281,6 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void ScheduleFullUpdate()
{
// m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId);
if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null)
return;
@ -3315,16 +3312,18 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.QueueForUpdateCheck();
bool isfull = false;
lock (UpdateFlagLock)
{
PrimUpdateFlags update;
if (ParentGroup.IsAttachment)
{
UpdateFlag |= PrimUpdateFlags.FullUpdate;
update = PrimUpdateFlags.FullUpdate;
isfull = true;
}
else
UpdateFlag |= PrimUpdateFlags.TerseUpdate;
}
update = PrimUpdateFlags.TerseUpdate;
lock (UpdateFlagLock)
UpdateFlag |= update;
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull);
}
@ -3341,16 +3340,14 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.QueueForUpdateCheck();
bool isfull = false;
lock (UpdateFlagLock)
{
if (ParentGroup.IsAttachment)
{
UpdateFlag |= update | PrimUpdateFlags.FullUpdate;
update |= PrimUpdateFlags.FullUpdate;
isfull = true;
}
else
lock (UpdateFlagLock)
UpdateFlag |= update;
}
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, isfull);
}
@ -3369,41 +3366,29 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null)
return;
// m_log.DebugFormat(
// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
if (ParentGroup.IsAttachment)
{
ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar);
if (sp != null)
{
sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate);
}
}
else
{
SendFullUpdateToClient(remoteClient);
SendUpdateToClient(remoteClient, PrimUpdateFlags.FullUpdate);
}
}
protected internal void SendFullUpdate(IClientAPI remoteClient, PrimUpdateFlags update)
protected internal void SendUpdate(IClientAPI remoteClient, PrimUpdateFlags update)
{
if (ParentGroup == null)
return;
// m_log.DebugFormat(
// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
if (ParentGroup.IsAttachment)
{
ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar);
if (sp != null)
{
sp.SendAttachmentUpdate(this, update);
}
}
else
{
SendUpdateToClient(remoteClient, update);
@ -3413,7 +3398,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Send a full update for this part to all clients.
/// </summary>
public void SendFullUpdateToAllClientsInternal()
public void SendFullUpdateToAllClientsNoAttachment()
{
if (ParentGroup == null)
return;
@ -3427,11 +3412,12 @@ namespace OpenSim.Region.Framework.Scenes
m_lastAcceleration = Acceleration;
m_lastAngularVelocity = AngularVelocity;
m_lastUpdateSentTime = Util.GetTimeStampMS();
UpdateFlag &= ~PrimUpdateFlags.FullUpdate;
}
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
SendFullUpdate(avatar.ControllingClient);
SendUpdateToClient(avatar.ControllingClient, PrimUpdateFlags.FullUpdate);
});
}
@ -3449,52 +3435,24 @@ namespace OpenSim.Region.Framework.Scenes
m_lastAcceleration = Acceleration;
m_lastAngularVelocity = AngularVelocity;
m_lastUpdateSentTime = Util.GetTimeStampMS();
UpdateFlag &= ~PrimUpdateFlags.FullUpdate;
}
if (ParentGroup.IsAttachment)
{
ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar);
if (sp != null)
{
sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate);
}
}
else
{
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
SendFullUpdate(avatar.ControllingClient);
SendUpdateToClient(avatar.ControllingClient, PrimUpdateFlags.FullUpdate);
});
}
}
/// <summary>
/// Sends a full update to the client
/// </summary>
/// <param name="remoteClient"></param>
public void SendFullUpdateToClient(IClientAPI remoteClient)
{
if (ParentGroup == null || ParentGroup.IsDeleted)
return;
if (ParentGroup.IsAttachment
&& ParentGroup.AttachedAvatar != remoteClient.AgentId
&& ParentGroup.HasPrivateAttachmentPoint)
return;
if (remoteClient.AgentId == OwnerID)
{
if ((Flags & PrimFlags.CreateSelected) != 0)
Flags &= ~PrimFlags.CreateSelected;
}
//bool isattachment = IsAttachment;
//if (LocalId != ParentGroup.RootPart.LocalId)
//isattachment = ParentGroup.RootPart.IsAttachment;
remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate);
ParentGroup.Scene.StatsReporter.AddObjectUpdates(1);
}
private const float ROTATION_TOLERANCE = 0.01f;
private const float VELOCITY_TOLERANCE = 0.1f;
private const float ANGVELOCITY_TOLERANCE = 0.005f;
@ -3546,17 +3504,12 @@ namespace OpenSim.Region.Framework.Scenes
if(vz > 128.0)
break;
if(
vx < VELOCITY_TOLERANCE &&
vy < VELOCITY_TOLERANCE &&
vz < VELOCITY_TOLERANCE
if(vx < VELOCITY_TOLERANCE && vy < VELOCITY_TOLERANCE && vz < VELOCITY_TOLERANCE
)
{
if(!AbsolutePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))
break;
if(vx < 1e-4 &&
vy < 1e-4 &&
vz < 1e-4 &&
if(vx < 1e-4 && vy < 1e-4 && vz < 1e-4 &&
(
Math.Abs(m_lastVelocity.X) > 1e-4 ||
Math.Abs(m_lastVelocity.Y) > 1e-4 ||
@ -4750,10 +4703,8 @@ namespace OpenSim.Region.Framework.Scenes
AggregateInnerPerms();
if (OwnerMask != prevOwnerMask ||
GroupMask != prevGroupMask ||
EveryoneMask != prevEveryoneMask ||
NextOwnerMask != prevNextOwnerMask)
if (OwnerMask != prevOwnerMask || GroupMask != prevGroupMask ||
EveryoneMask != prevEveryoneMask || NextOwnerMask != prevNextOwnerMask)
SendFullUpdateToAllClients();
}

View File

@ -2168,11 +2168,6 @@ namespace OpenSim.Region.Framework.Scenes
{
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.SendFullAnimUpdateToClient(ControllingClient);
}
@ -5439,35 +5434,34 @@ namespace OpenSim.Region.Framework.Scenes
PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length];
SceneObjectPart rootpart = sog.RootPart;
PrimUpdateFlags rootreq = sog.RootPart.GetAndClearUpdateFlag();
PrimUpdateFlags cur = sog.RootPart.GetAndClearUpdateFlag();
int j = 0;
int nparts = 0;
if (cur != PrimUpdateFlags.None)
{
flags[nparts] = cur;
parts[nparts] = rootpart;
++nparts;
}
PrimUpdateFlags cur;
for (int i = 0; i < origparts.Length; i++)
{
if (origparts[i] != rootpart)
{
if (origparts[i] == rootpart)
continue;
cur = origparts[i].GetAndClearUpdateFlag();
if(cur == PrimUpdateFlags.None)
continue;
flags[j] = cur;
parts[j] = origparts[i];
j++;
}
flags[nparts] = cur;
parts[nparts] = origparts[i];
++nparts;
}
if (j == 0 && rootreq == PrimUpdateFlags.None)
if (nparts == 0)
return;
int nparts = j;
ControllingClient.SendEntityUpdate(rootpart, rootreq);
for (int i = 0; i < nparts; i++)
{
ControllingClient.SendEntityUpdate(parts[i], flags[i]);
}
if (sog.HasPrivateAttachmentPoint)
return;
@ -5481,14 +5475,10 @@ namespace OpenSim.Region.Framework.Scenes
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
continue;
p.ControllingClient.SendEntityUpdate(rootpart, rootreq);
for (int i = 0; i < nparts; i++)
{
p.ControllingClient.SendEntityUpdate(parts[i], flags[i]);
}
}
}
public void SendAttachmentUpdate(SceneObjectGroup sog, PrimUpdateFlags update)
{
@ -5532,31 +5522,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void SendAttachmentScheduleUpdate(SceneObjectPart part)
{
if (IsChildAgent || IsInTransit)
return;
PrimUpdateFlags flag = part.GetAndClearUpdateFlag();
ControllingClient.SendEntityUpdate(part, flag);
if (part.ParentGroup.HasPrivateAttachmentPoint)
return;
List<ScenePresence> allPresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allPresences)
{
if (p == this)
continue;
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
continue;
p.ControllingClient.SendEntityUpdate(part, flag);
}
}
public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags flag)
{
if (IsChildAgent || IsInTransit)