diff --git a/src/main/resources/lua/server_to_players.lua b/src/main/resources/lua/server_to_players.lua index a3fdd97..6a20552 100644 --- a/src/main/resources/lua/server_to_players.lua +++ b/src/main/resources/lua/server_to_players.lua @@ -6,12 +6,10 @@ for _, proxy in ipairs(ARGV) do for _, player in ipairs(players) do local server = redis.call("HGET", "player:" .. player, "server") if server then - if serverToData[server] then - local data = serverToData[server] - data[#data + 1] = player - else + if not serverToData[server] then serverToData[server] = {player} end + table.insert(serverToData[server], player) end end end