public void Stop() { Output.Instance.Log("char", "Stopping bot ..."); if (workerThread != null) { workerThread.Stop(); workerThread = null; Output.Instance.Log("char", "Bot stopped"); } else Output.Instance.Log("char", "Bot not running."); }
//public PlayerState State //{ // get { return stateManager.State; } //} protected void InitThreadObj() { workerThread = new GThread {Name = "BotManagerThread"}; workerThread.OnRun += OnRun; workerThread.OnException += OnException; workerThread.OnInitialize += OnInitialize; workerThread.OnBeforeStart += OnBeforeStart; workerThread.OnBeforeStop += OnBeforeStop; workerThread.OnFinalize += OnFinalize; workerThread.OnInit += InitConfigParams; }
/// <summary> /// Constructor /// </summary> public BotManager() { //stateManager = StateManager.Instance; //stateManager.Init(); workerThread = null; }
private void OnException(Exception e, GThread.ThreadPhase phase) { //Output.Instance.LogError(e); Console.WriteLine(e.ToString()); }