コード例 #1
0
 private void Upload()
 {
     while (true)
     {
         int    uploadInterval = ConfigurationManager.AppSettings["Upload_Interval"].ToInt();
         string gameName       = ConfigurationManager.AppSettings["ServerGameName"].ToString();
         int    minute         = DateTime.Now.Minute;
         bool   flag           = minute % uploadInterval == 0 && DateTime.Now.Second == 0;
         if (flag)
         {
             SessionModel session = CenterDataFactory.KeyTable();
             PoliceDataFactory.Entrance(session.Id, gameName);
             PoliceDataFactory.InspectTicket(session.Id, gameName);
             PoliceDataFactory.Ticket(session.Id, gameName);
         }
     }
 }
コード例 #2
0
        private void Btn_UploadPolice_Click(object sender, RoutedEventArgs e)
        {
            SaveConfig();
            string    gameName  = txt_game.Text;
            MatchInfo?matchInfo = this.cmb_gagame.SelectedItem as MatchInfo?;

            if (matchInfo != null)
            {
                PoliceDataFactory.Entrance(matchInfo.Value.SessionId, gameName);
                PoliceDataFactory.InspectTicket(matchInfo.Value.SessionId, gameName);
                PoliceDataFactory.Ticket(matchInfo.Value.SessionId, gameName);
                MessageBox.Show("同步数据成功");
            }
            else
            {
                MessageBox.Show("请选择比赛场次");
            }
        }