aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2007-12-06 20:13:02 +0000
committerSean Dague2007-12-06 20:13:02 +0000
commit1ad83bcf1b71722a503ebca5540cc61015aad635 (patch)
tree9a6c4217dd7b9a50bc6d2b8ba20fdb7910d5d1be
parentremoved obsolete Verbose() function (diff)
downloadopensim-SC-1ad83bcf1b71722a503ebca5540cc61015aad635.zip
opensim-SC-1ad83bcf1b71722a503ebca5540cc61015aad635.tar.gz
opensim-SC-1ad83bcf1b71722a503ebca5540cc61015aad635.tar.bz2
opensim-SC-1ad83bcf1b71722a503ebca5540cc61015aad635.tar.xz
reversing the r2599 patch, as this started causing CreateThread errors for
me on Mono 1.2.4, which led to client crashes. I think the Timer.Stop() wasn't doing what was desired on Mono. The Queue refactoring should address the readability issues lbsa71 was working on as soon as I get the merge together.
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs7
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs572
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
3 files changed, 272 insertions, 308 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 64e0e54..cb8b9f6 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -776,13 +776,8 @@ namespace OpenSim.Framework.Communications.Cache
776 im.Header.Reliable = false; 776 im.Header.Reliable = false;
777 im.ImageID.Packet = (ushort) (req.PacketCounter); 777 im.ImageID.Packet = (ushort) (req.PacketCounter);
778 im.ImageID.ID = req.ImageInfo.FullID; 778 im.ImageID.ID = req.ImageInfo.FullID;
779
780 int size = req.ImageInfo.Data.Length - 600 - (1000*(req.PacketCounter - 1)); 779 int size = req.ImageInfo.Data.Length - 600 - (1000*(req.PacketCounter - 1));
781 if (size > 1000) 780 if (size > 1000) size = 1000;
782 {
783 size = 1000;
784 }
785
786 //Console.WriteLine("length= {0} counter= {1} size= {2}",req.ImageInfo.Data.Length, req.PacketCounter, size); 781 //Console.WriteLine("length= {0} counter= {1} size= {2}",req.ImageInfo.Data.Length, req.PacketCounter, size);
787 im.ImageData.Data = new byte[size]; 782 im.ImageData.Data = new byte[size];
788 Array.Copy(req.ImageInfo.Data, 600 + (1000*(req.PacketCounter - 1)), im.ImageData.Data, 0, size); 783 Array.Copy(req.ImageInfo.Data, 600 + (1000*(req.PacketCounter - 1)), im.ImageData.Data, 0, size);
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index fb1623b..17e3567 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -91,62 +91,62 @@ namespace OpenSim.Region.ClientStack
91 protected AgentCircuitManager m_authenticateSessionsHandler; 91 protected AgentCircuitManager m_authenticateSessionsHandler;
92 private Encoding enc = Encoding.ASCII; 92 private Encoding enc = Encoding.ASCII;
93 // Dead client detection vars 93 // Dead client detection vars
94 private Timer m_clientPingTimer; 94 private Timer clientPingTimer;
95 private int m_packetsReceived = 0; 95 private int packetsReceived = 0;
96 private int m_probesWithNoIngressPackets = 0; 96 private int probesWithNoIngressPackets = 0;
97 private int m_lastPacketsReceived = 0; 97 private int lastPacketsReceived = 0;
98 98
99 // 1536000 99 // 1536000
100 private int m_throttleOutboundMax = 1536000; // Number of bytes allowed to go out per second. (256kbps per client) 100 private int throttleOutboundMax = 1536000; // Number of bytes allowed to go out per second. (256kbps per client)
101 // TODO: Make this variable. Lower throttle on un-ack. Raise over time? 101 // TODO: Make this variable. Lower throttle on un-ack. Raise over time?
102 private int m_bytesSent = 0; // Number of bytes sent this period 102 private int bytesSent = 0; // Number of bytes sent this period
103 103
104 private int m_throttleOutbound = 162144; // Number of bytes allowed to go out per second. (256kbps per client) 104 private int throttleOutbound = 162144; // Number of bytes allowed to go out per second. (256kbps per client)
105 // TODO: Make this variable. Lower throttle on un-ack. Raise over time 105 // TODO: Make this variable. Lower throttle on un-ack. Raise over time
106 106
107 // All throttle times and number of bytes are calculated by dividing by this value 107 // All throttle times and number of bytes are calculated by dividing by this value
108 // This value also determines how many times per throttletimems the timer will run 108 // This value also determines how many times per throttletimems the timer will run
109 // If throttleimems is 1000 ms, then the timer will fire every 1000/7 milliseconds 109 // If throttleimems is 1000 ms, then the timer will fire every 1000/7 milliseconds
110 110
111 private int m_throttleTimeDivisor = 7; 111 private int throttleTimeDivisor = 7;
112 112
113 private int m_throttletimems = 1000; 113 private int throttletimems = 1000;
114 114
115 // Maximum -per type- throttle 115 // Maximum -per type- throttle
116 private int m_resendthrottleMAX = 100000; 116 private int ResendthrottleMAX = 100000;
117 private int m_landthrottleMax = 100000; 117 private int LandthrottleMax = 100000;
118 private int m_windthrottleMax = 100000; 118 private int WindthrottleMax = 100000;
119 private int m_cloudthrottleMax = 100000; 119 private int CloudthrottleMax = 100000;
120 private int m_taskthrottleMax = 800000; 120 private int TaskthrottleMax = 800000;
121 private int m_assetthrottleMax = 800000; 121 private int AssetthrottleMax = 800000;
122 private int m_texturethrottleMax = 800000; 122 private int TexturethrottleMax = 800000;
123 123
124 // Minimum -per type- throttle 124 // Minimum -per type- throttle
125 private int m_resendthrottleMin = 5000; // setting resendmin to 0 results in mostly dropped packets 125 private int ResendthrottleMin = 5000; // setting resendmin to 0 results in mostly dropped packets
126 private int m_landthrottleMin = 1000; 126 private int LandthrottleMin = 1000;
127 private int m_windthrottleMin = 1000; 127 private int WindthrottleMin = 1000;
128 private int m_cloudthrottleMin = 1000; 128 private int CloudthrottleMin = 1000;
129 private int m_taskthrottleMin = 1000; 129 private int TaskthrottleMin = 1000;
130 private int m_assetthrottleMin = 1000; 130 private int AssetthrottleMin = 1000;
131 private int m_texturethrottleMin = 1000; 131 private int TexturethrottleMin = 1000;
132 132
133 // Sim default per-client settings. 133 // Sim default per-client settings.
134 private int m_resendthrottleOutbound = 50000; 134 private int ResendthrottleOutbound = 50000;
135 private int m_resendBytesSent = 0; 135 private int ResendBytesSent = 0;
136 private int m_landthrottleOutbound = 100000; 136 private int LandthrottleOutbound = 100000;
137 private int m_landBytesSent = 0; 137 private int LandBytesSent = 0;
138 private int m_windthrottleOutbound = 10000; 138 private int WindthrottleOutbound = 10000;
139 private int m_windBytesSent = 0; 139 private int WindBytesSent = 0;
140 private int m_cloudthrottleOutbound = 5000; 140 private int CloudthrottleOutbound = 5000;
141 private int m_cloudBytesSent = 0; 141 private int CloudBytesSent = 0;
142 private int m_taskthrottleOutbound = 100000; 142 private int TaskthrottleOutbound = 100000;
143 private int m_taskBytesSent = 0; 143 private int TaskBytesSent = 0;
144 private int m_assetthrottleOutbound = 80000; 144 private int AssetthrottleOutbound = 80000;
145 private int m_assetBytesSent = 0; 145 private int AssetBytesSent = 0;
146 private int m_texturethrottleOutbound = 100000; 146 private int TexturethrottleOutbound = 100000;
147 private int m_textureBytesSent = 0; 147 private int TextureBytesSent = 0;
148 148
149 private Timer m_throttleTimer; 149 private Timer throttleTimer;
150 150
151 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager, 151 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, ClientManager clientManager,
152 IScene scene, AssetCache assetCache, PacketServer packServer, 152 IScene scene, AssetCache assetCache, PacketServer packServer,
@@ -174,17 +174,17 @@ namespace OpenSim.Region.ClientStack
174 // in it to process. it's an on-purpose threadlock though because 174 // in it to process. it's an on-purpose threadlock though because
175 // without it, the clientloop will suck up all sim resources. 175 // without it, the clientloop will suck up all sim resources.
176 176
177 m_packetQueue = new BlockingQueue<QueItem>(); 177 PacketQueue = new BlockingQueue<QueItem>();
178 178
179 m_incomingPacketQueue = new Queue<QueItem>(); 179 IncomingPacketQueue = new Queue<QueItem>();
180 m_outgoingPacketQueue = new Queue<QueItem>(); 180 OutgoingPacketQueue = new Queue<QueItem>();
181 m_resendOutgoingPacketQueue = new Queue<QueItem>(); 181 ResendOutgoingPacketQueue = new Queue<QueItem>();
182 m_landOutgoingPacketQueue = new Queue<QueItem>(); 182 LandOutgoingPacketQueue = new Queue<QueItem>();
183 m_windOutgoingPacketQueue = new Queue<QueItem>(); 183 WindOutgoingPacketQueue = new Queue<QueItem>();
184 m_cloudOutgoingPacketQueue = new Queue<QueItem>(); 184 CloudOutgoingPacketQueue = new Queue<QueItem>();
185 m_taskOutgoingPacketQueue = new Queue<QueItem>(); 185 TaskOutgoingPacketQueue = new Queue<QueItem>();
186 m_textureOutgoingPacketQueue = new Queue<QueItem>(); 186 TextureOutgoingPacketQueue = new Queue<QueItem>();
187 m_assetOutgoingPacketQueue = new Queue<QueItem>(); 187 AssetOutgoingPacketQueue = new Queue<QueItem>();
188 188
189 189
190 //this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache); 190 //this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
@@ -192,9 +192,9 @@ namespace OpenSim.Region.ClientStack
192 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); 192 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
193 AckTimer.Start(); 193 AckTimer.Start();
194 194
195 m_throttleTimer = new Timer((int)(m_throttletimems/m_throttleTimeDivisor)); 195 throttleTimer = new Timer((int)(throttletimems/throttleTimeDivisor));
196 m_throttleTimer.Elapsed += throttleTimer_Elapsed; 196 throttleTimer.Elapsed += new ElapsedEventHandler(throttleTimer_Elapsed);
197 m_throttleTimer.Start(); 197 throttleTimer.Start();
198 198
199 RegisterLocalPacketHandlers(); 199 RegisterLocalPacketHandlers();
200 200
@@ -205,24 +205,14 @@ namespace OpenSim.Region.ClientStack
205 205
206 void throttleTimer_Elapsed(object sender, ElapsedEventArgs e) 206 void throttleTimer_Elapsed(object sender, ElapsedEventArgs e)
207 { 207 {
208 // We need to stop the timer so that another timer event won't cause queue races. 208 bytesSent = 0;
209 m_throttleTimer.Stop(); 209 ResendBytesSent = 0;
210 210 LandBytesSent = 0;
211 ProcessThrottleQueues(); 211 WindBytesSent = 0;
212 212 CloudBytesSent = 0;
213 m_throttleTimer.Start(); 213 TaskBytesSent = 0;
214 } 214 AssetBytesSent = 0;
215 215 TextureBytesSent = 0;
216 private void ProcessThrottleQueues()
217 {
218 m_bytesSent = 0;
219 m_resendBytesSent = 0;
220 m_landBytesSent = 0;
221 m_windBytesSent = 0;
222 m_cloudBytesSent = 0;
223 m_taskBytesSent = 0;
224 m_assetBytesSent = 0;
225 m_textureBytesSent = 0;
226 216
227 // I was considering this.. Will an event fire if the thread it's on is blocked? 217 // I was considering this.. Will an event fire if the thread it's on is blocked?
228 218
@@ -235,96 +225,76 @@ namespace OpenSim.Region.ClientStack
235 225
236 // We're going to dequeue all of the saved up packets until 226 // We're going to dequeue all of the saved up packets until
237 // we've hit the throttle limit or there's no more packets to send 227 // we've hit the throttle limit or there's no more packets to send
238 228 while ((bytesSent <= ((int)(throttleOutbound/throttleTimeDivisor)) &&
239 229 (ResendOutgoingPacketQueue.Count > 0 ||
240 230 LandOutgoingPacketQueue.Count > 0 ||
241 while (TimeToDequeue( m_bytesSent, m_throttleOutbound ) && 231 WindOutgoingPacketQueue.Count > 0 ||
242 (m_resendOutgoingPacketQueue.Count > 0 || 232 CloudOutgoingPacketQueue.Count > 0 ||
243 m_landOutgoingPacketQueue.Count > 0 || 233 TaskOutgoingPacketQueue.Count > 0 ||
244 m_windOutgoingPacketQueue.Count > 0 || 234 AssetOutgoingPacketQueue.Count > 0 ||
245 m_cloudOutgoingPacketQueue.Count > 0 || 235 TextureOutgoingPacketQueue.Count > 0)) && throttleLoops <= MaxThrottleLoops)
246 m_taskOutgoingPacketQueue.Count > 0 ||
247 m_assetOutgoingPacketQueue.Count > 0 ||
248 m_textureOutgoingPacketQueue.Count > 0) && ( throttleLoops <= MaxThrottleLoops))
249 { 236 {
250 throttleLoops++; 237 throttleLoops++;
251 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up. 238 //Now comes the fun part.. we dump all our elements into PacketQueue that we've saved up.
252 239 if (ResendBytesSent <= ((int)(ResendthrottleOutbound/throttleTimeDivisor)) && ResendOutgoingPacketQueue.Count > 0)
253 if (TimeToDequeue(m_resendBytesSent, m_resendthrottleOutbound))
254 { 240 {
255 m_resendBytesSent += ProcessQueue(m_resendOutgoingPacketQueue); 241 QueItem qpack = ResendOutgoingPacketQueue.Dequeue();
256 }
257 242
258 if (TimeToDequeue(m_landBytesSent, m_landthrottleOutbound)) 243 PacketQueue.Enqueue(qpack);
259 { 244 bytesSent += qpack.Packet.ToBytes().Length;
260 m_landBytesSent += ProcessQueue(m_landOutgoingPacketQueue); 245 ResendBytesSent += qpack.Packet.ToBytes().Length;
261 } 246 }
262 247 if (LandBytesSent <= ((int)(LandthrottleOutbound/throttleTimeDivisor)) && LandOutgoingPacketQueue.Count > 0)
263 // -- TODO: Well, do the same for the rest of them
264
265 if (m_windBytesSent <= ((int)(m_windthrottleOutbound/m_throttleTimeDivisor)) && m_windOutgoingPacketQueue.Count > 0)
266 { 248 {
267 QueItem qpack = m_windOutgoingPacketQueue.Dequeue(); 249 QueItem qpack = LandOutgoingPacketQueue.Dequeue();
268 250
269 m_packetQueue.Enqueue(qpack); 251 PacketQueue.Enqueue(qpack);
270 m_bytesSent += qpack.Packet.ToBytes().Length; 252 bytesSent += qpack.Packet.ToBytes().Length;
271 m_windBytesSent += qpack.Packet.ToBytes().Length; 253 LandBytesSent += qpack.Packet.ToBytes().Length;
272 } 254 }
273 if (m_cloudBytesSent <= ((int)(m_cloudthrottleOutbound/m_throttleTimeDivisor)) && m_cloudOutgoingPacketQueue.Count > 0) 255 if (WindBytesSent <= ((int)(WindthrottleOutbound/throttleTimeDivisor)) && WindOutgoingPacketQueue.Count > 0)
274 { 256 {
275 QueItem qpack = m_cloudOutgoingPacketQueue.Dequeue(); 257 QueItem qpack = WindOutgoingPacketQueue.Dequeue();
276 258
277 m_packetQueue.Enqueue(qpack); 259 PacketQueue.Enqueue(qpack);
278 m_bytesSent += qpack.Packet.ToBytes().Length; 260 bytesSent += qpack.Packet.ToBytes().Length;
279 m_cloudBytesSent += qpack.Packet.ToBytes().Length; 261 WindBytesSent += qpack.Packet.ToBytes().Length;
280 } 262 }
281 if (m_taskBytesSent <= ((int)(m_taskthrottleOutbound/m_throttleTimeDivisor)) && m_taskOutgoingPacketQueue.Count > 0) 263 if (CloudBytesSent <= ((int)(CloudthrottleOutbound/throttleTimeDivisor)) && CloudOutgoingPacketQueue.Count > 0)
282 { 264 {
283 QueItem qpack = m_taskOutgoingPacketQueue.Dequeue(); 265 QueItem qpack = CloudOutgoingPacketQueue.Dequeue();
284 266
285 m_packetQueue.Enqueue(qpack); 267 PacketQueue.Enqueue(qpack);
286 m_bytesSent += qpack.Packet.ToBytes().Length; 268 bytesSent += qpack.Packet.ToBytes().Length;
287 m_taskBytesSent += qpack.Packet.ToBytes().Length; 269 CloudBytesSent += qpack.Packet.ToBytes().Length;
288 } 270 }
289 if (m_textureBytesSent <= ((int)(m_texturethrottleOutbound/m_throttleTimeDivisor)) && m_textureOutgoingPacketQueue.Count > 0) 271 if (TaskBytesSent <= ((int)(TaskthrottleOutbound/throttleTimeDivisor)) && TaskOutgoingPacketQueue.Count > 0)
290 { 272 {
291 QueItem qpack = m_textureOutgoingPacketQueue.Dequeue(); 273 QueItem qpack = TaskOutgoingPacketQueue.Dequeue();
292 274
293 m_packetQueue.Enqueue(qpack); 275 PacketQueue.Enqueue(qpack);
294 m_bytesSent += qpack.Packet.ToBytes().Length; 276 bytesSent += qpack.Packet.ToBytes().Length;
295 m_textureBytesSent += qpack.Packet.ToBytes().Length; 277 TaskBytesSent += qpack.Packet.ToBytes().Length;
296 } 278 }
297 if (m_assetBytesSent <= ((int)(m_assetthrottleOutbound/m_throttleTimeDivisor)) && m_assetOutgoingPacketQueue.Count > 0) 279 if (TextureBytesSent <= ((int)(TexturethrottleOutbound/throttleTimeDivisor)) && TextureOutgoingPacketQueue.Count > 0)
298 { 280 {
299 QueItem qpack = m_assetOutgoingPacketQueue.Dequeue(); 281 QueItem qpack = TextureOutgoingPacketQueue.Dequeue();
300 282
301 m_packetQueue.Enqueue(qpack); 283 PacketQueue.Enqueue(qpack);
302 m_bytesSent += qpack.Packet.ToBytes().Length; 284 bytesSent += qpack.Packet.ToBytes().Length;
303 m_assetBytesSent += qpack.Packet.ToBytes().Length; 285 TextureBytesSent += qpack.Packet.ToBytes().Length;
304 } 286 }
287 if (AssetBytesSent <= ((int)(AssetthrottleOutbound/throttleTimeDivisor)) && AssetOutgoingPacketQueue.Count > 0)
288 {
289 QueItem qpack = AssetOutgoingPacketQueue.Dequeue();
305 290
306 } 291 PacketQueue.Enqueue(qpack);
307 } 292 bytesSent += qpack.Packet.ToBytes().Length;
308 293 AssetBytesSent += qpack.Packet.ToBytes().Length;
309 private int ProcessQueue(Queue<QueItem> queue) 294 }
310 {
311 if (queue.Count > 0)
312 {
313 QueItem qpack = queue.Dequeue();
314
315 m_packetQueue.Enqueue(qpack);
316 int packLength = qpack.Packet.ToBytes().Length;
317 295
318 m_bytesSent += packLength;
319 return packLength;
320 } 296 }
321 297
322 return 0;
323 }
324
325 private bool TimeToDequeue(int bytesSent, int outboundThrottle)
326 {
327 return bytesSent <= ((int)(outboundThrottle / m_throttleTimeDivisor));
328 } 298 }
329 299
330 public LLUUID SessionId 300 public LLUUID SessionId
@@ -341,7 +311,7 @@ namespace OpenSim.Region.ClientStack
341 311
342 public void Close() 312 public void Close()
343 { 313 {
344 m_clientPingTimer.Stop(); 314 clientPingTimer.Stop();
345 315
346 m_scene.RemoveClient(AgentId); 316 m_scene.RemoveClient(AgentId);
347 317
@@ -363,7 +333,7 @@ namespace OpenSim.Region.ClientStack
363 } 333 }
364 public void Stop() 334 public void Stop()
365 { 335 {
366 m_clientPingTimer.Stop(); 336 clientPingTimer.Stop();
367 337
368 libsecondlife.Packets.DisableSimulatorPacket disable = new libsecondlife.Packets.DisableSimulatorPacket(); 338 libsecondlife.Packets.DisableSimulatorPacket disable = new libsecondlife.Packets.DisableSimulatorPacket();
369 OutPacket(disable, ThrottleOutPacketType.Task); 339 OutPacket(disable, ThrottleOutPacketType.Task);
@@ -464,7 +434,7 @@ namespace OpenSim.Region.ClientStack
464 MainLog.Instance.Verbose("CLIENT", "Entered loop"); 434 MainLog.Instance.Verbose("CLIENT", "Entered loop");
465 while (true) 435 while (true)
466 { 436 {
467 QueItem nextPacket = m_packetQueue.Dequeue(); 437 QueItem nextPacket = PacketQueue.Dequeue();
468 if (nextPacket.Incoming) 438 if (nextPacket.Incoming)
469 { 439 {
470 queuedLast = false; 440 queuedLast = false;
@@ -472,7 +442,7 @@ namespace OpenSim.Region.ClientStack
472 //is a incoming packet 442 //is a incoming packet
473 if (nextPacket.Packet.Type != PacketType.AgentUpdate) 443 if (nextPacket.Packet.Type != PacketType.AgentUpdate)
474 { 444 {
475 m_packetsReceived++; 445 packetsReceived++;
476 } 446 }
477 DebugPacket("IN", nextPacket.Packet); 447 DebugPacket("IN", nextPacket.Packet);
478 ProcessInPacket(nextPacket.Packet); 448 ProcessInPacket(nextPacket.Packet);
@@ -480,9 +450,9 @@ namespace OpenSim.Region.ClientStack
480 else 450 else
481 { 451 {
482 // Throw it back on the queue if it's going to cause us to flood the client 452 // Throw it back on the queue if it's going to cause us to flood the client
483 if (m_bytesSent > m_throttleOutboundMax) 453 if (bytesSent > throttleOutboundMax)
484 { 454 {
485 m_packetQueue.Enqueue(nextPacket); 455 PacketQueue.Enqueue(nextPacket);
486 MainLog.Instance.Verbose("THROTTLE", "Client over throttle limit, requeuing packet"); 456 MainLog.Instance.Verbose("THROTTLE", "Client over throttle limit, requeuing packet");
487 457
488 if (queuedLast) 458 if (queuedLast)
@@ -501,7 +471,7 @@ namespace OpenSim.Region.ClientStack
501 471
502 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()! 472 //Don't throttle AvatarPickerReplies!, they return a null .ToBytes()!
503 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply) 473 if (nextPacket.Packet.Type != PacketType.AvatarPickerReply)
504 m_bytesSent += nextPacket.Packet.ToBytes().Length; 474 bytesSent += nextPacket.Packet.ToBytes().Length;
505 475
506 476
507 //is a out going packet 477 //is a out going packet
@@ -517,10 +487,10 @@ namespace OpenSim.Region.ClientStack
517 487
518 protected void CheckClientConnectivity(object sender, ElapsedEventArgs e) 488 protected void CheckClientConnectivity(object sender, ElapsedEventArgs e)
519 { 489 {
520 if (m_packetsReceived == m_lastPacketsReceived) 490 if (packetsReceived == lastPacketsReceived)
521 { 491 {
522 m_probesWithNoIngressPackets++; 492 probesWithNoIngressPackets++;
523 if (m_probesWithNoIngressPackets > 30) 493 if (probesWithNoIngressPackets > 30)
524 { 494 {
525 if (OnConnectionClosed != null) 495 if (OnConnectionClosed != null)
526 { 496 {
@@ -536,8 +506,8 @@ namespace OpenSim.Region.ClientStack
536 else 506 else
537 { 507 {
538 // Something received in the meantime - we can reset the counters 508 // Something received in the meantime - we can reset the counters
539 m_probesWithNoIngressPackets = 0; 509 probesWithNoIngressPackets = 0;
540 m_lastPacketsReceived = m_packetsReceived; 510 lastPacketsReceived = packetsReceived;
541 } 511 }
542 } 512 }
543 513
@@ -545,9 +515,9 @@ namespace OpenSim.Region.ClientStack
545 515
546 protected virtual void InitNewClient() 516 protected virtual void InitNewClient()
547 { 517 {
548 m_clientPingTimer = new Timer(5000); 518 clientPingTimer = new Timer(5000);
549 m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); 519 clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
550 m_clientPingTimer.Enabled = true; 520 clientPingTimer.Enabled = true;
551 521
552 MainLog.Instance.Verbose("CLIENT", "Adding viewer agent to scene"); 522 MainLog.Instance.Verbose("CLIENT", "Adding viewer agent to scene");
553 m_scene.AddNewClient(this, true); 523 m_scene.AddNewClient(this, true);
@@ -2233,20 +2203,20 @@ namespace OpenSim.Region.ClientStack
2233 } 2203 }
2234 2204
2235 // Previously ClientView.PacketQueue 2205 // Previously ClientView.PacketQueue
2236 protected BlockingQueue<QueItem> m_packetQueue; 2206 protected BlockingQueue<QueItem> PacketQueue;
2237 2207
2238 protected Queue<QueItem> m_incomingPacketQueue; 2208 protected Queue<QueItem> IncomingPacketQueue;
2239 protected Queue<QueItem> m_outgoingPacketQueue; 2209 protected Queue<QueItem> OutgoingPacketQueue;
2240 protected Queue<QueItem> m_resendOutgoingPacketQueue; 2210 protected Queue<QueItem> ResendOutgoingPacketQueue;
2241 protected Queue<QueItem> m_landOutgoingPacketQueue; 2211 protected Queue<QueItem> LandOutgoingPacketQueue;
2242 protected Queue<QueItem> m_windOutgoingPacketQueue; 2212 protected Queue<QueItem> WindOutgoingPacketQueue;
2243 protected Queue<QueItem> m_cloudOutgoingPacketQueue; 2213 protected Queue<QueItem> CloudOutgoingPacketQueue;
2244 protected Queue<QueItem> m_taskOutgoingPacketQueue; 2214 protected Queue<QueItem> TaskOutgoingPacketQueue;
2245 protected Queue<QueItem> m_textureOutgoingPacketQueue; 2215 protected Queue<QueItem> TextureOutgoingPacketQueue;
2246 protected Queue<QueItem> m_assetOutgoingPacketQueue; 2216 protected Queue<QueItem> AssetOutgoingPacketQueue;
2247 2217
2248 protected Dictionary<uint, uint> m_pendingAcks = new Dictionary<uint, uint>(); 2218 protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
2249 protected Dictionary<uint, Packet> m_needAck = new Dictionary<uint, Packet>(); 2219 protected Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
2250 2220
2251 protected Timer AckTimer; 2221 protected Timer AckTimer;
2252 protected uint Sequence = 0; 2222 protected uint Sequence = 0;
@@ -2288,13 +2258,13 @@ namespace OpenSim.Region.ClientStack
2288 2258
2289 protected void AddAck(Packet Pack) 2259 protected void AddAck(Packet Pack)
2290 { 2260 {
2291 lock (m_needAck) 2261 lock (NeedAck)
2292 { 2262 {
2293 if (!m_needAck.ContainsKey(Pack.Header.Sequence)) 2263 if (!NeedAck.ContainsKey(Pack.Header.Sequence))
2294 { 2264 {
2295 try 2265 try
2296 { 2266 {
2297 m_needAck.Add(Pack.Header.Sequence, Pack); 2267 NeedAck.Add(Pack.Header.Sequence, Pack);
2298 } 2268 }
2299 catch (Exception e) // HACKY 2269 catch (Exception e) // HACKY
2300 { 2270 {
@@ -2308,7 +2278,7 @@ namespace OpenSim.Region.ClientStack
2308 else 2278 else
2309 { 2279 {
2310 // Client.Log("Attempted to add a duplicate sequence number (" + 2280 // Client.Log("Attempted to add a duplicate sequence number (" +
2311 // packet.Header.Sequence + ") to the m_needAck dictionary for packet type " + 2281 // packet.Header.Sequence + ") to the NeedAck dictionary for packet type " +
2312 // packet.Type.ToString(), Helpers.LogLevel.Warning); 2282 // packet.Type.ToString(), Helpers.LogLevel.Warning);
2313 } 2283 }
2314 } 2284 }
@@ -2317,21 +2287,21 @@ namespace OpenSim.Region.ClientStack
2317 protected virtual void SetPendingAcks(ref Packet Pack) 2287 protected virtual void SetPendingAcks(ref Packet Pack)
2318 { 2288 {
2319 // Append any ACKs that need to be sent out to this packet 2289 // Append any ACKs that need to be sent out to this packet
2320 lock (m_pendingAcks) 2290 lock (PendingAcks)
2321 { 2291 {
2322 // TODO: If we are over MAX_APPENDED_ACKS we should drain off some of these 2292 // TODO: If we are over MAX_APPENDED_ACKS we should drain off some of these
2323 if (m_pendingAcks.Count > 0 && m_pendingAcks.Count < MAX_APPENDED_ACKS) 2293 if (PendingAcks.Count > 0 && PendingAcks.Count < MAX_APPENDED_ACKS)
2324 { 2294 {
2325 Pack.Header.AckList = new uint[m_pendingAcks.Count]; 2295 Pack.Header.AckList = new uint[PendingAcks.Count];
2326 int i = 0; 2296 int i = 0;
2327 2297
2328 foreach (uint ack in m_pendingAcks.Values) 2298 foreach (uint ack in PendingAcks.Values)
2329 { 2299 {
2330 Pack.Header.AckList[i] = ack; 2300 Pack.Header.AckList[i] = ack;
2331 i++; 2301 i++;
2332 } 2302 }
2333 2303
2334 m_pendingAcks.Clear(); 2304 PendingAcks.Clear();
2335 Pack.Header.AppendedAcks = true; 2305 Pack.Header.AppendedAcks = true;
2336 } 2306 }
2337 } 2307 }
@@ -2387,11 +2357,11 @@ namespace OpenSim.Region.ClientStack
2387 // Handle appended ACKs 2357 // Handle appended ACKs
2388 if (NewPack.Header.AppendedAcks) 2358 if (NewPack.Header.AppendedAcks)
2389 { 2359 {
2390 lock (m_needAck) 2360 lock (NeedAck)
2391 { 2361 {
2392 foreach (uint ack in NewPack.Header.AckList) 2362 foreach (uint ack in NewPack.Header.AckList)
2393 { 2363 {
2394 m_needAck.Remove(ack); 2364 NeedAck.Remove(ack);
2395 } 2365 }
2396 } 2366 }
2397 } 2367 }
@@ -2401,11 +2371,11 @@ namespace OpenSim.Region.ClientStack
2401 { 2371 {
2402 PacketAckPacket ackPacket = (PacketAckPacket) NewPack; 2372 PacketAckPacket ackPacket = (PacketAckPacket) NewPack;
2403 2373
2404 lock (m_needAck) 2374 lock (NeedAck)
2405 { 2375 {
2406 foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets) 2376 foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets)
2407 { 2377 {
2408 m_needAck.Remove(block.ID); 2378 NeedAck.Remove(block.ID);
2409 } 2379 }
2410 } 2380 }
2411 } 2381 }
@@ -2422,7 +2392,7 @@ namespace OpenSim.Region.ClientStack
2422 QueItem item = new QueItem(); 2392 QueItem item = new QueItem();
2423 item.Packet = NewPack; 2393 item.Packet = NewPack;
2424 item.Incoming = true; 2394 item.Incoming = true;
2425 m_packetQueue.Enqueue(item); 2395 PacketQueue.Enqueue(item);
2426 } 2396 }
2427 } 2397 }
2428 2398
@@ -2434,11 +2404,11 @@ namespace OpenSim.Region.ClientStack
2434 // wait for the timer to fire to put things into the 2404 // wait for the timer to fire to put things into the
2435 // output queue 2405 // output queue
2436 2406
2437 if((q.Count == 0) && (TypeBytesSent <= ((int)(Throttle / m_throttleTimeDivisor)))) 2407 if((q.Count == 0) && (TypeBytesSent <= ((int)(Throttle / throttleTimeDivisor))))
2438 { 2408 {
2439 m_bytesSent += item.Packet.ToBytes().Length; 2409 bytesSent += item.Packet.ToBytes().Length;
2440 TypeBytesSent += item.Packet.ToBytes().Length; 2410 TypeBytesSent += item.Packet.ToBytes().Length;
2441 m_packetQueue.Enqueue(item); 2411 PacketQueue.Enqueue(item);
2442 } 2412 }
2443 else 2413 else
2444 { 2414 {
@@ -2458,34 +2428,34 @@ namespace OpenSim.Region.ClientStack
2458 switch (throttlePacketType) 2428 switch (throttlePacketType)
2459 { 2429 {
2460 case ThrottleOutPacketType.Resend: 2430 case ThrottleOutPacketType.Resend:
2461 ThrottleCheck(ref m_resendBytesSent, m_resendthrottleOutbound, ref m_resendOutgoingPacketQueue, item); 2431 ThrottleCheck(ref ResendBytesSent, ResendthrottleOutbound, ref ResendOutgoingPacketQueue, item);
2462 break; 2432 break;
2463 case ThrottleOutPacketType.Texture: 2433 case ThrottleOutPacketType.Texture:
2464 ThrottleCheck(ref m_textureBytesSent, m_texturethrottleOutbound, ref m_textureOutgoingPacketQueue, item); 2434 ThrottleCheck(ref TextureBytesSent, TexturethrottleOutbound, ref TextureOutgoingPacketQueue, item);
2465 break; 2435 break;
2466 case ThrottleOutPacketType.Task: 2436 case ThrottleOutPacketType.Task:
2467 ThrottleCheck(ref m_taskBytesSent, m_taskthrottleOutbound, ref m_taskOutgoingPacketQueue, item); 2437 ThrottleCheck(ref TaskBytesSent, TaskthrottleOutbound, ref TaskOutgoingPacketQueue, item);
2468 break; 2438 break;
2469 case ThrottleOutPacketType.Land: 2439 case ThrottleOutPacketType.Land:
2470 ThrottleCheck(ref m_landBytesSent, m_landthrottleOutbound, ref m_landOutgoingPacketQueue, item); 2440 ThrottleCheck(ref LandBytesSent, LandthrottleOutbound, ref LandOutgoingPacketQueue, item);
2471 break; 2441 break;
2472 case ThrottleOutPacketType.Asset: 2442 case ThrottleOutPacketType.Asset:
2473 ThrottleCheck(ref m_assetBytesSent, m_assetthrottleOutbound, ref m_assetOutgoingPacketQueue, item); 2443 ThrottleCheck(ref AssetBytesSent, AssetthrottleOutbound, ref AssetOutgoingPacketQueue, item);
2474 break; 2444 break;
2475 case ThrottleOutPacketType.Cloud: 2445 case ThrottleOutPacketType.Cloud:
2476 ThrottleCheck(ref m_cloudBytesSent, m_cloudthrottleOutbound, ref m_cloudOutgoingPacketQueue, item); 2446 ThrottleCheck(ref CloudBytesSent, CloudthrottleOutbound, ref CloudOutgoingPacketQueue, item);
2477 break; 2447 break;
2478 case ThrottleOutPacketType.Wind: 2448 case ThrottleOutPacketType.Wind:
2479 ThrottleCheck(ref m_windBytesSent, m_windthrottleOutbound, ref m_windOutgoingPacketQueue, item); 2449 ThrottleCheck(ref WindBytesSent, WindthrottleOutbound, ref WindOutgoingPacketQueue, item);
2480 break; 2450 break;
2481 2451
2482 default: 2452 default:
2483 // Acknowledgements and other such stuff should go directly to the blocking Queue 2453 // Acknowledgements and other such stuff should go directly to the blocking Queue
2484 // Throttling them may and likely 'will' be problematic 2454 // Throttling them may and likely 'will' be problematic
2485 m_packetQueue.Enqueue(item); 2455 PacketQueue.Enqueue(item);
2486 break; 2456 break;
2487 } 2457 }
2488 //m_outgoingPacketQueue.Enqueue(item); 2458 //OutgoingPacketQueue.Enqueue(item);
2489 } 2459 }
2490 2460
2491 # region Low Level Packet Methods 2461 # region Low Level Packet Methods
@@ -2505,10 +2475,10 @@ namespace OpenSim.Region.ClientStack
2505 /* 2475 /*
2506 if (Pack.Header.Reliable) 2476 if (Pack.Header.Reliable)
2507 { 2477 {
2508 lock (m_pendingAcks) 2478 lock (PendingAcks)
2509 { 2479 {
2510 uint sequence = (uint)Pack.Header.Sequence; 2480 uint sequence = (uint)Pack.Header.Sequence;
2511 if (!m_pendingAcks.ContainsKey(sequence)) { m_pendingAcks[sequence] = sequence; } 2481 if (!PendingAcks.ContainsKey(sequence)) { PendingAcks[sequence] = sequence; }
2512 } 2482 }
2513 }*/ 2483 }*/
2514 } 2484 }
@@ -2517,9 +2487,9 @@ namespace OpenSim.Region.ClientStack
2517 { 2487 {
2518 int now = System.Environment.TickCount; 2488 int now = System.Environment.TickCount;
2519 2489
2520 lock (m_needAck) 2490 lock (NeedAck)
2521 { 2491 {
2522 foreach (Packet packet in m_needAck.Values) 2492 foreach (Packet packet in NeedAck.Values)
2523 { 2493 {
2524 if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) 2494 if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
2525 { 2495 {
@@ -2535,11 +2505,11 @@ namespace OpenSim.Region.ClientStack
2535 2505
2536 protected void SendAcks() 2506 protected void SendAcks()
2537 { 2507 {
2538 lock (m_pendingAcks) 2508 lock (PendingAcks)
2539 { 2509 {
2540 if (m_pendingAcks.Count > 0) 2510 if (PendingAcks.Count > 0)
2541 { 2511 {
2542 if (m_pendingAcks.Count > 250) 2512 if (PendingAcks.Count > 250)
2543 { 2513 {
2544 // FIXME: Handle the odd case where we have too many pending ACKs queued up 2514 // FIXME: Handle the odd case where we have too many pending ACKs queued up
2545 MainLog.Instance.Verbose("NETWORK", "Too many ACKs queued up!"); 2515 MainLog.Instance.Verbose("NETWORK", "Too many ACKs queued up!");
@@ -2550,9 +2520,9 @@ namespace OpenSim.Region.ClientStack
2550 2520
2551 int i = 0; 2521 int i = 0;
2552 PacketAckPacket acks = new PacketAckPacket(); 2522 PacketAckPacket acks = new PacketAckPacket();
2553 acks.Packets = new PacketAckPacket.PacketsBlock[m_pendingAcks.Count]; 2523 acks.Packets = new PacketAckPacket.PacketsBlock[PendingAcks.Count];
2554 2524
2555 foreach (uint ack in m_pendingAcks.Values) 2525 foreach (uint ack in PendingAcks.Values)
2556 { 2526 {
2557 acks.Packets[i] = new PacketAckPacket.PacketsBlock(); 2527 acks.Packets[i] = new PacketAckPacket.PacketsBlock();
2558 acks.Packets[i].ID = ack; 2528 acks.Packets[i].ID = ack;
@@ -2562,7 +2532,7 @@ namespace OpenSim.Region.ClientStack
2562 acks.Header.Reliable = false; 2532 acks.Header.Reliable = false;
2563 OutPacket(acks, ThrottleOutPacketType.Unknown); 2533 OutPacket(acks, ThrottleOutPacketType.Unknown);
2564 2534
2565 m_pendingAcks.Clear(); 2535 PendingAcks.Clear();
2566 } 2536 }
2567 } 2537 }
2568 } 2538 }
@@ -3415,7 +3385,7 @@ namespace OpenSim.Region.ClientStack
3415 // If the client didn't send acceptable values.... 3385 // If the client didn't send acceptable values....
3416 // Scale the clients values down until they are acceptable. 3386 // Scale the clients values down until they are acceptable.
3417 3387
3418 if (tall <= m_throttleOutboundMax) 3388 if (tall <= throttleOutboundMax)
3419 { 3389 {
3420 // Sanity 3390 // Sanity
3421 // Making sure the client sends sane values 3391 // Making sure the client sends sane values
@@ -3424,61 +3394,61 @@ namespace OpenSim.Region.ClientStack
3424 // Then Check Min of type 3394 // Then Check Min of type
3425 3395
3426 // Resend throttle 3396 // Resend throttle
3427 if (tResend <= m_resendthrottleMAX) 3397 if (tResend <= ResendthrottleMAX)
3428 m_resendthrottleOutbound = tResend; 3398 ResendthrottleOutbound = tResend;
3429 3399
3430 if (tResend < m_resendthrottleMin) 3400 if (tResend < ResendthrottleMin)
3431 m_resendthrottleOutbound = m_resendthrottleMin; 3401 ResendthrottleOutbound = ResendthrottleMin;
3432 3402
3433 // Land throttle 3403 // Land throttle
3434 if (tLand <= m_landthrottleMax) 3404 if (tLand <= LandthrottleMax)
3435 m_landthrottleOutbound = tLand; 3405 LandthrottleOutbound = tLand;
3436 3406
3437 if (tLand < m_landthrottleMin) 3407 if (tLand < LandthrottleMin)
3438 m_landthrottleOutbound = m_landthrottleMin; 3408 LandthrottleOutbound = LandthrottleMin;
3439 3409
3440 // Wind throttle 3410 // Wind throttle
3441 if (tWind <= m_windthrottleMax) 3411 if (tWind <= WindthrottleMax)
3442 m_windthrottleOutbound = tWind; 3412 WindthrottleOutbound = tWind;
3443 3413
3444 if (tWind < m_windthrottleMin) 3414 if (tWind < WindthrottleMin)
3445 m_windthrottleOutbound = m_windthrottleMin; 3415 WindthrottleOutbound = WindthrottleMin;
3446 3416
3447 // Cloud throttle 3417 // Cloud throttle
3448 if (tCloud <= m_cloudthrottleMax) 3418 if (tCloud <= CloudthrottleMax)
3449 m_cloudthrottleOutbound = tCloud; 3419 CloudthrottleOutbound = tCloud;
3450 3420
3451 if (tCloud < m_cloudthrottleMin) 3421 if (tCloud < CloudthrottleMin)
3452 m_cloudthrottleOutbound = m_cloudthrottleMin; 3422 CloudthrottleOutbound = CloudthrottleMin;
3453 3423
3454 // Task throttle 3424 // Task throttle
3455 if (tTask <= m_taskthrottleMax) 3425 if (tTask <= TaskthrottleMax)
3456 m_taskthrottleOutbound = tTask; 3426 TaskthrottleOutbound = tTask;
3457 3427
3458 if (tTask < m_taskthrottleMin) 3428 if (tTask < TaskthrottleMin)
3459 m_taskthrottleOutbound = m_taskthrottleMin; 3429 TaskthrottleOutbound = TaskthrottleMin;
3460 3430
3461 // Texture throttle 3431 // Texture throttle
3462 if (tTexture <= m_texturethrottleMax) 3432 if (tTexture <= TexturethrottleMax)
3463 m_texturethrottleOutbound = tTexture; 3433 TexturethrottleOutbound = tTexture;
3464 3434
3465 if (tTexture < m_texturethrottleMin) 3435 if (tTexture < TexturethrottleMin)
3466 m_texturethrottleOutbound = m_texturethrottleMin; 3436 TexturethrottleOutbound = TexturethrottleMin;
3467 3437
3468 //Asset throttle 3438 //Asset throttle
3469 if (tAsset <= m_assetthrottleMax) 3439 if (tAsset <= AssetthrottleMax)
3470 m_assetthrottleOutbound = tAsset; 3440 AssetthrottleOutbound = tAsset;
3471 3441
3472 if (tAsset < m_assetthrottleMin) 3442 if (tAsset < AssetthrottleMin)
3473 m_assetthrottleOutbound = m_assetthrottleMin; 3443 AssetthrottleOutbound = AssetthrottleMin;
3474 3444
3475 /* MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + m_resendthrottleOutbound + 3445 /* MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + ResendthrottleOutbound +
3476 " landbytes=" + m_landthrottleOutbound + 3446 " landbytes=" + LandthrottleOutbound +
3477 " windbytes=" + m_windthrottleOutbound + 3447 " windbytes=" + WindthrottleOutbound +
3478 " cloudbytes=" + m_cloudthrottleOutbound + 3448 " cloudbytes=" + CloudthrottleOutbound +
3479 " taskbytes=" + m_taskthrottleOutbound + 3449 " taskbytes=" + TaskthrottleOutbound +
3480 " texturebytes=" + m_texturethrottleOutbound + 3450 " texturebytes=" + TexturethrottleOutbound +
3481 " Assetbytes=" + m_assetthrottleOutbound + 3451 " Assetbytes=" + AssetthrottleOutbound +
3482 " Allbytes=" + tall); 3452 " Allbytes=" + tall);
3483 */ 3453 */
3484 } 3454 }
@@ -3498,23 +3468,23 @@ namespace OpenSim.Region.ClientStack
3498 // it's client recommended level (won't scale it down) 3468 // it's client recommended level (won't scale it down)
3499 // unless it's beyond sane values itself. 3469 // unless it's beyond sane values itself.
3500 3470
3501 if (tResend <= m_resendthrottleMAX) 3471 if (tResend <= ResendthrottleMAX)
3502 { 3472 {
3503 // This is nexted because we only want to re-set the values 3473 // This is nexted because we only want to re-set the values
3504 // the packet throttler uses once. 3474 // the packet throttler uses once.
3505 3475
3506 if (tResend >= m_resendthrottleMin) 3476 if (tResend >= ResendthrottleMin)
3507 { 3477 {
3508 m_resendthrottleOutbound = tResend; 3478 ResendthrottleOutbound = tResend;
3509 } 3479 }
3510 else 3480 else
3511 { 3481 {
3512 m_resendthrottleOutbound = m_resendthrottleMin; 3482 ResendthrottleOutbound = ResendthrottleMin;
3513 } 3483 }
3514 } 3484 }
3515 else 3485 else
3516 { 3486 {
3517 m_resendthrottleOutbound = m_resendthrottleMAX; 3487 ResendthrottleOutbound = ResendthrottleMAX;
3518 } 3488 }
3519 3489
3520 3490
@@ -3529,12 +3499,12 @@ namespace OpenSim.Region.ClientStack
3529 // Okay.. now we've got the percentages of total communication. 3499 // Okay.. now we've got the percentages of total communication.
3530 // Apply them to a new max total 3500 // Apply them to a new max total
3531 3501
3532 int tLandResult = (int)(LandPercent * m_throttleOutboundMax); 3502 int tLandResult = (int)(LandPercent * throttleOutboundMax);
3533 int tWindResult = (int)(WindPercent * m_throttleOutboundMax); 3503 int tWindResult = (int)(WindPercent * throttleOutboundMax);
3534 int tCloudResult = (int)(CloudPercent * m_throttleOutboundMax); 3504 int tCloudResult = (int)(CloudPercent * throttleOutboundMax);
3535 int tTaskResult = (int)(TaskPercent * m_throttleOutboundMax); 3505 int tTaskResult = (int)(TaskPercent * throttleOutboundMax);
3536 int tTextureResult = (int)(TexturePercent * m_throttleOutboundMax); 3506 int tTextureResult = (int)(TexturePercent * throttleOutboundMax);
3537 int tAssetResult = (int)(AssetPercent * m_throttleOutboundMax); 3507 int tAssetResult = (int)(AssetPercent * throttleOutboundMax);
3538 3508
3539 // Now we have to check our scaled values for sanity 3509 // Now we have to check our scaled values for sanity
3540 3510
@@ -3542,54 +3512,54 @@ namespace OpenSim.Region.ClientStack
3542 // Then Check Min of type 3512 // Then Check Min of type
3543 3513
3544 // Land throttle 3514 // Land throttle
3545 if (tLandResult <= m_landthrottleMax) 3515 if (tLandResult <= LandthrottleMax)
3546 m_landthrottleOutbound = tLandResult; 3516 LandthrottleOutbound = tLandResult;
3547 3517
3548 if (tLandResult < m_landthrottleMin) 3518 if (tLandResult < LandthrottleMin)
3549 m_landthrottleOutbound = m_landthrottleMin; 3519 LandthrottleOutbound = LandthrottleMin;
3550 3520
3551 // Wind throttle 3521 // Wind throttle
3552 if (tWindResult <= m_windthrottleMax) 3522 if (tWindResult <= WindthrottleMax)
3553 m_windthrottleOutbound = tWindResult; 3523 WindthrottleOutbound = tWindResult;
3554 3524
3555 if (tWindResult < m_windthrottleMin) 3525 if (tWindResult < WindthrottleMin)
3556 m_windthrottleOutbound = m_windthrottleMin; 3526 WindthrottleOutbound = WindthrottleMin;
3557 3527
3558 // Cloud throttle 3528 // Cloud throttle
3559 if (tCloudResult <= m_cloudthrottleMax) 3529 if (tCloudResult <= CloudthrottleMax)
3560 m_cloudthrottleOutbound = tCloudResult; 3530 CloudthrottleOutbound = tCloudResult;
3561 3531
3562 if (tCloudResult < m_cloudthrottleMin) 3532 if (tCloudResult < CloudthrottleMin)
3563 m_cloudthrottleOutbound = m_cloudthrottleMin; 3533 CloudthrottleOutbound = CloudthrottleMin;
3564 3534
3565 // Task throttle 3535 // Task throttle
3566 if (tTaskResult <= m_taskthrottleMax) 3536 if (tTaskResult <= TaskthrottleMax)
3567 m_taskthrottleOutbound = tTaskResult; 3537 TaskthrottleOutbound = tTaskResult;
3568 3538
3569 if (tTaskResult < m_taskthrottleMin) 3539 if (tTaskResult < TaskthrottleMin)
3570 m_taskthrottleOutbound = m_taskthrottleMin; 3540 TaskthrottleOutbound = TaskthrottleMin;
3571 3541
3572 // Texture throttle 3542 // Texture throttle
3573 if (tTextureResult <= m_texturethrottleMax) 3543 if (tTextureResult <= TexturethrottleMax)
3574 m_texturethrottleOutbound = tTextureResult; 3544 TexturethrottleOutbound = tTextureResult;
3575 3545
3576 if (tTextureResult < m_texturethrottleMin) 3546 if (tTextureResult < TexturethrottleMin)
3577 m_texturethrottleOutbound = m_texturethrottleMin; 3547 TexturethrottleOutbound = TexturethrottleMin;
3578 3548
3579 //Asset throttle 3549 //Asset throttle
3580 if (tAssetResult <= m_assetthrottleMax) 3550 if (tAssetResult <= AssetthrottleMax)
3581 m_assetthrottleOutbound = tAssetResult; 3551 AssetthrottleOutbound = tAssetResult;
3582 3552
3583 if (tAssetResult < m_assetthrottleMin) 3553 if (tAssetResult < AssetthrottleMin)
3584 m_assetthrottleOutbound = m_assetthrottleMin; 3554 AssetthrottleOutbound = AssetthrottleMin;
3585 3555
3586 /* MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + m_resendthrottleOutbound + 3556 /* MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + ResendthrottleOutbound +
3587 " landbytes=" + m_landthrottleOutbound + 3557 " landbytes=" + LandthrottleOutbound +
3588 " windbytes=" + m_windthrottleOutbound + 3558 " windbytes=" + WindthrottleOutbound +
3589 " cloudbytes=" + m_cloudthrottleOutbound + 3559 " cloudbytes=" + CloudthrottleOutbound +
3590 " taskbytes=" + m_taskthrottleOutbound + 3560 " taskbytes=" + TaskthrottleOutbound +
3591 " texturebytes=" + m_texturethrottleOutbound + 3561 " texturebytes=" + TexturethrottleOutbound +
3592 " Assetbytes=" + m_assetthrottleOutbound + 3562 " Assetbytes=" + AssetthrottleOutbound +
3593 " Allbytes=" + tall); 3563 " Allbytes=" + tall);
3594 */ 3564 */
3595 } 3565 }
@@ -3597,20 +3567,20 @@ namespace OpenSim.Region.ClientStack
3597 { 3567 {
3598 // The client sent a stupid value.. 3568 // The client sent a stupid value..
3599 // We're going to set the throttles to the minimum possible 3569 // We're going to set the throttles to the minimum possible
3600 m_resendthrottleOutbound = m_resendthrottleMin; 3570 ResendthrottleOutbound = ResendthrottleMin;
3601 m_landthrottleOutbound = m_landthrottleMin; 3571 LandthrottleOutbound = LandthrottleMin;
3602 m_windthrottleOutbound = m_windthrottleMin; 3572 WindthrottleOutbound = WindthrottleMin;
3603 m_cloudthrottleOutbound = m_cloudthrottleMin; 3573 CloudthrottleOutbound = CloudthrottleMin;
3604 m_taskthrottleOutbound = m_taskthrottleMin; 3574 TaskthrottleOutbound = TaskthrottleMin;
3605 m_texturethrottleOutbound = m_texturethrottleMin; 3575 TexturethrottleOutbound = TexturethrottleMin;
3606 m_assetthrottleOutbound = m_assetthrottleMin; 3576 AssetthrottleOutbound = AssetthrottleMin;
3607 MainLog.Instance.Verbose("THROTTLE", "ClientSentBadThrottle Using:resendbytes=" + m_resendthrottleOutbound + 3577 MainLog.Instance.Verbose("THROTTLE", "ClientSentBadThrottle Using:resendbytes=" + ResendthrottleOutbound +
3608 " landbytes=" + m_landthrottleOutbound + 3578 " landbytes=" + LandthrottleOutbound +
3609 " windbytes=" + m_windthrottleOutbound + 3579 " windbytes=" + WindthrottleOutbound +
3610 " cloudbytes=" + m_cloudthrottleOutbound + 3580 " cloudbytes=" + CloudthrottleOutbound +
3611 " taskbytes=" + m_taskthrottleOutbound + 3581 " taskbytes=" + TaskthrottleOutbound +
3612 " texturebytes=" + m_texturethrottleOutbound + 3582 " texturebytes=" + TexturethrottleOutbound +
3613 " Assetbytes=" + m_assetthrottleOutbound + 3583 " Assetbytes=" + AssetthrottleOutbound +
3614 " Allbytes=" + tall); 3584 " Allbytes=" + tall);
3615 } 3585 }
3616 } 3586 }
@@ -3618,13 +3588,13 @@ namespace OpenSim.Region.ClientStack
3618 // This has the effect of 'wiggling the slider 3588 // This has the effect of 'wiggling the slider
3619 // causes prim and stuck textures that didn't download to download 3589 // causes prim and stuck textures that didn't download to download
3620 3590
3621 m_resendBytesSent = 0; 3591 ResendBytesSent = 0;
3622 m_landBytesSent = 0; 3592 LandBytesSent = 0;
3623 m_windBytesSent = 0; 3593 WindBytesSent = 0;
3624 m_cloudBytesSent = 0; 3594 CloudBytesSent = 0;
3625 m_taskBytesSent = 0; 3595 TaskBytesSent = 0;
3626 m_assetBytesSent = 0; 3596 AssetBytesSent = 0;
3627 m_textureBytesSent = 0; 3597 TextureBytesSent = 0;
3628 3598
3629 //Yay, we've finally handled the agent Throttle packet! 3599 //Yay, we've finally handled the agent Throttle packet!
3630 break; 3600 break;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 29a8219..40de870 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -396,7 +396,6 @@ namespace OpenSim.Region.Environment.Scenes
396 module.Close(); 396 module.Close();
397 } 397 }
398 } 398 }
399
400 Modules.Clear(); 399 Modules.Clear();
401 400
402 base.Close(); 401 base.Close();