aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools
diff options
context:
space:
mode:
authorSean Dague2008-02-26 21:10:57 +0000
committerSean Dague2008-02-26 21:10:57 +0000
commit8d31fc2cd03fc08daf0a39b561758aedc7fff51a (patch)
tree3781030e86f91d9c94381cf85fc5a43b10b63a71 /OpenSim/Tools
parentgive pCampBot a -h, -help option (diff)
downloadopensim-SC_OLD-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.zip
opensim-SC_OLD-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.tar.gz
opensim-SC_OLD-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.tar.bz2
opensim-SC_OLD-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.tar.xz
require -loginuri on pCampBot
Diffstat (limited to 'OpenSim/Tools')
-rw-r--r--OpenSim/Tools/pCampBot/PhysicsBot.cs2
-rw-r--r--OpenSim/Tools/pCampBot/pCampBot.cs36
2 files changed, 22 insertions, 16 deletions
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
117 firstname = startupConfig.GetString("firstname", "random"); 117 firstname = startupConfig.GetString("firstname", "random");
118 lastname = startupConfig.GetString("lastname", "random"); 118 lastname = startupConfig.GetString("lastname", "random");
119 password = startupConfig.GetString("password", "12345"); 119 password = startupConfig.GetString("password", "12345");
120 loginURI = startupConfig.GetString("loginuri", "http://10.1.1.5:9000"); 120 loginURI = startupConfig.GetString("loginuri");
121 121
122 122
123 123
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
52 [STAThread] 52 [STAThread]
53 public static void Main(string[] args) 53 public static void Main(string[] args)
54 { 54 {
55 //Set up our nifty config.. thanks to nini 55 IConfig config = ParseConfig(args);
56 ArgvConfigSource cs = new ArgvConfigSource(args); 56 if (config.Get("help") != null || config.Get("loginuri") == null) {
57
58 cs.AddSwitch("Startup", "botcount","n");
59 cs.AddSwitch("Startup", "loginuri","l");
60 cs.AddSwitch("Startup", "firstname");
61 cs.AddSwitch("Startup", "lastname");
62 cs.AddSwitch("Startup", "password");
63 cs.AddSwitch("Startup", "help","h");
64
65 IConfig ol = cs.Configs["Startup"];
66 if (ol.Get("help") != null) {
67 Help(); 57 Help();
68 } else { 58 } else {
69 int botcount = ol.GetInt("botcount", 1); 59 int botcount = config.GetInt("botcount", 1);
70 60
71 BotManager bm = new BotManager(); 61 BotManager bm = new BotManager();
72 62
73 //startup specified number of bots. 1 is the default 63 //startup specified number of bots. 1 is the default
74 bm.dobotStartup(botcount, ol); 64 bm.dobotStartup(botcount, config);
75 while (true) 65 while (true)
76 { 66 {
77 MainConsole.Instance.Prompt(); 67 MainConsole.Instance.Prompt();
78 } 68 }
79 } 69 }
80 } 70 }
71
72 private static IConfig ParseConfig(String[] args)
73 {
74 //Set up our nifty config.. thanks to nini
75 ArgvConfigSource cs = new ArgvConfigSource(args);
76
77 cs.AddSwitch("Startup", "botcount","n");
78 cs.AddSwitch("Startup", "loginuri","l");
79 cs.AddSwitch("Startup", "firstname");
80 cs.AddSwitch("Startup", "lastname");
81 cs.AddSwitch("Startup", "password");
82 cs.AddSwitch("Startup", "help","h");
83
84 IConfig ol = cs.Configs["Startup"];
85 return ol;
86 }
81 87
82 public static void Help() 88 private static void Help()
83 { 89 {
84 System.Console.WriteLine( 90 System.Console.WriteLine(
85 "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n" + 91 "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n" +