diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 215 | ||||
-rw-r--r-- | OpenSim/Framework/Parallel.cs | 8 |
2 files changed, 114 insertions, 109 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 9aa3af1..d304345 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -448,6 +448,10 @@ namespace OpenSim.Framework | |||
448 | public delegate void AvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); | 448 | public delegate void AvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages); |
449 | public delegate void PlacesQuery(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client); | 449 | public delegate void PlacesQuery(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client); |
450 | 450 | ||
451 | public delegate void AgentFOV(IClientAPI client, float verticalAngle); | ||
452 | |||
453 | public delegate double UpdatePriorityHandler(UpdatePriorityData data); | ||
454 | |||
451 | #endregion | 455 | #endregion |
452 | 456 | ||
453 | public struct DirPlacesReplyData | 457 | public struct DirPlacesReplyData |
@@ -519,124 +523,100 @@ namespace OpenSim.Framework | |||
519 | 523 | ||
520 | public struct SendAvatarData | 524 | public struct SendAvatarData |
521 | { | 525 | { |
522 | private ulong m_regionHandle; | 526 | public readonly ulong RegionHandle; |
523 | private string m_firstName; | 527 | public readonly string FirstName; |
524 | private string m_lastName; | 528 | public readonly string LastName; |
525 | private string m_grouptitle; | 529 | public readonly string GroupTitle; |
526 | private UUID m_avatarID; | 530 | public readonly UUID AvatarID; |
527 | private uint m_avatarLocalID; | 531 | public readonly uint AvatarLocalID; |
528 | private Vector3 m_Pos; | 532 | public readonly Vector3 Position; |
529 | private byte[] m_textureEntry; | 533 | public readonly byte[] TextureEntry; |
530 | private uint m_parentID; | 534 | public readonly uint ParentID; |
531 | private Quaternion m_rotation; | 535 | public readonly Quaternion Rotation; |
532 | 536 | ||
533 | public SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, | 537 | public SendAvatarData(ulong regionHandle, string firstName, string lastName, string groupTitle, UUID avatarID, |
534 | uint avatarLocalID, | 538 | uint avatarLocalID, Vector3 position, byte[] textureEntry, uint parentID, Quaternion rotation) |
535 | Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) | ||
536 | { | 539 | { |
537 | this.m_regionHandle = regionHandle; | 540 | RegionHandle = regionHandle; |
538 | this.m_firstName = firstName; | 541 | FirstName = firstName; |
539 | this.m_lastName = lastName; | 542 | LastName = lastName; |
540 | this.m_grouptitle = grouptitle; | 543 | GroupTitle = groupTitle; |
541 | this.m_avatarID = avatarID; | 544 | AvatarID = avatarID; |
542 | this.m_avatarLocalID = avatarLocalID; | 545 | AvatarLocalID = avatarLocalID; |
543 | this.m_Pos = Pos; | 546 | Position = position; |
544 | this.m_textureEntry = textureEntry; | 547 | TextureEntry = textureEntry; |
545 | this.m_parentID = parentID; | 548 | ParentID = parentID; |
546 | this.m_rotation = rotation; | 549 | Rotation = rotation; |
547 | } | 550 | } |
548 | |||
549 | public ulong regionHandle { get { return this.m_regionHandle; } } | ||
550 | public string firstName { get { return this.m_firstName; } } | ||
551 | public string lastName { get { return this.m_lastName; } } | ||
552 | public string grouptitle { get { return this.m_grouptitle; } } | ||
553 | public UUID avatarID { get { return this.m_avatarID; } } | ||
554 | public uint avatarLocalID { get { return this.m_avatarLocalID; } } | ||
555 | public Vector3 Pos { get { return this.m_Pos; } } | ||
556 | public byte[] textureEntry { get { return this.m_textureEntry; } } | ||
557 | public uint parentID { get { return this.m_parentID; } } | ||
558 | public Quaternion rotation { get { return this.m_rotation; } } | ||
559 | } | 551 | } |
560 | 552 | ||
561 | public struct SendAvatarTerseData | 553 | public struct SendAvatarTerseData |
562 | { | 554 | { |
563 | private ulong m_regionHandle; | 555 | public readonly ulong RegionHandle; |
564 | private ushort m_timeDilation; | 556 | public readonly ushort TimeDilation; |
565 | private uint m_localID; | 557 | public readonly uint LocalID; |
566 | private Vector3 m_position; | 558 | public readonly Vector3 Position; |
567 | private Vector3 m_velocity; | 559 | public readonly Vector3 Velocity; |
568 | private Quaternion m_rotation; | 560 | public readonly Vector3 Acceleration; |
569 | private UUID m_agentid; | 561 | public readonly Quaternion Rotation; |
570 | private double m_priority; | 562 | public readonly Vector4 CollisionPlane; |
571 | 563 | public readonly UUID AgentID; | |
572 | public SendAvatarTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, | 564 | public readonly byte[] TextureEntry; |
573 | Vector3 velocity, Quaternion rotation, UUID agentid, double priority) | 565 | public readonly double Priority; |
566 | |||
567 | public SendAvatarTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, Vector3 velocity, | ||
568 | Vector3 acceleration, Quaternion rotation, Vector4 collisionPlane, UUID agentid, byte[] textureEntry, double priority) | ||
574 | { | 569 | { |
575 | this.m_regionHandle = regionHandle; | 570 | RegionHandle = regionHandle; |
576 | this.m_timeDilation = timeDilation; | 571 | TimeDilation = timeDilation; |
577 | this.m_localID = localID; | 572 | LocalID = localID; |
578 | this.m_position = position; | 573 | Position = position; |
579 | this.m_velocity = velocity; | 574 | Velocity = velocity; |
580 | this.m_rotation = rotation; | 575 | Acceleration = acceleration; |
581 | this.m_agentid = agentid; | 576 | Rotation = rotation; |
582 | this.m_priority = priority; | 577 | CollisionPlane = collisionPlane; |
578 | AgentID = agentid; | ||
579 | TextureEntry = textureEntry; | ||
580 | Priority = priority; | ||
583 | } | 581 | } |
584 | |||
585 | public ulong regionHandle { get { return this.m_regionHandle; } } | ||
586 | public ushort timeDilation { get { return this.m_timeDilation; } } | ||
587 | public uint localID { get { return this.m_localID; } } | ||
588 | public Vector3 position { get { return this.m_position; } } | ||
589 | public Vector3 velocity { get { return this.m_velocity; } } | ||
590 | public Quaternion rotation { get { return this.m_rotation; } } | ||
591 | public UUID agentid { get { return this.m_agentid; } } | ||
592 | public double priority { get { return this.m_priority; } } | ||
593 | } | 582 | } |
594 | 583 | ||
595 | public struct SendPrimitiveTerseData | 584 | public struct SendPrimitiveTerseData |
596 | { | 585 | { |
597 | private ulong m_regionHandle; | 586 | public readonly ulong RegionHandle; |
598 | private ushort m_timeDilation; | 587 | public readonly ushort TimeDilation; |
599 | private uint m_localID; | 588 | public readonly uint LocalID; |
600 | private Vector3 m_position; | 589 | public readonly Vector3 Position; |
601 | private Quaternion m_rotation; | 590 | public readonly Quaternion Rotation; |
602 | private Vector3 m_velocity; | 591 | public readonly Vector3 Velocity; |
603 | private Vector3 m_rotationalvelocity; | 592 | public readonly Vector3 Acceleration; |
604 | private byte m_state; | 593 | public readonly Vector3 AngularVelocity; |
605 | private UUID m_AssetId; | 594 | public readonly byte State; |
606 | private UUID m_owner; | 595 | public readonly UUID AssetID; |
607 | private int m_attachPoint; | 596 | public readonly UUID OwnerID; |
608 | private double m_priority; | 597 | public readonly int AttachPoint; |
598 | public readonly byte[] TextureEntry; | ||
599 | public readonly double Priority; | ||
609 | 600 | ||
610 | public SendPrimitiveTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, | 601 | public SendPrimitiveTerseData(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, |
611 | Quaternion rotation, Vector3 velocity, Vector3 rotationalvelocity, byte state, | 602 | Quaternion rotation, Vector3 velocity, Vector3 acceleration, Vector3 rotationalvelocity, byte state, |
612 | UUID AssetId, UUID owner, int attachPoint, double priority) | 603 | UUID assetID, UUID ownerID, int attachPoint, byte[] textureEntry, double priority) |
613 | { | 604 | { |
614 | this.m_regionHandle = regionHandle; | 605 | RegionHandle = regionHandle; |
615 | this.m_timeDilation = timeDilation; | 606 | TimeDilation = timeDilation; |
616 | this.m_localID = localID; | 607 | LocalID = localID; |
617 | this.m_position = position; | 608 | Position = position; |
618 | this.m_rotation = rotation; | 609 | Rotation = rotation; |
619 | this.m_velocity = velocity; | 610 | Velocity = velocity; |
620 | this.m_rotationalvelocity = rotationalvelocity; | 611 | Acceleration = acceleration; |
621 | this.m_state = state; | 612 | AngularVelocity = rotationalvelocity; |
622 | this.m_AssetId = AssetId; | 613 | State = state; |
623 | this.m_owner = owner; | 614 | AssetID = assetID; |
624 | this.m_attachPoint = attachPoint; | 615 | OwnerID = ownerID; |
625 | this.m_priority = priority; | 616 | AttachPoint = attachPoint; |
617 | TextureEntry = textureEntry; | ||
618 | Priority = priority; | ||
626 | } | 619 | } |
627 | |||
628 | public ulong regionHandle { get { return this.m_regionHandle; } } | ||
629 | public ushort timeDilation { get { return this.m_timeDilation; } } | ||
630 | public uint localID { get { return this.m_localID; } } | ||
631 | public Vector3 position { get { return this.m_position; } } | ||
632 | public Quaternion rotation { get { return this.m_rotation; } } | ||
633 | public Vector3 velocity { get { return this.m_velocity; } } | ||
634 | public Vector3 rotationalvelocity { get { return this.m_rotationalvelocity; } } | ||
635 | public byte state { get { return this.m_state; } } | ||
636 | public UUID AssetId { get { return this.m_AssetId; } } | ||
637 | public UUID owner { get { return this.m_owner; } } | ||
638 | public int attachPoint { get { return this.m_attachPoint; } } | ||
639 | public double priority { get { return this.m_priority; } } | ||
640 | } | 620 | } |
641 | 621 | ||
642 | public struct SendPrimitiveData | 622 | public struct SendPrimitiveData |
@@ -650,7 +630,7 @@ namespace OpenSim.Framework | |||
650 | private Vector3 m_acc; | 630 | private Vector3 m_acc; |
651 | private Quaternion m_rotation; | 631 | private Quaternion m_rotation; |
652 | private Vector3 m_rvel; | 632 | private Vector3 m_rvel; |
653 | private uint m_flags; | 633 | private PrimFlags m_flags; |
654 | private UUID m_objectID; | 634 | private UUID m_objectID; |
655 | private UUID m_ownerID; | 635 | private UUID m_ownerID; |
656 | private string m_text; | 636 | private string m_text; |
@@ -695,7 +675,7 @@ namespace OpenSim.Framework | |||
695 | this.m_acc = acc; | 675 | this.m_acc = acc; |
696 | this.m_rotation = rotation; | 676 | this.m_rotation = rotation; |
697 | this.m_rvel = rvel; | 677 | this.m_rvel = rvel; |
698 | this.m_flags = flags; | 678 | this.m_flags = (PrimFlags)flags; |
699 | this.m_objectID = objectID; | 679 | this.m_objectID = objectID; |
700 | this.m_ownerID = ownerID; | 680 | this.m_ownerID = ownerID; |
701 | this.m_text = text; | 681 | this.m_text = text; |
@@ -724,7 +704,7 @@ namespace OpenSim.Framework | |||
724 | public Vector3 acc { get { return this.m_acc; } } | 704 | public Vector3 acc { get { return this.m_acc; } } |
725 | public Quaternion rotation { get { return this.m_rotation; } } | 705 | public Quaternion rotation { get { return this.m_rotation; } } |
726 | public Vector3 rvel { get { return this.m_rvel; } } | 706 | public Vector3 rvel { get { return this.m_rvel; } } |
727 | public uint flags { get { return this.m_flags; } } | 707 | public PrimFlags flags { get { return this.m_flags; } } |
728 | public UUID objectID { get { return this.m_objectID; } } | 708 | public UUID objectID { get { return this.m_objectID; } } |
729 | public UUID ownerID { get { return this.m_ownerID; } } | 709 | public UUID ownerID { get { return this.m_ownerID; } } |
730 | public string text { get { return this.m_text; } } | 710 | public string text { get { return this.m_text; } } |
@@ -744,6 +724,29 @@ namespace OpenSim.Framework | |||
744 | public double priority { get { return this.m_priority; } } | 724 | public double priority { get { return this.m_priority; } } |
745 | } | 725 | } |
746 | 726 | ||
727 | public struct UpdatePriorityData { | ||
728 | private double m_priority; | ||
729 | private uint m_localID; | ||
730 | |||
731 | public UpdatePriorityData(double priority, uint localID) { | ||
732 | this.m_priority = priority; | ||
733 | this.m_localID = localID; | ||
734 | } | ||
735 | |||
736 | public double priority { get { return this.m_priority; } } | ||
737 | public uint localID { get { return this.m_localID; } } | ||
738 | } | ||
739 | |||
740 | [Flags] | ||
741 | public enum StateUpdateTypes | ||
742 | { | ||
743 | None = 0, | ||
744 | AvatarTerse = 1, | ||
745 | PrimitiveTerse = AvatarTerse << 1, | ||
746 | PrimitiveFull = PrimitiveTerse << 1, | ||
747 | All = AvatarTerse | PrimitiveTerse | PrimitiveFull, | ||
748 | } | ||
749 | |||
747 | public interface IClientAPI | 750 | public interface IClientAPI |
748 | { | 751 | { |
749 | Vector3 StartPos { get; set; } | 752 | Vector3 StartPos { get; set; } |
@@ -1118,6 +1121,8 @@ namespace OpenSim.Framework | |||
1118 | 1121 | ||
1119 | void SendPrimTerseUpdate(SendPrimitiveTerseData data); | 1122 | void SendPrimTerseUpdate(SendPrimitiveTerseData data); |
1120 | 1123 | ||
1124 | void ReprioritizeUpdates(StateUpdateTypes type, UpdatePriorityHandler handler); | ||
1125 | |||
1121 | void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, | 1126 | void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, |
1122 | List<InventoryFolderBase> folders, bool fetchFolders, | 1127 | List<InventoryFolderBase> folders, bool fetchFolders, |
1123 | bool fetchItems); | 1128 | bool fetchItems); |
diff --git a/OpenSim/Framework/Parallel.cs b/OpenSim/Framework/Parallel.cs index 6efdad0..cf4f773 100644 --- a/OpenSim/Framework/Parallel.cs +++ b/OpenSim/Framework/Parallel.cs | |||
@@ -36,7 +36,7 @@ namespace OpenSim.Framework | |||
36 | /// </summary> | 36 | /// </summary> |
37 | public static class Parallel | 37 | public static class Parallel |
38 | { | 38 | { |
39 | private static readonly int processorCount = System.Environment.ProcessorCount; | 39 | public static readonly int ProcessorCount = System.Environment.ProcessorCount; |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// Executes a for loop in which iterations may run in parallel | 42 | /// Executes a for loop in which iterations may run in parallel |
@@ -46,7 +46,7 @@ namespace OpenSim.Framework | |||
46 | /// <param name="body">Method body to run for each iteration of the loop</param> | 46 | /// <param name="body">Method body to run for each iteration of the loop</param> |
47 | public static void For(int fromInclusive, int toExclusive, Action<int> body) | 47 | public static void For(int fromInclusive, int toExclusive, Action<int> body) |
48 | { | 48 | { |
49 | For(processorCount, fromInclusive, toExclusive, body); | 49 | For(ProcessorCount, fromInclusive, toExclusive, body); |
50 | } | 50 | } |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
@@ -103,7 +103,7 @@ namespace OpenSim.Framework | |||
103 | /// <param name="body">Method body to run for each object in the collection</param> | 103 | /// <param name="body">Method body to run for each object in the collection</param> |
104 | public static void ForEach<T>(IEnumerable<T> enumerable, Action<T> body) | 104 | public static void ForEach<T>(IEnumerable<T> enumerable, Action<T> body) |
105 | { | 105 | { |
106 | ForEach<T>(processorCount, enumerable, body); | 106 | ForEach<T>(ProcessorCount, enumerable, body); |
107 | } | 107 | } |
108 | 108 | ||
109 | /// <summary> | 109 | /// <summary> |
@@ -161,7 +161,7 @@ namespace OpenSim.Framework | |||
161 | /// <param name="actions">A series of method bodies to execute</param> | 161 | /// <param name="actions">A series of method bodies to execute</param> |
162 | public static void Invoke(params Action[] actions) | 162 | public static void Invoke(params Action[] actions) |
163 | { | 163 | { |
164 | Invoke(processorCount, actions); | 164 | Invoke(ProcessorCount, actions); |
165 | } | 165 | } |
166 | 166 | ||
167 | /// <summary> | 167 | /// <summary> |