mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Make some Lua calls local to increase performance.
This commit is contained in:
parent
1c598868a9
commit
8d3681dc1f
@ -1,15 +1,18 @@
|
|||||||
-- This script needs all active proxies available specified as args.
|
-- This script needs all active proxies available specified as args.
|
||||||
|
local insert = table.insert
|
||||||
|
local call = redis.call
|
||||||
|
|
||||||
local serverToData = {}
|
local serverToData = {}
|
||||||
|
|
||||||
for _, proxy in ipairs(ARGV) do
|
for _, proxy in ipairs(ARGV) do
|
||||||
local players = redis.call("SMEMBERS", "proxy:" .. proxy .. ":usersOnline")
|
local players = call("SMEMBERS", "proxy:" .. proxy .. ":usersOnline")
|
||||||
for _, player in ipairs(players) do
|
for _, player in ipairs(players) do
|
||||||
local server = redis.call("HGET", "player:" .. player, "server")
|
local server = call("HGET", "player:" .. player, "server")
|
||||||
if server then
|
if server then
|
||||||
if not serverToData[server] then
|
if not serverToData[server] then
|
||||||
serverToData[server] = {}
|
serverToData[server] = {}
|
||||||
end
|
end
|
||||||
table.insert(serverToData[server], player)
|
insert(serverToData[server], player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user