diff --git a/OpenSim/Tools/pCampBot/PhysicsBot.cs b/OpenSim/Tools/pCampBot/PhysicsBot.cs index 48ce062692..c3babda16d 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 b701d7d3bd..56f2e262c5 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" +