Do bot startup on another thread so console is responsive during this process

0.7.4.1
Justin Clark-Casey (justincc) 2012-05-11 01:56:00 +01:00
parent 93b615c51d
commit 0ddf3c5289
2 changed files with 5 additions and 1 deletions

View File

@ -222,6 +222,7 @@ namespace pCampBot
Thread pbThread = new Thread(pb.startup); Thread pbThread = new Thread(pb.startup);
pbThread.Name = pb.Name; pbThread.Name = pb.Name;
pbThread.IsBackground = true; pbThread.IsBackground = true;
pbThread.Start(); pbThread.Start();
} }

View File

@ -27,6 +27,7 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
@ -67,7 +68,9 @@ namespace pCampBot
BotManager bm = new BotManager(); BotManager bm = new BotManager();
//startup specified number of bots. 1 is the default //startup specified number of bots. 1 is the default
bm.dobotStartup(botcount, config); Thread startBotThread = new Thread(o => bm.dobotStartup(botcount, config));
startBotThread.Name = "Initial start bots thread";
startBotThread.Start();
while (true) while (true)
{ {