Files
libremetaverse/libsecondlife-cs/examples/Key2Name/Program.cs
mindtriggerz 0faf97b3dd Added Baba's example Key2Name function.
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@762 52acb1d6-8a22-11de-b505-999d5b087335
2006-12-23 02:55:54 +00:00

42 lines
1.5 KiB
C#

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