aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-22 21:40:53 +0000
committerTeravus Ovares2007-11-22 21:40:53 +0000
commitf97aeab9163fb24bee16a0a85328a8d177b046fb (patch)
tree7a440ca4c320666c100ffb7a9b3075d840e3baba
parentCreated a client driven packet throttler. The sim now respects the client's ... (diff)
downloadopensim-SC-f97aeab9163fb24bee16a0a85328a8d177b046fb.zip
opensim-SC-f97aeab9163fb24bee16a0a85328a8d177b046fb.tar.gz
opensim-SC-f97aeab9163fb24bee16a0a85328a8d177b046fb.tar.bz2
opensim-SC-f97aeab9163fb24bee16a0a85328a8d177b046fb.tar.xz
* Quelled a Log format exception in the logging routines.
* Tweaked some esoteric throttle settings * Removed AgentThrottle from the unsupported packet list.
-rw-r--r--OpenSim/Framework/Console/LogBase.cs17
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs11
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs4
3 files changed, 25 insertions, 7 deletions
diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs
index 6651e5d..ec3c5bc 100644
--- a/OpenSim/Framework/Console/LogBase.cs
+++ b/OpenSim/Framework/Console/LogBase.cs
@@ -238,9 +238,16 @@ namespace OpenSim.Framework.Console
238 { 238 {
239 string now = DateTime.Now.ToString("[MM-dd hh:mm:ss] "); 239 string now = DateTime.Now.ToString("[MM-dd hh:mm:ss] ");
240 Log.Write(now); 240 Log.Write(now);
241 Log.WriteLine(format, args); 241 try
242 Log.Flush(); 242 {
243 Log.WriteLine(format, args);
244 Log.Flush();
245 }
243 246
247 catch (FormatException FE)
248 {
249 System.Console.WriteLine(args);
250 }
244 System.Console.Write(now); 251 System.Console.Write(now);
245 try 252 try
246 { 253 {
@@ -255,6 +262,12 @@ namespace OpenSim.Framework.Console
255 // Some older systems dont support coloured text. 262 // Some older systems dont support coloured text.
256 System.Console.WriteLine(format, args); 263 System.Console.WriteLine(format, args);
257 } 264 }
265 catch (System.FormatException)
266 {
267 // Some older systems dont support coloured text.
268 System.Console.WriteLine(args);
269 }
270
258 return; 271 return;
259 } 272 }
260 } 273 }
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 93c12a6..8c4dba6 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -783,7 +783,7 @@ namespace OpenSim.Region.ClientStack
783 783
784 case PacketType.AgentThrottle: 784 case PacketType.AgentThrottle:
785 785
786 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString()); 786 //OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString());
787 787
788 AgentThrottlePacket atpack = (AgentThrottlePacket)Pack; 788 AgentThrottlePacket atpack = (AgentThrottlePacket)Pack;
789 789
@@ -825,6 +825,7 @@ namespace OpenSim.Region.ClientStack
825 tAsset = (int)BitConverter.ToSingle(throttle, j); 825 tAsset = (int)BitConverter.ToSingle(throttle, j);
826 826
827 tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset; 827 tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset;
828 /*
828 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "Client AgentThrottle - Got throttle:resendbytes=" + tResend + 829 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "Client AgentThrottle - Got throttle:resendbytes=" + tResend +
829 " landbytes=" + tLand + 830 " landbytes=" + tLand +
830 " windbytes=" + tWind + 831 " windbytes=" + tWind +
@@ -833,6 +834,8 @@ namespace OpenSim.Region.ClientStack
833 " texturebytes=" + tTexture + 834 " texturebytes=" + tTexture +
834 " Assetbytes=" + tAsset + 835 " Assetbytes=" + tAsset +
835 " Allbytes=" + tall); 836 " Allbytes=" + tall);
837 */
838
836 // Total Sanity 839 // Total Sanity
837 // Make sure that the client sent sane total values. 840 // Make sure that the client sent sane total values.
838 841
@@ -896,7 +899,7 @@ namespace OpenSim.Region.ClientStack
896 if (tAsset < AssetthrottleMin) 899 if (tAsset < AssetthrottleMin)
897 AssetthrottleOutbound = AssetthrottleMin; 900 AssetthrottleOutbound = AssetthrottleMin;
898 901
899 OpenSim.Framework.Console.MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + ResendthrottleOutbound + 902 /* OpenSim.Framework.Console.MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + ResendthrottleOutbound +
900 " landbytes=" + LandthrottleOutbound + 903 " landbytes=" + LandthrottleOutbound +
901 " windbytes=" + WindthrottleOutbound + 904 " windbytes=" + WindthrottleOutbound +
902 " cloudbytes=" + CloudthrottleOutbound + 905 " cloudbytes=" + CloudthrottleOutbound +
@@ -904,6 +907,7 @@ namespace OpenSim.Region.ClientStack
904 " texturebytes=" + TexturethrottleOutbound + 907 " texturebytes=" + TexturethrottleOutbound +
905 " Assetbytes=" + AssetthrottleOutbound + 908 " Assetbytes=" + AssetthrottleOutbound +
906 " Allbytes=" + tall); 909 " Allbytes=" + tall);
910 */
907 } 911 }
908 else 912 else
909 { 913 {
@@ -1006,7 +1010,7 @@ namespace OpenSim.Region.ClientStack
1006 if (tAssetResult < AssetthrottleMin) 1010 if (tAssetResult < AssetthrottleMin)
1007 AssetthrottleOutbound = AssetthrottleMin; 1011 AssetthrottleOutbound = AssetthrottleMin;
1008 1012
1009 OpenSim.Framework.Console.MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + ResendthrottleOutbound + 1013 /* OpenSim.Framework.Console.MainLog.Instance.Verbose("THROTTLE", "Using:resendbytes=" + ResendthrottleOutbound +
1010 " landbytes=" + LandthrottleOutbound + 1014 " landbytes=" + LandthrottleOutbound +
1011 " windbytes=" + WindthrottleOutbound + 1015 " windbytes=" + WindthrottleOutbound +
1012 " cloudbytes=" + CloudthrottleOutbound + 1016 " cloudbytes=" + CloudthrottleOutbound +
@@ -1014,6 +1018,7 @@ namespace OpenSim.Region.ClientStack
1014 " texturebytes=" + TexturethrottleOutbound + 1018 " texturebytes=" + TexturethrottleOutbound +
1015 " Assetbytes=" + AssetthrottleOutbound + 1019 " Assetbytes=" + AssetthrottleOutbound +
1016 " Allbytes=" + tall); 1020 " Allbytes=" + tall);
1021 */
1017 1022
1018 } 1023 }
1019 else 1024 else
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 411883b..b4441ec 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Region.ClientStack
96 // TODO: Make this variable. Lower throttle on un-ack. Raise over time 96 // TODO: Make this variable. Lower throttle on un-ack. Raise over time
97 97
98 // All throttle times and number of bytes are calculated by dividing by this value 98 // All throttle times and number of bytes are calculated by dividing by this value
99 private int throttleTimeDivisor = 5; 99 private int throttleTimeDivisor = 7;
100 100
101 private int throttletimems = 1000; 101 private int throttletimems = 1000;
102 102
@@ -208,7 +208,7 @@ namespace OpenSim.Region.ClientStack
208 // The General overhead of the UDP protocol gets sent to the queue un-throttled by this 208 // The General overhead of the UDP protocol gets sent to the queue un-throttled by this
209 // so This'll pick up about around the right time. 209 // so This'll pick up about around the right time.
210 210
211 int MaxThrottleLoops = 5550; // 50*7 packets can be dequeued at once. 211 int MaxThrottleLoops = 4550; // 50*7 packets can be dequeued at once.
212 int throttleLoops = 0; 212 int throttleLoops = 0;
213 213
214 // We're going to dequeue all of the saved up packets until 214 // We're going to dequeue all of the saved up packets until