diff options
author | Sean Dague | 2008-02-26 21:10:57 +0000 |
---|---|---|
committer | Sean Dague | 2008-02-26 21:10:57 +0000 |
commit | 8d31fc2cd03fc08daf0a39b561758aedc7fff51a (patch) | |
tree | 3781030e86f91d9c94381cf85fc5a43b10b63a71 /OpenSim/Tools/pCampBot/pCampBot.cs | |
parent | give pCampBot a -h, -help option (diff) | |
download | opensim-SC-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.zip opensim-SC-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.tar.gz opensim-SC-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.tar.bz2 opensim-SC-8d31fc2cd03fc08daf0a39b561758aedc7fff51a.tar.xz |
require -loginuri on pCampBot
Diffstat (limited to 'OpenSim/Tools/pCampBot/pCampBot.cs')
-rw-r--r-- | OpenSim/Tools/pCampBot/pCampBot.cs | 36 |
1 files changed, 21 insertions, 15 deletions
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" + |