Improve sorting of player score metric
This commit is contained in:
parent
4d299b19d6
commit
3c57a71f20
1 changed files with 4 additions and 6 deletions
|
@ -13,20 +13,18 @@ local function step()
|
||||||
|
|
||||||
local sum = 0
|
local sum = 0
|
||||||
local avg = 0
|
local avg = 0
|
||||||
local bins = { [50]=0, [100]=0, [200]=0, [5000]=0, rest=0 }
|
local bins = { r050=0, r200=0, r5000=0, rest=0 }
|
||||||
if #minetest.get_connected_players() > 0 then
|
if #minetest.get_connected_players() > 0 then
|
||||||
for _, player in pairs(minetest.get_connected_players()) do
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
local total, _ = ctf_stats.player(player:get_player_name())
|
local total, _ = ctf_stats.player(player:get_player_name())
|
||||||
sum = sum + total.score
|
sum = sum + total.score
|
||||||
|
|
||||||
if total.score > 174000 then
|
if total.score > 174000 then
|
||||||
bins[50] = bins[50] + 1
|
bins.r050 = bins.r050 + 1
|
||||||
elseif total.score > 80000 then
|
|
||||||
bins[100] = bins[100] + 1
|
|
||||||
elseif total.score > 10000 then
|
elseif total.score > 10000 then
|
||||||
bins[200] = bins[200] + 1
|
bins.r200 = bins.r200 + 1
|
||||||
elseif total.score > 1000 then
|
elseif total.score > 1000 then
|
||||||
bins[5000] = bins[5000] + 1
|
bins.r5000 = bins.r5000 + 1
|
||||||
else
|
else
|
||||||
bins.rest = bins.rest + 1
|
bins.rest = bins.rest + 1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue