I’m trying to implement a timeout function that kicks inactive players if they haven’t submitted a certain action in a certain amount of time. After correctly registering presences in the match state, using the function
match_kick(presence) in said presences doesn’t do anything, as shown in the following screenshot:
The code that kicks the players is:
-- M.match_check_timeout(dispatcher,state) -- ... for _, id in ipairs(state.players) do if state.formation[id] == nil then dispatcher.match_kick(state.presences[id]) print("kicked player "..state.presences[id].username) end end -- ...
And the code that tracks the presences before and after the kick:
-- match_loop print("presences before timeout: ") for k,v in pairs(state.presences) do print(state.presences[k].username) end M.match_check_timeout(dispatcher,state) print("presences after timeout: ") for k,v in pairs(state.presences) do print(state.presences[k].username) end
Am I doing something wrong? Is that the correct usage of
Please help! Thanks in advance!