diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 276b36724d..99c9049e01 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2856,6 +2856,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendSelectedPartsProprieties(List parts) { +/* not in use // udp part ObjectPropertiesPacket packet = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); @@ -2893,6 +2894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP llsdBody.Add("ObjectData", array); eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); +*/ } @@ -4839,7 +4841,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP OpenSim.Framework.Lazy> propertyUpdates = new OpenSim.Framework.Lazy>(); - + + List needPhysics = new List(); + EntityUpdate iupdate; 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) { SceneObjectPart sop = (SceneObjectPart)update.Entity; + needPhysics.Add(sop); ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); objectPropertiesBlocks.Value.Add(objPropDB); propertyUpdates.Value.Add(update); @@ -4932,7 +4937,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP // fpcnt++; // fbcnt++; } - + } + + if(needPhysics.Count > 0) + { + IEventQueue eq = Scene.RequestModuleInterface(); + 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); diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 3f48372db3..24a2db792b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -166,8 +166,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void SelectPrim(List primIDs, IClientAPI remoteClient) { - List needUpdates = new List(); - foreach(uint primLocalID in primIDs) { SceneObjectPart part = GetSceneObjectPart(primLocalID); @@ -179,8 +177,6 @@ namespace OpenSim.Region.Framework.Scenes if (sog == null) continue; - needUpdates.Add((ISceneEntity)part); - // 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(sog.OwnerID != remoteClient.AgentId) @@ -193,10 +189,9 @@ namespace OpenSim.Region.Framework.Scenes part.IsSelected = true; EventManager.TriggerParcelPrimCountTainted(); } - } - if(needUpdates.Count > 0) - remoteClient.SendSelectedPartsProprieties(needUpdates); + part.SendPropertiesToClient(remoteClient); + } } /// @@ -248,38 +243,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = GetSceneObjectPart(primLocalID); if (part == null) 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; // This is wrong, wrong, wrong. Selection should not be