Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP|BF3]  (Read 35657 times)

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #15 on: August 02, 2009, 07:45:11 PM »
you can download a fresh geoip database here : http://www.maxmind.com/

Offline matthewstice

  • Full Member
  • ***
  • Posts: 57
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #16 on: April 23, 2010, 07:35:55 AM »
Ahh ya i uploaded everything correctly,
And all im getting is

Playername is connecting from --

decided too try this out until i can get my Geowelcome plugin to work


how did you fix this, Mind max site is lookin for money. What am i missing?

Offline matthewstice

  • Full Member
  • ***
  • Posts: 57
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #17 on: April 23, 2010, 07:45:37 AM »
ok i added a new GeoIP dat and its working now, if i enable the  Welcome plguin and this, will they both come up for connecting players>? im just using this one temp till i can get the geowelcome plugin working, so ill have the country IN the welcome message rather than welcome message and then the Connecting from ___county (1 vs 2 diff Messages)

Offline Macdead3

  • Jr. Member
  • **
  • Posts: 11
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #18 on: June 01, 2010, 09:52:04 PM »
i got error!

Code: [Select]
100601 20:44:36	WARNING	WelcomePlugin: using default value 20 for command !greeting
100601 20:44:36 CRITICAL Error loading plugin: No module named GeoIP.PurePythonGeoIP
Traceback (most recent call last):
  File "b3\parser.pyo", line 473, in loadPlugins
  File "b3\parser.pyo", line 541, in pluginImport
  File "C:\UserFiles\Macdead3\GameServers\TC65827862833366865025541\b3\extplugins\countryfilter.py", line 25, in <module>
ImportError: No module named GeoIP.PurePythonGeoIP
100601 20:45:01 ERROR Error executing crontab <bound method StatusPlugin.update of <b3.plugins.status.StatusPlugin instance at 0x015AB2D8>>: 'NoneType' object has no attribute 'gameName'
[('b3\\cron.pyo', 233, 'run', None), ('b3\\cron.pyo', 171, 'run', None), ('b3\\cron.pyo', 60, 'run', None), ('b3\\plugins\\status.pyo', 172, 'update', None)]

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #19 on: June 02, 2010, 08:52:38 PM »
Are you running version 1.3.x of the bot?

Offline Macdead3

  • Jr. Member
  • **
  • Posts: 11
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #20 on: June 02, 2010, 09:52:19 PM »
yes

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #21 on: June 03, 2010, 10:38:30 AM »
Install the latest version of the countryfilter plugin: http://www.bigbrotherbot.net/forums/downloads/?sa=view;down=12 and try again.

Offline Armani

  • Jr. Member
  • **
  • Posts: 20
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #22 on: June 20, 2010, 04:53:49 PM »
Hello and Thanks for this nice plugin, this is just what I needed,
I installed it and it is running like a charm I denied all and allowed my country.
But I have a question :
Can I make an exception for a player from a denied country ? I have a friend in Canada and I want to let him access my server without allowing all Canada :p

I was thinking about it and I tried several things like :
I tried this and I doubted that it would work and indeed it didnt work:
Code: [Select]
<set name="cf_order">allow,deny</set>
<set name="cf_allow_from">[b]His>IP.Here[/b]</set>
<set name="cf_deny_from">CA</set>

But earlier today I was installing Courgette's banlist plugin and I saw it has in the config file :

Code: [Select]
<set name="immunity_level">100</set>

I searched the config file of the countryfilter and didnt find such thing which will be great in my case, I just make set the immunity level at 20 and put my friend in the moderators group this way he will override the country filter and access my server without getting affected with the fact that whole Canada is banned :P

And I actually opened the countryfilter.py file with an editor and tried to add this function by adding client.maxLevel > 20 somewhere in the code but yea again I failed ..

So if anyone can help or advice i would be thankful :D

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #23 on: June 20, 2010, 07:01:17 PM »
If the guy has a registered name or a fixed IP address it's simple. Add one or the other to the config:


