Commit Graph

69 Commits (master)

Author SHA1 Message Date
shivajiva101 5939b517e7
Fix: crash when creating cache with an empty db 2022-04-30 21:25:41 +01:00
shivajiva101 332a823048
Update: cherry pick updates from 0.5 branch
Add indexes on the auth table in the sauth.sqlite db
Add annotations for functions and code
Add caching on auth record creation
Change name of cache table to cache
Return the result of all functions directly where possible for potential future error handling
Restructure the code for the cache in get_auth 
Turn on caching on load by default - use conf setting to disable
2022-01-06 14:25:12 +00:00
shivajiva101 225e4f9d39
Update README.md 2021-12-12 01:08:42 +00:00
shivajiva101 1c82b35b14
Add CI workflow test 2021-12-12 01:04:32 +00:00
shivajiva101 a3acf31f96
Correctly implement iterate function
return an iterator not a table!
2019-11-27 15:27:14 +00:00
shivajiva101 9da08c4cbb
Update README.md 2019-04-06 01:58:03 +01:00
shivajiva101 70c2139dcb
prevent crash when fetching settings
re-factor settings to return the column value if the row exists for simplicity
2019-03-15 01:35:05 +00:00
shivajiva101 6782b03aea
fix settings checks
check the correct table elements to fix import functionality lost when settings functionality was objectified
2019-03-10 20:31:25 +00:00
shivajiva101 e373e2856f
Update README.md 2019-02-24 20:37:46 +00:00
shivajiva101 c36c30b1da
add missing bracket 2019-02-24 10:55:11 +00:00
shivajiva101 d80911ed16
Update schema_single.sql
drop and recreate _s table
2019-01-09 00:49:53 +00:00
shivajiva101 c123013a68
log amount of cached records 2019-01-09 00:47:18 +00:00
shivajiva101 0e1dae85d7
add missing semicolon 2019-01-09 00:41:51 +00:00
shivajiva101 d386c4e88d
fix typo 2019-01-09 00:40:57 +00:00
shivajiva101 7d1e4ed414
convert settings to type on read 2019-01-09 00:25:47 +00:00
shivajiva101 30e2e90d6d
Fix import priv handling
wrap adding the db import flag in a check to prevent subsequent imports adding rows of this flag
2019-01-08 22:47:52 +00:00
shivajiva101 208eec75c2
performance enhancements (#10)
* drop index and change primary key in DB

* Create schema_update.sql

* Update README.md

* add caching

* fix caching function

* Update schema_update.sql

* removed preload caching

impractical to use, causes crash when building the cache due to the induced lag

* Update README.md

* Create schema_single.sql

converts the dev branch database for use with the rc-1 branch code

* re-add enhanced caching

* Update README.md

* Turned caching off by default

* Update schema_update.sql

* insert version into db if missing

table for cache search fixed
2019-01-08 22:05:14 +00:00
shivajiva101 9a327ee563
Merge pull request #9 from rubenwardy/fix/record_login
Fix crash on record_login() before auth cached
2018-07-30 18:40:01 +01:00
rubenwardy 81b52994d5
Fix crash on record_login() before auth cached 2018-07-30 11:32:11 +01:00
shivajiva101 34b4cd1e0c
add iterate function to auth handler
auth_table is a local cache so provide a method of returning the full list of names
2018-04-05 17:51:41 +01:00
shivajiva101 db5a9705e5
tidy up and add a few comments 2018-03-03 20:55:39 +00:00
shivajiva101 a71112e3b4
initialise importauth prior to use 2018-03-03 19:26:16 +00:00
shivajiva101 071240db97
fix crash on missing bracket! 2018-03-03 19:21:44 +00:00
shivajiva101 1fca93560b
cleanup authimport after it loses scope
clear local variable authimport to keep memory use to a minimum on the first run of the mod
2018-03-03 19:15:56 +00:00
shivajiva101 20712fe5c0
remove dependancy on core.auth_table for import
minetest commit 36838ea22f19022bf897fac8f77dbcd1c292256e removes the global core.auth_table previously being exploited to reduce the code length of sauth. This commit internalises the loading of auth.txt so the global is no longer accessed or required.
2018-03-03 19:07:04 +00:00
shivajiva101 b254403a6c
change flag to string type in db_import
prevents crash
2018-01-18 15:15:03 +00:00
shivajiva101 e13372a125
pass privs as string in db_import
privs need to be passed as a string for insertion on import to prevent crashing
2018-01-18 13:58:04 +00:00
shivajiva101 65cda645f3
fix crash when ' is part of name in get_auth 2018-01-09 15:42:57 +00:00
shivajiva101 2a35105a76
catch empty name on calls to get_auth
fix courtesy of ExeterDad who pointed out the need to catch empty names in get_auth
see https://github.com/shivajiva101/sauth/issues/6
2017-12-29 02:36:25 +00:00
shivajiva101 2c8284fdf9
Merge pull request #5 from shivajiva101/testing
[FIX] prevent owner losing privilege privs
2017-12-11 01:56:39 +00:00
shivajiva101 0e3ede49e8
[FIX] prevent owner losing privilege privs
Enhance testing from the admin account by only retaining privs privilege.
Fix backwards compatibility - restructured settings globally for handling deprecated setting_get.
Fixes total revocation of privileges on the admin account reported by IhrFussel
2017-12-11 01:37:33 +00:00
shivajiva101 6556a3d38c
add name search function to handler 2017-12-08 19:09:13 +00:00
shivajiva101 522228971e
fix login duplicate name check
make sure the comparison is done in lower case for both sides
2017-12-01 22:11:22 +00:00
shivajiva101 03efd4f62b
delay removal of the player cache entry on leave
hold the player record in the cache for 60 seconds after the player has left to increase performance
2017-11-17 01:55:05 +00:00
shivajiva101 7f90d81a1f
enhance the import routine
Check if the import is occurring on a local server and update the player to prevent a duplicate entry in the database
2017-11-15 19:41:21 +00:00
shivajiva101 9ad8c873f9
fix sauth privileges for old settings
privs were wrongly stored as a table in the db for minetest versions below 0.4.16
should fix legacy support
2017-11-15 10:56:24 +00:00
shivajiva101 b8e0e86309
fix crashes for offline player handling 2017-11-03 11:05:40 +00:00
shivajiva101 107263669e
Update README.md 2017-11-02 14:39:00 +00:00
shivajiva101 d7c61c17f3
Update README.md 2017-11-02 12:07:53 +00:00
shivajiva101 e01686b53e
Update README.md
add some additional information to describe the import/export process
2017-11-01 18:20:55 +00:00
shivajiva101 3ec1d1b54a
Update init.lua
add missing =
2017-11-01 17:59:11 +00:00
shivajiva101 5ed1f2d0be
Update init.lua
add fixes from the test branch, reverting merge from #6460 to keep compatibility with 0.4-stable
fixes priv handling and tidies comments
2017-11-01 17:43:26 +00:00
shivajiva101 e39ffc3b24
update export function
remove sauth.sqlite after export file is created to avoid duplicate entries and reinstate previous handling of the import flag
2017-10-31 22:08:11 +00:00
shivajiva101 92109126ed
correct sql statement in export function 2017-10-31 14:14:53 +00:00
shivajiva101 89c13ba24b add optional caching in get_auth
Add capability of using the handlers get_auth function to check if a player has a database entry without caching the result.
To prevent caching use the format sauth.get_auth(<name>, false)
2017-10-22 17:13:31 +01:00
shivajiva101 341e99fd3f Update README.md 2017-10-22 01:40:01 +01:00
shivajiva101 f1628e05ab Merge branch '#6460' into master 2017-10-22 00:47:27 +01:00
shivajiva101 3eb676ca5b fix import/dump code
Add function to get length of keypair table instead of trying to get length of a non integer table!
Shift import/dump routine on first run to a timer event, allowing the server to load.
2017-10-22 00:30:16 +01:00
shivajiva101 e19782ea43 expand compatibility
Added test for minetest.settings so older setting_get method can be used to expand the compatibility of the mod.
Fixed missing tabs on create_auth
2017-10-16 01:52:46 +01:00
shivajiva101 b6fd18fb53 fix bad paste and wrong table 2017-10-14 17:23:34 +01:00