aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/BotManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index 704770a..c4c6f8f 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -51,7 +51,6 @@ namespace pCampBot
51 protected CommandConsole m_console; 51 protected CommandConsole m_console;
52 protected List<Bot> m_lBot; 52 protected List<Bot> m_lBot;
53 protected Random somthing = new Random(Environment.TickCount); 53 protected Random somthing = new Random(Environment.TickCount);
54 protected int numbots = 0;
55 public IConfig Config { get; private set; } 54 public IConfig Config { get; private set; }
56 55
57 /// <summary> 56 /// <summary>
@@ -200,16 +199,17 @@ namespace pCampBot
200 { 199 {
201 case EventType.CONNECTED: 200 case EventType.CONNECTED:
202 m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Connected"); 201 m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Connected");
203 numbots++;
204// m_log.InfoFormat("NUMBOTS {0}", numbots);
205 break; 202 break;
206 case EventType.DISCONNECTED: 203 case EventType.DISCONNECTED:
207 m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Disconnected"); 204 m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Disconnected");
208 numbots--; 205
209// m_log.InfoFormat("NUMBOTS {0}", numbots); 206 lock (m_lBot)
210 if (numbots <= 0) 207 {
211 Environment.Exit(0); 208 if (m_lBot.TrueForAll(b => !b.IsConnected))
212 break; 209 Environment.Exit(0);
210
211 break;
212 }
213 } 213 }
214 } 214 }
215 215