Initial commit

I wish I could figure out how to have PlexVie be out of the LibOMV tree but its just not working die to a DLL not found exception about libopenjpeg. (Yes the dll is in the bin folder)
This will do for now
This commit is contained in:
Blake Bourque
2015-06-18 22:15:24 -04:00
commit 0bb2dff347
382 changed files with 273704 additions and 0 deletions
@@ -0,0 +1,23 @@
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.";
Category = CommandCategory.Simulator;
}
public override string Execute(string[] args, UUID fromAgentID)
{
return "Dilation is " + Client.Network.CurrentSim.Stats.Dilation.ToString();
}
}
}
@@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using OpenMetaverse.Packets;
namespace OpenMetaverse.TestClient
{
public class NetstatsCommand : Command
{
public NetstatsCommand(TestClient testClient)
{
Name = "netstats";
Description = "Provide packet and capabilities utilization statistics";
Category = CommandCategory.Simulator;
}
public override string Execute(string[] args, UUID fromAgentID)
{
StringBuilder output = new StringBuilder();
if (!Client.Settings.TRACK_UTILIZATION)
{
return "TRACK_UTILIZATION is not enabled in Settings, statistics not available";
}
StringBuilder packetOutput = new StringBuilder();
StringBuilder capsOutput = new StringBuilder();
packetOutput.AppendFormat("{0,-30}|{1,4}|{2,4}|{3,-10}|{4,-10}|" + System.Environment.NewLine, "Packet Name", "Sent", "Recv",
" TX Bytes ", " RX Bytes ");
capsOutput.AppendFormat("{0,-30}|{1,4}|{2,4}|{3,-10}|{4,-10}|" + System.Environment.NewLine, "Message Name", "Sent", "Recv",
" TX Bytes ", " RX Bytes ");
// " RX "
long packetsSentCount = 0;
long packetsRecvCount = 0;
long packetBytesSent = 0;
long packetBytesRecv = 0;
long capsSentCount = 0;
long capsRecvCount = 0;
long capsBytesSent = 0;
long capsBytesRecv = 0;
foreach (KeyValuePair<string, OpenMetaverse.Stats.UtilizationStatistics.Stat> kvp in Client.Stats.GetStatistics())
{
if (kvp.Value.Type == OpenMetaverse.Stats.Type.Message)
{
capsOutput.AppendFormat("{0,-30}|{1,4}|{2,4}|{3,-10}|{4,-10}|" + System.Environment.NewLine, kvp.Key, kvp.Value.TxCount, kvp.Value.RxCount,
FormatBytes(kvp.Value.TxBytes), FormatBytes(kvp.Value.RxBytes));
capsSentCount += kvp.Value.TxCount;
capsRecvCount += kvp.Value.RxCount;
capsBytesSent += kvp.Value.TxBytes;
capsBytesRecv += kvp.Value.RxBytes;
}
else if (kvp.Value.Type == OpenMetaverse.Stats.Type.Packet)
{
packetOutput.AppendFormat("{0,-30}|{1,4}|{2,4}|{3,-10}|{4,-10}|" + System.Environment.NewLine, kvp.Key, kvp.Value.TxCount, kvp.Value.RxCount,
FormatBytes(kvp.Value.TxBytes), FormatBytes(kvp.Value.RxBytes));
packetsSentCount += kvp.Value.TxCount;
packetsRecvCount += kvp.Value.RxCount;
packetBytesSent += kvp.Value.TxBytes;
packetBytesRecv += kvp.Value.RxBytes;
}
}
capsOutput.AppendFormat("{0,30}|{1,4}|{2,4}|{3,-10}|{4,-10}|" + System.Environment.NewLine, "Capabilities Totals", capsSentCount, capsRecvCount,
FormatBytes(capsBytesSent), FormatBytes(capsBytesRecv));
packetOutput.AppendFormat("{0,30}|{1,4}|{2,4}|{3,-10}|{4,-10}|" + System.Environment.NewLine, "Packet Totals", packetsSentCount, packetsRecvCount,
FormatBytes(packetBytesSent), FormatBytes(packetBytesRecv));
return System.Environment.NewLine + capsOutput.ToString() + System.Environment.NewLine + System.Environment.NewLine + packetOutput.ToString();
}
public string FormatBytes(long bytes)
{
const int scale = 1024;
string[] orders = new string[] { "GB", "MB", "KB", "Bytes" };
long max = (long)Math.Pow(scale, orders.Length - 1);
foreach (string order in orders)
{
if ( bytes > max )
return string.Format("{0:##.##} {1}", decimal.Divide( bytes, max ), order);
max /= scale;
}
return "0";
}
}
}
@@ -0,0 +1,59 @@
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";
Category = CommandCategory.Simulator;
}
public override string Execute(string[] args, UUID fromAgentID)
{
StringBuilder output = new StringBuilder();
output.AppendLine(Client.Network.CurrentSim.ToString());
output.Append("UUID: ");
output.AppendLine(Client.Network.CurrentSim.ID.ToString());
uint x, y;
Utils.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());
output.Append("Datacenter:");
output.AppendLine(Client.Network.CurrentSim.ColoLocation);
output.Append("CPU Ratio:");
output.AppendLine(Client.Network.CurrentSim.CPURatio.ToString());
output.Append("CPU Class:");
output.AppendLine(Client.Network.CurrentSim.CPUClass.ToString());
output.Append("Region SKU/Type:");
output.AppendLine(Client.Network.CurrentSim.ProductSku + " " + Client.Network.CurrentSim.ProductName);
return output.ToString();
}
}
}
@@ -0,0 +1,48 @@
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";
Category = CommandCategory.Simulator;
}
public override string Execute(string[] args, UUID 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();
}
}
}
@@ -0,0 +1,26 @@
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.";
Category = CommandCategory.TestClient;
}
public override string Execute(string[] args, UUID fromAgentID)
{
string name = Client.ToString();
return "I am " + name + ", Up Since: " + Created + " (" + (DateTime.Now - Created) + ")";
}
}
}