From 2c67aa0f41193bf2271b75f060093f44819cdeae Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 14 Aug 2013 21:07:29 +0100
Subject: If pCampbot has been asked to shutdown, don't carry on logging in
queued bots
---
OpenSim/Tools/pCampBot/BotManager.cs | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index 5988584..397a98e 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -52,6 +52,11 @@ namespace pCampBot
public const int DefaultLoginDelay = 5000;
///
+ /// True if pCampbot is in the process of shutting down.
+ ///
+ public bool ShuttingDown { get; private set; }
+
+ ///
/// Delay between logins of multiple bots.
///
/// TODO: This value needs to be configurable by a command line argument.
@@ -186,6 +191,9 @@ namespace pCampBot
for (int i = 0; i < botcount; i++)
{
+ if (ShuttingDown)
+ break;
+
string lastName = string.Format("{0}_{1}", lastNameStem, i + fromBotNumber);
// We must give each bot its own list of instantiated behaviours since they store state.
@@ -363,7 +371,9 @@ namespace pCampBot
private void HandleShutdown(string module, string[] cmd)
{
- m_log.Info("[BOTMANAGER]: Shutting down bots");
+ MainConsole.Instance.Output("Shutting down");
+
+ ShuttingDown = true;
doBotShutdown();
}
--
cgit v1.1