/// <summary> /// /// </summary> private void MonitorThreadPro() { while (!mIsClosed) { resetEvent.WaitOne(); resetEvent.Reset(); if (mIsClosed) { break; } if (mProxy.IsConnected) { try { string sname = mProxy.GetRunnerDatabase(); if (!string.IsNullOrEmpty(sname)) { CheckAndLoadDatabase(sname); } else { Thread.Sleep(1000); resetEvent.Set(); continue; } } catch { Thread.Sleep(1000); resetEvent.Set(); continue; } } else { if (!string.IsNullOrEmpty(mDatabaseName)) { CloseDatabase(); } } IsReadyEvent?.Invoke(mProxy.IsConnected); Thread.Sleep(2000); } }
public override void OnEvent(IsReadyEvent evnt) { PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady = !PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady; }
void IsReady_OnClick() { var evnt = IsReadyEvent.Create(); evnt.Send(); }