Files
libremetaverse/libsecondlife-cs/examples/TestClient/Commands/FindSimCommand.cs
John Hurliman d695369b51 * Set CAPS KeepAlive to false to resolve issue 67
* Big refactoring of GridManager, no more five second sleep. Added MapLayer CAPS stub. GridRegion is now a struct and GetGridRegion() returns a bool
* LLSD integer type now maps to C# type int instead of long. Misc cleanups in LLSD, more is and as usage
* Added RegionFlags and SimAccess enums
* Another try/catch in SLProxy for CAPS connection problems
* Simulator.Equals now compares based on IPEndPoint, == and != overloads added
* Added a stub for making CAPS calls (awaiting the NetworkManager message pumps)
* More CAPS error handling for 404, timed out connections, and misc problems
* FindSim and Goto commands no longer sleep or try to download info on every sim in the grid
* More logging messages output the simulator name that they originated from
* Helpers.FieldToHexString now properly prints the given field name
* Another disconnect sanity check in NetworkManager
* Log() and DebugLog() now use String.Format. Always use String.Format when there are lots of parameters!
* Settings.cs documentation, CROSS_BORDERS renamed to MULTIPLE_SIMS
* Removed pointless libsecondlife.nunit file

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1060 52acb1d6-8a22-11de-b505-999d5b087335
2007-03-21 15:24:51 +00:00

44 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.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, LLUUID fromAgentID)
{
if (args.Length < 1)
return "Usage: findsim [Simulator Name]";
// Build the simulator name from the args list
string simName = string.Empty;
for (int i = 0; i < args.Length; i++)
simName += args[i] + " ";
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, out region))
return String.Format("{0}: handle={1} ({2},{3})", region.Name, region.RegionHandle, region.X, region.Y);
else
return "Lookup of " + simName + " failed";
}
}
}