Code: xml [Select]
  <settings name="ignore">
    <!--
    Add a list of names of players that will be able to allways connect.
    Seperate names with a ,
    -->   
    <set name="names"></set>
    <!--
    Add a list of IP's of players that will be able to allways connect.
    Seperate ip's with a ,
    -->   
    <set name="ips"></set>
  </settings>


Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #24 on: June 20, 2010, 07:15:02 PM »
I liked the idea of the maxlevel and added it to the latest version.

Version 1.1.7 is untested, please let me know if this new version works for you.

Offline Armani

  • Jr. Member
  • **
  • Posts: 20
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #25 on: June 20, 2010, 07:32:30 PM »
EDIT: testing it right now

EDIT 2: Silly me the moment I wrote my post above I was working on Version 1.1.2 instead of 1.1.6 which I downloaded by mistake and it doesnt have the <set name="ips"></set>.

Ok I installed it now and ran it on a server, the maxlevel works great any player with a level < 1 even if from a banned country can access the server, Thanks very much :D

PS: During the tests I did modify the test account goup_bits directly in the database and connect each time with a different level and as I said it is working great 0 & 1 are getting kicked and from 2 to 100 arent filtered :), but the weird thing at the end I did set the group_bits to 0 and I copied the test account IP directly from the database and pasted it in the :
<set name="ips">AA.XX.YY.ZZ</set>

but even though this account was kicked it is like B3 ignored the fact that this specific IP shall be ignored.
I dont think I made a mistake somewhere because it is quite simple I just copied an pasted the IP directly from the database.
« Last Edit: June 20, 2010, 08:18:45 PM by Armani »

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #26 on: June 20, 2010, 08:45:13 PM »
Okay, re-download the latest version, install it, restart B3, repeat your test and look in b3.log for the line that looks somewhat like this:

Countryfilterplugin: Checking client: name: **** - ip: ***** - level: *****

Attach the b3.log for me to look what's happening...

Offline Armani

  • Jr. Member
  • **
  • Posts: 20
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #27 on: June 20, 2010, 10:17:29 PM »
OK, still the same thing :P
Level check is working,
IP check is not,

And yes the line you mentioned above:
Countryfilterplugin: Checking client: name: **** - ip: ***** - level: *****
is present at every time the player login.

The account who I ran the test on is Sn1p3r, and with those levels 0, 1, 2, 40 (but in the b3 log it says 60 while I am sure the last time I set it to 40 and it is 40 in front of me in the database but that's not a big deal).

Config file and log file attached ;)

[attachment deleted by maintenance]

Offline xlr8or

  • [ www.xlrstats.com ]
  • Project Lead
  • Hero Member
  • *
  • Posts: 2057
    • The Art of Tactical Gaming
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #28 on: June 21, 2010, 08:02:04 PM »
I can't see where the instance is that you have level 0 and an ignored ip, can you just test that one?

I've also pushed a minor change to the repo, if your test fails, try updating the plugin.

Thanks for testing this :)

Offline Armani

  • Jr. Member
  • **
  • Posts: 20
Re: CountryFilter [CoD|CoD:UO|CoD2|CoD4|UrT|WoP]
« Reply #29 on: June 21, 2010, 10:49:47 PM »
I re-tested it,
And still the same, when the player has a level higher than 1 he is ignored but, about the IP ignore it is still the same he gets kicked.
I reattached the new log file and also config file you can see  in the log file that the Sn1p3r's IP match the IP  that must be ignored and mentioned in the config file but even though he still get kicked.
BTW level check is more important for me it is also way better than IP check because IPs are most of the time dynamic and unreliable but it is only useful if the player's IP is static but lol it is not working :P

Thanks for your HUGE work :)

EDIT:
Even though I am not interested with name ignore but I tested the name filter and it seems not to be working just like the IP ignore, I mean a player is allowed to connect only because of his level and you see in the log:

CountryfilterPlugin: Sn1p3r is a higher level user, and allowed to connect

but you NEVER see someone allowed to connect because of his name or IP like:
CountryfilterPlugin: Sn1p3r Name is on ignorelist, allways allowed to connect
CountryfilterPlugin: Sn1p3r Ip address is on ignorelist, allways allowed to connect

[attachment deleted by maintenance]
« Last Edit: June 21, 2010, 11:15:40 PM by Armani »

 


Rate this page +1 at Google Search