diff options
author | UbitUmarov | 2014-08-29 16:30:49 +0100 |
---|---|---|
committer | UbitUmarov | 2014-08-29 16:30:49 +0100 |
commit | 18de5c8a2da2577246485f8df100e1e155a30d56 (patch) | |
tree | a8a9ce01c9f719c47e218317e417682ccf550476 /OpenSim/Region | |
parent | add method to get a category throttle rate (diff) | |
download | opensim-SC-18de5c8a2da2577246485f8df100e1e155a30d56.zip opensim-SC-18de5c8a2da2577246485f8df100e1e155a30d56.tar.gz opensim-SC-18de5c8a2da2577246485f8df100e1e155a30d56.tar.bz2 opensim-SC-18de5c8a2da2577246485f8df100e1e155a30d56.tar.xz |
make use of it in GetMeshModule, and meshs are Assets not Task itens,
reduce MeshModule impact on udp rate
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 7b15284..a381a1b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -189,9 +189,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
189 | // 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. | 189 | // 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. |
190 | public void ThrottleUpdate(ScenePresence p) | 190 | public void ThrottleUpdate(ScenePresence p) |
191 | { | 191 | { |
192 | byte[] throttles = p.ControllingClient.GetThrottlesPacked(1); | ||
193 | UUID user = p.UUID; | 192 | UUID user = p.UUID; |
194 | int imagethrottle = ExtractTaskThrottle(throttles); | 193 | int imagethrottle = p.ControllingClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset); |
195 | PollServiceMeshEventArgs args; | 194 | PollServiceMeshEventArgs args; |
196 | if (m_pollservices.TryGetValue(user, out args)) | 195 | if (m_pollservices.TryGetValue(user, out args)) |
197 | { | 196 | { |
@@ -199,44 +198,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
199 | } | 198 | } |
200 | } | 199 | } |
201 | 200 | ||
202 | private int ExtractTaskThrottle(byte[] pthrottles) | ||
203 | { | ||
204 | |||
205 | byte[] adjData; | ||
206 | int pos = 0; | ||
207 | |||
208 | if (!BitConverter.IsLittleEndian) | ||
209 | { | ||
210 | byte[] newData = new byte[7 * 4]; | ||
211 | Buffer.BlockCopy(pthrottles, 0, newData, 0, 7 * 4); | ||
212 | |||
213 | for (int i = 0; i < 7; i++) | ||
214 | Array.Reverse(newData, i * 4, 4); | ||
215 | |||
216 | adjData = newData; | ||
217 | } | ||
218 | else | ||
219 | { | ||
220 | adjData = pthrottles; | ||
221 | } | ||
222 | |||
223 | // 0.125f converts from bits to bytes | ||
224 | //int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
225 | //pos += 4; | ||
226 | // int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
227 | //pos += 4; | ||
228 | // int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
229 | // pos += 4; | ||
230 | // int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
231 | // pos += 4; | ||
232 | pos += 16; | ||
233 | int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
234 | // pos += 4; | ||
235 | //int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); //pos += 4; | ||
236 | //int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); | ||
237 | return task; | ||
238 | } | ||
239 | |||
240 | private class PollServiceMeshEventArgs : PollServiceEventArgs | 201 | private class PollServiceMeshEventArgs : PollServiceEventArgs |
241 | { | 202 | { |
242 | private List<Hashtable> requests = | 203 | private List<Hashtable> requests = |
@@ -425,7 +386,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
425 | { | 386 | { |
426 | ThrottleBytes = pBytes; | 387 | ThrottleBytes = pBytes; |
427 | lastTimeElapsed = Util.EnvironmentTickCount(); | 388 | lastTimeElapsed = Util.EnvironmentTickCount(); |
428 | Throttle = ThrottleOutPacketType.Task; | 389 | Throttle = ThrottleOutPacketType.Asset; |
429 | m_scene = pScene; | 390 | m_scene = pScene; |
430 | User = puser; | 391 | User = puser; |
431 | } | 392 | } |
@@ -550,8 +511,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
550 | // UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); | 511 | // UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); |
551 | 512 | ||
552 | float udp = 1.0f - CapThrottleDistributon; | 513 | float udp = 1.0f - CapThrottleDistributon; |
553 | if(udp < 0.5f) | 514 | if(udp < 0.7f) |
554 | udp = 0.5f; | 515 | udp = 0.7f; |
555 | UDPSetThrottle = (int) ((float)pimagethrottle * udp); | 516 | UDPSetThrottle = (int) ((float)pimagethrottle * udp); |
556 | if (CapSetThrottle < 4068) | 517 | if (CapSetThrottle < 4068) |
557 | CapSetThrottle = 4068; // at least two discovery mesh | 518 | CapSetThrottle = 4068; // at least two discovery mesh |