Ejemplo n.º 1
0
        public async Task <IActionResult> Daily([FromRoute] string symbol,
                                                [FromRoute] int year, [FromRoute][Range(1, 12)] int month, [FromRoute][Range(1, 31)] int day)
        {
            if (!IsMonthValid(month) || !IsDayValid(day))
            {
                return(BadRequest());
            }

            var dateTime = new DateTime(year, month, day);
            var price    = await _analyticsService.GetDailyAsync(symbol, dateTime);

            if (price == null)
            {
                return(NotFound());
            }

            var result = new DailyModel()
            {
                Symbol = symbol,
                Day    = dateTime,
                Price  = Map(price)
            };

            return(Ok(result));
        }
Ejemplo n.º 2
0
    public DailyModel GetDailyState(String Id)
    {
        DailyModel model = null;

        Lock();

        if (m_pDailyState.ContainsKey(Id))
        {
            model = m_pDailyState[Id];
        }
        else
        {
            XmlElement   e    = m_pDoc.CreateElement(@"daily");
            XmlAttribute attr = m_pDoc.CreateAttribute(@"id");
            attr.Value = Id;
            e.Attributes.Append(attr);

            XmlNode dailys = m_pDoc.SelectSingleNode(@"root/dailys");
            dailys.AppendChild(e);

            model = new DailyModel(e, this);

            m_pDailyState.Add(Id, model);

            SaveDbToFile();
        }

        Unlock();

        return(model);
    }
    public void SetDone()
    {
        String     key   = DateTime.Now.ToShortDateString();
        DailyModel model = m_pDb.GetDailyState(key);
        Boolean    ret   = model.MissionComplete(Id);

        if (ret)
        {
            PocketModule pocket = m_pDb.GetPocketModel();
            pocket.Point.UpdatePoint(Award);

            List <DailyMissionAssociatedAchievementModel> assolist = m_pModel.AssociatedAchievementModelList;
            foreach (DailyMissionAssociatedAchievementModel tmp in assolist)
            {
                AchievementGroupModel achi_model = m_pDb.GetAchievementsModel().GetAchievementGroup(tmp.AchievementId);
                if (achi_model != null)
                {
                    achi_model.SetProgress(tmp.Progress);
                }
            }

            DateTime          time     = DateTime.Now;
            GregorianCalendar calendar = new GregorianCalendar();
            int    weekOfYears         = calendar.GetWeekOfYear(time, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
            String weekKey             = time.Year + "-" + weekOfYears;

            WeeksModel weekModel = m_pDb.GetWeekyState(weekKey);
            weekModel.UpdateProgress(Award);
        }
    }
        private DailyModel GetTodayDaily()
        {
            using (var db = new SystemDBContext())
            {
                var today    = DateTime.Today;
                var tomorrow = today.AddDays(1).AddHours(-1);

                var daily =
                    db.Daylies.FirstOrDefault(
                        x => x.UserHashId == UserToken.UserId && x.BeginTime >= today && x.EndTime <= tomorrow);

                if (daily == null)
                {
                    daily = new DailyModel()
                    {
                        BeginTime  = today,
                        EndTime    = tomorrow,
                        IsDone     = false,
                        UserHashId = UserToken.UserId,
                        DailyType  = DailyModelHelper.GetDailyType(today)
                    };

                    db.Daylies.Add(daily);
                    db.SaveChanges();
                }
                return(daily);
            }
        }
Ejemplo n.º 5
0
        public bool Update(DailyModel model)
        {
            try
            {
                tbl_DailyDetail tbl = new tbl_DailyDetail();
                tbl.Id          = model.Id;
                tbl.FormTime    = model.FormTime;
                tbl.ToTime      = model.ToTime;
                tbl.Content_Job = model.Content_Job;
                tbl.Method      = model.Method;
                tbl.Result      = model.Result;
                tbl.JobId       = model.JobId;
                tbl.DailyId     = model.DailyId;

                db.Entry(tbl).State = System.Data.Entity.EntityState.Modified;

                db.SaveChanges();
                string Total_Job = Calculator(model.DailyId);
                if (!string.IsNullOrWhiteSpace(Total_Job))
                {
                    var cal = db.tbl_Daily.Find(model.DailyId);
                    cal.Total_Job = Total_Job;
                }
                ;
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Monthly([FromRoute] string symbol, [FromRoute] int year, [FromRoute] int month)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var response = await _analyticsService.GetMonthlyAsync(symbol, year, month);

                    if (response != null)
                    {
                        var result = new DailyModel()
                        {
                            Symbol = symbol,
                            Day    = DateTime.Now.Date,
                            Price  = Map(response)
                        };

                        return(Ok(result));
                    }
                    return(NotFound());
                }
                catch (Exception)
                {
                }
            }
            return(BadRequest("error occured"));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Daily([FromRoute] string symbol, [FromRoute] int year, [FromRoute] int month, [FromRoute] int day)
        {
            //try
            //{
            var prices = await _analyticsService.GetDailyAsync(symbol, new DateTime(year, month, day));

            var result = new DailyModel()
            {
                Symbol = symbol,
                Day    = new DateTime(year, month, day),
                Price  = Map(prices)
            };

            return(Ok(result));
            //}
            //catch (ApplicationException exp)
            //{
            //    if (exp.Message.Contains("NotFound:"))
            //        return NotFound(exp.Message);
            //    return BadRequest(exp.Message);
            //}
            //catch (Exception exp) //TO DO [Done]: Move this exception moved to middleware extension
            //{
            //    return BadRequest(exp.Message);
            //}
        }
Ejemplo n.º 8
0
        private void AddUpdate()
        {
            if (_date.Length == 0 || _name.Length == 0 || _amount.Length == 0)
            {
                return;
            }

            if (_isAddMode == false)
            {
                _selectedItem.DeleteData();
                ItemCollection.Remove(_selectedItem);
            }

            DailyModel newItem = new DailyModel();

            newItem.Type   = _selectedType;
            newItem.Date   = _date;
            newItem.Name   = _name;
            newItem.Amount = int.Parse(_amount.Replace(",", ""));

            ItemCollection.Add(newItem);

            newItem.AddData();

            _lastSearchedStartDayofPeriod = DateTime.MinValue; // In order to update period total amount
            _monthSearched = 0;                                // In order to update monthly total amount
            InitializeList();                                  // In order to update all the IDs
            TextBoxInitialize();
            UpdateText();
        }
Ejemplo n.º 9
0
 private void Clear()
 {
     _isAddMode    = true;
     _selectedItem = null;
     TextBoxInitialize();
     UpdateText();
 }
Ejemplo n.º 10
0
 public void GetClientDailySuccess(DailyModel daily)
 {
     GetServiceDailySuccess(daily);
     if (daily.updatetime.AddMinutes(15) < DateTime.Now)
     {
         swipeRefreshLayout.Refreshing = true;
         OnRefresh();
     }
 }
        public async Task <IActionResult> Daily([FromRoute] string symbol, [FromRoute] int year, [FromRoute] int month, [FromRoute] int day)
        {
            // TODO: Add implementation for the daily summary

            //validate route values
            if (symbol.Length > 3 || symbol.Length < 3)
            {
                return(BadRequest("Symbol characters exceeded or below"));
            }

            if (year == 0 || month == 0 || day == 0)
            {
                return(BadRequest("Incorrect Route Values for date"));
            }

            if (year < 1000)
            {
                return(BadRequest("The year value is less"));
            }

            if (!Enumerable.Range(1, 12).Contains(month))
            {
                return(BadRequest("The month value doesn't exist"));
            }

            if (!Enumerable.Range(1, 31).Contains(day))
            {
                return(BadRequest("The day value doesn't exist"));
            }


            //Parse from route values Datetime object
            var queryTime = new DateTime(year, month, day);

            AnalyticsPrice todaysAnalyticsPrice = new AnalyticsPrice();

            //Set validation for route values
            try
            {
                todaysAnalyticsPrice = await _analyticsService.GetDailyAsync(symbol, queryTime);
            }
            catch (Exception e)
            {
                return(NotFound(e.Message));
            }


            var result = new DailyModel()
            {
                Symbol = symbol,
                Day    = queryTime,
                Price  = Map(todaysAnalyticsPrice)
            };

            return(Ok(result));
        }
Ejemplo n.º 12
0
        public void ClearDatabase()
        {
            using (var context = new SystemDBContext())
            {
                var felixHash = GetFelixHashId();
                // Delete all Maps
                foreach (var id in context.Maps.Where(x => x.CreatorhashId != felixHash).Select(e => e.Id))
                {
                    var entity = new MapModel()
                    {
                        Id = id
                    };
                    context.Maps.Attach(entity);
                    context.Maps.Remove(entity);
                }


                // Delete all Dailies
                foreach (var id in context.Daylies.Where(x => x.UserHashId != felixHash).Select(e => e.Id))
                {
                    var entity = new DailyModel()
                    {
                        Id = id
                    };
                    context.Daylies.Attach(entity);
                    context.Daylies.Remove(entity);
                }

                // Delete all Leaderboards
                foreach (var id in context.Leaderboards.Select(e => e.Id))
                {
                    var entity = new LeaderboardModel()
                    {
                        Id = id
                    };
                    context.Leaderboards.Attach(entity);
                    context.Leaderboards.Remove(entity);
                }

                // Delete all Friends
                foreach (var id in context.Friends.Select(e => e.Id))
                {
                    var entity = new FriendModel()
                    {
                        Id = id
                    };
                    context.Friends.Attach(entity);
                    context.Friends.Remove(entity);
                }

                context.SaveChanges();
            }
        }
Ejemplo n.º 13
0
    private void InitDailyState()
    {
        m_pDailyState = new Dictionary <String, DailyModel>();

        XmlNodeList list = m_pDoc.SelectNodes(@"root/dailys/daily");

        foreach (XmlNode tmp in list)
        {
            DailyModel d = new DailyModel(tmp, this);
            m_pDailyState.Add(d.Id, d);
        }
    }
        public async Task <IActionResult> Daily([FromRoute] string symbol, [FromRoute] int year, [FromRoute] int month, [FromRoute] int day)
        {
            // TODO: Add implementation for the daily summary
            var result = new DailyModel()
            {
                Symbol = symbol,
                Day    = new DateTime(),
                Price  = Map(new AnalyticsPrice())
            };

            return(Ok(result));
        }
Ejemplo n.º 15
0
        public ActionResult Index(bool noLayout = false)
        {
            Cache = new DailyModel();
            BountyManager.SampleApiTest();

            if (noLayout)
            {
                return(View("PartialIndex", Cache));
            }

            ViewBag.HtmlTagOverride = @"data-redirect=""/#daily""";
            return(View("Index", Cache));
        }
Ejemplo n.º 16
0
        public async Task <IActionResult> Daily([FromRoute] string symbol, [FromRoute] int year, [FromRoute] int month, [FromRoute] int day)
        {
            var dayDateTime    = new DateTime(year, month, day);
            var analyticsPrice = await _analyticsService.GetDailyAsync(symbol, dayDateTime);

            var result = new DailyModel()
            {
                Symbol = symbol,
                Day    = dayDateTime,
                Price  = Map(analyticsPrice)
            };

            return(Ok(result));
        }
Ejemplo n.º 17
0
 async Task <bool> RenewDailyUI(DailyModel model, DailyExtraModel modelEx)
 {
     if (model == null || modelEx == null || model.title == null)
     {
         return(await Task.FromResult(false));
     }
     return(await Task.Run(() =>
     {
         Title = model.title;
         CssFileName = "daily.css";
         HtmlBody = model.body.Replace("img-place-holder", "img-place-holder1");
         ProgressBarFinish();
         return true;
     }));
 }
Ejemplo n.º 18
0
        private void UpdateConfig()
        {
            AttackModel attackModel = new AttackModel
            {
                Boss        = (bool)BossBattle.IsChecked,
                Friend      = (bool)FriendBattle.IsChecked,
                Guild       = (bool)GuildBattle.IsChecked,
                Brave       = (bool)BraveBattle.IsChecked,
                DoS         = (bool)DoSBattle.IsChecked,
                Expedition  = (bool)ExpeditionBattle.IsChecked,
                PlanetTrial = (bool)PlanetTrialBattle.IsChecked,

                PlanetTrialRetryAmount = Convert.ToInt32(PlanetTrialRetry.Text),
                PlanetTrialAutoRetry   = (bool)PlanetTrialAutoRetry.IsChecked,

                BraveMaxTickets = Convert.ToInt32(BraveMaxTickets.Text),
                BraveMaxCE      = Convert.ToInt32(BraveMaxCE.Text),
                BraveAutoRetry  = (bool)BraveAttackMore.IsChecked,

                GuildRetryAmount = Convert.ToInt32(GuildMax.Text),

                FriendRetryAmount = Convert.ToInt32(FriendRetry.Text),
                FriendMaxOnly     = (bool)FriendMax.IsChecked
            };

            GlobalVariables.attackSettings = attackModel;

            DailyModel dailyModel = new DailyModel
            {
                Alchemy      = (bool)Alchemy.IsChecked,
                SendHearts   = (bool)SendHearts.IsChecked,
                SpinWheel    = (bool)SpinWheel.IsChecked,
                DailyTavern  = (bool)CompleteTavern.IsChecked,
                CombineEquip = (bool)CombineEquip.IsChecked,
                CommonSummon = (bool)PerformCommon.IsChecked,
                GrandSummon  = (bool)PerformGrand.IsChecked,
                DailyBrave   = (bool)CompleteBrave.IsChecked,

                SendFriendReq     = (bool)SendFriend.IsChecked,
                AcceptFreindReq   = (bool)AcceptFriends.IsChecked,
                DeclineFriendReq  = (bool)DeclineFriends.IsChecked,
                DailyBag          = (bool)DailyBag.IsChecked,
                PurchaseDoSTicket = (bool)PurchaseDoS.IsChecked,
                DeleteMail        = (bool)DeleteMail.IsChecked
            };

            WriteIni.UpdateConfig(attackModel, dailyModel);
        }
Ejemplo n.º 19
0
        public void GetServiceDailySuccess(DailyModel daily)
        {
            if (swipeRefreshLayout.Refreshing)
            {
                swipeRefreshLayout.Refreshing = false;
            }
            if (daily != null && daily.id > 0)
            {
                this.daily     = daily;
                title          = daily.title;
                txtTitle.Text  = daily.title;
                txtAuthor.Text = daily.image_source;
                body.Settings.JavaScriptEnabled = true;
                body.Settings.DomStorageEnabled = true;
                var jsInterface = new WebViewJSInterface(this);
                body.SetWebViewClient(DailyWebViewClient.With(this));
                body.AddJavascriptInterface(jsInterface, "openlistner");
                body.LoadRenderedContent(daily.body.Replace("img-place-holder", "img-place-holder1"));
                jsInterface.CallFromPageReceived += delegate(object sender, WebViewJSInterface.CallFromPageReceivedEventArgs e)
                {
                    switch (e.Type)
                    {
                    case WebViewJSInterface.CallFromType.Image:
                        PhotoActivity.Start(this, e.Result.Split(','), e.Index);
                        break;

                    case WebViewJSInterface.CallFromType.Href:
                        Intent intent = new Intent();
                        intent.SetAction("android.intent.action.VIEW");
                        intent.SetData(Android.Net.Uri.Parse(e.Result));
                        intent.SetClassName("com.android.browser", "com.android.browser.BrowserActivity");
                        StartActivity(intent);
                        break;
                    }
                };
                if (daily.image != "")
                {
                    Picasso.With(this).Load(daily.image).Into(titleImage);
                }
                else
                {
                    appbar.LayoutParameters = new CoordinatorLayout.LayoutParams(CoordinatorLayout.LayoutParams.MatchParent, toolbar.Height);
                    toolbarTitle.Text       = title;
                }
            }
        }
Ejemplo n.º 20
0
 public ActionResult SaveDaily(DailyModel model)
 {
     if (ModelState.IsValid)
     {
         bool status = false;
         if (model.Id > 0)
         {
             status = new DailyDetailDao().Update(model);
         }
         else
         {
             status = new DailyDetailDao().Save(model);
         }
         return(Json(new { status = status }, JsonRequestBehavior.AllowGet));
     }
     ViewBag.Job = new SelectList(new JobDao().GetWithUser(), "Id", "Ten_Job");
     return(PartialView("_DetailDailyReport", model));
 }
Ejemplo n.º 21
0
        public ActionResult DetailReport(long mad, int ma)
        {
            if (new DailyReportDao().CheckPermission(ma))
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
            DailyModel model = new DailyModel();

            if (mad > 0)
            {
                model = new DailyDetailDao().detail(mad, ma);
            }
            else
            {
                model.DailyId = ma;
            }
            ViewBag.Job = new SelectList(new JobDao().GetWithUser(), "Id", "Ten_Job");
            return(PartialView("_DetailDailyReport", model));
        }
Ejemplo n.º 22
0
        public async Task <IActionResult> Daily([FromRoute] string symbol, [FromRoute] int year, [FromRoute] int month, [FromRoute] int day)
        {
            var result = await _analyticsService.GetDailyAsync(symbol, new DateTime(year, month, day));

            if (result != null)
            {
                var dailyResult = new DailyModel
                {
                    Price  = Map(result),
                    Symbol = symbol,
                    Day    = new DateTime(year, month, day)
                };

                return(Ok(dailyResult));
            }
            else
            {
                return(NotFound("not found"));
            }
        }
Ejemplo n.º 23
0
        public override async Task InitializeAsync(object navigationData)
        {
            if (IsInitialize == true)
            {
                return;
            }
            model = await dailyPresenter.GetClientDaily(Id);            //从本地数据库获取

            modelEx = await dailyPresenter.GetClientDailyExtra(Id);     //从本地数据库获取

            IsProgressing |= await RenewDailyUI(model, modelEx) == false;

            ProgressBarRunning();
            if (model.title == "" || model.updatetime.AddMinutes(15) < DateTime.Now)
            {
                model = await dailyPresenter.GetServiceDaily(Id);

                modelEx = await dailyPresenter.GetServiceDailyExtra(Id);
                await RenewDailyUI(model, modelEx);

                IsProgressing = false;
            }
            IsInitialize = true;
        }
Ejemplo n.º 24
0
        private static bool ClaimDailies()
        {
            if (!Main.CheckSameDay(GlobalVariables.LAST_RAN))
            {
                Main.LogConsole($"Bot Hasn't Been Ran Since {GlobalVariables.LAST_RAN} Completing Daily Tasks");
                GlobalVariables.tasksSettings = new TasksModel(); //Resets Everything back to default
                GlobalVariables.LAST_RAN      = DateTime.Now;
            }
            else
            {
                Main.LogConsole($"Bot Already Ran Today. No Need To Re-Do Everything");
            }

            if (GlobalVariables.EVENTS_COMPLETED)
            {
                return(true);
            }

            TasksModel tasks = GlobalVariables.tasksSettings;
            DailyModel daily = GlobalVariables.dailySettings;

            if (!tasks.FriendsClaimed && daily.SendHearts)
            {
                Main.LogConsole("Claiming Friend Requests");
                if (UpdatePlayerInfo.ClaimFriends())
                {
                    tasks.FriendsClaimed = true;
                    tasks.SentHears      = true;
                }
            }

            if (!tasks.DailyClaimed)
            {
                Main.LogConsole("Claiming Daily Privalege");
                tasks.DailyClaimed = UpdatePlayerInfo.ClaimPrivellage();;
            }

            if (!tasks.Defeat3Claimed)
            {
                Main.LogConsole("Defeating Daily 3 waves");
                tasks.Defeat3Claimed = UpdatePlayerInfo.Defeat3Main();
            }


            if (!tasks.AlchemyClaimed && daily.Alchemy)
            {
                Main.LogConsole("Claiming Alchemy");
                tasks.AlchemyClaimed = UpdatePlayerInfo.ClaimAlchemy();
            }


            if (!tasks.SpunWheel && daily.SpinWheel)
            {
                Main.LogConsole("Spinning Daily Wheel");
                tasks.SpunWheel = UpdatePlayerInfo.SpinWheel();
            }

            if (!tasks.CompletedTavern && daily.DailyTavern)
            {
                Main.LogConsole("Completing Daily Tavern Quests");
                tasks.CompletedTavern = UpdatePlayerInfo.ClaimTavernQuest();
            }

            if (!tasks.CombinedEquip && daily.CombineEquip)
            {
                Main.LogConsole("Combining 3 Equipment");
                tasks.CombinedEquip = UpdatePlayerInfo.CombineEquipment();
            }

            if (!tasks.PerformedCommon && daily.CommonSummon)
            {
                Main.LogConsole("Performing Common Summon");
                tasks.PerformedCommon = UpdatePlayerInfo.SummonCommonKey();
            }

            if (!tasks.PerformedGrand && daily.GrandSummon)
            {
                Main.LogConsole("Performing Grand Summon");
                tasks.PerformedGrand = UpdatePlayerInfo.SummonGrandKey();
            }

            if (!tasks.CompletedBrave && daily.DailyBrave)
            {
                Main.LogConsole("Attacking Brave");
                Attack.BraveAttackHandler();
                Attack.BraveAttackHandler();
                tasks.CompletedBrave = true;
            }

            if (!tasks.CompletedEvents)
            {
                Main.LogConsole("Attacking Daily Events");
                tasks.CompletedEvents = UpdatePlayerInfo.ClaimEvents();
            }

            if (tasks.CombinedEquip && tasks.AlchemyClaimed && tasks.SentHears && tasks.SentHears && tasks.SpunWheel && tasks.CompletedTavern && tasks.PerformedCommon && tasks.PerformedGrand && tasks.Defeat3Claimed && tasks.CompletedEvents)
            {
                Main.LogConsole("All Daily Quests Finishes. Claiming Rewards.");
                tasks.CompletedQuests = true;
                UpdatePlayerInfo.ClaimQuestReward();
            }

            UpdatePlayerInfo.MineGuildGold();
            UpdatePlayerInfo.SetGuildTeam();

            GlobalVariables.LAST_RAN = DateTime.Now;


            //Claim Mail
            UpdatePlayerInfo.ClaimMail();

            //Update Global Variables Settings
            GlobalVariables.tasksSettings = tasks;
            GlobalVariables.LAST_RAN      = DateTime.Now;

            Ini.WriteIni.UpdateConfig(GlobalVariables.attackSettings, GlobalVariables.dailySettings);

            return(true);
        }
Ejemplo n.º 25
0
        public static void ReadFile()
        {
            var IniFile = "BotConfig.Ini";


            try
            {
                var     parser = new FileIniDataParser();
                IniData data   = parser.ReadFile(IniFile);
                GlobalVariables.LAST_RAN         = DateTime.Parse(data["General"]["Bot Last Ran"]);
                GlobalVariables.CURRENCY_INFO[2] = Convert.ToInt32(data["General"]["Player Level"]);
                AttackModel attackModel = new AttackModel
                {
                    Boss        = Boolean.Parse(data["Battle"]["Boss Battle"]),
                    Friend      = Boolean.Parse(data["Battle"]["Friend Battle"]),
                    Guild       = Boolean.Parse(data["Battle"]["Guild Battle"]),
                    Brave       = Boolean.Parse(data["Battle"]["Brave Battle"]),
                    DoS         = Boolean.Parse(data["Battle"]["DoS Battle"]),
                    Expedition  = Boolean.Parse(data["Battle"]["Expedition Battle"]),
                    PlanetTrial = Boolean.Parse(data["Battle"]["Planet Trial Battle"]),

                    PlanetTrialRetryAmount = Convert.ToInt32(data["Battle Extra"]["Planet Trial Retry"]),
                    PlanetTrialAutoRetry   = Boolean.Parse(data["Battle Extra"]["Planet Trial Auto Retry"]),

                    BraveMaxTickets = Convert.ToInt32(data["Battle Extra"]["Brave Max Tickets"]),
                    BraveMaxCE      = Convert.ToInt32(data["Battle Extra"]["Brave Max CE"]),
                    BraveAutoRetry  = Boolean.Parse(data["Battle Extra"]["Brave Auto Retry"]),

                    GuildRetryAmount = Convert.ToInt32(data["Battle Extra"]["Guild Retry"]),

                    FriendRetryAmount = Convert.ToInt32(data["Battle Extra"]["Friend Retry"]),
                    FriendMaxOnly     = Boolean.Parse(data["Battle Extra"]["Friend Auto Retry"])
                };

                GlobalVariables.attackSettings = attackModel;

                DailyModel dailyModel = new DailyModel
                {
                    Alchemy      = Boolean.Parse(data["Daily"]["Alchemy"]),
                    SendHearts   = Boolean.Parse(data["Daily"]["Send Hearts"]),
                    SpinWheel    = Boolean.Parse(data["Daily"]["Spin Wheel"]),
                    DailyTavern  = Boolean.Parse(data["Daily"]["Daily 2 Tavern"]),
                    CombineEquip = Boolean.Parse(data["Daily"]["Combine Equipments"]),
                    CommonSummon = Boolean.Parse(data["Daily"]["Common Summon"]),
                    GrandSummon  = Boolean.Parse(data["Daily"]["Grand Summon"]),
                    DailyBrave   = Boolean.Parse(data["Daily"]["Daily Brave League"]),

                    SendFriendReq     = Boolean.Parse(data["Daily Extra"]["Send Friend Requests"]),
                    AcceptFreindReq   = Boolean.Parse(data["Daily Extra"]["Accept Friend Requests"]),
                    DeclineFriendReq  = Boolean.Parse(data["Daily Extra"]["Decline Friend Requests"]),
                    DailyBag          = Boolean.Parse(data["Daily Extra"]["Claim Free Gift Bad"]),
                    PurchaseDoSTicket = Boolean.Parse(data["Daily Extra"]["Purchase DoS Tickets"]),
                    DeleteMail        = Boolean.Parse(data["Daily Extra"]["Delete Mail"])
                };

                GlobalVariables.dailySettings = dailyModel;
            }
            catch
            {
                Main.LogConsole("Error Reading Config! Reseting Config....");
                File.Delete("BotConfig.ini");
                WriteIni.WriteConfig();
            }
        }
Ejemplo n.º 26
0
 public DailyDetail(DailyModel model)
 {
     InitializeComponent();
     this.DataContext = model;
 }
 public void SetDay(DailyModel inDailyModel)
 {
     day = inDailyModel;
 }
Ejemplo n.º 28
0
 public async Task <IActionResult> Daily([FromQuery] DailyModel model)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
Ejemplo n.º 29
0
        public static void UpdateConfig(AttackModel attackModel, DailyModel dailyModel)
        {
            var IniFile = "BotConfig.Ini";

            var parser = new IniDataParser();

            IniData parsedData;

            using (FileStream fs = File.Open(IniFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                using (StreamReader sr = new StreamReader(fs, System.Text.Encoding.UTF8))
                {
                    parsedData = parser.Parse(sr.ReadToEnd());
                }
            }

            // Modify the loaded ini file
            //General Header
            parsedData["General"]["version"]      = "1.0";
            parsedData["General"]["Bot Last Ran"] = GlobalVariables.LAST_RAN.ToString();
            parsedData["General"]["Player Last"]  = "0";
            //parsedData["General"]["Bot Last Ran"] = DateTime.Now.ToString();

            parsedData["Battle"]["Boss Battle"]         = attackModel.Boss.ToString();
            parsedData["Battle"]["Friend Battle"]       = attackModel.Friend.ToString();
            parsedData["Battle"]["Guild Battle"]        = attackModel.Guild.ToString();
            parsedData["Battle"]["Brave Battle"]        = attackModel.Brave.ToString();
            parsedData["Battle"]["DoS Battle"]          = attackModel.DoS.ToString();
            parsedData["Battle"]["Expedition Battle"]   = attackModel.Expedition.ToString();
            parsedData["Battle"]["Planet Trial Battle"] = attackModel.PlanetTrial.ToString();

            parsedData["Battle Extra"]["Planet Trial Retry"]      = attackModel.PlanetTrialRetryAmount.ToString();
            parsedData["Battle Extra"]["Planet Trial Auto Retry"] = attackModel.PlanetTrialAutoRetry.ToString();

            parsedData["Battle Extra"]["Brave Max Tickets"] = attackModel.BraveMaxTickets.ToString();
            parsedData["Battle Extra"]["Brave Max CE"]      = attackModel.BraveMaxCE.ToString();
            parsedData["Battle Extra"]["Brave Auto Retry"]  = attackModel.BraveAutoRetry.ToString();

            parsedData["Battle Extra"]["Guild Retry"] = attackModel.GuildRetryAmount.ToString();

            parsedData["Battle Extra"]["Friend Retry"]      = attackModel.FriendRetryAmount.ToString();
            parsedData["Battle Extra"]["Friend Auto Retry"] = attackModel.FriendMaxOnly.ToString();

            parsedData["Daily"]["Alchemy"]            = dailyModel.Alchemy.ToString();
            parsedData["Daily"]["Send Hearts"]        = dailyModel.SendHearts.ToString();
            parsedData["Daily"]["Spin Wheel"]         = dailyModel.SpinWheel.ToString();
            parsedData["Daily"]["Daily 2 Tavern"]     = dailyModel.DailyTavern.ToString();
            parsedData["Daily"]["Combine Equipments"] = dailyModel.CombineEquip.ToString();
            parsedData["Daily"]["Common Summon"]      = dailyModel.CommonSummon.ToString();
            parsedData["Daily"]["Grand Summon"]       = dailyModel.GrandSummon.ToString();
            parsedData["Daily"]["Daily Brave League"] = dailyModel.DailyBrave.ToString();

            parsedData["Daily Extra"]["Send Friend Requests"]    = dailyModel.SendFriendReq.ToString();
            parsedData["Daily Extra"]["Accept Friend Requests"]  = dailyModel.AcceptFreindReq.ToString();
            parsedData["Daily Extra"]["Decline Friend Requests"] = dailyModel.DeclineFriendReq.ToString();
            parsedData["Daily Extra"]["Claim Free Gift Bad"]     = dailyModel.DailyBag.ToString();
            parsedData["Daily Extra"]["Purchase DoS Tickets"]    = dailyModel.PurchaseDoSTicket.ToString();
            parsedData["Daily Extra"]["Delete Mail"]             = dailyModel.DeleteMail.ToString();

            var fileparser = new FileIniDataParser();

            fileparser.WriteFile(IniFile, parsedData);
        }