Files

39 lines
1.3 KiB
C#
Raw Permalink Normal View History

using System;
2021-07-25 11:10:52 -05:00
using System.Linq;
namespace OpenMetaverse.TestClient
{
public class FindSimCommand : Command
{
public FindSimCommand(TestClient testClient)
{
Name = "findsim";
Description = "Searches for a simulator and returns information about it. Usage: findsim [Simulator Name]";
}
public override string Execute(string[] args, UUID fromAgentID)
{
if (args.Length < 1)
return "Usage: findsim [Simulator Name]";
// Build the simulator name from the args list
2021-07-25 11:10:52 -05:00
string simName = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
simName = simName.TrimEnd().ToLower();
//if (!GridDataCached[Client])
//{
// Client.Grid.RequestAllSims(GridManager.MapLayerType.Objects);
// System.Threading.Thread.Sleep(5000);
// GridDataCached[Client] = true;
//}
GridRegion region;
if (Client.Grid.GetGridRegion(simName, GridLayerType.Objects, out region))
2022-02-25 19:38:11 -06:00
return $"{region.Name}: handle={region.RegionHandle} ({region.X},{region.Y})";
else
return "Lookup of " + simName + " failed";
}
}
}