on Select use again the priority queues to send ObjectProperties, including physics via caps. This is need to reduce useless redudance

melanie
UbitUmarov 2016-11-10 17:56:51 +00:00
parent d1baa3e0c3
commit bddaef5122
2 changed files with 34 additions and 41 deletions

View File

@ -2856,6 +2856,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendSelectedPartsProprieties(List<ISceneEntity> parts) public void SendSelectedPartsProprieties(List<ISceneEntity> parts)
{ {
/* not in use
// udp part // udp part
ObjectPropertiesPacket packet = ObjectPropertiesPacket packet =
(ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
@ -2893,6 +2894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
llsdBody.Add("ObjectData", array); llsdBody.Add("ObjectData", array);
eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId);
*/
} }
@ -4840,6 +4842,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates =
new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>();
List<SceneObjectPart> needPhysics = new List<SceneObjectPart>();
EntityUpdate iupdate; EntityUpdate iupdate;
Int32 timeinqueue; // this is just debugging code & can be dropped later Int32 timeinqueue; // this is just debugging code & can be dropped later
@ -4867,6 +4871,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (update.Entity is SceneObjectPart) if (update.Entity is SceneObjectPart)
{ {
SceneObjectPart sop = (SceneObjectPart)update.Entity; SceneObjectPart sop = (SceneObjectPart)update.Entity;
needPhysics.Add(sop);
ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop);
objectPropertiesBlocks.Value.Add(objPropDB); objectPropertiesBlocks.Value.Add(objPropDB);
propertyUpdates.Value.Add(update); propertyUpdates.Value.Add(update);
@ -4932,7 +4937,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// fpcnt++; // fpcnt++;
// fbcnt++; // fbcnt++;
} }
}
if(needPhysics.Count > 0)
{
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
if(eq != null)
{
OSDArray array = new OSDArray();
foreach(SceneObjectPart sop in needPhysics)
{
OSDMap physinfo = new OSDMap(6);
physinfo["LocalID"] = sop.LocalId;
physinfo["Density"] = sop.Density;
physinfo["Friction"] = sop.Friction;
physinfo["GravityMultiplier"] = sop.GravityModifier;
physinfo["Restitution"] = sop.Restitution;
physinfo["PhysicsShapeType"] = (int)sop.PhysicsShapeType;
array.Add(physinfo);
}
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("ObjectData", array);
eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId);
}
} }
// m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt); // m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt);

View File

@ -166,8 +166,6 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
public void SelectPrim(List<uint> primIDs, IClientAPI remoteClient) public void SelectPrim(List<uint> primIDs, IClientAPI remoteClient)
{ {
List<ISceneEntity> needUpdates = new List<ISceneEntity>();
foreach(uint primLocalID in primIDs) foreach(uint primLocalID in primIDs)
{ {
SceneObjectPart part = GetSceneObjectPart(primLocalID); SceneObjectPart part = GetSceneObjectPart(primLocalID);
@ -179,8 +177,6 @@ namespace OpenSim.Region.Framework.Scenes
if (sog == null) if (sog == null)
continue; continue;
needUpdates.Add((ISceneEntity)part);
// waste of time because properties do not send prim flags as they should // waste of time because properties do not send prim flags as they should
// if a friend got or lost edit rights after login, a full update is needed // if a friend got or lost edit rights after login, a full update is needed
if(sog.OwnerID != remoteClient.AgentId) if(sog.OwnerID != remoteClient.AgentId)
@ -193,10 +189,9 @@ namespace OpenSim.Region.Framework.Scenes
part.IsSelected = true; part.IsSelected = true;
EventManager.TriggerParcelPrimCountTainted(); EventManager.TriggerParcelPrimCountTainted();
} }
}
if(needUpdates.Count > 0) part.SendPropertiesToClient(remoteClient);
remoteClient.SendSelectedPartsProprieties(needUpdates); }
} }
/// <summary> /// <summary>
@ -248,37 +243,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetSceneObjectPart(primLocalID); SceneObjectPart part = GetSceneObjectPart(primLocalID);
if (part == null) if (part == null)
return; return;
/*
// A deselect packet contains all the local prims being deselected. However, since selection is still
// group based we only want the root prim to trigger a full update - otherwise on objects with many prims
// we end up sending many duplicate ObjectUpdates
if (part.ParentGroup.RootPart.LocalId != part.LocalId)
return;
// This is wrong, wrong, wrong. Selection should not be
// handled by group, but by prim. Legacy cruft.
// TODO: Make selection flagging per prim!
//
if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId)
|| Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
part.ParentGroup.IsSelected = false;
part.ParentGroup.ScheduleGroupForFullUpdate();
// If it's not an attachment, and we are allowed to move it,
// then we might have done so. If we moved across a parcel
// boundary, we will need to recount prims on the parcels.
// For attachments, that makes no sense.
//
if (!part.ParentGroup.IsAttachment)
{
if (Permissions.CanEditObject(
part.UUID, remoteClient.AgentId)
|| Permissions.CanMoveObject(
part.UUID, remoteClient.AgentId))
EventManager.TriggerParcelPrimCountTainted();
}
*/
bool oldgprSelect = part.ParentGroup.IsSelected; bool oldgprSelect = part.ParentGroup.IsSelected;