aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs43
1 files changed, 30 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index ce6415a..931093a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -252,8 +252,6 @@ namespace OpenSim.Region.Framework.Scenes
252 if (part.ParentGroup.RootPart.LocalId != part.LocalId) 252 if (part.ParentGroup.RootPart.LocalId != part.LocalId)
253 return; 253 return;
254 254
255 bool isAttachment = false;
256
257 // This is wrong, wrong, wrong. Selection should not be 255 // This is wrong, wrong, wrong. Selection should not be
258 // handled by group, but by prim. Legacy cruft. 256 // handled by group, but by prim. Legacy cruft.
259 // TODO: Make selection flagging per prim! 257 // TODO: Make selection flagging per prim!
@@ -262,17 +260,14 @@ namespace OpenSim.Region.Framework.Scenes
262 || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId)) 260 || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
263 part.ParentGroup.IsSelected = false; 261 part.ParentGroup.IsSelected = false;
264 262
265 if (part.ParentGroup.IsAttachment) 263 part.ParentGroup.ScheduleGroupForFullUpdate();
266 isAttachment = true;
267 else
268 part.ParentGroup.ScheduleGroupForFullUpdate();
269 264
270 // If it's not an attachment, and we are allowed to move it, 265 // If it's not an attachment, and we are allowed to move it,
271 // then we might have done so. If we moved across a parcel 266 // then we might have done so. If we moved across a parcel
272 // boundary, we will need to recount prims on the parcels. 267 // boundary, we will need to recount prims on the parcels.
273 // For attachments, that makes no sense. 268 // For attachments, that makes no sense.
274 // 269 //
275 if (!isAttachment) 270 if (!part.ParentGroup.IsAttachment)
276 { 271 {
277 if (Permissions.CanEditObject( 272 if (Permissions.CanEditObject(
278 part.UUID, remoteClient.AgentId) 273 part.UUID, remoteClient.AgentId)
@@ -296,6 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
296 EventManager.TriggerParcelPrimCountTainted(); 291 EventManager.TriggerParcelPrimCountTainted();
297 } 292 }
298 293
294 // restore targetOmega
295 if (part.AngularVelocity != Vector3.Zero)
296 part.ScheduleTerseUpdate();
297
299 } 298 }
300 299
301 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount, 300 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount,
@@ -416,6 +415,7 @@ namespace OpenSim.Region.Framework.Scenes
416 void ProcessViewerEffect(IClientAPI remoteClient, List<ViewerEffectEventHandlerArg> args) 415 void ProcessViewerEffect(IClientAPI remoteClient, List<ViewerEffectEventHandlerArg> args)
417 { 416 {
418 // TODO: don't create new blocks if recycling an old packet 417 // TODO: don't create new blocks if recycling an old packet
418 bool discardableEffects = true;
419 ViewerEffectPacket.EffectBlock[] effectBlockArray = new ViewerEffectPacket.EffectBlock[args.Count]; 419 ViewerEffectPacket.EffectBlock[] effectBlockArray = new ViewerEffectPacket.EffectBlock[args.Count];
420 for (int i = 0; i < args.Count; i++) 420 for (int i = 0; i < args.Count; i++)
421 { 421 {
@@ -427,17 +427,34 @@ namespace OpenSim.Region.Framework.Scenes
427 effect.Type = args[i].Type; 427 effect.Type = args[i].Type;
428 effect.TypeData = args[i].TypeData; 428 effect.TypeData = args[i].TypeData;
429 effectBlockArray[i] = effect; 429 effectBlockArray[i] = effect;
430
431 if ((EffectType)effect.Type != EffectType.LookAt && (EffectType)effect.Type != EffectType.Beam)
432 discardableEffects = false;
433
434 //m_log.DebugFormat("[YYY]: VE {0} {1} {2}", effect.AgentID, effect.Duration, (EffectType)effect.Type);
430 } 435 }
431 436
432 ForEachClient( 437 ForEachScenePresence(sp =>
433 delegate(IClientAPI client)
434 { 438 {
435 if (client.AgentId != remoteClient.AgentId) 439 if (sp.ControllingClient.AgentId != remoteClient.AgentId)
436 client.SendViewerEffect(effectBlockArray); 440 {
437 } 441 if (!discardableEffects ||
438 ); 442 (discardableEffects && ShouldSendDiscardableEffect(remoteClient, sp)))
443 {
444 //m_log.DebugFormat("[YYY]: Sending to {0}", sp.UUID);
445 sp.ControllingClient.SendViewerEffect(effectBlockArray);
446 }
447 //else
448 // m_log.DebugFormat("[YYY]: Not sending to {0}", sp.UUID);
449 }
450 });
439 } 451 }
440 452
453 private bool ShouldSendDiscardableEffect(IClientAPI thisClient, ScenePresence other)
454 {
455 return Vector3.Distance(other.CameraPosition, thisClient.SceneAgent.AbsolutePosition) < 10;
456 }
457
441 private class DescendentsRequestData 458 private class DescendentsRequestData
442 { 459 {
443 public IClientAPI RemoteClient; 460 public IClientAPI RemoteClient;