Example #1
0
        private static void ProxyPayment()
        {
            IPayment checkProxy          = new CheckProxy("HDFC", 10002000, DateTime.Now);
            string   checkPaymentReciept = checkProxy.PayFund(10000);

            Console.WriteLine(" Reciept Number : {0}", checkPaymentReciept);

            IPayment onlinePaymentProxy   = new OnlinePaymentProxy("ICICI", 10002222, DateTime.Now);
            string   onlinePaymentReciept = onlinePaymentProxy.PayFund(50000);

            Console.WriteLine(" Reciept Number : {0}", onlinePaymentReciept);
        }
Example #2
0
        public void OnConnect(ConnectEventArgs e)
        {
            string[]   blProvider = GetDNSBLServer().ToArray();
            CheckProxy m_checker  = new CheckProxy(TShock.Players[e.Who].IP, blProvider);

            if (!CheckWhitelist(TShock.Players[e.Who].IP))
            {
                if (m_checker.IPAddr.Valid)
                {
                    if (m_checker.BlackList.IsListed)
                    {
                        TShock.Utils.ForceKick(TShock.Players[e.Who],
                                               string.Format("You are listed on the blacklist at {0}.",
                                                             m_checker.BlackList.VerifiedOnServer), true, false);
                        Log.ConsoleInfo(string.Format("{0} was found on the blacklist at {1}", TShock.Players[e.Who].IP,
                                                      m_checker.BlackList.VerifiedOnServer));
                        e.Handled = true;
                        return;
                    }
                }
            }
        }
Example #3
0
        public void InitSelenium(Account acc)
        {
            this.acc = acc;
            var access = acc.Access.GetNewAccess();

            SetupChromeDriver(access, acc.AccInfo.Nickname, acc.AccInfo.ServerUrl);

            if (this.Html == null)
            {
                this.Html = new HtmlAgilityPack.HtmlDocument();
            }

            // If account is using a proxy, check if the proxy is working correctly
            if (!string.IsNullOrEmpty(access.Proxy))
            {
                var checkProxy = new CheckProxy()
                {
                    ExecuteAt = DateTime.MinValue.AddMinutes(1)
                };
                TaskExecutor.AddTask(acc, checkProxy);
            }
        }
        public async Task InitSelenium(Account acc, bool newAccess = true)
        {
            this.acc = acc;
            Access access = newAccess ? await acc.Access.GetNewAccess() : acc.Access.GetCurrentAccess();

            SetupChromeDriver(access, acc.AccInfo.Nickname, acc.AccInfo.ServerUrl);

            if (this.Html == null)
            {
                this.Html = new HtmlAgilityPack.HtmlDocument();
            }

            InitHttpClient(access);
            if (!string.IsNullOrEmpty(access.Proxy))
            {
                var checkproxy = new CheckProxy();
                await checkproxy.Execute(acc);
            }
            else
            {
                await this.Navigate(acc.AccInfo.ServerUrl);
            }
        }
Example #5
0
 public void OnConnect(int pID, HandledEventArgs e)
 {
     string[] blProvider = GetDNSBLServer().ToArray();
     CheckProxy m_checker= new CheckProxy(TShock.Players[pID].IP,blProvider);
     if (!CheckWhitelist(TShock.Players[pID].IP))
     {
         if (m_checker.IPAddr.Valid)
         {
             if (m_checker.BlackList.IsListed)
             {
                 TShock.Utils.ForceKick(TShock.Players[pID],
                                        string.Format("You are listed on the blacklist at {0}.",
                                                      m_checker.BlackList.VerifiedOnServer), true, false);
                 Log.ConsoleInfo(string.Format("{0} was found on the blacklist at {1}", TShock.Players[pID].IP,
                                               m_checker.BlackList.VerifiedOnServer));
                 e.Handled = true;
                 return;
             }
         }
     }
 }