示例#1
0
        public void OnFindPlayer(Player player)
        {
            if (_gameState == GameState.Follow)
            {
                return;
            }

            _follow      = player;
            _actionState = ActionState.FindPlayer;
            _wait.Start(TimeSpan.FromSeconds(3));
        }
 private void StartButton_Click(object sender, EventArgs e)
 {
     WaitTimer.Start();
     CountdownThread.RunWorkerAsync();
     StartButton.Enabled = false;
     StopButton.Enabled  = true;
 }
示例#3
0
        void Start()
        {
            _actor       = GetComponent <Actor>();
            _actionState = ActionState.Stand;

            _wait = new WaitTimer();
            _wait.Start(TimeSpan.FromSeconds(3));
        }
示例#4
0
 private void Waitbutton_Click(object sender, EventArgs e)
 {
     RoadTimer.Enabled    = false;
     GeneralTimer.Enabled = false;
     GeneralTimer.Start();
     WaitTimer.Start();
     Contbutton.Enabled = true;
     Waitbutton.Enabled = false;
 }
 public void StartLengthyOperation()
 {
     if (WaitTimer.Enabled)
     {
         return;
     }
     this.ShowWaitForm();
     WaitTimer.Start();
 }
示例#6
0
文件: LanUser.cs 项目: prape/LanIM
        //发送上线
        public void Login()
        {
            foreach (IPAddress broadcastAddr in this.BroadcastAddress)
            {
                //先发送一个空操作,以防失败
                SendEmptyPacket(broadcastAddr);
                Thread.Sleep(100);

                UdpPacket packet = new UdpPacket();
                packet.Address = broadcastAddr;
                packet.Port    = this.Port;
                packet.ToMAC   = string.Empty;
                packet.Command = UdpPacket.CMD_ENTRY |
                                 UdpPacket.CMD_OPTION_STATE_NICKNAME |
                                 //UdpPacket.CMD_OPTION_STATE_PROFILE_PHOTO | //TODO 应该更新所有的,但是跨网的时候好像发送的byte太长,不能正常发送暂且去掉头像
                                 UdpPacket.CMD_OPTION_STATE_PUBKEY |
                                 UdpPacket.CMD_OPTION_STATE_STATUS;
                packet.FromMAC = this.MAC;

                UdpPacketStateExtend extend = new UdpPacketStateExtend();
                extend.PublicKey    = _client.SecurityKeys.Public;//送公钥出去
                extend.NickName     = this.NickName;
                extend.ProfilePhoto = ProfilePhotoPool.GetPhoto(this.ID, false);
                extend.Status       = this.Status;

                packet.Extend = extend;
                _client.Send(packet);
                Thread.Sleep(100);
            }

            //10分钟以后更新头像
            WaitTimer.Start(1 * 60 * 10 * 1000,
                            new TimerCallback((obj) =>
            {
                UpdateState(LanIM.UpdateState.Photo);
            }
                                              ), null);
        }
示例#7
0
 /// <summary>
 /// Load event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void WatchdogWindow_Load(object sender, EventArgs e)
 {
     WaitTimer.Start();
     StatusLabel.Text = "Waiting for EVEMon to close.";
 }