Moving examples, mapgenerator, and VisualParamGenerator to Programs folder (SVN is seriously ruined still, don't check out yet)
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1961 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
|
||||
namespace OpenMetaverse.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.Stats.Dilation.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenMetaverse.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("UUID: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.ID.ToString());
|
||||
uint x, y;
|
||||
Helpers.LongToUInts(Client.Network.CurrentSim.Handle, out x, out y);
|
||||
output.AppendLine(String.Format("Handle: {0} (X: {1} Y: {2})", Client.Network.CurrentSim.Handle, x, y));
|
||||
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.ToString());
|
||||
output.Append("TerrainBase1: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainBase1.ToString());
|
||||
output.Append("TerrainBase2: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainBase2.ToString());
|
||||
output.Append("TerrainBase3: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainBase3.ToString());
|
||||
output.Append("TerrainDetail0: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainDetail0.ToString());
|
||||
output.Append("TerrainDetail1: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainDetail1.ToString());
|
||||
output.Append("TerrainDetail2: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainDetail2.ToString());
|
||||
output.Append("TerrainDetail3: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.TerrainDetail3.ToString());
|
||||
output.Append("Water Height: ");
|
||||
output.AppendLine(Client.Network.CurrentSim.WaterHeight.ToString());
|
||||
|
||||
return output.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Programs/examples/TestClient/Commands/Stats/StatsCommand.cs
Normal file
47
Programs/examples/TestClient/Commands/Stats/StatsCommand.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
|
||||
namespace OpenMetaverse.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.Stats.Dilation, sim.Stats.IncomingBPS, sim.Stats.OutgoingBPS,
|
||||
sim.Stats.ResentPackets, sim.Stats.ReceivedResends));
|
||||
}
|
||||
}
|
||||
|
||||
Simulator csim = Client.Network.CurrentSim;
|
||||
|
||||
output.Append("Packets in the queue: " + Client.Network.InboxCount);
|
||||
output.AppendLine(String.Format("FPS : {0} PhysicsFPS : {1} AgentUpdates : {2} Objects : {3} Scripted Objects : {4}",
|
||||
csim.Stats.FPS, csim.Stats.PhysicsFPS, csim.Stats.AgentUpdates, csim.Stats.Objects, csim.Stats.ScriptedObjects));
|
||||
output.AppendLine(String.Format("Frame Time : {0} Net Time : {1} Image Time : {2} Physics Time : {3} Script Time : {4} Other Time : {5}",
|
||||
csim.Stats.FrameTime, csim.Stats.NetTime, csim.Stats.ImageTime, csim.Stats.PhysicsTime, csim.Stats.ScriptTime, csim.Stats.OtherTime));
|
||||
output.AppendLine(String.Format("Agents : {0} Child Agents : {1} Active Scripts : {2}",
|
||||
csim.Stats.Agents, csim.Stats.ChildAgents, csim.Stats.ActiveScripts));
|
||||
|
||||
return output.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Programs/examples/TestClient/Commands/Stats/UptimeCommand.cs
Normal file
25
Programs/examples/TestClient/Commands/Stats/UptimeCommand.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
|
||||
namespace OpenMetaverse.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) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user