Skip to content

Commit de72fd5

Browse files
committed
chore: improved example
1 parent 593b988 commit de72fd5

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

examples/minecraft/.scroll/packet_handler/query.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,25 @@ function handle(ctx, data)
8181

8282
map = get_var("MapName") or "server idle"
8383

84+
local finishSec = get_finish_sec()
85+
86+
if finishSec ~= nil then
87+
finishSec = math.ceil(finishSec)
88+
end
89+
8490
if queue ~= nil and queue["install"] == "running" then
85-
name = get_var("ServerListNameInstalling") or "INSTALLING, this might take a moment"
91+
if finishSec ~= nil then
92+
-- finish sec is not necissary applicable, but it's better to show something I guess
93+
name = get_var("ServerListNameInstalling") or
94+
string.format("INSTALLING, this might take a moment - %ds", finishSec)
95+
else
96+
name = get_var("ServerListNameInstalling") or "INSTALLING, this might take a moment"
97+
end
98+
8699
map = get_var("MapNameInstalling") or "installing server"
87-
elseif get_finish_sec() ~= nil then
100+
elseif finishSec ~= nil then
88101
nameTemplate = get_var("ServerListNameStarting") or "Druid Gameserver (starting) - %ds"
89-
name = string.format(nameTemplate, math.ceil(get_finish_sec()))
102+
name = string.format(nameTemplate, finishSec)
90103
end
91104

92105
folder = get_var("GameSteamFolder") or "ark_survival_evolved"

examples/minecraft/.scroll/scroll-lock.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)