From 3a62f39044403e7bf453c7b5b1fe825a48e908f3 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 14 Aug 2013 18:26:11 +0100 Subject: [PATCH] Add a -form switch to pCampbot to allow one to login a sequence of bots starting from numbers other than 0 --- OpenSim/Tools/pCampBot/BotManager.cs | 3 ++- OpenSim/Tools/pCampBot/pCampBot.cs | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 57bd737527..0fdfa0e050 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -157,6 +157,7 @@ namespace pCampBot string password = startupConfig.GetString("password"); string loginUri = startupConfig.GetString("loginuri"); string startLocation = startupConfig.GetString("start", "last"); + int fromBotNumber = startupConfig.GetInt("from", 0); string wearSetting = startupConfig.GetString("wear", "no"); string startUri = ParseInputStartLocationToUri(startLocation); @@ -178,7 +179,7 @@ namespace pCampBot for (int i = 0; i < botcount; i++) { - string lastName = string.Format("{0}_{1}", lastNameStem, i); + string lastName = string.Format("{0}_{1}", lastNameStem, i + fromBotNumber); // We must give each bot its own list of instantiated behaviours since they store state. List behaviours = new List(); diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index 9c9ed3b232..c8b6304cef 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs @@ -118,6 +118,7 @@ namespace pCampBot ArgvConfigSource cs = new ArgvConfigSource(args); cs.AddSwitch("Startup", "botcount", "n"); + cs.AddSwitch("Startup", "from", "f"); cs.AddSwitch("Startup", "loginuri", "l"); cs.AddSwitch("Startup", "start", "s"); cs.AddSwitch("Startup", "firstname"); @@ -137,15 +138,17 @@ namespace pCampBot // You can either say no, to not load anything, yes, to load one of the default wearables, a folder // name, to load an specific folder, or save, to save an avatar with some already existing wearables // worn to the folder MyAppearance/FirstName_LastName, and the load it. + Console.WriteLine( "usage: pCampBot <-loginuri loginuri> [OPTIONS]\n" + "Spawns a set of bots to test an OpenSim region\n\n" + " -l, -loginuri loginuri for grid/standalone (required)\n" - + " -s, -start 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" - + " -n, -botcount number of bots to start (default: 1)\n" + + " -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" + " -firstname first name for the bots\n" + " -lastname lastname for the bots. Each lastname will have _ appended, e.g. Ima Bot_0\n" + " -password password for the bots\n" + + " -n, -botcount optional number of bots to start (default: 1)\n" + + " -f, -from optional starting number for login bot names, e.g. 25 will login Ima Bot_25, Ima Bot_26, etc. (default: 0)" + " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n" + " current options are:\n" + " p (physics - bots constantly move and jump around)\n" @@ -153,7 +156,7 @@ namespace pCampBot + " n (none - bots do nothing)\n" + " t (teleport - bots regularly teleport between regions on the grid)\n" // " c (cross)" + - + " -wear set appearance folder to load from (default: no)\n" + + " -wear optional folder from which to load appearance data, \"no\" if there is no such folder (default: no)\n" + " -h, -help show this message.\n"); } }