Resource icon

Approved Proxy Checker 1.1

No permission to download

PearlJ

Contributor
Contributor
Aug 14, 2014
86
16
8
27
Italy
misternerd.eu
Hi,
I have this error with this plugin:
Code:
[IronPython] Error in plugin ProxyChecker:
Traceback (most recent call last):
File "<string>", line 12, in On_PlayerConnected
IndexError: index out of range: 1
 

BogdanWDK

Administrator
Administrator
Jul 31, 2014
109
53
28
23
United Kingdom
That's because plugin cannot track player location and check for proxy. You can ignore that error , it will be fixed in next version which will be uploaded later today.
 

BogdanWDK

Administrator
Administrator
Jul 31, 2014
109
53
28
23
United Kingdom
Soon i'll switch to GeoIP module and there'd be no more errors like i hope.
I recommend disabling it until i'll post an update.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,983
1,467
113
At your house.
github.com
Soon i'll switch to GeoIP module and there'd be no more errors like i hope.
I recommend disabling it until i'll post an update.
GeoIP lite cant tell if Its a proxy. The url that ur requesting changes sometimes. I will post a method that is able to counter that in the morning.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,983
1,467
113
At your house.
github.com
BogdanWDK submitted a new resource:

Proxy Checker - Check player on connect if he's using proxy and take actions on him.



Read more about this resource...
Use this.

Python:
import clr
clr.AddReferenceByPartialName("Fougerite")
import sys
import Fougerite
import re


class ProxyChecker:
   
    def On_PlayerConnected(self, Player):
        try:
            Message = str(Web.GET("http://iphub.info/api.php?ip=" + Player.IP + "&showtype=4"))
            Message = re.findall(r'(?:"proxy":).*', Message)
            Message = re.sub("[\}\"]", "", Message[0])
            isusingproxy = int(Message.split(':')[1])
            if isusingproxy == 1:
                Player.Message("You're using PROXY/VPN/NOLOGIN")
                Player.Message("In order to play here you must not use any Proxy/VPN/Nologin")
                # Player.Message(str(isusingproxy))
                Player.Disconnect()
            else:
                Player.Message("ProxyChecker cannot detect any proxy usage.")
        except:
            pass
 

tarynkelley

Moderator
Moderator
Nov 14, 2015
559
107
28
Parts Unknown
When the IPHUB.info API is down this causes serious lags for your server. This happened for me now the 2-3rd time. I think the only way to fix that is running it on a separate thread and lowering the Web.get timeout.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,983
1,467
113
At your house.
github.com
When the IPHUB.info API is down this causes serious lags for your server. This happened for me now the 2-3rd time. I think the only way to fix that is running it on a separate thread and lowering the Web.get timeout.
Yes, with Fougerite 1.4.6B2

Python:
__author__ = 'BogdanWDK'
__version__ = '1.0'

import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
import re
import sys


class ProxyChecker:

    def DefaultSample(self, Player):
        try:
            Message = str(Web.GET("http://iphub.info/api.php?ip=" + Player.IP + "&showtype=4"))
            Message = re.findall(r'(?:"proxy":).*', Message)
            Message = re.sub("[\}\"]", "", Message[0])
            isusingproxy = int(Message.split(':')[1])
            if isusingproxy == 1:
                Player.Message("You're using PROXY/VPN/NOLOGIN")
                Player.Message("In order to play here you must not use any Proxy/VPN/Nologin")
                Player.Disconnect()
            else:
                Player.Message("ProxyChecker cannot detect any proxy usage.")
        except:
            pass
  
    def On_PlayerConnected(self, Player):
        Loom.ExecuteInBiggerStackThread(lambda:
            self.DefaultSample(Player)
        )
 

tarynkelley

Moderator
Moderator
Nov 14, 2015
559
107
28
Parts Unknown
The latest version of Dretax works. I didn't check yet if the lag disappear. But since it is run in a thread there shouldn't be any lags.
 

tarynkelley

Moderator
Moderator
Nov 14, 2015
559
107
28
Parts Unknown
It doesn't really run in a thread.

The server still produces

"Unresponsive for xxx seconds" errors and freezes when there is a problem with the iphub.info API.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
3,983
1,467
113
At your house.
github.com
I looked through all of my plugins to see why my server was lagging.

I left out the threading, since this plugin is causing lagg spikes.

This solves it.

Python:
import clr
clr.AddReferenceByPartialName("Fougerite")
import sys
import Fougerite


class ProxyChecker:
 
    def On_PlayerConnected(self, Player):
        Loom.ExecuteInBiggerStackThread(lambda:
            self.ProcessPlayer(Player)
        )
     
    def ProcessPlayer(self, Player):
        try:
            Message = str(Web.GET("http://iphub.info/api.php?ip=" + Player.IP + "&showtype=4"))
            Message = Message.replace('"', '').split(",")
            isusingproxy = Message[5]
            isusingproxy = int(isusingproxy.split(":")[1].replace("}", ""))
            if isusingproxy == 1:
                Player.Message("You're using PROXY/VPN/NOLOGIN")
                Player.Message("In order to play here you must not use any Proxy/VPN/Nologin")
                Player.Disconnect()
        except:
            pass
 
Last edited:

Watch dogs

New Member
Trusted Member
Member
Nov 27, 2018
20
1
3
22
yea same don't work it doesn't kick players off for using vpn/proxy i hope they update it
 

ice cold

Active Member
Trusted Member
Member
Oct 24, 2016
606
171
28
Canada
yea same don't work it doesn't kick players off for using vpn/proxy i hope they update it
its not working anymore becaus the webAPI that the plugin uses got removed ;(
There still are some website around but you have to pay a license