Skip to content

Commit

Permalink
chore: improved example
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcStdt committed Nov 17, 2024
1 parent 593b988 commit de72fd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
19 changes: 16 additions & 3 deletions examples/minecraft/.scroll/packet_handler/query.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,25 @@ function handle(ctx, data)

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

local finishSec = get_finish_sec()

if finishSec ~= nil then
finishSec = math.ceil(finishSec)
end

if queue ~= nil and queue["install"] == "running" then
name = get_var("ServerListNameInstalling") or "INSTALLING, this might take a moment"
if finishSec ~= nil then
-- finish sec is not necissary applicable, but it's better to show something I guess
name = get_var("ServerListNameInstalling") or
string.format("INSTALLING, this might take a moment - %ds", finishSec)
else
name = get_var("ServerListNameInstalling") or "INSTALLING, this might take a moment"
end

map = get_var("MapNameInstalling") or "installing server"
elseif get_finish_sec() ~= nil then
elseif finishSec ~= nil then
nameTemplate = get_var("ServerListNameStarting") or "Druid Gameserver (starting) - %ds"
name = string.format(nameTemplate, math.ceil(get_finish_sec()))
name = string.format(nameTemplate, finishSec)
end

folder = get_var("GameSteamFolder") or "ark_survival_evolved"
Expand Down
1 change: 0 additions & 1 deletion examples/minecraft/.scroll/scroll-lock.json

This file was deleted.

0 comments on commit de72fd5

Please sign in to comment.