diff options
author | UbitUmarov | 2017-06-13 14:09:34 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-13 14:09:34 +0100 |
commit | fd8836e49393415524abedc00de3c8cacf9f529a (patch) | |
tree | 052d63a88dc1334fd156bdccc692b98716523b22 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |
parent | some cleanup (diff) | |
download | opensim-SC-fd8836e49393415524abedc00de3c8cacf9f529a.zip opensim-SC-fd8836e49393415524abedc00de3c8cacf9f529a.tar.gz opensim-SC-fd8836e49393415524abedc00de3c8cacf9f529a.tar.bz2 opensim-SC-fd8836e49393415524abedc00de3c8cacf9f529a.tar.xz |
dont let time go back
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f13b259..1118bb6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -8030,19 +8030,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8030 | return true; | 8030 | return true; |
8031 | } | 8031 | } |
8032 | 8032 | ||
8033 | Dictionary<uint, uint> objImageSeqs = null; | ||
8034 | double lastobjImageSeqsMS = 0.0; | ||
8035 | |||
8033 | private bool HandleObjectImage(IClientAPI sender, Packet Pack) | 8036 | private bool HandleObjectImage(IClientAPI sender, Packet Pack) |
8034 | { | 8037 | { |
8035 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; | 8038 | ObjectImagePacket imagePack = (ObjectImagePacket)Pack; |
8036 | 8039 | ||
8037 | UpdatePrimTexture handlerUpdatePrimTexture = null; | 8040 | UpdatePrimTexture handlerUpdatePrimTexture = OnUpdatePrimTexture; |
8041 | if (handlerUpdatePrimTexture == null) | ||
8042 | return true; | ||
8043 | |||
8044 | double now = Util.GetTimeStampMS(); | ||
8045 | if(objImageSeqs == null) | ||
8046 | objImageSeqs = new Dictionary<uint, uint>(16); | ||
8047 | else | ||
8048 | { | ||
8049 | if ( now - lastobjImageSeqsMS > 30000.0) | ||
8050 | objImageSeqs.Clear(); | ||
8051 | } | ||
8052 | |||
8053 | lastobjImageSeqsMS = now; | ||
8054 | uint seq = Pack.Header.Sequence; | ||
8055 | uint id; | ||
8056 | uint lastseq; | ||
8057 | |||
8058 | ObjectImagePacket.ObjectDataBlock o; | ||
8038 | for (int i = 0; i < imagePack.ObjectData.Length; i++) | 8059 | for (int i = 0; i < imagePack.ObjectData.Length; i++) |
8039 | { | 8060 | { |
8040 | handlerUpdatePrimTexture = OnUpdatePrimTexture; | 8061 | o = imagePack.ObjectData[i]; |
8041 | if (handlerUpdatePrimTexture != null) | 8062 | id = o.ObjectLocalID; |
8042 | { | 8063 | if(objImageSeqs.TryGetValue(id, out lastseq)) |
8043 | handlerUpdatePrimTexture(imagePack.ObjectData[i].ObjectLocalID, | 8064 | { |
8044 | imagePack.ObjectData[i].TextureEntry, this); | 8065 | if(seq <= lastseq) |
8045 | } | 8066 | continue; |
8067 | } | ||
8068 | objImageSeqs[id] = seq; | ||
8069 | handlerUpdatePrimTexture(id, o.TextureEntry, this); | ||
8046 | } | 8070 | } |
8047 | return true; | 8071 | return true; |
8048 | } | 8072 | } |