Example #1
0
        public void StartBotting(BotMode mode, SteamID target, ulong matchId)
        {
            _log.Debug("Checking if the index file contains a newer available index...");

            ParseIndexFile(); // Before we bot, we parse the index file to get the latest available index

            _log.Debug("Starting botting using index {Index}.", _index);

            List <TitanAccount> accounts;

            if (_accounts.TryGetValue(_index, out accounts))
            {
                try
                {
                    Titan.Instance.ThreadManager.StartWatchdog();
                }
                catch (Exception ex)
                {
                    _log.Warning(ex, "Could not start Watchdog thread, starting to report without one!");
                }

                foreach (var acc in accounts)
                {
                    try
                    {
                        Titan.Instance.ThreadManager.Start(mode, acc, target.AccountID, matchId);
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex, "Could not start reporting for account {Account}: {Message}",
                                   acc.JsonAccount.Username, ex.Message);
                    }
                }
            }
            else
            {
                _log.Error("Could not export accounts for current index {Index}. " +
                           "Does it exist?", _index);
                return;
            }

            if (mode == BotMode.Report)
            {
                Titan.Instance.VictimTracker.AddVictim(target);
            }

            if (!_indexEntries.ContainsKey(_index))
            {
                _indexEntries.Add(_index, TimeUtil.DateTimeToTicks(DateTime.Now.AddHours(6)));
                SaveIndexFile();
            }

            _log.Debug("Index #{Index} has been used. It will be unlocked on {Unlock}. " +
                       "Using index #{NextIndex} for next botting session.",
                       _index, DateTime.Now.AddHours(6).ToLongTimeString(), ++_index);
        }
Example #2
0
        public void StartReporting(int index, ReportInfo info)
        {
            _log.Debug("Starting botting using index {Index}.", index);

            List <TitanAccount> accounts;

            if (Accounts.TryGetValue(index, out accounts))
            {
                try
                {
                    Titan.Instance.ThreadManager.StartWatchdog();
                }
                catch (Exception ex)
                {
                    _log.Warning(ex, "Could not start Watchdog thread, starting to report without one!");
                }

                foreach (var acc in accounts)
                {
                    try
                    {
                        Titan.Instance.ThreadManager.StartReport(acc, info);
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex, "Could not start botting for account {Account}: {Message}",
                                   acc.JsonAccount.Username, ex.Message);
                    }
                }
            }
            else
            {
                _log.Error("Could not export accounts for current index {Index}. " +
                           "Does it exist?", Index);
                return;
            }

            Titan.Instance.VictimTracker.AddVictim(info.SteamID);

            if (!_indexEntries.ContainsKey(index) && index != -1)
            {
                _indexEntries.Add(index, TimeUtil.DateTimeToTicks(DateTime.Now.AddHours(6)));
                SaveIndexFile();
            }

            _log.Debug("Index #{Index} has been used. It will be unlocked on {Unlock}. " +
                       "Suggesting index #{NextIndex} for next botting session.",
                       index, DateTime.Now.AddHours(6).ToLongTimeString(), ++index);
        }
Example #3
0
        public void StartCommending(int index, CommendInfo info)
        {
            _log.Debug("Starting botting using index {Index}.", index);

            if (Accounts.TryGetValue(index, out var accounts))
            {
                accounts.Last().IsLast = true;

                foreach (var acc in accounts)
                {
                    try
                    {
                        Titan.Instance.ThreadManager.StartCommend(acc, info);
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex, "Could not start botting for account {Account}: {Message}",
                                   acc.JsonAccount.Username, ex.Message);
                    }
                }
            }
            else
            {
                _log.Error("Could not export accounts for current index {Index}. " +
                           "Does it exist?", Index);
                return;
            }

            if (!_indexEntries.ContainsKey(index))
            {
                _indexEntries.Add(index, TimeUtil.DateTimeToTicks(DateTime.Now.AddHours(12)));
                SaveIndexFile();
            }

            _log.Debug("Index #{Index} has been used. It will be unlocked on {Unlock}. " +
                       "Suggesting index #{NextIndex} for next botting session.",
                       index, DateTime.Now.AddHours(12).ToLongTimeString(), ++index);
        }