diff options
author | UbitUmarov | 2017-07-20 14:28:26 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-20 14:28:26 +0100 |
commit | d1f7fac570f6655507ab2481b76e525e2d6b2c23 (patch) | |
tree | 6f122645ae0eeab07be149bb71c97a002e49d0cb | |
parent | merge (diff) | |
download | opensim-SC-d1f7fac570f6655507ab2481b76e525e2d6b2c23.zip opensim-SC-d1f7fac570f6655507ab2481b76e525e2d6b2c23.tar.gz opensim-SC-d1f7fac570f6655507ab2481b76e525e2d6b2c23.tar.bz2 opensim-SC-d1f7fac570f6655507ab2481b76e525e2d6b2c23.tar.xz |
fix merge issues
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index d77cf0c..9a561ea 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | |||
@@ -146,39 +146,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
146 | } | 146 | } |
147 | } | 147 | } |
148 | } | 148 | } |
149 | private int ExtractImageThrottle(byte[] pthrottles) | 149 | |
150 | { | ||
151 | |||
152 | byte[] adjData; | ||
153 | int pos = 0; | ||
154 | |||
155 | if (!BitConverter.IsLittleEndian) | ||
156 | { | ||
157 | byte[] newData = new byte[7 * 4]; | ||
158 | Buffer.BlockCopy(pthrottles, 0, newData, 0, 7 * 4); | ||
159 | |||
160 | for (int i = 0; i < 7; i++) | ||
161 | Array.Reverse(newData, i * 4, 4); | ||
162 | |||
163 | adjData = newData; | ||
164 | } | ||
165 | else | ||
166 | { | ||
167 | adjData = pthrottles; | ||
168 | } | ||
169 | |||
170 | pos = pos + 20; | ||
171 | int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); //pos += 4; | ||
172 | //int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
173 | return texture; | ||
174 | } | ||
175 | |||
176 | // Now we know when the throttle is changed by the client in the case of a root agent or by a neighbor region in the case of a child agent. | 150 | // Now we know when the throttle is changed by the client in the case of a root agent or by a neighbor region in the case of a child agent. |
177 | public void ThrottleUpdate(ScenePresence p) | 151 | public void ThrottleUpdate(ScenePresence p) |
178 | { | 152 | { |
179 | byte[] throttles = p.ControllingClient.GetThrottlesPacked(1); | 153 | byte[] throttles = p.ControllingClient.GetThrottlesPacked(1); |
180 | UUID user = p.UUID; | 154 | UUID user = p.UUID; |
181 | int imagethrottle = ExtractImageThrottle(throttles); | 155 | int imagethrottle = p.ControllingClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Texture); |
182 | PollServiceTextureEventArgs args; | 156 | PollServiceTextureEventArgs args; |
183 | if (m_pollservices.TryGetValue(user,out args)) | 157 | if (m_pollservices.TryGetValue(user,out args)) |
184 | { | 158 | { |
@@ -221,11 +195,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
221 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); | 195 | private HashSet<UUID> dropedResponses = new HashSet<UUID>(); |
222 | 196 | ||
223 | private Scene m_scene; | 197 | private Scene m_scene; |
224 | private CapsDataThrottler m_throttler = new CapsDataThrottler(100000); | 198 | private CapsDataThrottler m_throttler; |
225 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : | 199 | public PollServiceTextureEventArgs(UUID pId, Scene scene) : |
226 | base(null, "", null, null, null, null, pId, int.MaxValue) | 200 | base(null, "", null, null, null, null, pId, int.MaxValue) |
227 | { | 201 | { |
228 | m_scene = scene; | 202 | m_scene = scene; |
203 | m_throttler = new CapsDataThrottler(100000); | ||
229 | // x is request id, y is userid | 204 | // x is request id, y is userid |
230 | HasEvents = (x, y) => | 205 | HasEvents = (x, y) => |
231 | { | 206 | { |
@@ -372,7 +347,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
372 | if(dropedResponses.Contains(requestID)) | 347 | if(dropedResponses.Contains(requestID)) |
373 | { | 348 | { |
374 | dropedResponses.Remove(requestID); | 349 | dropedResponses.Remove(requestID); |
375 | m_throttler.ProcessTime(); | 350 | m_throttler.PassTime(); |
376 | return; | 351 | return; |
377 | } | 352 | } |
378 | } | 353 | } |