diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 72 |
1 files changed, 53 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5bd1cf1..2b6c5e6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -5364,7 +5364,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5364 | 5364 | ||
5365 | return validated; | 5365 | return validated; |
5366 | } | 5366 | } |
5367 | 5367 | /* | |
5368 | public void SendAttachmentsToAllAgents() | 5368 | public void SendAttachmentsToAllAgents() |
5369 | { | 5369 | { |
5370 | lock (m_attachments) | 5370 | lock (m_attachments) |
@@ -5385,7 +5385,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5385 | } | 5385 | } |
5386 | } | 5386 | } |
5387 | } | 5387 | } |
5388 | 5388 | */ | |
5389 | // send attachments to a client without filters except for huds | 5389 | // send attachments to a client without filters except for huds |
5390 | // for now they are checked in several places down the line... | 5390 | // for now they are checked in several places down the line... |
5391 | public void SendAttachmentsToAgentNF(ScenePresence p) | 5391 | public void SendAttachmentsToAgentNF(ScenePresence p) |
@@ -5429,14 +5429,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
5429 | if (IsChildAgent || IsInTransit) | 5429 | if (IsChildAgent || IsInTransit) |
5430 | return; | 5430 | return; |
5431 | 5431 | ||
5432 | |||
5432 | SceneObjectPart[] origparts = sog.Parts; | 5433 | SceneObjectPart[] origparts = sog.Parts; |
5433 | SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; | 5434 | SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; |
5434 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; | 5435 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; |
5435 | 5436 | ||
5436 | SceneObjectPart rootpart = sog.RootPart; | 5437 | SceneObjectPart rootpart = sog.RootPart; |
5437 | PrimUpdateFlags cur = sog.RootPart.GetAndClearUpdateFlag(); | 5438 | PrimUpdateFlags cur = sog.RootPart.GetAndClearUpdateFlag(); |
5439 | bool noanim = !rootpart.Shape.MeshFlagEntry; | ||
5438 | 5440 | ||
5439 | int nparts = 0; | 5441 | int nparts = 0; |
5442 | if (noanim || rootpart.Animations == null) | ||
5443 | cur &= ~PrimUpdateFlags.Animations; | ||
5440 | if (cur != PrimUpdateFlags.None) | 5444 | if (cur != PrimUpdateFlags.None) |
5441 | { | 5445 | { |
5442 | flags[nparts] = cur; | 5446 | flags[nparts] = cur; |
@@ -5450,7 +5454,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
5450 | continue; | 5454 | continue; |
5451 | 5455 | ||
5452 | cur = origparts[i].GetAndClearUpdateFlag(); | 5456 | cur = origparts[i].GetAndClearUpdateFlag(); |
5453 | if(cur == PrimUpdateFlags.None) | 5457 | if (noanim || origparts[i].Animations == null) |
5458 | cur &= ~PrimUpdateFlags.Animations; | ||
5459 | if (cur == PrimUpdateFlags.None) | ||
5454 | continue; | 5460 | continue; |
5455 | flags[nparts] = cur; | 5461 | flags[nparts] = cur; |
5456 | parts[nparts] = origparts[i]; | 5462 | parts[nparts] = origparts[i]; |
@@ -5485,19 +5491,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
5485 | if (IsChildAgent || IsInTransit) | 5491 | if (IsChildAgent || IsInTransit) |
5486 | return; | 5492 | return; |
5487 | 5493 | ||
5488 | SceneObjectPart[] parts = sog.Parts; | 5494 | SceneObjectPart[] origparts = sog.Parts; |
5495 | SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; | ||
5496 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; | ||
5497 | |||
5489 | SceneObjectPart rootpart = sog.RootPart; | 5498 | SceneObjectPart rootpart = sog.RootPart; |
5499 | bool noanim = !rootpart.Shape.MeshFlagEntry; | ||
5490 | 5500 | ||
5491 | ControllingClient.SendEntityUpdate(rootpart, update); | 5501 | int nparts = 0; |
5502 | PrimUpdateFlags cur = update; | ||
5503 | if (noanim || rootpart.Animations == null) | ||
5504 | cur &= ~PrimUpdateFlags.Animations; | ||
5505 | if (cur != PrimUpdateFlags.None) | ||
5506 | { | ||
5507 | flags[nparts] = cur; | ||
5508 | parts[nparts] = rootpart; | ||
5509 | ++nparts; | ||
5510 | } | ||
5492 | 5511 | ||
5493 | for (int i = 0; i < parts.Length; i++) | 5512 | for (int i = 0; i < origparts.Length; i++) |
5494 | { | 5513 | { |
5495 | SceneObjectPart part = parts[i]; | 5514 | if (origparts[i] == rootpart) |
5496 | if (part == rootpart) | ||
5497 | continue; | 5515 | continue; |
5498 | ControllingClient.SendEntityUpdate(part, update); | 5516 | |
5517 | cur = update; | ||
5518 | if (noanim || origparts[i].Animations == null) | ||
5519 | cur &= ~PrimUpdateFlags.Animations; | ||
5520 | if (cur == PrimUpdateFlags.None) | ||
5521 | continue; | ||
5522 | flags[nparts] = cur; | ||
5523 | parts[nparts] = origparts[i]; | ||
5524 | ++nparts; | ||
5499 | } | 5525 | } |
5500 | 5526 | ||
5527 | if (nparts == 0) | ||
5528 | return; | ||
5529 | |||
5530 | for(int i = 0; i < nparts; i++) | ||
5531 | ControllingClient.SendEntityUpdate(parts[i], flags[i]); | ||
5532 | |||
5501 | if (sog.HasPrivateAttachmentPoint) | 5533 | if (sog.HasPrivateAttachmentPoint) |
5502 | return; | 5534 | return; |
5503 | 5535 | ||
@@ -5512,22 +5544,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
5512 | 5544 | ||
5513 | p.ControllingClient.SendEntityUpdate(rootpart, update); | 5545 | p.ControllingClient.SendEntityUpdate(rootpart, update); |
5514 | 5546 | ||
5515 | for (int i = 0; i < parts.Length; i++) | 5547 | for (int i = 0; i < nparts; i++) |
5516 | { | 5548 | p.ControllingClient.SendEntityUpdate(parts[i], flags[i]); |
5517 | SceneObjectPart part = parts[i]; | ||
5518 | if (part == rootpart) | ||
5519 | continue; | ||
5520 | p.ControllingClient.SendEntityUpdate(part, update); | ||
5521 | } | ||
5522 | } | 5549 | } |
5523 | } | 5550 | } |
5524 | 5551 | ||
5525 | public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags flag) | 5552 | public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags update) |
5526 | { | 5553 | { |
5527 | if (IsChildAgent || IsInTransit) | 5554 | if (IsChildAgent || IsInTransit) |
5528 | return; | 5555 | return; |
5529 | 5556 | ||
5530 | ControllingClient.SendEntityUpdate(part, flag); | 5557 | if ((update & PrimUpdateFlags.Animations) != 0 && part.Animations == null) |
5558 | { | ||
5559 | update &= ~PrimUpdateFlags.Animations; | ||
5560 | if (update == PrimUpdateFlags.None) | ||
5561 | return; | ||
5562 | } | ||
5563 | |||
5564 | ControllingClient.SendEntityUpdate(part, update); | ||
5531 | 5565 | ||
5532 | if (part.ParentGroup.HasPrivateAttachmentPoint) | 5566 | if (part.ParentGroup.HasPrivateAttachmentPoint) |
5533 | return; | 5567 | return; |
@@ -5540,7 +5574,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5540 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 5574 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
5541 | continue; | 5575 | continue; |
5542 | 5576 | ||
5543 | p.ControllingClient.SendEntityUpdate(part, flag); | 5577 | p.ControllingClient.SendEntityUpdate(part, update); |
5544 | } | 5578 | } |
5545 | } | 5579 | } |
5546 | 5580 | ||