From c77573a2966cfc3ee899bcbf001eb8a97da6229e Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Sat, 29 Nov 2008 02:08:34 +0000 Subject: [PATCH] TC-55 Adds check to login command, displays usage information instead of throwing an exception if no args are passed git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2365 52acb1d6-8a22-11de-b505-999d5b087335 --- Programs/examples/TestClient/ClientManager.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Programs/examples/TestClient/ClientManager.cs b/Programs/examples/TestClient/ClientManager.cs index 55017bb7..57d97046 100644 --- a/Programs/examples/TestClient/ClientManager.cs +++ b/Programs/examples/TestClient/ClientManager.cs @@ -150,6 +150,12 @@ namespace OpenMetaverse.TestClient /// public TestClient Login(string[] args) { + + if (args.Length < 3) + { + Console.WriteLine("Usage: login firstname lastname password [simname] [login server url]"); + return null; + } LoginDetails account = new LoginDetails(); account.FirstName = args[0]; account.LastName = args[1]; @@ -157,8 +163,10 @@ namespace OpenMetaverse.TestClient if (args.Length > 3) account.StartLocation = NetworkManager.StartLocation(args[3], 128, 128, 40); + if (args.Length > 4) - account.URI = args[4]; + if(args[4].StartsWith("http://")) + account.URI = args[4]; return Login(account); }