Commit Graph

122 Commits (b86827d72c8c3cbd595a350afea1ba51f400a6c4)

Author SHA1 Message Date
shivajiva101 b86827d72c
Remove luacheck warning 2021-12-12 21:09:56 +00:00
shivajiva101 7ce051fb77
Fixes: detection of player new account names
remove join cache as it breaks new names for a player id due to malformed logic
2021-12-12 20:58:09 +00:00
shivajiva101 ea5e0b26c7
Fixes: permanent bans expiring during update
fully qualify the conditions for active bans expiring to prevent permanent bans expiring!
2021-12-12 11:31:09 +00:00
shivajiva101 adb7e3b7e7
Updates: CI to github
* Create check-release.yml
* Update README.md - change/add badges
* Update init.lua - removed unused var causing warning!
* Delete .travis.yml
2021-12-11 21:36:56 +00:00
shivajiva101 96eb4f4cb8
Fixes: crash vector in ban gui
ensure ban gui page arrows are always cleared to prevent server crashing if they are clicked without the context that triggered their appearance
2021-12-11 17:18:26 +00:00
shivajiva101 bb9710c6bb
Added: cleaner checking for irc mod 2021-12-11 10:42:26 +00:00
shivajiva101 d5bd6e255b
Added: data integrity check
check for orphaned active ban records when mod loads and log them in the debug text file
2021-12-10 01:08:49 +00:00
shivajiva101 440000d82b
Fixes: crash in issue #34
prevent crash vector from legacy null field and give meaningful output for a permanent ban in the GUI
2021-12-09 00:46:34 +00:00
shivajiva101 fc1df33e5f
Fixes: incomplete record data in expired bans
catch legacy records with null expires field and update to reflect permanent ban being revoked
2021-12-09 00:12:11 +00:00
shivajiva101 381bba309a
Fixes: expired bans processing on mod load
fix typos
2021-12-08 22:58:01 +00:00
shivajiva101 4189cf4caf
Fixes: null expires entries in migration process
catch null expires entries correctly when the data is migrated from the ban table to fix issue #34
2021-12-08 00:04:00 +00:00
shivajiva101 30c882337b
Assign db timeout handler
Allow 50ms for a db transaction if a busy state is encountered
2020-09-13 22:14:39 +01:00
shivajiva101 439bca09cb
Log db:errmsg when create_ban_record name search fails 2020-09-12 15:33:23 +01:00
shivajiva101 7d49031c3a
Ensure ban name is passed to kick if search fails (#32)
* Ensure ban name is passed to kick if search fails

* Add logging for failed name search
2020-09-12 10:36:38 +01:00
shivajiva101 44695d22df
Update README.md 2020-05-09 01:04:16 +01:00
shivajiva101 50c116692a
Update init.lua 2020-05-08 20:26:36 +01:00
shivajiva101 4f82eb5550
Fix: linter warnings 2020-05-08 20:23:45 +01:00
shivajiva101 7ada3c96eb
revert prev change 2020-05-08 20:22:07 +01:00
shivajiva101 01c48c8fac
Update .luacheckrc 2020-05-08 20:08:27 +01:00
shivajiva101 3eeeaaa705
Create depends.txt 2020-05-08 20:05:33 +01:00
shivajiva101 e78b6c994b
add irc optional dependency 2020-05-08 20:03:54 +01:00
shivajiva101 f693d54557
Add: missing irc functionality
Don't rely on other maintainers accepting PR's for functionality, override instead!
Remove extraneous new lines in ban_record output
Require correct db version before allowing mt to run
2020-05-08 20:01:59 +01:00
shivajiva101 7e06739e00
Fixes: Travis warnings 2020-05-07 10:07:38 +01:00
shivajiva101 b4ecb070af
Fixes: ban_record command output to IRC
refactor player_record to return a string so ban_record chat command is used correctly
strip newline to compact the output and clean it up
2020-05-06 20:52:21 +01:00
shivajiva101 01fb30eeff
fix typo in prev commit 2020-05-02 02:34:40 +01:00
shivajiva101 534a540e1d
Add a msg for ban status when player is not banned 2020-05-01 20:08:06 +01:00
shivajiva101 e034f17c5f
Fix issue #30
Correct row header supplied to format #10 param
2020-01-13 00:55:48 +00:00
shivajiva101 ca8a38bdf0
Update README.md 2019-12-15 20:14:27 +00:00
shivajiva101 39971babf0
Update conf settings section 2019-12-15 20:12:59 +00:00
shivajiva101 9a10f0c25c
Remove whitespace 2019-12-06 08:59:50 +00:00
shivajiva101 4477ed90ef
Reorder prejoin event to cache exclusions
Reorder prejoin event to cache white listed players and owner
2019-12-01 16:28:49 +00:00
shivajiva e526eb6431 colorize some command output
add colour for readability to /whois and ban_record output
2019-11-29 23:40:21 +00:00
shivajiva101 03fa84d47a
Update /whois command
restructure the /whois command to require v as an extra parameter to extend ip address display from last ip to the full list in descending order of last login as used previously.
2019-11-28 20:33:45 +00:00
shivajiva101 507ddc9754
Update README.md 2019-11-28 16:13:22 +00:00
shivajiva 4627dee959 Fix: import/export functions
rework import of xban.db file for ban_dbi & ban_dbe commands to work
with strongly typed and indexed db fields in the new schema
2019-11-28 15:05:36 +00:00
shivajiva101 e269b6dfd5
Fixes crash reported in #29
Initialise last_pos if nil to prevent crash
2019-11-26 09:29:43 +00:00
David Leal af9d1c41dd Give privilege to administrator automatically (#28)
The 'ban_admin' privilege will be given automatically to admins.
2019-11-25 09:03:45 +00:00
shivajiva fac3e48808 fix importer
ensure expires field is supplied the correct type
modify remaing checks and initialisation of expires to default to 0 if
missing and exclude 0 from any expired test
2019-11-24 23:06:08 +00:00
shivajiva101 b184bf12be
Fix typo causing crash 2019-10-29 05:46:04 +00:00
shivajiva101 bcf2ea2fc5
Remove trailing space 2019-10-09 11:05:57 +01:00
shivajiva101 bde23ed3f8
Add optional ip per id limit
adds the ability to limit the amount of ip addresses an id can have
2019-10-04 21:40:48 +01:00
shivajiva101 d5e901f49a
Re-add newline removed on prev commit 2019-09-26 19:17:18 +01:00
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