Commit Graph

130 Commits (master)

Author SHA1 Message Date
shivajiva101 355c0fe6a3
Remove development warning 2019-09-26 19:15:29 +01:00
shivajiva101 0464e32c52
Merge changes from dev branch (#27)
* Add API functions

Add API to allow other mods to access useful functions. (ban, unban, list bans, check if player is banned)
Add name caching to speed up access to frequent players id
Restructure the database tables for primary keys on names and ip addresses to reduce database access time
Track number of logins for individual names and ip addresses and the last login to provide a clearer account of each id's activity

* Create sban_update.sql

* Update README.md

* fix crash in prev commit

rogue string spread over multiple lines without concatenation

* fix errors preventing travis build

* Update schema.md

* Update LICENSE

* Process expired bans during server start

clean up expired bans on server start to reduce prejoin triggering for every banned player attempting to join

* fix typos

missing commas added and space removed

* Enhance the performance of formspec generation

* Fixes: crash parsing expired bans

Correct datatype handling for integer fields in the sql statements
Refactor code in update_ban_record() to use cached ban data
Use correct param for update_ban_record id_key

* Add annotation & ip caching

* Update README.md

* Fix travis errors

* Fix some travis warnings

* Fix travis warnings

* Fix travis warnings

* Fix crashes

Init cap variable
pass ip string instead of table to ip_key function when building the cache

* Add type checking for ban records

Prevent rogue text entries being added to id field on db update

* Fix crash in caching on first run

Check login exists when building the cache
Initialise cap outside the function

* Alter SQL to fix any text id entry in bans table

* Fix crash when showing ban record

* Fix ban_record command truncating output for admin

* Fix export to xban2

* Cosmetic format on ceateDb string

added primary keys to whitelist & violation tables

* Refactor process_expired_bans function

remove repetitive calls to update_ban_record()
add vacum to shrink the table

* Fix missing # symbols in process_expired_bans()

* Added db indexes to tables and merged with latest dev changes (#26)

* Added db indexes to tables - #25
Formatted and used consistent db column types as well as added various table indexes to the create db script and upgrade script. This prevents Sqlite from doing slow table scans. also fixed string formatting error caused by no default max ban expiry setting

* Fix minor issues

tab spacing
add dev bypass for owner
add expires zero check
remove tostring() cast on cache id
rename id_key to more appropriate id and change type in description
remove primary key in violation table (better structure needed)

* Remove white space preventing travis build

* Fix tabs and remove violation primary key

* Add id & ip cache for names on prejoin event

Simplify join method by caching id and ip on prejoin, removing the need
to call the functions in join. Uses a minetest.after() function call to
clean up

* Refactor join cache clearing mechanism

refactor the join cache clearing mechanism to manage orphaned entries
and work correctly

* Refactor violation functions

Change violations table structure so it can be indexed
Remove id size limit on integer primary keys
Add missing dev check in kick routine
Remove transaction statement; db:exec uses the method internally
Add primary key index to violations table
Remove primary key on expired id; column isn't unique
Initialise active expires on db update

* Modify api ban expires handling. Add api doc.

extend possible types and values for the api ban command to allow
alphanumerical time expression i.e. 1w1d12h30m30s as well as seconds to
expiry & UTC seconds value of expiry.
Create and add API documentation.

* Restructure config settings

Restructure db config table
Refactor config code
Add mod_version to first run initialisation
Rename fixed table to reflect it's temporary nature
Explicitly name table columns for the fix INSERT statement
Modify config INSERT statements to reflect new schema
Add missing last_login to address_tmp INSERT

* Fix Travis build warnings

* Add expired ban processing

Check and update expired bans in active, moving them to expired and
filling in the reqd fields.

* Modify debug bool for release
2019-09-26 19:12:39 +01:00
shivajiva101 ccfbb05320
Enhance the performance of formspec generation 2019-07-13 11:41:30 +01:00
shivajiva101 3375b428df
Update init.lua
add missing handle id for non existent player in tempban command, Fixes #22
2018-09-15 11:23:11 +01:00
shivajiva101 3a76158a2c
remove redundant owner check 2018-07-15 01:37:09 +01:00
shivajiva101 be9032c82a
remove defunct find_records 2018-06-21 09:16:42 +01:00
shivajiva101 032b531a2e
remove unused variables
fixes travis build
2018-06-21 09:12:46 +01:00
shivajiva101 b7192a8376
expand scope of owner exemptions
allows owner unlimited accounts based on id of the owner account name in minetest.conf
2018-06-17 21:14:48 +01:00
shivajiva101 a5c1cdcb06
add owner exemption to names per id 2018-06-09 01:42:59 +01:00
shivajiva101 c9983b5e3b
revert incomplete changes from cached branch 2018-04-15 23:25:10 +01:00
shivajiva101 e813efd791
Merge branch 'cached' into master 2018-04-15 21:46:10 +01:00
shivajiva101 7bc2e5281f
remove whitespace 2018-04-07 00:29:10 +01:00
shivajiva101 79631bc1cd
Merge branch 'dev-1' into master 2018-04-07 00:20:25 +01:00
shivajiva101 5968732a15
add override for builtin kick command
detach player if the first attempt fails
2018-04-05 02:27:19 +01:00
shivajiva101 b5813258cc
use set_detach()
stops players bypassing kick event by attaching to entities
2018-04-05 01:46:35 +01:00
shivajiva101 40ac537d75
fix lacal variable shadowing function param 2018-04-03 00:17:06 +01:00
shivajiva101 f8bca73f2d
Update .travis.yml 2018-04-03 00:14:04 +01:00
shivajiva101 4a7767e43b
Update .travis.yml 2018-04-02 23:50:40 +01:00
shivajiva101 67d2be427b
Update .travis.yml 2018-04-02 23:46:55 +01:00
shivajiva101 bba8b1444d
Update init.lua 2018-04-02 01:41:02 +01:00
shivajiva101 1781426724
Update init.lua 2018-04-02 01:32:58 +01:00
shivajiva101 9a035782b0
Update README.md 2018-04-02 01:29:53 +01:00
shivajiva101 b8d365f04b
Update init.lua 2018-04-02 01:03:43 +01:00
shivajiva101 25782fb428
add whois command functionality and names per ip
added whois privilege.
added /whois <player> command to display names and ip addresses associated with the player. 
added names per ip functionality restricting new players to a limited number of accounts for an ip.
Requires the setting max_names_per_ip = <limit> adding to minetest.conf to activate the functionality.
Existing players exceeding the threshold will not bay able to create further accounts.
Renamed poorly named qbc function to active_ban
2018-04-02 00:59:11 +01:00
shivajiva101 ed7b998417
fix ban/unban failure when ' used in reason string 2018-04-01 21:56:23 +01:00
shivajiva101 b2bf2e486b
Merge pull request #18 from rubenwardy/feature/names
Add list of usernames to ban_record output
2018-02-05 21:56:18 +00:00
shivajiva101 12bbd2582c
Merge pull request #17 from rubenwardy/fix/travis
Add travis support and fix simple issues
2018-02-05 21:45:01 +00:00
rubenwardy 30b6dec9dc Add list of usernames to ban_record output 2018-02-03 20:24:12 +00:00
rubenwardy e213e5e8cf Add travis support and fix simple issues 2018-02-03 20:09:03 +00:00
shivajiva101 80fde63e12
fix typo in previous commit 2018-01-26 19:57:21 +00:00
shivajiva101 00215b3a84
handle both types of settings api 2018-01-26 19:26:33 +00:00
shivajiva101 d20583e862
Fix ip detection for ip4 passed as ip6
simplify client ip detection to fix previous bad logic on handling pseudo ip6
2018-01-26 18:26:33 +00:00
shivajiva101 65107ef1a5
catch non existant player in ban record param
prevents server crash on supplying a player name that doesn't exist when checking ban records
2018-01-19 20:18:05 +00:00
shivajiva101 b8ea8ea557
prevent * being used in ban_record for name
prevent a crash when /ban_record * is used to try and list all records
2018-01-18 12:47:08 +00:00
shivajiva101 5cc0a874e0
declare expires outside of the conditional branch
fixes crash on banning unknown player
2018-01-17 23:19:40 +00:00
shivajiva101 cab824aef0
invert logic on check in ban command 2018-01-08 01:23:02 +00:00
shivajiva101 e1840eb919
remove extra 'then' @L255 2018-01-07 23:10:15 +00:00
shivajiva101 a6134767d5
restructure commands to prevent crash on nil id 2018-01-07 23:04:47 +00:00
shivajiva101 33e3cbf980
add ip6 handling
parse players ip for ip6 and ip4 addresses expressed as ip6
2018-01-07 01:12:20 +00:00
Ezhh cfedc916eb
Initialise hotlist to prevent crash 2018-01-06 23:02:58 +00:00
shivajiva101 d0a16ff46f
correct spelling mistake 2018-01-06 20:32:11 +00:00
sofar b5885a6f2e Gui: all luachecked and tested. (#11)
* Obvious and simple luacheck motivated fixes.

* Use minetest.log().

* Avoid single execution loops.

contentious, but correct. Needs testing for sure.

* add a GUI

adds the convenience of a GUI to administer ban/tempban/unban and check player ban records

* rearange code structure and add checks, tidy up

* change chat command

* add textures

* Update README.md

* fix missing name in unban logging

* Update README.md

* fixes issue #1

* remove background for screen

* fix error with name in prejoin

* fix crash in prejoin & missing declaration in ban

* dont display list if it's empty

* add missing assingment for prev commit

* add info if no record found when using the gui

* add missing format to active_ban_record

* add conf setting for tempban duration

* Update README.md

* check IP on prejoin

* add a check for data in prejoin

* get ban data with ip if name fails in prejoin

* simplify ban search for prejoin event

* Properly fix single-query sql sequences.

* Luacheck fixes.

* Since `default` is optional (and should be), fix crash if it is missing.

* Fix "nil unbanned by..." display issue.
2018-01-06 20:25:42 +00:00
sofar f72b8930d8 Obvious and simple luacheck motivated fixes. (#10)
* Obvious and simple luacheck motivated fixes.

* Use minetest.log().

* Avoid single execution loops.

contentious, but correct. Needs testing for sure.
2018-01-06 20:10:26 +00:00
shivajiva101 ae8a9d0a72
Add GUI (#12)
* add a GUI

adds the convenience of a GUI to administer ban/tempban/unban and check player ban records

* rearange code structure and add checks, tidy up

* change chat command

* add textures

* Update README.md

* fix missing name in unban logging

* Update README.md

* fixes issue #1

* remove background for screen

* fix error with name in prejoin

* fix crash in prejoin & missing declaration in ban

* dont display list if it's empty

* add missing assingment for prev commit

* add info if no record found when using the gui

* add missing format to active_ban_record

* add conf setting for tempban duration

* Update README.md

* check IP on prejoin

* add a check for data in prejoin

* get ban data with ip if name fails in prejoin

* simplify ban search for prejoin event
2018-01-06 18:30:23 +00:00
shivajiva101 c94cc3865d
Merge pull request #9 from sofar/luacheck
Add .luacheckrc
2018-01-04 20:07:19 +00:00
Auke Kok 285232608e Add .luacheckrc
Plenty of errors/warnings exist, so expose them so they can
be fixed and checked.
2018-01-04 11:52:07 -08:00
shivajiva101 9330c5c7e4
add missing formatting to active_ban_record 2017-12-29 23:56:01 +00:00
shivajiva101 66784252c2
Create tmp 2017-12-28 20:35:07 +00:00
shivajiva101 5c091baa06
add orphan record check to prejoin
check and fix orphaned entries in the prejoin event
modify qbc function to return boolean to simplify code
2017-12-28 14:42:22 +00:00
shivajiva101 4bdc1d6e88
add missing comma... 2017-12-04 23:05:58 +00:00