diff options
author | UbitUmarov | 2018-12-28 13:52:59 +0000 |
---|---|---|
committer | UbitUmarov | 2018-12-28 13:52:59 +0000 |
commit | 4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4 (patch) | |
tree | 6e8200b3b7a3c0465853e42bbd790a59ccd4e312 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | update pbs (diff) | |
download | opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.zip opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.gz opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.bz2 opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.xz |
now break several things at same time... sog/sop updates, threads options,...
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 145 |
1 files changed, 43 insertions, 102 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3312ace..a308abb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2173,7 +2173,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2173 | // if(root.LocalId != ParentPart.LocalId) | 2173 | // if(root.LocalId != ParentPart.LocalId) |
2174 | // ControllingClient.SendEntityTerseUpdateImmediate(root); | 2174 | // ControllingClient.SendEntityTerseUpdateImmediate(root); |
2175 | // ControllingClient.SendEntityTerseUpdateImmediate(ParentPart); | 2175 | // ControllingClient.SendEntityTerseUpdateImmediate(ParentPart); |
2176 | ParentPart.ParentGroup.SendFullUpdateToClient(ControllingClient); | 2176 | ParentPart.ParentGroup.SendFullAnimUpdateToClient(ControllingClient); |
2177 | } | 2177 | } |
2178 | 2178 | ||
2179 | // verify baked textures and cache | 2179 | // verify baked textures and cache |
@@ -4036,7 +4036,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4036 | foreach (EntityBase e in entities) | 4036 | foreach (EntityBase e in entities) |
4037 | { | 4037 | { |
4038 | if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment) | 4038 | if (e != null && e is SceneObjectGroup && !((SceneObjectGroup)e).IsAttachment) |
4039 | ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient); | 4039 | ((SceneObjectGroup)e).SendFullAnimUpdateToClient(ControllingClient); |
4040 | } | 4040 | } |
4041 | 4041 | ||
4042 | m_reprioritizationLastPosition = AbsolutePosition; | 4042 | m_reprioritizationLastPosition = AbsolutePosition; |
@@ -4883,18 +4883,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
4883 | Animator.ResetAnimations(); | 4883 | Animator.ResetAnimations(); |
4884 | 4884 | ||
4885 | Overrides.CopyAOPairsFrom(cAgent.MovementAnimationOverRides); | 4885 | Overrides.CopyAOPairsFrom(cAgent.MovementAnimationOverRides); |
4886 | 4886 | int nanim = ControllingClient.NextAnimationSequenceNumber; | |
4887 | // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? | 4887 | // FIXME: Why is this null check necessary? Where are the cases where we get a null Anims object? |
4888 | if (cAgent.DefaultAnim != null) | 4888 | if (cAgent.DefaultAnim != null) |
4889 | { | ||
4890 | if (cAgent.DefaultAnim.SequenceNum > nanim) | ||
4891 | nanim = cAgent.DefaultAnim.SequenceNum; | ||
4889 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); | 4892 | Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); |
4893 | } | ||
4890 | if (cAgent.AnimState != null) | 4894 | if (cAgent.AnimState != null) |
4895 | { | ||
4896 | if (cAgent.AnimState.SequenceNum > nanim) | ||
4897 | nanim = cAgent.AnimState.SequenceNum; | ||
4891 | Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); | 4898 | Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); |
4899 | } | ||
4892 | if (cAgent.Anims != null) | 4900 | if (cAgent.Anims != null) |
4893 | Animator.Animations.FromArray(cAgent.Anims); | 4901 | { |
4902 | int canim = Animator.Animations.FromArray(cAgent.Anims); | ||
4903 | if(canim > nanim) | ||
4904 | nanim = canim; | ||
4905 | } | ||
4906 | ControllingClient.NextAnimationSequenceNumber = ++nanim; | ||
4907 | |||
4894 | if (cAgent.MotionState != 0) | 4908 | if (cAgent.MotionState != 0) |
4895 | Animator.currentControlState = (ScenePresenceAnimator.motionControlStates) cAgent.MotionState; | 4909 | Animator.currentControlState = (ScenePresenceAnimator.motionControlStates) cAgent.MotionState; |
4896 | 4910 | ||
4897 | |||
4898 | crossingFlags = cAgent.CrossingFlags; | 4911 | crossingFlags = cAgent.CrossingFlags; |
4899 | gotCrossUpdate = (crossingFlags != 0); | 4912 | gotCrossUpdate = (crossingFlags != 0); |
4900 | if(gotCrossUpdate) | 4913 | if(gotCrossUpdate) |
@@ -5401,14 +5414,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
5401 | SceneObjectPart[] parts = sog.Parts; | 5414 | SceneObjectPart[] parts = sog.Parts; |
5402 | SceneObjectPart rootpart = sog.RootPart; | 5415 | SceneObjectPart rootpart = sog.RootPart; |
5403 | 5416 | ||
5404 | p.ControllingClient.SendEntityUpdate(rootpart, PrimUpdateFlags.FullUpdate); | 5417 | PrimUpdateFlags update = PrimUpdateFlags.FullUpdate; |
5418 | if (rootpart.Shape.MeshFlagEntry) | ||
5419 | update = PrimUpdateFlags.FullUpdatewithAnim; | ||
5420 | |||
5421 | p.ControllingClient.SendEntityUpdate(rootpart, update); | ||
5405 | 5422 | ||
5406 | for (int i = 0; i < parts.Length; i++) | 5423 | for (int i = 0; i < parts.Length; i++) |
5407 | { | 5424 | { |
5408 | SceneObjectPart part = parts[i]; | 5425 | SceneObjectPart part = parts[i]; |
5409 | if (part == rootpart) | 5426 | if (part == rootpart) |
5410 | continue; | 5427 | continue; |
5411 | p.ControllingClient.SendEntityUpdate(part, PrimUpdateFlags.FullUpdate); | 5428 | p.ControllingClient.SendEntityUpdate(part, update); |
5412 | } | 5429 | } |
5413 | } | 5430 | } |
5414 | 5431 | ||
@@ -5422,51 +5439,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
5422 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; | 5439 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; |
5423 | 5440 | ||
5424 | SceneObjectPart rootpart = sog.RootPart; | 5441 | SceneObjectPart rootpart = sog.RootPart; |
5425 | UpdateRequired rootreq = sog.RootPart.UpdateFlag; | 5442 | PrimUpdateFlags rootreq = sog.RootPart.GetAndClearUpdateFlag(); |
5426 | 5443 | ||
5427 | int j = 0; | 5444 | int j = 0; |
5428 | bool allterse = true; | 5445 | |
5446 | PrimUpdateFlags cur; | ||
5429 | for (int i = 0; i < origparts.Length; i++) | 5447 | for (int i = 0; i < origparts.Length; i++) |
5430 | { | 5448 | { |
5431 | if (origparts[i] != rootpart) | 5449 | if (origparts[i] != rootpart) |
5432 | { | 5450 | { |
5433 | switch (origparts[i].UpdateFlag) | 5451 | cur = origparts[i].GetAndClearUpdateFlag(); |
5434 | { | 5452 | if(cur == PrimUpdateFlags.None) |
5435 | case UpdateRequired.NONE: | 5453 | continue; |
5436 | break; | 5454 | flags[j] = cur; |
5437 | 5455 | parts[j] = origparts[i]; | |
5438 | case UpdateRequired.TERSE: | 5456 | j++; |
5439 | flags[j] = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
5440 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | ||
5441 | parts[j] = origparts[i]; | ||
5442 | j++; | ||
5443 | break; | ||
5444 | |||
5445 | case UpdateRequired.FULL: | ||
5446 | flags[j] = PrimUpdateFlags.FullUpdate; | ||
5447 | allterse = false; | ||
5448 | parts[j] = origparts[i]; | ||
5449 | j++; | ||
5450 | break; | ||
5451 | } | ||
5452 | } | 5457 | } |
5453 | origparts[i].UpdateFlag = 0; | ||
5454 | } | 5458 | } |
5455 | 5459 | ||
5456 | if (j == 0 && rootreq == UpdateRequired.NONE) | 5460 | if (j == 0 && rootreq == PrimUpdateFlags.None) |
5457 | return; | 5461 | return; |
5458 | 5462 | ||
5459 | PrimUpdateFlags rootflag = PrimUpdateFlags.FullUpdate; | ||
5460 | |||
5461 | if (rootreq != UpdateRequired.FULL && allterse) | ||
5462 | { | ||
5463 | rootflag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
5464 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | ||
5465 | } | ||
5466 | |||
5467 | int nparts = j; | 5463 | int nparts = j; |
5468 | 5464 | ||
5469 | ControllingClient.SendEntityUpdate(rootpart, rootflag); | 5465 | ControllingClient.SendEntityUpdate(rootpart, rootreq); |
5470 | 5466 | ||
5471 | for (int i = 0; i < nparts; i++) | 5467 | for (int i = 0; i < nparts; i++) |
5472 | { | 5468 | { |
@@ -5485,7 +5481,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5485 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 5481 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
5486 | continue; | 5482 | continue; |
5487 | 5483 | ||
5488 | p.ControllingClient.SendEntityUpdate(rootpart, rootflag); | 5484 | p.ControllingClient.SendEntityUpdate(rootpart, rootreq); |
5489 | 5485 | ||
5490 | for (int i = 0; i < nparts; i++) | 5486 | for (int i = 0; i < nparts; i++) |
5491 | { | 5487 | { |
@@ -5494,41 +5490,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
5494 | } | 5490 | } |
5495 | } | 5491 | } |
5496 | 5492 | ||
5497 | public void SendAttachmentUpdate(SceneObjectGroup sog, UpdateRequired UpdateFlag) | 5493 | public void SendAttachmentUpdate(SceneObjectGroup sog, PrimUpdateFlags update) |
5498 | { | 5494 | { |
5499 | if (IsChildAgent || IsInTransit) | 5495 | if (IsChildAgent || IsInTransit) |
5500 | return; | 5496 | return; |
5501 | 5497 | ||
5502 | PrimUpdateFlags flag; | ||
5503 | switch (UpdateFlag) | ||
5504 | { | ||
5505 | case UpdateRequired.TERSE: | ||
5506 | flag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
5507 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | ||
5508 | break; | ||
5509 | |||
5510 | case UpdateRequired.FULL: | ||
5511 | flag = PrimUpdateFlags.FullUpdate; | ||
5512 | break; | ||
5513 | |||
5514 | default: | ||
5515 | return; | ||
5516 | } | ||
5517 | |||
5518 | SceneObjectPart[] parts = sog.Parts; | 5498 | SceneObjectPart[] parts = sog.Parts; |
5519 | SceneObjectPart rootpart = sog.RootPart; | 5499 | SceneObjectPart rootpart = sog.RootPart; |
5520 | 5500 | ||
5521 | // rootpart.UpdateFlag = 0; | 5501 | ControllingClient.SendEntityUpdate(rootpart, update); |
5522 | |||
5523 | ControllingClient.SendEntityUpdate(rootpart, flag); | ||
5524 | 5502 | ||
5525 | for (int i = 0; i < parts.Length; i++) | 5503 | for (int i = 0; i < parts.Length; i++) |
5526 | { | 5504 | { |
5527 | SceneObjectPart part = parts[i]; | 5505 | SceneObjectPart part = parts[i]; |
5528 | if (part == rootpart) | 5506 | if (part == rootpart) |
5529 | continue; | 5507 | continue; |
5530 | ControllingClient.SendEntityUpdate(part, flag); | 5508 | ControllingClient.SendEntityUpdate(part, update); |
5531 | // part.UpdateFlag = 0; | ||
5532 | } | 5509 | } |
5533 | 5510 | ||
5534 | if (sog.HasPrivateAttachmentPoint) | 5511 | if (sog.HasPrivateAttachmentPoint) |
@@ -5543,14 +5520,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
5543 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 5520 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
5544 | continue; | 5521 | continue; |
5545 | 5522 | ||
5546 | p.ControllingClient.SendEntityUpdate(rootpart, flag); | 5523 | p.ControllingClient.SendEntityUpdate(rootpart, update); |
5547 | 5524 | ||
5548 | for (int i = 0; i < parts.Length; i++) | 5525 | for (int i = 0; i < parts.Length; i++) |
5549 | { | 5526 | { |
5550 | SceneObjectPart part = parts[i]; | 5527 | SceneObjectPart part = parts[i]; |
5551 | if (part == rootpart) | 5528 | if (part == rootpart) |
5552 | continue; | 5529 | continue; |
5553 | p.ControllingClient.SendEntityUpdate(part, flag); | 5530 | p.ControllingClient.SendEntityUpdate(part, update); |
5554 | } | 5531 | } |
5555 | } | 5532 | } |
5556 | } | 5533 | } |
@@ -5560,24 +5537,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5560 | if (IsChildAgent || IsInTransit) | 5537 | if (IsChildAgent || IsInTransit) |
5561 | return; | 5538 | return; |
5562 | 5539 | ||
5563 | 5540 | PrimUpdateFlags flag = part.GetAndClearUpdateFlag(); | |
5564 | PrimUpdateFlags flag; | ||
5565 | switch (part.UpdateFlag) | ||
5566 | { | ||
5567 | case UpdateRequired.TERSE: | ||
5568 | flag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
5569 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | ||
5570 | break; | ||
5571 | |||
5572 | case UpdateRequired.FULL: | ||
5573 | flag = PrimUpdateFlags.FullUpdate; | ||
5574 | break; | ||
5575 | |||
5576 | default: | ||
5577 | return; | ||
5578 | } | ||
5579 | |||
5580 | part.UpdateFlag = 0; | ||
5581 | 5541 | ||
5582 | ControllingClient.SendEntityUpdate(part, flag); | 5542 | ControllingClient.SendEntityUpdate(part, flag); |
5583 | 5543 | ||
@@ -5597,30 +5557,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
5597 | } | 5557 | } |
5598 | } | 5558 | } |
5599 | 5559 | ||
5600 | 5560 | public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags flag) | |
5601 | public void SendAttachmentUpdate(SceneObjectPart part, UpdateRequired UpdateFlag) | ||
5602 | { | 5561 | { |
5603 | if (IsChildAgent || IsInTransit) | 5562 | if (IsChildAgent || IsInTransit) |
5604 | return; | 5563 | return; |
5605 | 5564 | ||
5606 | PrimUpdateFlags flag; | ||
5607 | switch (UpdateFlag) | ||
5608 | { | ||
5609 | case UpdateRequired.TERSE: | ||
5610 | flag = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | ||
5611 | | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity; | ||
5612 | break; | ||
5613 | |||
5614 | case UpdateRequired.FULL: | ||
5615 | flag = PrimUpdateFlags.FullUpdate; | ||
5616 | break; | ||
5617 | |||
5618 | default: | ||
5619 | return; | ||
5620 | } | ||
5621 | |||
5622 | // part.UpdateFlag = 0; | ||
5623 | |||
5624 | ControllingClient.SendEntityUpdate(part, flag); | 5565 | ControllingClient.SendEntityUpdate(part, flag); |
5625 | 5566 | ||
5626 | if (part.ParentGroup.HasPrivateAttachmentPoint) | 5567 | if (part.ParentGroup.HasPrivateAttachmentPoint) |