diff --git a/libsecondlife-cs/examples/Key2Name/Program.cs b/libsecondlife-cs/examples/Key2Name/Program.cs new file mode 100644 index 00000000..55820c4a --- /dev/null +++ b/libsecondlife-cs/examples/Key2Name/Program.cs @@ -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 loginParams = client.Network.DefaultLoginValues(args[0], + args[1], args[2], "00:00:00:00:00:00", "last", "Win", "0", "key2name", + "jessemalthus@gmail.com"); + Dictionary loginReply = new Dictionary(); + 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(); + } + } +} diff --git a/libsecondlife-cs/examples/Key2Name/Properties/AssemblyInfo.cs b/libsecondlife-cs/examples/Key2Name/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..1cc42f4e --- /dev/null +++ b/libsecondlife-cs/examples/Key2Name/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Key2Name")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Thearis Systems/RedWire Virtual")] +[assembly: AssemblyProduct("Key2Name")] +[assembly: AssemblyCopyright("Copyright © Thearis Systems/RedWire Virtual 2006")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d7607cfe-25cf-4240-a0ea-064b54f3b71d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/libsecondlife-cs/libsecondlife.sln b/libsecondlife-cs/libsecondlife.sln index 13467030..a91306e4 100644 --- a/libsecondlife-cs/libsecondlife.sln +++ b/libsecondlife-cs/libsecondlife.sln @@ -52,6 +52,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife.Utilities", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsecondlife.Tests", "libsecondlife.Tests\libsecondlife.Tests.csproj", "{E0BCBBAE-A620-431A-9EB7-30173EAF195B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Key2Name", "examples\Key2Name\Key2Name.csproj", "{7E5841DB-6276-4DED-AFD3-E8004D8508D6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET 1.1 = Debug|.NET 1.1 @@ -220,6 +222,12 @@ Global {E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|.NET 1.1.Build.0 = Release|.NET 1.1 {E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|Any CPU.ActiveCfg = Release|Any CPU {E0BCBBAE-A620-431A-9EB7-30173EAF195B}.Release|Any CPU.Build.0 = Release|Any CPU + {7E5841DB-6276-4DED-AFD3-E8004D8508D6}.Debug|.NET 1.1.ActiveCfg = Debug|Any CPU + {7E5841DB-6276-4DED-AFD3-E8004D8508D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E5841DB-6276-4DED-AFD3-E8004D8508D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E5841DB-6276-4DED-AFD3-E8004D8508D6}.Release|.NET 1.1.ActiveCfg = Release|Any CPU + {7E5841DB-6276-4DED-AFD3-E8004D8508D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E5841DB-6276-4DED-AFD3-E8004D8508D6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE