Example #1
0
        /// <summary>
        /// Обрабатывает AType:10. Хранит всю информацию о событии AType 10
        /// </summary>
        /// <param name="str">Принимает строку, в которой содержится информация о событии AType:10</param>
        public AType10(string str)
        {
            str  = str.Replace('(', '{');
            str  = str.Replace(')', '}');
            TICK = int.Parse(reg_tick.Match(str).Value);
            PLID = int.Parse(reg_plid.Match(str).Value);
            PID  = int.Parse(reg_pid.Match(str).Value);
            BUL  = int.Parse(reg_bul.Match(str).Value);
            SH   = int.Parse(reg_sh.Match(str).Value);
            BOMB = int.Parse(reg_bomb.Match(str).Value);
            RCT  = int.Parse(reg_rct.Match(str).Value);
            var strcoord = reg_coord.Match(str).Value.Split(new char[] { ',' });

            XPos       = double.Parse(SetApp.ReplaceSeparator(strcoord[0]));
            YPos       = double.Parse(SetApp.ReplaceSeparator(strcoord[1]));
            ZPos       = double.Parse(SetApp.ReplaceSeparator(strcoord[2]));
            IDS        = reg_ids.Match(str).Value;
            LOGIN      = reg_login.Match(str).Value;
            NAME       = reg_name.Match(str).Value;
            TYPE       = reg_type.Match(str).Value;
            COUNTRY    = int.Parse(reg_country.Match(str).Value);
            FORM       = int.Parse(reg_form.Match(str).Value);
            FIELD      = int.Parse(reg_form.Match(str).Value);
            INAIR      = int.Parse(reg_inair.Match(str).Value);
            PARENT     = int.Parse(reg_parent.Match(str).Value);
            ICPL       = int.Parse(reg_icpl.Match(str).Value);
            ISTSTART   = int.Parse(reg_iststart.Match(str).Value);
            PAYLOAD    = int.Parse(reg_payload.Match(str).Value);
            FUEL       = double.Parse(SetApp.ReplaceSeparator(reg_fuel.Match(str).Value));
            SKIN       = reg_skin.Match(str).Value;
            WM         = int.Parse(reg_wm.Match(str).Value);
            GameStatus = GameStatusPilot.Parking.ToString();
            Banned     = CheckBanned();
        }
Example #2
0
 private string GetConnString()
 {
     if (string.IsNullOrEmpty(SetApp.Config.ConnectionString))
     {
         SetApp.SetUp();
     }
     return(SetApp.Config.ConnectionString);
 }
Example #3
0
 protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
 {
     if (string.IsNullOrEmpty(SetApp.Config.ConnectionString))
     {
         SetApp.SetUp();
     }
     optionsBuilder.UseSqlServer(SetApp.Config.ConnectionString);
 }
Example #4
0
        /// <summary>
        /// Обрабатывает AType:6. Хранит всю информацию о событии AType 6. Событие посадки.
        /// </summary>
        /// <param name="str">Принимает строку, в которой содержится информация о событии AType:6</param>
        public AType6(string str)
        {
            str  = str.Replace('(', '{');
            str  = str.Replace(')', '}');
            TICK = int.Parse(reg_tick.Match(str).Value);
            PID  = int.Parse(reg_pid.Match(str).Value);
            var strcoord = reg_coord.Match(str).Value.Split(new char[] { ',' });

            if (strcoord.Length > 1)
            {
                XPos = double.Parse(SetApp.ReplaceSeparator(strcoord[0]));
                YPos = double.Parse(SetApp.ReplaceSeparator(strcoord[1]));
                ZPos = double.Parse(SetApp.ReplaceSeparator(strcoord[2]));
            }
        }
Example #5
0
        /// <summary>
        /// Чтение лог-файла, постановка его в очередь на обработку
        /// </summary>
        /// <param name="pathLog">Принимает путь до лог-файла</param>
        private void ReadLogFile(string pathLog)
        {
            var str = SetApp.GetFile(pathLog);

            if (Form1.TriggerTime)
            {
                qLog.Enqueue(str);
            }
            else
            {
                SetVictoryLog(str, pathLog);
            }
            FileInfo fi = new FileInfo(pathLog);

            File.Move(pathLog, SetApp.Config.DirStatLogs + fi.Name);
        }
Example #6
0
        /// <summary>
        /// Обработка первого лог файла
        /// </summary>
        /// <param name="path">Путь до файла</param>
        private void HandlingFirstLog(string path)
        {
            var str = SetApp.GetFile(path);

            for (int i = 0; i < str.Count; i++)
            {
                if (str[i].Contains("AType:9 "))
                {
                    ReWriteAType9(str, i, str[i], path);
                    break;
                }
            }
            if (File.Exists(path))
            {
                File.Delete(path);
            }
        }
Example #7
0
        /// <summary>
        /// Обрабатывает AType:8. Хранит всю информацию о событии AType8
        /// </summary>
        /// <param name="str">Принимает строку, в которой содержится информация о событии AType:8</param>
        public AType8(string str)
        {
            str    = str.Replace('(', '{');
            str    = str.Replace(')', '}');
            TICK   = int.Parse(reg_tick.Match(str).Value);
            COAL   = int.Parse(reg_coal.Match(str).Value);
            OBJID  = int.Parse(reg_objid.Match(str).Value);
            TYPE   = int.Parse(reg_type.Match(str).Value);
            RES    = int.Parse(reg_res.Match(str).Value);
            ICTYPE = int.Parse(reg_ictype.Match(str).Value);
            var strcoord = reg_coord.Match(str).Value.Split(new char[] { ',' });

            if (strcoord.Length > 1)
            {
                XPos = double.Parse(SetApp.ReplaceSeparator(strcoord[0]));
                YPos = double.Parse(SetApp.ReplaceSeparator(strcoord[1]));
                ZPos = double.Parse(SetApp.ReplaceSeparator(strcoord[2]));
            }
        }
Example #8
0
        /// <summary>
        /// Обрабатывает AType:12. Хранит всю информацию о событии AType 12
        /// </summary>
        /// <param name="str">Принимает строку, в которой содержится информация о событии AType:12</param>
        public AType12(string str)
        {
            str     = str.Replace('(', '{');
            str     = str.Replace(')', '}');
            TICK    = int.Parse(reg_tick.Match(str).Value);
            ID      = int.Parse(reg_id.Match(str).Value);
            TYPE    = reg_type.Match(str).Value;
            COUNTRY = int.Parse(reg_country.Match(str).Value);
            NAME    = reg_name.Match(str).Value;
            PID     = int.Parse(reg_pid.Match(str).Value);
            var strcoord = reg_coord.Match(str).Value.Split(new char[] { ',' });

            if (strcoord.Length > 1)
            {
                XPos = double.Parse(SetApp.ReplaceSeparator(strcoord[0]));
                YPos = double.Parse(SetApp.ReplaceSeparator(strcoord[1]));
                ZPos = double.Parse(SetApp.ReplaceSeparator(strcoord[2]));
            }
            TypeVeh = GetTypeAtype12();
        }