2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-10-31 18:48:01 +00:00

Slightly simplified the Lua code.

This commit is contained in:
Tux 2015-06-21 20:02:12 -04:00
parent 85eea7746e
commit d7b3568eec

View File

@ -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