Commit Graph

49 Commits (1c82b35b14719f538e1f94b61dcb6c473ce6275f)

Author SHA1 Message Date
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 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 c36c30b1da
add missing bracket 2019-02-24 10:55:11 +00:00
shivajiva101 c123013a68
log amount of cached records 2019-01-09 00:47:18 +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
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 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 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 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
shivajiva101 cc6691dcb3 update handler for #6460
Do not grant all privs to the admin - changes game behavior #6460
2017-10-13 12:40:52 +01:00
shivajiva101 bce1d3c913 limit query result to 1 where possible 2017-10-13 11:33:21 +01:00
shivajiva101 16f4fe943f add name check
make same name, different case behaviour match default handler
2017-10-13 10:02:06 +01:00
shivajiva101 114215af3c fix create_auth crash 2017-10-12 00:53:00 +01:00
shivajiva101 5634454939 add priv check for cached player 2017-10-11 21:50:40 +01:00
shivajiva101 8f14f5739b fix crash caused by prev commit 2017-10-11 17:23:10 +01:00
shivajiva101 e18a5387f5 alter cache logic to speed it up 2017-10-11 15:46:17 +01:00
shivajiva101 f3a2ce436c add auth_table cache
speed up auth handler by caching online players
2017-10-11 10:19:51 +01:00
shivajiva101 068166b042 modify auth.txt import
if there are more than 360 records in the auth.txt file change strategy to sql dump file that can be imported with sqlite3
2017-10-10 15:22:25 +01:00
shivajiva101 baab891b34 hard tabs 2017-10-10 15:03:53 +01:00
shivajiva101 2d31694351 Update init.lua
make global sqlite3 nil, not an empty table!
2017-10-09 09:03:27 +01:00
shivajiva101 ee28348dcf Update init.lua
prevent other mods using the global sqlite library to create databases
2017-10-07 20:14:31 +01:00
shivajiva101 f07e757131 Create init.lua 2017-10-01 17:58:52 +01:00