aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/pCampBot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools/pCampBot/pCampBot.cs')
-rw-r--r--OpenSim/Tools/pCampBot/pCampBot.cs38
1 files changed, 24 insertions, 14 deletions
diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs
index b02f917..781bb00 100644
--- a/OpenSim/Tools/pCampBot/pCampBot.cs
+++ b/OpenSim/Tools/pCampBot/pCampBot.cs
@@ -51,7 +51,7 @@ namespace pCampBot
51 { 51 {
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 public const string ConfigFileName = "pCampbot.ini"; 54 public const string ConfigFileName = "pCampBot.ini";
55 55
56 [STAThread] 56 [STAThread]
57 public static void Main(string[] args) 57 public static void Main(string[] args)
@@ -82,6 +82,13 @@ namespace pCampBot
82 82
83 IConfigSource configSource = new IniConfigSource(iniFilePath); 83 IConfigSource configSource = new IniConfigSource(iniFilePath);
84 84
85 IConfig botManagerConfig = configSource.Configs["BotManager"];
86
87 if (botManagerConfig != null)
88 {
89 bm.LoginDelay = botManagerConfig.GetInt("LoginDelay", bm.LoginDelay);
90 }
91
85 IConfig botConfig = configSource.Configs["Bot"]; 92 IConfig botConfig = configSource.Configs["Bot"];
86 93
87 if (botConfig != null) 94 if (botConfig != null)
@@ -94,11 +101,12 @@ namespace pCampBot
94 } 101 }
95 102
96 int botcount = commandLineConfig.GetInt("botcount", 1); 103 int botcount = commandLineConfig.GetInt("botcount", 1);
104 bool startConnected = commandLineConfig.Get("connect") != null;
105
106 bm.CreateBots(botcount, commandLineConfig);
97 107
98 //startup specified number of bots. 1 is the default 108 if (startConnected)
99 Thread startBotThread = new Thread(o => bm.dobotStartup(botcount, commandLineConfig)); 109 bm.ConnectBots(botcount);
100 startBotThread.Name = "Initial start bots thread";
101 startBotThread.Start();
102 110
103 while (true) 111 while (true)
104 { 112 {
@@ -119,6 +127,7 @@ namespace pCampBot
119 //Set up our nifty config.. thanks to nini 127 //Set up our nifty config.. thanks to nini
120 ArgvConfigSource cs = new ArgvConfigSource(args); 128 ArgvConfigSource cs = new ArgvConfigSource(args);
121 129
130 cs.AddSwitch("Startup", "connect", "c");
122 cs.AddSwitch("Startup", "botcount", "n"); 131 cs.AddSwitch("Startup", "botcount", "n");
123 cs.AddSwitch("Startup", "from", "f"); 132 cs.AddSwitch("Startup", "from", "f");
124 cs.AddSwitch("Startup", "loginuri", "l"); 133 cs.AddSwitch("Startup", "loginuri", "l");
@@ -145,20 +154,21 @@ namespace pCampBot
145 "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n" 154 "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n"
146 + "Spawns a set of bots to test an OpenSim region\n\n" 155 + "Spawns a set of bots to test an OpenSim region\n\n"
147 + " -l, -loginuri loginuri for grid/standalone (required)\n" 156 + " -l, -loginuri loginuri for grid/standalone (required)\n"
148 + " -s, -start optional start location for bots. Can be \"last\", \"home\" or a specific location with or without co-ords (e.g. \"region1\" or \"region2/50/30/90\"\n" 157 + " -s, -start start location for bots (optional). Can be \"last\", \"home\" or a specific location with or without co-ords (e.g. \"region1\" or \"region2/50/30/90\"\n"
149 + " -firstname first name for the bots\n" 158 + " -firstname first name for the bots (required)\n"
150 + " -lastname lastname for the bots. Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n" 159 + " -lastname lastname for the bots (required). Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n"
151 + " -password password for the bots\n" 160 + " -password password for the bots (required)\n"
152 + " -n, -botcount optional number of bots to start (default: 1)\n" 161 + " -n, -botcount number of bots to start (default: 1) (optional)\n"
153 + " -f, -from optional starting number for login bot names, e.g. 25 will login Ima Bot_25, Ima Bot_26, etc. (default: 0)" 162 + " -f, -from starting number for login bot names, e.g. 25 will login Ima Bot_25, Ima Bot_26, etc. (default: 0) (optional)\n"
154 + " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n" 163 + " -c, -connect connect all bots at startup (optional)\n"
164 + " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p (required)\n"
155 + " current options are:\n" 165 + " current options are:\n"
156 + " p (physics - bots constantly move and jump around)\n" 166 + " p (physics - bots constantly move and jump around)\n"
157 + " g (grab - bots randomly click prims whether set clickable or not)\n" 167 + " g (grab - bots randomly click prims whether set clickable or not)\n"
158 + " n (none - bots do nothing)\n" 168 + " n (none - bots do nothing)\n"
159 + " t (teleport - bots regularly teleport between regions on the grid)\n" 169 + " t (teleport - bots regularly teleport between regions on the grid)\n"
160// " c (cross)" + 170// " c (cross)\n" +
161 + " -wear optional folder from which to load appearance data, \"no\" if there is no such folder (default: no)\n" 171 + " -wear folder from which to load appearance data, \"no\" if there is no such folder (default: no) (optional)\n"
162 + " -h, -help show this message.\n"); 172 + " -h, -help show this message.\n");
163 } 173 }
164 } 174 }