From 47810b04d54793bc8be6287086a30494e31569fd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 1 Feb 2024 18:39:43 +0000 Subject: [PATCH] pcampbot do not add 0 to last name if only making one bot; do not try to look for tree textures --- OpenSim/Tools/pCampBot/Bot.cs | 2 +- OpenSim/Tools/pCampBot/BotManager.cs | 21 +++++++++++++++++---- OpenSim/Tools/pCampBot/pCampBot.cs | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs index a14252737d..2c58a96679 100644 --- a/OpenSim/Tools/pCampBot/Bot.cs +++ b/OpenSim/Tools/pCampBot/Bot.cs @@ -650,7 +650,7 @@ namespace pCampBot Primitive prim = args.Prim; - if (prim != null) + if (prim is not null && prim.Textures.DefaultTexture is not null) { lock (m_objects) m_objects[prim.ID] = prim; diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 2b6fbceb07..56bcb90ca9 100755 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -298,16 +298,29 @@ namespace pCampBot Array.ForEach( startupConfig.GetString("behaviours", "p").Split(new char[] { ',' }), b => m_defaultBehaviourSwitches.Add(b)); - for (int i = 0; i < botcount; i++) + if(botcount == 1) { lock (m_bots) { - string lastName = string.Format("{0}{1}", m_lastNameStem, i + m_fromBotNumber); - CreateBot( this, CreateBehavioursFromAbbreviatedNames(m_defaultBehaviourSwitches), - m_firstName, lastName, m_password, m_loginUri, m_startUri, m_wearSetting); + m_firstName, m_lastNameStem, m_password, m_loginUri, m_startUri, m_wearSetting); + } + } + else + { + for (int i = 0; i < botcount; i++) + { + lock (m_bots) + { + string lastName = string.Format("{0}{1}", m_lastNameStem, i + m_fromBotNumber); + + CreateBot( + this, + CreateBehavioursFromAbbreviatedNames(m_defaultBehaviourSwitches), + m_firstName, lastName, m_password, m_loginUri, m_startUri, m_wearSetting); + } } } } diff --git a/OpenSim/Tools/pCampBot/pCampBot.cs b/OpenSim/Tools/pCampBot/pCampBot.cs index f162f10279..990f5e627b 100644 --- a/OpenSim/Tools/pCampBot/pCampBot.cs +++ b/OpenSim/Tools/pCampBot/pCampBot.cs @@ -56,7 +56,7 @@ namespace pCampBot [STAThread] public static void Main(string[] args) { - XmlConfigurator.Configure(); + XmlConfigurator.Configure(new System.IO.FileInfo("pCampBot.exe.config")); IConfig commandLineConfig = ParseConfig(args); if (commandLineConfig.Get("help") != null || commandLineConfig.Get("loginuri") == null)