aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
diff options
context:
space:
mode:
authorMelanie2009-10-15 21:14:13 +0100
committerMelanie2009-10-15 21:14:13 +0100
commit6deef7d0f3e9657bdc7bc4c41011dba15fea944b (patch)
treeffa84d5963afbb5390b132278c95df20b21681d5 /OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
parentMerge branch 'master' into vehicles (diff)
parentMerge branch 'htb-throttle' of ssh://opensimulator.org/var/git/opensim into h... (diff)
downloadopensim-SC_OLD-6deef7d0f3e9657bdc7bc4c41011dba15fea944b.zip
opensim-SC_OLD-6deef7d0f3e9657bdc7bc4c41011dba15fea944b.tar.gz
opensim-SC_OLD-6deef7d0f3e9657bdc7bc4c41011dba15fea944b.tar.bz2
opensim-SC_OLD-6deef7d0f3e9657bdc7bc4c41011dba15fea944b.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs97
1 files changed, 82 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
index 858a03c..008d827 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/ThrottleRates.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using OpenSim.Framework;
29using Nini.Config; 30using Nini.Config;
30 31
31namespace OpenSim.Region.ClientStack.LindenUDP 32namespace OpenSim.Region.ClientStack.LindenUDP
@@ -45,12 +46,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
45 public int Wind; 46 public int Wind;
46 /// <summary>Drip rate for cloud packets</summary> 47 /// <summary>Drip rate for cloud packets</summary>
47 public int Cloud; 48 public int Cloud;
48 /// <summary>Drip rate for task (state and transaction) packets</summary> 49 /// <summary>Drip rate for task packets</summary>
49 public int Task; 50 public int Task;
50 /// <summary>Drip rate for texture packets</summary> 51 /// <summary>Drip rate for texture packets</summary>
51 public int Texture; 52 public int Texture;
52 /// <summary>Drip rate for asset packets</summary> 53 /// <summary>Drip rate for asset packets</summary>
53 public int Asset; 54 public int Asset;
55 /// <summary>Drip rate for state packets</summary>
56 public int State;
57 /// <summary>Drip rate for the parent token bucket</summary>
58 public int Total;
54 59
55 /// <summary>Maximum burst rate for resent packets</summary> 60 /// <summary>Maximum burst rate for resent packets</summary>
56 public int ResendLimit; 61 public int ResendLimit;
@@ -66,6 +71,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
66 public int TextureLimit; 71 public int TextureLimit;
67 /// <summary>Maximum burst rate for asset packets</summary> 72 /// <summary>Maximum burst rate for asset packets</summary>
68 public int AssetLimit; 73 public int AssetLimit;
74 /// <summary>Maximum burst rate for state packets</summary>
75 public int StateLimit;
76 /// <summary>Burst rate for the parent token bucket</summary>
77 public int TotalLimit;
69 78
70 /// <summary> 79 /// <summary>
71 /// Default constructor 80 /// Default constructor
@@ -77,23 +86,81 @@ namespace OpenSim.Region.ClientStack.LindenUDP
77 { 86 {
78 IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"]; 87 IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"];
79 88
80 Resend = throttleConfig.GetInt("ResendDefault", 12500); 89 Resend = throttleConfig.GetInt("resend_default", 12500);
81 Land = throttleConfig.GetInt("LandDefault", 500); 90 Land = throttleConfig.GetInt("land_default", 500);
82 Wind = throttleConfig.GetInt("WindDefault", 500); 91 Wind = throttleConfig.GetInt("wind_default", 500);
83 Cloud = throttleConfig.GetInt("CloudDefault", 500); 92 Cloud = throttleConfig.GetInt("cloud_default", 500);
84 Task = throttleConfig.GetInt("TaskDefault", 500); 93 Task = throttleConfig.GetInt("task_default", 500);
85 Texture = throttleConfig.GetInt("TextureDefault", 500); 94 Texture = throttleConfig.GetInt("texture_default", 500);
86 Asset = throttleConfig.GetInt("AssetDefault", 500); 95 Asset = throttleConfig.GetInt("asset_default", 500);
96 State = throttleConfig.GetInt("state_default", 500);
87 97
88 ResendLimit = throttleConfig.GetInt("ResendLimit", 18750); 98 Total = throttleConfig.GetInt("client_throttle_max_bps", 0);
89 LandLimit = throttleConfig.GetInt("LandLimit", 29750); 99
90 WindLimit = throttleConfig.GetInt("WindLimit", 18750); 100 ResendLimit = throttleConfig.GetInt("resend_limit", 18750);
91 CloudLimit = throttleConfig.GetInt("CloudLimit", 18750); 101 LandLimit = throttleConfig.GetInt("land_limit", 29750);
92 TaskLimit = throttleConfig.GetInt("TaskLimit", 55750); 102 WindLimit = throttleConfig.GetInt("wind_limit", 18750);
93 TextureLimit = throttleConfig.GetInt("TextureLimit", 55750); 103 CloudLimit = throttleConfig.GetInt("cloud_limit", 18750);
94 AssetLimit = throttleConfig.GetInt("AssetLimit", 27500); 104 TaskLimit = throttleConfig.GetInt("task_limit", 18750);
105 TextureLimit = throttleConfig.GetInt("texture_limit", 55750);
106 AssetLimit = throttleConfig.GetInt("asset_limit", 27500);
107 State = throttleConfig.GetInt("state_limit", 37000);
108
109 TotalLimit = throttleConfig.GetInt("client_throttle_max_bps", 0);
95 } 110 }
96 catch (Exception) { } 111 catch (Exception) { }
97 } 112 }
113
114 public int GetRate(ThrottleOutPacketType type)
115 {
116 switch (type)
117 {
118 case ThrottleOutPacketType.Resend:
119 return Resend;
120 case ThrottleOutPacketType.Land:
121 return Land;
122 case ThrottleOutPacketType.Wind:
123 return Wind;
124 case ThrottleOutPacketType.Cloud:
125 return Cloud;
126 case ThrottleOutPacketType.Task:
127 return Task;
128 case ThrottleOutPacketType.Texture:
129 return Texture;
130 case ThrottleOutPacketType.Asset:
131 return Asset;
132 case ThrottleOutPacketType.State:
133 return State;
134 case ThrottleOutPacketType.Unknown:
135 default:
136 return 0;
137 }
138 }
139
140 public int GetLimit(ThrottleOutPacketType type)
141 {
142 switch (type)
143 {
144 case ThrottleOutPacketType.Resend:
145 return ResendLimit;
146 case ThrottleOutPacketType.Land:
147 return LandLimit;
148 case ThrottleOutPacketType.Wind:
149 return WindLimit;
150 case ThrottleOutPacketType.Cloud:
151 return CloudLimit;
152 case ThrottleOutPacketType.Task:
153 return TaskLimit;
154 case ThrottleOutPacketType.Texture:
155 return TextureLimit;
156 case ThrottleOutPacketType.Asset:
157 return AssetLimit;
158 case ThrottleOutPacketType.State:
159 return StateLimit;
160 case ThrottleOutPacketType.Unknown:
161 default:
162 return 0;
163 }
164 }
98 } 165 }
99} 166}