diff options
author | unknown | 2010-05-12 15:59:48 -0700 |
---|---|---|
committer | unknown | 2010-05-12 15:59:48 -0700 |
commit | bf5c81d77e492cd6df5517ecab32cd64168b01c2 (patch) | |
tree | ecbbfded19609dc8bcd39c0a8adea705c192fdb3 /OpenSim/Framework/IClientAPI.cs | |
parent | Removed the unreferenced MaxPrimsPerFrame from OpenSim.ini.example (diff) | |
download | opensim-SC_OLD-bf5c81d77e492cd6df5517ecab32cd64168b01c2.zip opensim-SC_OLD-bf5c81d77e492cd6df5517ecab32cd64168b01c2.tar.gz opensim-SC_OLD-bf5c81d77e492cd6df5517ecab32cd64168b01c2.tar.bz2 opensim-SC_OLD-bf5c81d77e492cd6df5517ecab32cd64168b01c2.tar.xz |
* Initial commit of the slimupdates2 rewrite. This pass maintains the original behavior of avatar update sending and has a simplified set of IClientAPI methods for sending avatar/prim updates
Diffstat (limited to 'OpenSim/Framework/IClientAPI.cs')
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 258 |
1 files changed, 41 insertions, 217 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 01daeb1..00681cf 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -571,207 +571,6 @@ namespace OpenSim.Framework | |||
571 | public float dwell; | 571 | public float dwell; |
572 | } | 572 | } |
573 | 573 | ||
574 | public struct SendAvatarData | ||
575 | { | ||
576 | public readonly ulong RegionHandle; | ||
577 | public readonly string FirstName; | ||
578 | public readonly string LastName; | ||
579 | public readonly string GroupTitle; | ||
580 | public readonly UUID AvatarID; | ||
581 | public readonly uint AvatarLocalID; | ||
582 | public readonly Vector3 Position; | ||
583 | public readonly byte[] TextureEntry; | ||
584 | public readonly uint ParentID; | ||
585 | public readonly Quaternion Rotation; | ||
586 | |||
587 | public SendAvatarData(ulong regionHandle, string firstName, string lastName, string groupTitle, UUID avatarID, | ||
588 | uint avatarLocalID, Vector3 position, byte[] textureEntry, uint parentID, Quaternion rotation) | ||
589 | { | ||
590 | RegionHandle = regionHandle; | ||
591 | FirstName = firstName; | ||
592 | LastName = lastName; | ||
593 | GroupTitle = groupTitle; | ||
594 | AvatarID = avatarID; | ||
595 | AvatarLocalID = avatarLocalID; | ||
596 | Position = position; | ||
597 | TextureEntry = textureEntry; | ||
598 | ParentID = parentID; | ||
599 | Rotation = rotation; | ||
600 | } | ||
601 | } | ||
602 | |||
603 | public struct SendAvatarTerseData | ||
604 | { | ||
605 | public readonly ulong RegionHandle; | ||
606 | public readonly ushort TimeDilation; | ||
607 | public readonly uint LocalID; | ||
608 | public readonly Vector3 Position; | ||
609 | public readonly Vector3 Velocity; | ||
610 | public readonly Vector3 Acceleration; | ||
611 | public readonly Quaternion Rotation; | ||
612 | public readonly Vector4 CollisionPlane; | ||
613 | public readonly UUID AgentID; | ||
614 | public readonly byte[] TextureEntry; | ||
615 | public readonly double Priority; | ||
616 | |||
617 | public SendAvatarTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, Vector3 velocity, | ||
618 | Vector3 acceleration, Quaternion rotation, Vector4 collisionPlane, UUID agentid, byte[] textureEntry, double priority) | ||
619 | { | ||
620 | RegionHandle = regionHandle; | ||
621 | TimeDilation = timeDilation; | ||
622 | LocalID = localID; | ||
623 | Position = position; | ||
624 | Velocity = velocity; | ||
625 | Acceleration = acceleration; | ||
626 | Rotation = rotation; | ||
627 | CollisionPlane = collisionPlane; | ||
628 | AgentID = agentid; | ||
629 | TextureEntry = textureEntry; | ||
630 | Priority = priority; | ||
631 | } | ||
632 | } | ||
633 | |||
634 | public struct SendPrimitiveTerseData | ||
635 | { | ||
636 | public readonly ulong RegionHandle; | ||
637 | public readonly ushort TimeDilation; | ||
638 | public readonly uint LocalID; | ||
639 | public readonly Vector3 Position; | ||
640 | public readonly Quaternion Rotation; | ||
641 | public readonly Vector3 Velocity; | ||
642 | public readonly Vector3 Acceleration; | ||
643 | public readonly Vector3 AngularVelocity; | ||
644 | public readonly UUID AssetID; | ||
645 | public readonly UUID OwnerID; | ||
646 | public readonly int AttachPoint; | ||
647 | public readonly byte[] TextureEntry; | ||
648 | public readonly double Priority; | ||
649 | |||
650 | public SendPrimitiveTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, | ||
651 | Quaternion rotation, Vector3 velocity, Vector3 acceleration, Vector3 rotationalvelocity, | ||
652 | UUID assetID, UUID ownerID, int attachPoint, byte[] textureEntry, double priority) | ||
653 | { | ||
654 | RegionHandle = regionHandle; | ||
655 | TimeDilation = timeDilation; | ||
656 | LocalID = localID; | ||
657 | Position = position; | ||
658 | Rotation = rotation; | ||
659 | Velocity = velocity; | ||
660 | Acceleration = acceleration; | ||
661 | AngularVelocity = rotationalvelocity; | ||
662 | AssetID = assetID; | ||
663 | OwnerID = ownerID; | ||
664 | AttachPoint = attachPoint; | ||
665 | TextureEntry = textureEntry; | ||
666 | Priority = priority; | ||
667 | } | ||
668 | } | ||
669 | |||
670 | public struct SendPrimitiveData | ||
671 | { | ||
672 | private ulong m_regionHandle; | ||
673 | private ushort m_timeDilation; | ||
674 | private uint m_localID; | ||
675 | private PrimitiveBaseShape m_primShape; | ||
676 | private Vector3 m_pos; | ||
677 | private Vector3 m_vel; | ||
678 | private Vector3 m_acc; | ||
679 | private Quaternion m_rotation; | ||
680 | private Vector3 m_rvel; | ||
681 | private PrimFlags m_flags; | ||
682 | private UUID m_objectID; | ||
683 | private UUID m_ownerID; | ||
684 | private string m_text; | ||
685 | private byte[] m_color; | ||
686 | private uint m_parentID; | ||
687 | private byte[] m_particleSystem; | ||
688 | private byte m_clickAction; | ||
689 | private byte m_material; | ||
690 | private byte[] m_textureanim; | ||
691 | private bool m_attachment; | ||
692 | private uint m_AttachPoint; | ||
693 | private UUID m_AssetId; | ||
694 | private UUID m_SoundId; | ||
695 | private double m_SoundVolume; | ||
696 | private byte m_SoundFlags; | ||
697 | private double m_SoundRadius; | ||
698 | private double m_priority; | ||
699 | |||
700 | public SendPrimitiveData(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, | ||
701 | Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, | ||
702 | uint flags, UUID objectID, UUID ownerID, string text, byte[] color, | ||
703 | uint parentID, byte[] particleSystem, byte clickAction, byte material, double priority) : | ||
704 | this(regionHandle, timeDilation, localID, primShape, pos, vel, acc, rotation, rvel, flags, objectID, | ||
705 | ownerID, text, color, parentID, particleSystem, clickAction, material, new byte[0], false, 0, UUID.Zero, | ||
706 | UUID.Zero, 0, 0, 0, priority) { } | ||
707 | |||
708 | public SendPrimitiveData(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, | ||
709 | Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, | ||
710 | uint flags, | ||
711 | UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, | ||
712 | byte[] particleSystem, | ||
713 | byte clickAction, byte material, byte[] textureanim, bool attachment, | ||
714 | uint AttachPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, | ||
715 | double SoundRadius, double priority) | ||
716 | { | ||
717 | this.m_regionHandle = regionHandle; | ||
718 | this.m_timeDilation = timeDilation; | ||
719 | this.m_localID = localID; | ||
720 | this.m_primShape = primShape; | ||
721 | this.m_pos = pos; | ||
722 | this.m_vel = vel; | ||
723 | this.m_acc = acc; | ||
724 | this.m_rotation = rotation; | ||
725 | this.m_rvel = rvel; | ||
726 | this.m_flags = (PrimFlags)flags; | ||
727 | this.m_objectID = objectID; | ||
728 | this.m_ownerID = ownerID; | ||
729 | this.m_text = text; | ||
730 | this.m_color = color; | ||
731 | this.m_parentID = parentID; | ||
732 | this.m_particleSystem = particleSystem; | ||
733 | this.m_clickAction = clickAction; | ||
734 | this.m_material = material; | ||
735 | this.m_textureanim = textureanim; | ||
736 | this.m_attachment = attachment; | ||
737 | this.m_AttachPoint = AttachPoint; | ||
738 | this.m_AssetId = AssetId; | ||
739 | this.m_SoundId = SoundId; | ||
740 | this.m_SoundVolume = SoundVolume; | ||
741 | this.m_SoundFlags = SoundFlags; | ||
742 | this.m_SoundRadius = SoundRadius; | ||
743 | this.m_priority = priority; | ||
744 | } | ||
745 | |||
746 | public ulong regionHandle { get { return this.m_regionHandle; } } | ||
747 | public ushort timeDilation { get { return this.m_timeDilation; } } | ||
748 | public uint localID { get { return this.m_localID; } } | ||
749 | public PrimitiveBaseShape primShape { get { return this.m_primShape; } } | ||
750 | public Vector3 pos { get { return this.m_pos; } } | ||
751 | public Vector3 vel { get { return this.m_vel; } } | ||
752 | public Vector3 acc { get { return this.m_acc; } } | ||
753 | public Quaternion rotation { get { return this.m_rotation; } } | ||
754 | public Vector3 rvel { get { return this.m_rvel; } } | ||
755 | public PrimFlags flags { get { return this.m_flags; } } | ||
756 | public UUID objectID { get { return this.m_objectID; } } | ||
757 | public UUID ownerID { get { return this.m_ownerID; } } | ||
758 | public string text { get { return this.m_text; } } | ||
759 | public byte[] color { get { return this.m_color; } } | ||
760 | public uint parentID { get { return this.m_parentID; } } | ||
761 | public byte[] particleSystem { get { return this.m_particleSystem; } } | ||
762 | public byte clickAction { get { return this.m_clickAction; } } | ||
763 | public byte material { get { return this.m_material; } } | ||
764 | public byte[] textureanim { get { return this.m_textureanim; } } | ||
765 | public bool attachment { get { return this.m_attachment; } } | ||
766 | public uint AttachPoint { get { return this.m_AttachPoint; } } | ||
767 | public UUID AssetId { get { return this.m_AssetId; } } | ||
768 | public UUID SoundId { get { return this.m_SoundId; } } | ||
769 | public double SoundVolume { get { return this.m_SoundVolume; } } | ||
770 | public byte SoundFlags { get { return this.m_SoundFlags; } } | ||
771 | public double SoundRadius { get { return this.m_SoundRadius; } } | ||
772 | public double priority { get { return this.m_priority; } } | ||
773 | } | ||
774 | |||
775 | public struct UpdatePriorityData { | 574 | public struct UpdatePriorityData { |
776 | private double m_priority; | 575 | private double m_priority; |
777 | private uint m_localID; | 576 | private uint m_localID; |
@@ -785,14 +584,46 @@ namespace OpenSim.Framework | |||
785 | public uint localID { get { return this.m_localID; } } | 584 | public uint localID { get { return this.m_localID; } } |
786 | } | 585 | } |
787 | 586 | ||
587 | /// <summary> | ||
588 | /// Specifies the fields that have been changed when sending a prim or | ||
589 | /// avatar update | ||
590 | /// </summary> | ||
788 | [Flags] | 591 | [Flags] |
789 | public enum StateUpdateTypes | 592 | public enum PrimUpdateFlags : uint |
790 | { | 593 | { |
791 | None = 0, | 594 | None = 0, |
792 | AvatarTerse = 1, | 595 | AttachmentPoint = 1 << 0, |
793 | PrimitiveTerse = AvatarTerse << 1, | 596 | Material = 1 << 1, |
794 | PrimitiveFull = PrimitiveTerse << 1, | 597 | ClickAction = 1 << 2, |
795 | All = AvatarTerse | PrimitiveTerse | PrimitiveFull, | 598 | Scale = 1 << 3, |
599 | ParentID = 1 << 4, | ||
600 | PrimFlags = 1 << 5, | ||
601 | PrimData = 1 << 6, | ||
602 | MediaURL = 1 << 7, | ||
603 | ScratchPad = 1 << 8, | ||
604 | Textures = 1 << 9, | ||
605 | TextureAnim = 1 << 10, | ||
606 | NameValue = 1 << 11, | ||
607 | Position = 1 << 12, | ||
608 | Rotation = 1 << 13, | ||
609 | Velocity = 1 << 14, | ||
610 | Acceleration = 1 << 15, | ||
611 | AngularVelocity = 1 << 16, | ||
612 | CollisionPlane = 1 << 17, | ||
613 | Text = 1 << 18, | ||
614 | Particles = 1 << 19, | ||
615 | ExtraData = 1 << 20, | ||
616 | Sound = 1 << 21, | ||
617 | Joint = 1 << 22, | ||
618 | FullUpdate = UInt32.MaxValue | ||
619 | } | ||
620 | |||
621 | public static class PrimUpdateFlagsExtensions | ||
622 | { | ||
623 | public static bool HasFlag(this PrimUpdateFlags updateFlags, PrimUpdateFlags flag) | ||
624 | { | ||
625 | return (updateFlags & flag) == flag; | ||
626 | } | ||
796 | } | 627 | } |
797 | 628 | ||
798 | public interface IClientAPI | 629 | public interface IClientAPI |
@@ -1186,27 +1017,20 @@ namespace OpenSim.Framework | |||
1186 | void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); | 1017 | void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); |
1187 | void SendPayPrice(UUID objectID, int[] payPrice); | 1018 | void SendPayPrice(UUID objectID, int[] payPrice); |
1188 | 1019 | ||
1189 | void SendAvatarData(SendAvatarData data); | ||
1190 | |||
1191 | void SendAvatarTerseUpdate(SendAvatarTerseData data); | ||
1192 | |||
1193 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); | 1020 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); |
1194 | 1021 | ||
1195 | void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID); | 1022 | void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID); |
1196 | void SetChildAgentThrottle(byte[] throttle); | 1023 | void SetChildAgentThrottle(byte[] throttle); |
1197 | 1024 | ||
1198 | void SendPrimitiveToClient(SendPrimitiveData data); | 1025 | void SendAvatarDataImmediate(ISceneEntity avatar); |
1199 | 1026 | void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags); | |
1200 | void SendPrimTerseUpdate(SendPrimitiveTerseData data); | 1027 | void ReprioritizeUpdates(UpdatePriorityHandler handler); |
1201 | 1028 | void FlushPrimUpdates(); | |
1202 | void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler); | ||
1203 | 1029 | ||
1204 | void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, | 1030 | void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, |
1205 | List<InventoryFolderBase> folders, int version, bool fetchFolders, | 1031 | List<InventoryFolderBase> folders, int version, bool fetchFolders, |
1206 | bool fetchItems); | 1032 | bool fetchItems); |
1207 | 1033 | ||
1208 | void FlushPrimUpdates(); | ||
1209 | |||
1210 | void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item); | 1034 | void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item); |
1211 | 1035 | ||
1212 | /// <summary> | 1036 | /// <summary> |