diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 187 |
1 files changed, 145 insertions, 42 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 1f7e66d..6129e10 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3561,6 +3561,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3561 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation)); | 3561 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation)); |
3562 | } | 3562 | } |
3563 | 3563 | ||
3564 | /// <summary> | ||
3565 | /// Requeue an EntityUpdate when it was not acknowledged by the client. | ||
3566 | /// We will update the priority and put it in the correct queue, merging update flags | ||
3567 | /// with any other updates that may be queued for the same entity. | ||
3568 | /// The original update time is used for the merged update. | ||
3569 | /// </summary> | ||
3570 | private void ResendPrimUpdate(EntityUpdate update) | ||
3571 | { | ||
3572 | // If the update exists in priority queue, it will be updated. | ||
3573 | // If it does not exist then it will be added with the current (rather than its original) priority | ||
3574 | uint priority = m_prioritizer.GetUpdatePriority(this, update.Entity); | ||
3575 | |||
3576 | lock (m_entityUpdates.SyncRoot) | ||
3577 | m_entityUpdates.Enqueue(priority, update); | ||
3578 | } | ||
3579 | |||
3580 | /// <summary> | ||
3581 | /// Requeue a list of EntityUpdates when they were not acknowledged by the client. | ||
3582 | /// We will update the priority and put it in the correct queue, merging update flags | ||
3583 | /// with any other updates that may be queued for the same entity. | ||
3584 | /// The original update time is used for the merged update. | ||
3585 | /// </summary> | ||
3586 | private void ResendPrimUpdates(List<EntityUpdate> updates, OutgoingPacket oPacket) | ||
3587 | { | ||
3588 | // m_log.WarnFormat("[CLIENT] resending prim update {0}",updates[0].UpdateTime); | ||
3589 | |||
3590 | // Remove the update packet from the list of packets waiting for acknowledgement | ||
3591 | // because we are requeuing the list of updates. They will be resent in new packets | ||
3592 | // with the most recent state and priority. | ||
3593 | m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber); | ||
3594 | |||
3595 | // Count this as a resent packet since we are going to requeue all of the updates contained in it | ||
3596 | Interlocked.Increment(ref m_udpClient.PacketsResent); | ||
3597 | |||
3598 | foreach (EntityUpdate update in updates) | ||
3599 | ResendPrimUpdate(update); | ||
3600 | } | ||
3601 | |||
3564 | private void ProcessEntityUpdates(int maxUpdates) | 3602 | private void ProcessEntityUpdates(int maxUpdates) |
3565 | { | 3603 | { |
3566 | OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); | 3604 | OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); |
@@ -3568,6 +3606,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3568 | OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); | 3606 | OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); |
3569 | OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); | 3607 | OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>(); |
3570 | 3608 | ||
3609 | OpenSim.Framework.Lazy<List<EntityUpdate>> objectUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3610 | OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3611 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3612 | OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); | ||
3613 | |||
3571 | // Check to see if this is a flush | 3614 | // Check to see if this is a flush |
3572 | if (maxUpdates <= 0) | 3615 | if (maxUpdates <= 0) |
3573 | { | 3616 | { |
@@ -3583,7 +3626,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3583 | float avgTimeDilation = 1.0f; | 3626 | float avgTimeDilation = 1.0f; |
3584 | IEntityUpdate iupdate; | 3627 | IEntityUpdate iupdate; |
3585 | Int32 timeinqueue; // this is just debugging code & can be dropped later | 3628 | Int32 timeinqueue; // this is just debugging code & can be dropped later |
3586 | 3629 | ||
3587 | while (updatesThisCall < maxUpdates) | 3630 | while (updatesThisCall < maxUpdates) |
3588 | { | 3631 | { |
3589 | lock (m_entityUpdates.SyncRoot) | 3632 | lock (m_entityUpdates.SyncRoot) |
@@ -3688,24 +3731,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3688 | if (update.Entity is ScenePresence) | 3731 | if (update.Entity is ScenePresence) |
3689 | { | 3732 | { |
3690 | objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); | 3733 | objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); |
3734 | objectUpdates.Value.Add(update); | ||
3691 | } | 3735 | } |
3692 | else | 3736 | else |
3693 | { | 3737 | { |
3694 | objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); | 3738 | objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); |
3739 | objectUpdates.Value.Add(update); | ||
3695 | } | 3740 | } |
3696 | } | 3741 | } |
3697 | else if (!canUseImproved) | 3742 | else if (!canUseImproved) |
3698 | { | 3743 | { |
3699 | compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); | 3744 | compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); |
3745 | compressedUpdates.Value.Add(update); | ||
3700 | } | 3746 | } |
3701 | else | 3747 | else |
3702 | { | 3748 | { |
3703 | if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId) | 3749 | if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId) |
3750 | { | ||
3704 | // Self updates go into a special list | 3751 | // Self updates go into a special list |
3705 | terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); | 3752 | terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); |
3753 | terseAgentUpdates.Value.Add(update); | ||
3754 | } | ||
3706 | else | 3755 | else |
3756 | { | ||
3707 | // Everything else goes here | 3757 | // Everything else goes here |
3708 | terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); | 3758 | terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); |
3759 | terseUpdates.Value.Add(update); | ||
3760 | } | ||
3709 | } | 3761 | } |
3710 | 3762 | ||
3711 | #endregion Block Construction | 3763 | #endregion Block Construction |
@@ -3713,28 +3765,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3713 | 3765 | ||
3714 | 3766 | ||
3715 | #region Packet Sending | 3767 | #region Packet Sending |
3716 | |||
3717 | //const float TIME_DILATION = 1.0f; | ||
3718 | |||
3719 | |||
3720 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); | 3768 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); |
3721 | 3769 | ||
3722 | if (terseAgentUpdateBlocks.IsValueCreated) | 3770 | if (terseAgentUpdateBlocks.IsValueCreated) |
3723 | { | 3771 | { |
3724 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | 3772 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; |
3725 | 3773 | ||
3726 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 3774 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); |
3727 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3775 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3728 | packet.RegionData.TimeDilation = timeDilation; | 3776 | packet.RegionData.TimeDilation = timeDilation; |
3729 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 3777 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; |
3730 | 3778 | ||
3731 | for (int i = 0; i < blocks.Count; i++) | 3779 | for (int i = 0; i < blocks.Count; i++) |
3732 | packet.ObjectData[i] = blocks[i]; | 3780 | packet.ObjectData[i] = blocks[i]; |
3733 | 3781 | // If any of the packets created from this call go unacknowledged, all of the updates will be resent | |
3734 | 3782 | OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseAgentUpdates.Value, oPacket); }); | |
3735 | OutPacket(packet, ThrottleOutPacketType.Unknown, true); | ||
3736 | } | 3783 | } |
3737 | 3784 | ||
3738 | if (objectUpdateBlocks.IsValueCreated) | 3785 | if (objectUpdateBlocks.IsValueCreated) |
3739 | { | 3786 | { |
3740 | List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value; | 3787 | List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value; |
@@ -3746,8 +3793,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3746 | 3793 | ||
3747 | for (int i = 0; i < blocks.Count; i++) | 3794 | for (int i = 0; i < blocks.Count; i++) |
3748 | packet.ObjectData[i] = blocks[i]; | 3795 | packet.ObjectData[i] = blocks[i]; |
3749 | 3796 | // If any of the packets created from this call go unacknowledged, all of the updates will be resent | |
3750 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 3797 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(objectUpdates.Value, oPacket); }); |
3751 | } | 3798 | } |
3752 | 3799 | ||
3753 | if (compressedUpdateBlocks.IsValueCreated) | 3800 | if (compressedUpdateBlocks.IsValueCreated) |
@@ -3761,10 +3808,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3761 | 3808 | ||
3762 | for (int i = 0; i < blocks.Count; i++) | 3809 | for (int i = 0; i < blocks.Count; i++) |
3763 | packet.ObjectData[i] = blocks[i]; | 3810 | packet.ObjectData[i] = blocks[i]; |
3764 | 3811 | // If any of the packets created from this call go unacknowledged, all of the updates will be resent | |
3765 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 3812 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(compressedUpdates.Value, oPacket); }); |
3766 | } | 3813 | } |
3767 | 3814 | ||
3768 | if (terseUpdateBlocks.IsValueCreated) | 3815 | if (terseUpdateBlocks.IsValueCreated) |
3769 | { | 3816 | { |
3770 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; | 3817 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; |
@@ -3776,8 +3823,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3776 | 3823 | ||
3777 | for (int i = 0; i < blocks.Count; i++) | 3824 | for (int i = 0; i < blocks.Count; i++) |
3778 | packet.ObjectData[i] = blocks[i]; | 3825 | packet.ObjectData[i] = blocks[i]; |
3779 | 3826 | // If any of the packets created from this call go unacknowledged, all of the updates will be resent | |
3780 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 3827 | OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); |
3781 | } | 3828 | } |
3782 | } | 3829 | } |
3783 | 3830 | ||
@@ -3969,7 +4016,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3969 | { | 4016 | { |
3970 | SendFamilyProps = SendFamilyProps || update.SendFamilyProps; | 4017 | SendFamilyProps = SendFamilyProps || update.SendFamilyProps; |
3971 | SendObjectProps = SendObjectProps || update.SendObjectProps; | 4018 | SendObjectProps = SendObjectProps || update.SendObjectProps; |
3972 | Flags |= update.Flags; | 4019 | // other properties may need to be updated by base class |
4020 | base.Update(update); | ||
3973 | } | 4021 | } |
3974 | } | 4022 | } |
3975 | 4023 | ||
@@ -3980,6 +4028,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3980 | m_entityProps.Enqueue(priority, new ObjectPropertyUpdate(entity,requestFlags,true,false)); | 4028 | m_entityProps.Enqueue(priority, new ObjectPropertyUpdate(entity,requestFlags,true,false)); |
3981 | } | 4029 | } |
3982 | 4030 | ||
4031 | private void ResendPropertyUpdate(ObjectPropertyUpdate update) | ||
4032 | { | ||
4033 | uint priority = 0; | ||
4034 | lock (m_entityProps.SyncRoot) | ||
4035 | m_entityProps.Enqueue(priority, update); | ||
4036 | } | ||
4037 | |||
4038 | private void ResendPropertyUpdates(List<ObjectPropertyUpdate> updates, OutgoingPacket oPacket) | ||
4039 | { | ||
4040 | // m_log.WarnFormat("[CLIENT] resending object property {0}",updates[0].UpdateTime); | ||
4041 | |||
4042 | // Remove the update packet from the list of packets waiting for acknowledgement | ||
4043 | // because we are requeuing the list of updates. They will be resent in new packets | ||
4044 | // with the most recent state. | ||
4045 | m_udpClient.NeedAcks.Remove(oPacket.SequenceNumber); | ||
4046 | |||
4047 | // Count this as a resent packet since we are going to requeue all of the updates contained in it | ||
4048 | Interlocked.Increment(ref m_udpClient.PacketsResent); | ||
4049 | |||
4050 | foreach (ObjectPropertyUpdate update in updates) | ||
4051 | ResendPropertyUpdate(update); | ||
4052 | } | ||
4053 | |||
3983 | public void SendObjectPropertiesReply(ISceneEntity entity) | 4054 | public void SendObjectPropertiesReply(ISceneEntity entity) |
3984 | { | 4055 | { |
3985 | uint priority = 0; // time based ordering only | 4056 | uint priority = 0; // time based ordering only |
@@ -3995,6 +4066,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3995 | OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>> objectPropertiesBlocks = | 4066 | OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>> objectPropertiesBlocks = |
3996 | new OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>>(); | 4067 | new OpenSim.Framework.Lazy<List<ObjectPropertiesPacket.ObjectDataBlock>>(); |
3997 | 4068 | ||
4069 | OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> familyUpdates = | ||
4070 | new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); | ||
4071 | |||
4072 | OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>> propertyUpdates = | ||
4073 | new OpenSim.Framework.Lazy<List<ObjectPropertyUpdate>>(); | ||
4074 | |||
3998 | IEntityUpdate iupdate; | 4075 | IEntityUpdate iupdate; |
3999 | Int32 timeinqueue; // this is just debugging code & can be dropped later | 4076 | Int32 timeinqueue; // this is just debugging code & can be dropped later |
4000 | 4077 | ||
@@ -4013,6 +4090,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4013 | SceneObjectPart sop = (SceneObjectPart)update.Entity; | 4090 | SceneObjectPart sop = (SceneObjectPart)update.Entity; |
4014 | ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesFamilyBlock(sop,update.Flags); | 4091 | ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesFamilyBlock(sop,update.Flags); |
4015 | objectFamilyBlocks.Value.Add(objPropDB); | 4092 | objectFamilyBlocks.Value.Add(objPropDB); |
4093 | familyUpdates.Value.Add(update); | ||
4016 | } | 4094 | } |
4017 | } | 4095 | } |
4018 | 4096 | ||
@@ -4023,6 +4101,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4023 | SceneObjectPart sop = (SceneObjectPart)update.Entity; | 4101 | SceneObjectPart sop = (SceneObjectPart)update.Entity; |
4024 | ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); | 4102 | ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop); |
4025 | objectPropertiesBlocks.Value.Add(objPropDB); | 4103 | objectPropertiesBlocks.Value.Add(objPropDB); |
4104 | propertyUpdates.Value.Add(update); | ||
4026 | } | 4105 | } |
4027 | } | 4106 | } |
4028 | 4107 | ||
@@ -4030,12 +4109,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4030 | } | 4109 | } |
4031 | 4110 | ||
4032 | 4111 | ||
4033 | Int32 ppcnt = 0; | 4112 | // Int32 ppcnt = 0; |
4034 | Int32 pbcnt = 0; | 4113 | // Int32 pbcnt = 0; |
4035 | 4114 | ||
4036 | if (objectPropertiesBlocks.IsValueCreated) | 4115 | if (objectPropertiesBlocks.IsValueCreated) |
4037 | { | 4116 | { |
4038 | List<ObjectPropertiesPacket.ObjectDataBlock> blocks = objectPropertiesBlocks.Value; | 4117 | List<ObjectPropertiesPacket.ObjectDataBlock> blocks = objectPropertiesBlocks.Value; |
4118 | List<ObjectPropertyUpdate> updates = propertyUpdates.Value; | ||
4039 | 4119 | ||
4040 | ObjectPropertiesPacket packet = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); | 4120 | ObjectPropertiesPacket packet = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); |
4041 | packet.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[blocks.Count]; | 4121 | packet.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[blocks.Count]; |
@@ -4043,28 +4123,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4043 | packet.ObjectData[i] = blocks[i]; | 4123 | packet.ObjectData[i] = blocks[i]; |
4044 | 4124 | ||
4045 | packet.Header.Zerocoded = true; | 4125 | packet.Header.Zerocoded = true; |
4046 | OutPacket(packet, ThrottleOutPacketType.Task, true); | ||
4047 | 4126 | ||
4048 | pbcnt += blocks.Count; | 4127 | // Pass in the delegate so that if this packet needs to be resent, we send the current properties |
4049 | ppcnt++; | 4128 | // of the object rather than the properties when the packet was created |
4129 | OutPacket(packet, ThrottleOutPacketType.Task, true, | ||
4130 | delegate(OutgoingPacket oPacket) | ||
4131 | { | ||
4132 | ResendPropertyUpdates(updates, oPacket); | ||
4133 | }); | ||
4134 | |||
4135 | // pbcnt += blocks.Count; | ||
4136 | // ppcnt++; | ||
4050 | } | 4137 | } |
4051 | 4138 | ||
4052 | Int32 fpcnt = 0; | 4139 | // Int32 fpcnt = 0; |
4053 | Int32 fbcnt = 0; | 4140 | // Int32 fbcnt = 0; |
4054 | 4141 | ||
4055 | if (objectFamilyBlocks.IsValueCreated) | 4142 | if (objectFamilyBlocks.IsValueCreated) |
4056 | { | 4143 | { |
4057 | List<ObjectPropertiesFamilyPacket.ObjectDataBlock> blocks = objectFamilyBlocks.Value; | 4144 | List<ObjectPropertiesFamilyPacket.ObjectDataBlock> blocks = objectFamilyBlocks.Value; |
4058 | 4145 | ||
4059 | // ObjectPropertiesFamilyPacket objPropFamilyPack = | ||
4060 | // (ObjectPropertiesFamilyPacket)PacketPool.Instance.GetPacket(PacketType.ObjectPropertiesFamily); | ||
4061 | // | ||
4062 | // objPropFamilyPack.ObjectData = new ObjectPropertiesFamilyPacket.ObjectDataBlock[blocks.Count]; | ||
4063 | // for (int i = 0; i < blocks.Count; i++) | ||
4064 | // objPropFamilyPack.ObjectData[i] = blocks[i]; | ||
4065 | // | ||
4066 | // OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task, true); | ||
4067 | |||
4068 | // one packet per object block... uggh... | 4146 | // one packet per object block... uggh... |
4069 | for (int i = 0; i < blocks.Count; i++) | 4147 | for (int i = 0; i < blocks.Count; i++) |
4070 | { | 4148 | { |
@@ -4073,10 +4151,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4073 | 4151 | ||
4074 | packet.ObjectData = blocks[i]; | 4152 | packet.ObjectData = blocks[i]; |
4075 | packet.Header.Zerocoded = true; | 4153 | packet.Header.Zerocoded = true; |
4076 | OutPacket(packet, ThrottleOutPacketType.Task); | ||
4077 | 4154 | ||
4078 | fpcnt++; | 4155 | // Pass in the delegate so that if this packet needs to be resent, we send the current properties |
4079 | fbcnt++; | 4156 | // of the object rather than the properties when the packet was created |
4157 | List<ObjectPropertyUpdate> updates = new List<ObjectPropertyUpdate>(); | ||
4158 | updates.Add(familyUpdates.Value[i]); | ||
4159 | OutPacket(packet, ThrottleOutPacketType.Task, true, | ||
4160 | delegate(OutgoingPacket oPacket) | ||
4161 | { | ||
4162 | ResendPropertyUpdates(updates, oPacket); | ||
4163 | }); | ||
4164 | |||
4165 | // fpcnt++; | ||
4166 | // fbcnt++; | ||
4080 | } | 4167 | } |
4081 | 4168 | ||
4082 | } | 4169 | } |
@@ -4113,7 +4200,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4113 | 4200 | ||
4114 | return block; | 4201 | return block; |
4115 | } | 4202 | } |
4116 | 4203 | ||
4117 | private ObjectPropertiesPacket.ObjectDataBlock CreateObjectPropertiesBlock(SceneObjectPart sop) | 4204 | private ObjectPropertiesPacket.ObjectDataBlock CreateObjectPropertiesBlock(SceneObjectPart sop) |
4118 | { | 4205 | { |
4119 | //ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); | 4206 | //ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); |
@@ -11363,6 +11450,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11363 | /// handles splitting manually</param> | 11450 | /// handles splitting manually</param> |
11364 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) | 11451 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) |
11365 | { | 11452 | { |
11453 | OutPacket(packet, throttlePacketType, doAutomaticSplitting, null); | ||
11454 | } | ||
11455 | |||
11456 | /// <summary> | ||
11457 | /// This is the starting point for sending a simulator packet out to the client | ||
11458 | /// </summary> | ||
11459 | /// <param name="packet">Packet to send</param> | ||
11460 | /// <param name="throttlePacketType">Throttling category for the packet</param> | ||
11461 | /// <param name="doAutomaticSplitting">True to automatically split oversized | ||
11462 | /// packets (the default), or false to disable splitting if the calling code | ||
11463 | /// handles splitting manually</param> | ||
11464 | /// <param name="method">The method to be called in the event this packet is reliable | ||
11465 | /// and unacknowledged. The server will provide normal resend capability if you do not | ||
11466 | /// provide your own method.</param> | ||
11467 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method) | ||
11468 | { | ||
11366 | if (m_debugPacketLevel > 0) | 11469 | if (m_debugPacketLevel > 0) |
11367 | { | 11470 | { |
11368 | bool logPacket = true; | 11471 | bool logPacket = true; |
@@ -11388,7 +11491,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11388 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); | 11491 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); |
11389 | } | 11492 | } |
11390 | 11493 | ||
11391 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); | 11494 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); |
11392 | } | 11495 | } |
11393 | 11496 | ||
11394 | public bool AddMoney(int debit) | 11497 | public bool AddMoney(int debit) |