From dc0f0f5da87d6f7d310b1a3985186ca0af954e3f Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 17 Aug 2009 08:56:40 +0100 Subject: Limit the scrollback buffer output of the command line client to 100 lines (4 screens worth) so things don't scroll endlessly on connect --- OpenSim/ConsoleClient/ConsoleClient.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index 0d4f3cf..1e5f0b7 100644 --- a/OpenSim/ConsoleClient/ConsoleClient.cs +++ b/OpenSim/ConsoleClient/ConsoleClient.cs @@ -163,12 +163,25 @@ namespace OpenSim.ConsoleClient return; } + List lines = new List(); + foreach (XmlNode part in rootNodeL[0].ChildNodes) { if (part.Name != "Line") continue; - string[] parts = part.InnerText.Split(new char[] {':'}, 3); + lines.Add(part.InnerText); + } + + // Cut down scrollback to 100 lines (4 screens) + // for the command line client + // + while (lines.Count > 100) + lines.RemoveAt(0); + + foreach (string l in lines) + { + string[] parts = l.Split(new char[] {':'}, 3); if (parts.Length != 3) continue; -- cgit v1.1