示例#1
0
        /// <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);
            }
        }
示例#2
0
 public override void OnEvent(IsReadyEvent evnt)
 {
     PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady = !PlayerObjectRegistry.GetPlayer(evnt.RaisedBy).behavior.state.IsReady;
 }
示例#3
0
    void IsReady_OnClick()
    {
        var evnt = IsReadyEvent.Create();

        evnt.Send();
    }