Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerkiz committed Jul 31, 2020
1 parent 1f2fa4d commit 3e92eb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions maps/mountain_fortress_v3/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ function Public.reset_map()
AntiGrief.enable_capsule_warning(true)
AntiGrief.enable_capsule_cursor_warning(false)
AntiGrief.enable_jail(true)
AntiGrief.damage_entity_threshold(20)
AntiGrief.explosive_threshold(32)

PL.show_roles_in_list(true)

Expand Down
18 changes: 11 additions & 7 deletions utils/session_data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,27 @@ local error_offline = '[ERROR] Webpanel is offline.'
local session = {}
local online_track = {}
local trusted = {}
local settings = {
-- local trusted_value = 2592000 -- 12h
trusted_value = 5184000, -- 24h
nth_tick = 18000 -- nearest prime to 5 minutes in ticks
}
local set_data = Server.set_data
local try_get_data = Server.try_get_data
local concat = table.concat
-- local trusted_value = 2592000 -- 12h
local trusted_value = 5184000 -- 24h
local nth_tick = 18000 -- nearest prime to 5 minutes in ticks

Global.register(
{
session = session,
online_track = online_track,
trusted = trusted
trusted = trusted,
settings = settings
},
function(tbl)
session = tbl.session
online_track = tbl.online_track
trusted = tbl.trusted
settings = tbl.settings
end
)

Expand All @@ -41,7 +45,7 @@ local try_download_data =
local value = data.value
if value then
session[key] = value
if value > trusted_value then
if value > settings.trusted_value then
trusted[key] = true
end
else
Expand Down Expand Up @@ -183,13 +187,13 @@ Event.add(
end
)

Event.on_nth_tick(nth_tick, upload_data)
Event.on_nth_tick(settings.nth_tick, upload_data)

Server.on_data_set_changed(
session_data_set,
function(data)
session[data.key] = data.value
if data.value > trusted_value then
if data.value > settings.trusted_value then
trusted[data.key] = true
else
if trusted[data.key] then
Expand Down

0 comments on commit 3e92eb9

Please sign in to comment.