From 8d31fc2cd03fc08daf0a39b561758aedc7fff51a Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 26 Feb 2008 21:10:57 +0000 Subject: require -loginuri on pCampBot --- OpenSim/Tools/pCampBot/PhysicsBot.cs | 2 +- OpenSim/Tools/pCampBot/pCampBot.cs | 36 +++++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'OpenSim/Tools/pCampBot') diff --git a/OpenSim/Tools/pCampBot/PhysicsBot.cs b/OpenSim/Tools/pCampBot/PhysicsBot.cs index 48ce062..c3babda 100644 --- a/OpenSim/Tools/pCampBot/PhysicsBot.cs +++ b/OpenSim/Tools/pCampBot/PhysicsBot.cs @@ -117,7 +117,7 @@ namespace pCampBot firstname = startupConfig.GetString("firstname", "random"); lastname = startupConfig.GetString("lastname", "random"); password = startupConfig.GetString("password", "12345"); - loginURI = startupConfig.GetString("loginuri", "http://10.1.1.5:9000"); + loginURI = startupConfig.GetString("loginuri"); diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index b701d7d..56f2e26 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs @@ -52,34 +52,40 @@ namespace pCampBot [STAThread] public static void Main(string[] args) { - //Set up our nifty config.. thanks to nini - ArgvConfigSource cs = new ArgvConfigSource(args); - - cs.AddSwitch("Startup", "botcount","n"); - cs.AddSwitch("Startup", "loginuri","l"); - cs.AddSwitch("Startup", "firstname"); - cs.AddSwitch("Startup", "lastname"); - cs.AddSwitch("Startup", "password"); - cs.AddSwitch("Startup", "help","h"); - - IConfig ol = cs.Configs["Startup"]; - if (ol.Get("help") != null) { + IConfig config = ParseConfig(args); + if (config.Get("help") != null || config.Get("loginuri") == null) { Help(); } else { - int botcount = ol.GetInt("botcount", 1); + int botcount = config.GetInt("botcount", 1); BotManager bm = new BotManager(); //startup specified number of bots. 1 is the default - bm.dobotStartup(botcount, ol); + bm.dobotStartup(botcount, config); while (true) { MainConsole.Instance.Prompt(); } } } + + private static IConfig ParseConfig(String[] args) + { + //Set up our nifty config.. thanks to nini + ArgvConfigSource cs = new ArgvConfigSource(args); + + cs.AddSwitch("Startup", "botcount","n"); + cs.AddSwitch("Startup", "loginuri","l"); + cs.AddSwitch("Startup", "firstname"); + cs.AddSwitch("Startup", "lastname"); + cs.AddSwitch("Startup", "password"); + cs.AddSwitch("Startup", "help","h"); + + IConfig ol = cs.Configs["Startup"]; + return ol; + } - public static void Help() + private static void Help() { System.Console.WriteLine( "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n" + -- cgit v1.1