aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/BotManager.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-09 21:22:54 +0000
committerJustin Clark-Casey (justincc)2011-11-09 21:23:23 +0000
commitbbab7b6b4d1053d62037e7e05c37f9cb607db4da (patch)
tree8eab60f2f01db5651832279310440b76f376df09 /OpenSim/Tools/pCampBot/BotManager.cs
parentIn pCampBot, don't try and pull down Primitive faces or sculpts set to null (diff)
downloadopensim-SC_OLD-bbab7b6b4d1053d62037e7e05c37f9cb607db4da.zip
opensim-SC_OLD-bbab7b6b4d1053d62037e7e05c37f9cb607db4da.tar.gz
opensim-SC_OLD-bbab7b6b4d1053d62037e7e05c37f9cb607db4da.tar.bz2
opensim-SC_OLD-bbab7b6b4d1053d62037e7e05c37f9cb607db4da.tar.xz
Use IsConnected status to determine whether all pCampBots have disconnected, rather than maintaining a separate count
Checking IsConnected is more reliable.
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