From a00b7debccafe8d3a84d0ce5db0477ff48bf95d4 Mon Sep 17 00:00:00 2001 From: Michael Cortez Date: Wed, 8 Nov 2006 22:42:52 +0000 Subject: [PATCH] Added ability to teleport git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@540 52acb1d6-8a22-11de-b505-999d5b087335 --- .../IA_InventoryManager.csproj | 2 +- .../examples/IA_InventoryManager/iManager.cs | 46 ++++++++++++++++--- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/libsecondlife-cs/examples/IA_InventoryManager/IA_InventoryManager.csproj b/libsecondlife-cs/examples/IA_InventoryManager/IA_InventoryManager.csproj index 0f61d276..db0c2d65 100644 --- a/libsecondlife-cs/examples/IA_InventoryManager/IA_InventoryManager.csproj +++ b/libsecondlife-cs/examples/IA_InventoryManager/IA_InventoryManager.csproj @@ -15,7 +15,7 @@ true full false - ..\..\bin\ + ..\..\..\bin\ DEBUG;TRACE prompt 4 diff --git a/libsecondlife-cs/examples/IA_InventoryManager/iManager.cs b/libsecondlife-cs/examples/IA_InventoryManager/iManager.cs index 9f4e2826..100eefe7 100644 --- a/libsecondlife-cs/examples/IA_InventoryManager/iManager.cs +++ b/libsecondlife-cs/examples/IA_InventoryManager/iManager.cs @@ -49,7 +49,7 @@ namespace IA_InventoryManager System.Threading.Thread.Sleep(1000); Console.WriteLine("=================================================================="); - Console.WriteLine("The Inventory Manager program provides a simple shell for working with your Second Life[tm] Avatar's Inventory."); + Console.WriteLine("The Inventory Manager program provides a simple shell for working with your Second Life[tm] Avatar."); Console.WriteLine(); Console.WriteLine("Type HELP for a list of available commands."); Console.WriteLine("-------------------------------------------"); @@ -69,6 +69,7 @@ namespace IA_InventoryManager { case "quit": case "exit": + case "bye": case "q": shutdown = true; break; @@ -102,6 +103,10 @@ namespace IA_InventoryManager regioninfo(curCmdLine); break; + case "teleport": + teleport(curCmdLine); + break; + default: Console.WriteLine("Unknown command '" + curCmdLine[0] + "'."); Console.WriteLine("Type HELP for a list of available commands."); @@ -116,14 +121,43 @@ namespace IA_InventoryManager { Console.WriteLine("Currently available commands are: "); Console.WriteLine("LS - List contents of the current directory."); - Console.WriteLine("CD [dir] - Change directory."); - Console.WriteLine("MKDIR [dir] - Make a new directory."); - Console.WriteLine("RMDIR [dir] - Remove directory."); - Console.WriteLine("GETASSET [uuid] - Fetch an asset from SL."); - Console.WriteLine("REGIONINFO [name] - Display Grid Region Info."); + Console.WriteLine("CD - Change directory."); + Console.WriteLine("MKDIR - Make a new directory."); + Console.WriteLine("RMDIR - Remove directory."); + Console.WriteLine("GETASSET - Fetch an asset from SL."); + Console.WriteLine("REGIONINFO - Display Grid Region Info."); + Console.WriteLine("TELEPORT - Teleport to a new sim."); Console.WriteLine("QUIT - Exit the Inventory Manager."); } + private void teleport(string[] cmdLine) + { + if (cmdLine.Length < 5) + { + Console.WriteLine("Usage: teleport [sim] [x] [y] [z]"); + Console.WriteLine("Example: teleport hooper 182 40 26"); + return; + } + + if (cmdLine[1].ToLower() == client.Network.CurrentSim.Region.Name.ToLower()) + { + Console.WriteLine("TODO: Add the ability to teleport somewhere in the local region. " + + "Exiting for now, please specify a region other than the current one"); + } + else + { + if (client.Grid.Regions.Count == 0) + { + Console.WriteLine("Caching estate sims..."); + client.Grid.AddEstateSims(); + System.Threading.Thread.Sleep(3000); + } + + + client.Self.Teleport(cmdLine[1], new LLVector3( float.Parse(cmdLine[2]), float.Parse(cmdLine[3]), float.Parse(cmdLine[4]) ) ); + } + } + private void regioninfo(string[] cmdLine) { if (cmdLine.Length < 2)