[Mod] Extended Ban v2 [xban2]

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

[Mod] Extended Ban v2 [xban2]

by kaeza » Tue May 20, 2014 03:31

Extended Ban Mod for Minetest



This mod attempts to be an improvement to Minetest's ban system.

  • It supports normal bans and temporary bans (from 60 seconds up to the end of time, with 1 second granularity).
  • Records and joins all accounts using the same IP address and several IP addresses using the same name into a single record, and can ban/unban them as a single user.
  • Can ban offline players if you know their IP or username.
  • Holds a record of bans for each user, so moderators and administrators can consult it to know if a player is a repeat offender.
  • Does not modify the default ban database in any way (`ipban.txt').
  • Has an API to ban and check the ban database to allows other mods to manage users (for example, anticheat mods).

Usage
Install the mod as always and rename to `xban2'.

The mod provides the following chat commands:

Code: Select all
/xban <player_or_ip> <reason>

Ban a player permanently.

Code: Select all
/xtempban <player_or_ip> <time> <reason>

Ban a player temporarily. The syntax for `<time>' is:
  • 1s - Ban for one second.
  • 1m - Ban for one minute.
  • 1h - Ban for one hour.
  • 1D - Ban for one day (24 hours).
  • 1W - Ban for one week (7 days).
  • 1M - Ban for one month (30 days).
  • 1Y - Ban for one year (360 days).
Values can be combined. For example "1D3h3m7s" will ban for 1 day, 3 hours, 3 minutes, and 7 seconds.
Note that the units are just for convenience. You are not required to provide values within the bounds. It is possible to specify "3600s", which is the same as "60m" or "1h". Also note that the 's' is optional. Specifying just "42" is the same as "42s".

Code: Select all
/xunban <player_or_ip>

Unban a player.

Advanced Use

Code: Select all
/xban_record <player_or_ip>

See a player's ban record.

Code: Select all
/xban_dbi <importer>

Import a database. Valid values for `<importer>' are:
  • "minetest" - Import ban list from `ipban.txt' (Minetest ban database).
  • "v1" - Import ban list from `players.iplist' (xban v1 database).

All commands except for `/xban_dbi' require `ban' privilege to execute. The `/xban_dbi' command requires `server' privilege.

License: BSD 2 Clause License.
Dependencies: None.

Links
Download .zip
Download .tar.gz
Browse code on Github
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

LazyJ
Member
 
Posts: 476
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

Re: [Mod] Extended Ban v2 [xban2]

by LazyJ » Tue May 20, 2014 03:58

Is this compatible with the previous version of "xban's" files, kaeza?
.: Minetest 0.4.14 ~ Linux Mint ~ A moka pot, a French press, a dirty coffee cup, and a spoiled-rotten kitty :.
Visit our Minetest server at: LinuxGaming2.com, port 30000
Screenshots, overview maps, and server info at: http://forum.minetest.net/viewtopic.php?f=10&t=5684
My blog: http://lazyjminetest.blogspot.com/
 

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Extended Ban v2 [xban2]

by kaeza » Tue May 20, 2014 04:09

LazyJ wrote:Is this compatible with the previous version of "xban's" files, kaeza?

Not currently. I'm working on providing converters from MT's ipban.txt, old xban v1 `players.iplist', and newer `players.iplist.v2' formats, along with more utilities.

BTW, for those who used my old xban mod, the advantages of this one are:
  • Has a saner DB format (using a minetest.(de)serialize-compatible format.
  • Fixes an old bug where some users were not actually getting banned under some circumstances.
  • As said above, ban record :)
  • It's title says v2! so it must be better than v1! the internet said it, so it must be true!
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Krock
Member
 
Posts: 3577
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Extended Ban v2 [xban2]

by Krock » Tue May 20, 2014 10:26

*shuts down server*
*installs*
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Extended Ban v2 [xban2]

by kaeza » Wed May 21, 2014 10:13

*BUMP*

LazyJ: Added command to import old v1 DB and Minetest `ipban.txt'.
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Extended Ban v2 [xban2]

by kaeza » Fri May 23, 2014 08:48

Update:
  • Added `/xban_record' command to list players' ban records.
  • The mod now saves the last position of the banned player (if they are online). The `/xban_record' command also shows the last known position of the player, if available.
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

LazyJ
Member
 
Posts: 476
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

Re: [Mod] Extended Ban v2 [xban2]

by LazyJ » Thu Jun 26, 2014 05:16

kaeza, is xban2 capable of importing players.iplist.v2 ?
.: Minetest 0.4.14 ~ Linux Mint ~ A moka pot, a French press, a dirty coffee cup, and a spoiled-rotten kitty :.
Visit our Minetest server at: LinuxGaming2.com, port 30000
Screenshots, overview maps, and server info at: http://forum.minetest.net/viewtopic.php?f=10&t=5684
My blog: http://lazyjminetest.blogspot.com/
 

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Extended Ban v2 [xban2]

by kaeza » Thu Jun 26, 2014 06:25

Update:
  • Fixed an ugly bug that could cause unwanted bans on servers. It is recommended to delete the database and start anew, or run this script in the standalone Lua interpreter (get it from your favorite package manager, or from here) to purge duplicate entries. Thanks to Zeno` for testing :)
  • Added importer for old v2 database format. Thanks to LazyJ for helping with testing :)
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
stormchaser3000
Member
 
Posts: 407
Joined: Sun Oct 06, 2013 21:02

Re: [Mod] Extended Ban v2 [xban2]

by stormchaser3000 » Wed Oct 01, 2014 03:59

ok um here is a bug: when i xtempban someone they get permanetly banned until i execute xunban. and yes i did use xtempban
 

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Extended Ban v2 [xban2]

by kaeza » Wed Aug 05, 2015 00:21

Update:
  • Fixed temporary bans not working at all (the function responsible for removing expired bans was not being run).
  • The `/xban_record` command now lists the ban "source". The "source" is the player or mod that performed the ban (the source was always stored in the database, but the report did not include it).
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

Lejo
Member
 
Posts: 90
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [Mod] Extended Ban v2 [xban2]

by Lejo » Thu Sep 22, 2016 16:34

Is it possible to see the ips of the players?
Can I ban player per mac-Address?

This mod is soooooo nice!
Enjoy my Minigameserver Subgames for all!
https://forum.minetest.net/viewtopic.php?f=10&t=14480
 

User avatar
kaeza
Member
 
Posts: 2094
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Extended Ban v2 [xban2]

by kaeza » Thu Jan 26, 2017 10:14

The players' IP(s) are recorded in the database, but are not currently visible anywhere (except when banning).

Banning by MAC address is not possible as we don't have access to that info.
"Courage is not the absence of fear, but rather the judgement that something else is more important than fear." -- Ambrose Redmoon

Check out my stuff!
Tips (BTC): 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 


Return to Mod Releases

Who is online

Users browsing this forum: AiTechEye, jimy and 1 guest