Added Baba's example Key2Name function.
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@762 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
41
libsecondlife-cs/examples/Key2Name/Program.cs
Normal file
41
libsecondlife-cs/examples/Key2Name/Program.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user