Files
libremetaverse/libsecondlife/examples/Key2Name/key2name.cs
John Hurliman 1cb7f4c253 Huge svn cleanup!
* libsecondlife-cs is now libsecondlife
* All applications that are staying have been moved to trunk/
* SLProxy loads Analyst plugin by default if no other plugin is specified on the command line

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1068 52acb1d6-8a22-11de-b505-999d5b087335
2007-03-26 23:12:39 +00:00

44 lines
1.3 KiB
C#

using System;
using libsecondlife;
using libsecondlife.Utilities;
namespace Key2Name
{
class Program
{
static void Main(string[] args)
{
if (args.Length < 4)
{
Console.WriteLine("Usage: Key2Name [loginfirstname] [loginlastname] [password] [key]");
return;
}
SecondLife client = new SecondLife();
Console.WriteLine("Attempting to connect and login to Second Life.");
// Login to Second Life
if (!client.Network.Login(args[0], args[1], args[2], "key2name", "jessemalthus@gmail.com"))
{
// Login failed
Console.WriteLine("Error logging in: " + client.Network.LoginError);
return;
}
AvatarTracker avatarTracker = new AvatarTracker(client);
LLUUID lookup = new LLUUID();
LLUUID.TryParse(args[3], out lookup);
Console.WriteLine("Looking up name for " + lookup.ToStringHyphenated());
string name = avatarTracker.GetAvatarName(lookup);
Console.WriteLine("Name: " + name + Environment.NewLine + "Press enter to logout.");
Console.ReadLine();
client.Network.Logout();
}
}
}