diff options
author | UbitUmarov | 2016-11-10 17:56:51 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-10 17:56:51 +0000 |
commit | bddaef51220198c3a3894edeece750e29337a558 (patch) | |
tree | 88c826e7b58aa966caa045386583699976c85afe /OpenSim/Region | |
parent | fix some invalid string.format arguments (diff) | |
download | opensim-SC_OLD-bddaef51220198c3a3894edeece750e29337a558.zip opensim-SC_OLD-bddaef51220198c3a3894edeece750e29337a558.tar.gz opensim-SC_OLD-bddaef51220198c3a3894edeece750e29337a558.tar.bz2 opensim-SC_OLD-bddaef51220198c3a3894edeece750e29337a558.tar.xz |
on Select use again the priority queues to send ObjectProperties, including physics via caps. This is need to reduce useless redudance
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 42 |
2 files changed, 34 insertions, 41 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 276b367..99c9049 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 | |||
2856 | 2856 | ||
2857 | public void SendSelectedPartsProprieties(List<ISceneEntity> parts) | 2857 | public void SendSelectedPartsProprieties(List<ISceneEntity> parts) |
2858 | { | 2858 | { |
2859 | /* not in use | ||
2859 | // udp part | 2860 | // udp part |
2860 | ObjectPropertiesPacket packet = | 2861 | ObjectPropertiesPacket packet = |
2861 | (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); | 2862 | (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); |
@@ -2893,6 +2894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2893 | llsdBody.Add("ObjectData", array); | 2894 | llsdBody.Add("ObjectData", array); |
2894 | 2895 | ||
2895 | eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); | 2896 | eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); |
2897 | */ | ||
2896 | } | 2898 | } |
2897 | 2899 | ||
2898 | 2900 | ||
@@ -4839,7 +4841,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4839 | 4841 | ||
4840 | OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = | 4842 | OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = |
4841 | new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); | 4843 | new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); |
4842 | 4844 | ||
4845 | List<SceneObjectPart> needPhysics = new List<SceneObjectPart>(); | ||
4846 | |||
4843 | EntityUpdate iupdate; | 4847 | EntityUpdate iupdate; |
4844 | Int32 timeinqueue; // this is just debugging code & can be dropped later | 4848 | Int32 timeinqueue; // this is just debugging code & can be dropped later |
4845 | 4849 | ||
@@ -4867,6 +4871,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4867 | if (update.Entity is SceneObjectPart) | 4871 | if (update.Entity is SceneObjectPart) |
4868 | { | 4872 | { |
4869 | SceneObjectPart sop = (SceneObjectPart)update.Entity; | 4873 | SceneObjectPart sop = (SceneObjectPart)update.Entity; |
4874 | needPhysics.Add(sop); | ||
4870 | ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); | 4875 | ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); |
4871 | objectPropertiesBlocks.Value.Add(objPropDB); | 4876 | objectPropertiesBlocks.Value.Add(objPropDB); |
4872 | propertyUpdates.Value.Add(update); | 4877 | propertyUpdates.Value.Add(update); |
@@ -4932,7 +4937,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4932 | // fpcnt++; | 4937 | // fpcnt++; |
4933 | // fbcnt++; | 4938 | // fbcnt++; |
4934 | } | 4939 | } |
4935 | 4940 | } | |
4941 | |||
4942 | if(needPhysics.Count > 0) | ||
4943 | { | ||
4944 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
4945 | if(eq != null) | ||
4946 | { | ||
4947 | OSDArray array = new OSDArray(); | ||
4948 | foreach(SceneObjectPart sop in needPhysics) | ||
4949 | { | ||
4950 | OSDMap physinfo = new OSDMap(6); | ||
4951 | physinfo["LocalID"] = sop.LocalId; | ||
4952 | physinfo["Density"] = sop.Density; | ||
4953 | physinfo["Friction"] = sop.Friction; | ||
4954 | physinfo["GravityMultiplier"] = sop.GravityModifier; | ||
4955 | physinfo["Restitution"] = sop.Restitution; | ||
4956 | physinfo["PhysicsShapeType"] = (int)sop.PhysicsShapeType; | ||
4957 | array.Add(physinfo); | ||
4958 | } | ||
4959 | |||
4960 | OSDMap llsdBody = new OSDMap(1); | ||
4961 | llsdBody.Add("ObjectData", array); | ||
4962 | |||
4963 | eq.Enqueue(BuildEvent("ObjectPhysicsProperties", llsdBody),AgentId); | ||
4964 | } | ||
4936 | } | 4965 | } |
4937 | 4966 | ||
4938 | // m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt); | 4967 | // 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 3f48372..24a2db7 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 | |||
166 | /// <param name="remoteClient"></param> | 166 | /// <param name="remoteClient"></param> |
167 | public void SelectPrim(List<uint> primIDs, IClientAPI remoteClient) | 167 | public void SelectPrim(List<uint> primIDs, IClientAPI remoteClient) |
168 | { | 168 | { |
169 | List<ISceneEntity> needUpdates = new List<ISceneEntity>(); | ||
170 | |||
171 | foreach(uint primLocalID in primIDs) | 169 | foreach(uint primLocalID in primIDs) |
172 | { | 170 | { |
173 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | 171 | SceneObjectPart part = GetSceneObjectPart(primLocalID); |
@@ -179,8 +177,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
179 | if (sog == null) | 177 | if (sog == null) |
180 | continue; | 178 | continue; |
181 | 179 | ||
182 | needUpdates.Add((ISceneEntity)part); | ||
183 | |||
184 | // waste of time because properties do not send prim flags as they should | 180 | // waste of time because properties do not send prim flags as they should |
185 | // if a friend got or lost edit rights after login, a full update is needed | 181 | // if a friend got or lost edit rights after login, a full update is needed |
186 | if(sog.OwnerID != remoteClient.AgentId) | 182 | if(sog.OwnerID != remoteClient.AgentId) |
@@ -193,10 +189,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
193 | part.IsSelected = true; | 189 | part.IsSelected = true; |
194 | EventManager.TriggerParcelPrimCountTainted(); | 190 | EventManager.TriggerParcelPrimCountTainted(); |
195 | } | 191 | } |
196 | } | ||
197 | 192 | ||
198 | if(needUpdates.Count > 0) | 193 | part.SendPropertiesToClient(remoteClient); |
199 | remoteClient.SendSelectedPartsProprieties(needUpdates); | 194 | } |
200 | } | 195 | } |
201 | 196 | ||
202 | /// <summary> | 197 | /// <summary> |
@@ -248,38 +243,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
248 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | 243 | SceneObjectPart part = GetSceneObjectPart(primLocalID); |
249 | if (part == null) | 244 | if (part == null) |
250 | return; | 245 | return; |
251 | /* | 246 | |
252 | // A deselect packet contains all the local prims being deselected. However, since selection is still | ||
253 | // group based we only want the root prim to trigger a full update - otherwise on objects with many prims | ||
254 | // we end up sending many duplicate ObjectUpdates | ||
255 | if (part.ParentGroup.RootPart.LocalId != part.LocalId) | ||
256 | return; | ||
257 | |||
258 | // This is wrong, wrong, wrong. Selection should not be | ||
259 | // handled by group, but by prim. Legacy cruft. | ||
260 | // TODO: Make selection flagging per prim! | ||
261 | // | ||
262 | if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId) | ||
263 | || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) | ||
264 | part.ParentGroup.IsSelected = false; | ||
265 | |||
266 | part.ParentGroup.ScheduleGroupForFullUpdate(); | ||
267 | |||
268 | // If it's not an attachment, and we are allowed to move it, | ||
269 | // then we might have done so. If we moved across a parcel | ||
270 | // boundary, we will need to recount prims on the parcels. | ||
271 | // For attachments, that makes no sense. | ||
272 | // | ||
273 | if (!part.ParentGroup.IsAttachment) | ||
274 | { | ||
275 | if (Permissions.CanEditObject( | ||
276 | part.UUID, remoteClient.AgentId) | ||
277 | || Permissions.CanMoveObject( | ||
278 | part.UUID, remoteClient.AgentId)) | ||
279 | EventManager.TriggerParcelPrimCountTainted(); | ||
280 | } | ||
281 | */ | ||
282 | |||
283 | bool oldgprSelect = part.ParentGroup.IsSelected; | 247 | bool oldgprSelect = part.ParentGroup.IsSelected; |
284 | 248 | ||
285 | // This is wrong, wrong, wrong. Selection should not be | 249 | // This is wrong, wrong, wrong. Selection should not be |