Files
libremetaverse/libsecondlife/examples/Key2Name/key2name.cs
John Hurliman 77a9c8bd23 * XmlRpcCS has been replaced with custom XML handling, all login code has been moved to Login.cs
* XmlRpcCS moved to SLProxy folder, since SLProxy still relies on it
* Client.Network.LoginError is now obsolete, replaced by Client.Network.LoginErrorKey and Client.Network.LoginMessage
* Client.Self now has StartLocation and AgentAccess strings after a successful Login
* Removed the null LLUUID check in _Packets_.cs since LLUUID will be a struct soon
* Fixed directories in mapgen.bat
* AgentThrottle class lives in AgentThrottle.cs now

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1097 52acb1d6-8a22-11de-b505-999d5b087335
2007-04-02 04:37:15 +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.LoginMessage);
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();
}
}
}