2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +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 for _, player in ipairs(players) do
local server = redis.call("HGET", "player:" .. player, "server") local server = redis.call("HGET", "player:" .. player, "server")
if server then if server then
if serverToData[server] then if not serverToData[server] then
local data = serverToData[server]
data[#data + 1] = player
else
serverToData[server] = {player} serverToData[server] = {player}
end end
table.insert(serverToData[server], player)
end end
end end
end end