From e93869c7a785a4f375685ffa33c913033ed1c85a Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 21 Jun 2007 17:08:21 +0000 Subject: * Importing Ming's mass test client --- .../Commands/Stats/DilationCommand.cs | 22 +++++++++++ .../Commands/Stats/RegionInfoCommand.cs | 45 ++++++++++++++++++++++ .../Commands/Stats/StatsCommand.cs | 44 +++++++++++++++++++++ .../Commands/Stats/UptimeCommand.cs | 25 ++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 tools/mass test client/Commands/Stats/DilationCommand.cs create mode 100644 tools/mass test client/Commands/Stats/RegionInfoCommand.cs create mode 100644 tools/mass test client/Commands/Stats/StatsCommand.cs create mode 100644 tools/mass test client/Commands/Stats/UptimeCommand.cs (limited to 'tools/mass test client/Commands/Stats') diff --git a/tools/mass test client/Commands/Stats/DilationCommand.cs b/tools/mass test client/Commands/Stats/DilationCommand.cs new file mode 100644 index 0000000..e6e0a4d --- /dev/null +++ b/tools/mass test client/Commands/Stats/DilationCommand.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class DilationCommand : Command + { + public DilationCommand(TestClient testClient) + { + Name = "dilation"; + Description = "Shows time dilation for current sim."; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + return "Dilation is " + Client.Network.CurrentSim.Dilation.ToString(); + } + } +} \ No newline at end of file diff --git a/tools/mass test client/Commands/Stats/RegionInfoCommand.cs b/tools/mass test client/Commands/Stats/RegionInfoCommand.cs new file mode 100644 index 0000000..750175f --- /dev/null +++ b/tools/mass test client/Commands/Stats/RegionInfoCommand.cs @@ -0,0 +1,45 @@ +using System; +using System.Text; +using libsecondlife; + +namespace libsecondlife.TestClient +{ + public class RegionInfoCommand : Command + { + public RegionInfoCommand(TestClient testClient) + { + Name = "regioninfo"; + Description = "Prints out info about all the current region"; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + StringBuilder output = new StringBuilder(); + output.AppendLine(Client.Network.CurrentSim.ToString()); + output.Append("Access: "); + output.AppendLine(Client.Network.CurrentSim.Access.ToString()); + output.Append("Flags: "); + output.AppendLine(Client.Network.CurrentSim.Flags.ToString()); + output.Append("TerrainBase0: "); + output.AppendLine(Client.Network.CurrentSim.TerrainBase0.ToStringHyphenated()); + output.Append("TerrainBase1: "); + output.AppendLine(Client.Network.CurrentSim.TerrainBase1.ToStringHyphenated()); + output.Append("TerrainBase2: "); + output.AppendLine(Client.Network.CurrentSim.TerrainBase2.ToStringHyphenated()); + output.Append("TerrainBase3: "); + output.AppendLine(Client.Network.CurrentSim.TerrainBase3.ToStringHyphenated()); + output.Append("TerrainDetail0: "); + output.AppendLine(Client.Network.CurrentSim.TerrainDetail0.ToStringHyphenated()); + output.Append("TerrainDetail1: "); + output.AppendLine(Client.Network.CurrentSim.TerrainDetail1.ToStringHyphenated()); + output.Append("TerrainDetail2: "); + output.AppendLine(Client.Network.CurrentSim.TerrainDetail2.ToStringHyphenated()); + output.Append("TerrainDetail3: "); + output.AppendLine(Client.Network.CurrentSim.TerrainDetail3.ToStringHyphenated()); + output.Append("Water Height: "); + output.AppendLine(Client.Network.CurrentSim.WaterHeight.ToString()); + + return output.ToString(); + } + } +} diff --git a/tools/mass test client/Commands/Stats/StatsCommand.cs b/tools/mass test client/Commands/Stats/StatsCommand.cs new file mode 100644 index 0000000..cf3e4e9 --- /dev/null +++ b/tools/mass test client/Commands/Stats/StatsCommand.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class StatsCommand : Command + { + public StatsCommand(TestClient testClient) + { + Name = "stats"; + Description = "Provide connection figures and statistics"; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + StringBuilder output = new StringBuilder(); + + lock (Client.Network.Simulators) + { + for (int i = 0; i < Client.Network.Simulators.Count; i++) + { + Simulator sim = Client.Network.Simulators[i]; + + output.AppendLine(String.Format( + "[{0}] Dilation: {1} InBPS: {2} OutBPS: {3} ResentOut: {4} ResentIn: {5}", + sim.ToString(), sim.Dilation, sim.IncomingBPS, sim.OutgoingBPS, sim.ResentPackets, + sim.ReceivedResends)); + } + } + output.Append("Packets in the queue: " + Client.Network.InboxCount); + output.AppendLine(String.Format("FPS : {0} PhysicsFPS : {1} AgentUpdates : {2} Objects : {3} Scripted Objects : {4}", + Client.Network.CurrentSim.FPS, Client.Network.CurrentSim.PhysicsFPS, Client.Network.CurrentSim.AgentUpdates, Client.Network.CurrentSim.Objects, Client.Network.CurrentSim.ScriptedObjects)); + output.AppendLine(String.Format("Frame Time : {0} Net Time : {1} Image Time : {2} Physics Time : {3} Script Time : {4} Other Time : {5}", + Client.Network.CurrentSim.FrameTime, Client.Network.CurrentSim.NetTime, Client.Network.CurrentSim.ImageTime, Client.Network.CurrentSim.PhysicsTime, Client.Network.CurrentSim.ScriptTime, Client.Network.CurrentSim.OtherTime)); + output.AppendLine(String.Format("Agents : {0} Child Agents : {1} Active Scripts : {2}", + Client.Network.CurrentSim.Agents, Client.Network.CurrentSim.ChildAgents, Client.Network.CurrentSim.ActiveScripts)); + + return output.ToString(); + } + } +} diff --git a/tools/mass test client/Commands/Stats/UptimeCommand.cs b/tools/mass test client/Commands/Stats/UptimeCommand.cs new file mode 100644 index 0000000..ac94644 --- /dev/null +++ b/tools/mass test client/Commands/Stats/UptimeCommand.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class UptimeCommand : Command + { + public DateTime Created = DateTime.Now; + + public UptimeCommand(TestClient testClient) + { + Name = "uptime"; + Description = "Shows the login name, login time and length of time logged on."; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + string name = Client.ToString(); + return "I am " + name + ", Up Since: " + Created + " (" + (DateTime.Now - Created) + ")"; + } + } +} \ No newline at end of file -- cgit v1.1