require -loginuri on pCampBot
parent
b8e6d6e245
commit
8d31fc2cd0
|
@ -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");
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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" +
|
||||
|
|
Loading…
Reference in New Issue