123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
-
- using System;
- using OpenSim.Framework;
- using Nini.Config;
- namespace OpenSim.Region.ClientStack.LindenUDP
- {
-
-
-
-
-
- public sealed class ThrottleRates
- {
-
- public int Resend;
-
- public int Land;
-
- public int Wind;
-
- public int Cloud;
-
- public int Task;
-
- public int Texture;
-
- public int Asset;
-
- public int Total;
-
- public bool AdaptiveThrottlesEnabled;
-
-
-
-
-
- public ThrottleRates(IConfigSource config)
- {
- try
- {
- IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"];
- Resend = throttleConfig.GetInt("resend_default", 6625);
- Land = throttleConfig.GetInt("land_default", 9125);
- Wind = throttleConfig.GetInt("wind_default", 1750);
- Cloud = throttleConfig.GetInt("cloud_default", 1750);
- Task = throttleConfig.GetInt("task_default", 18500);
- Texture = throttleConfig.GetInt("texture_default", 18500);
- Asset = throttleConfig.GetInt("asset_default", 10500);
- Total = throttleConfig.GetInt("client_throttle_max_bps", 0);
- AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false);
- }
- catch (Exception) { }
- }
- public int GetRate(ThrottleOutPacketType type)
- {
- switch (type)
- {
- case ThrottleOutPacketType.Resend:
- return Resend;
- case ThrottleOutPacketType.Land:
- return Land;
- case ThrottleOutPacketType.Wind:
- return Wind;
- case ThrottleOutPacketType.Cloud:
- return Cloud;
- case ThrottleOutPacketType.Task:
- return Task;
- case ThrottleOutPacketType.Texture:
- return Texture;
- case ThrottleOutPacketType.Asset:
- return Asset;
- case ThrottleOutPacketType.Unknown:
- default:
- return 0;
- }
- }
- }
- }
|