From 07c6ea882fa683a1f1e686882250bf5d40200352 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Fri, 20 Apr 2018 20:53:33 +0100 Subject: [PATCH] Some Changes to maybe Fix Problem With Afk Kick --- Addons/Admin/afk-kick.lua | 4 ++-- Addons/Guis/polls.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Addons/Admin/afk-kick.lua b/Addons/Admin/afk-kick.lua index 06557f93..49ef748c 100644 --- a/Addons/Admin/afk-kick.lua +++ b/Addons/Admin/afk-kick.lua @@ -8,7 +8,7 @@ Discord: https://discord.gg/r6dC2uK ]] --Please Only Edit Below This Line----------------------------------------------------------- -local function get_afk_time(player) +function _.get_afk_time(player) local rank = Ranking.get_rank(player) local count = #game.connected_players local base = rank.base_afk_time or false @@ -22,7 +22,7 @@ Event.register(-1,function(event) }:on_event('tick',function(self) if (game.tick%3600) ~= 0 then return end for _,player in pairs(game.connected_players) do - local afk = #game.connected_players < 3 and 10 or get_afk_time(player) + local afk = #game.connected_players < 3 and 10 or _.get_afk_time(player) if afk then if player.afk_time > afk*3600 then game.kick_player(player,'AFK For Too Long ('..math.floor(afk)..' Minutes)') end end diff --git a/Addons/Guis/polls.lua b/Addons/Guis/polls.lua index a69bf50a..725b23be 100644 --- a/Addons/Guis/polls.lua +++ b/Addons/Guis/polls.lua @@ -16,7 +16,7 @@ local function _polls(reset) return global.addons.polls end -local function _poll_end(self) +function _._poll_end(self) local uuid = self.data.poll_uuid local poll = _polls().active[uuid] if not poll then return end @@ -49,7 +49,7 @@ local function _poll_data(question,answers) Server.new_thread{ data={poll_uuid=poll.uuid}, timeout=poll_time_out*60 - }:on_event('timeout',_poll_end):open() + }:on_event('timeout',_._poll_end):open() -- this time out is knowen to cause desyncs and so i have moved it to a hard coded function _polls().active[poll.uuid]=poll return poll.uuid