Reset whitelist memory on player login...

Allows names to be removed from file while session is active.
This commit is contained in:
Jordan Irwin 2022-09-28 10:12:58 -07:00
parent 063b544c7b
commit d56b25a22a
3 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,3 @@
TODO:
- check for names manually removed from file on player login
- remove empty lines from whitelist file on write

View File

@ -2,6 +2,9 @@
next
----
- check for singleplayer with core function instead of hardcoded "singleplayer"
- whitelist memory is reset before loading from file on player login
- allows names to be removed manually from file while sessions is active
v1.2
----

View File

@ -21,6 +21,9 @@ local function load_whitelist()
local file, err = io.open(world_path .. "/whitelist.txt", "r")
if err then return end
-- reset for session in case names have been manually removed
whitelist = {}
for line in file:lines() do
whitelist[line] = true
end