mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 20:16:38 +09:00
3rd attempt at fixing upvalues
This commit is contained in:
@@ -6,8 +6,8 @@ script.on_init(function(event)
|
||||
Server.new_thread{
|
||||
name='afk-kick',
|
||||
}:on_event('tick',function(self)
|
||||
-- the _env should be auto loaded but it does not for some reason
|
||||
local _ENV = self._env.setmetatable({self=self,event=event},{__index=self._env})
|
||||
-- the _env should be auto loaded but it does not for some reasonm this is an attempt to repair the upvalues
|
||||
for index,name in pairs(self._env._order) do self._env.debug.setupvalue(1,index,self._env[name]) end
|
||||
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_allowed_afk_time(player)
|
||||
@@ -16,9 +16,8 @@ script.on_init(function(event)
|
||||
end
|
||||
end
|
||||
end):on_event('error',function(self,err)
|
||||
-- the _env should be auto loaded but it does not for some reason
|
||||
local _ENV = _ENV or setmetatable({},{__index=_G})
|
||||
_ENV.Sync = self._env.Sync
|
||||
-- the _env should be auto loaded but it does not for some reasonm this is an attempt to repair the upvalues
|
||||
for index,name in pairs(self._env._order) do self._env.debug.setupvalue(1,index,self._env[name]) end
|
||||
if Sync then
|
||||
Sync.emit_embeded{
|
||||
title='Auto Kick Error',
|
||||
|
||||
Reference in New Issue
Block a user