22 lines
820 B
Lua
22 lines
820 B
Lua
---Sends all mod infos for the current game, should only be called on the first load of the map since mods don't change during runtime
|
|
function GetMods()
|
|
local mods = script.active_mods
|
|
local modstring = "---mod-info---\n"
|
|
for k,v in pairs(mods) do
|
|
modstring = modstring .. ("mod-info:%s:%s\n"):format(k,v)
|
|
|
|
end
|
|
helpers.send_udp(52555, modstring,1)
|
|
end
|
|
|
|
---Concats all player online times into a single string
|
|
---Takes all players that ever visited the server into account
|
|
---@return string
|
|
function GetPlayerTime()
|
|
local timeParts = {}
|
|
timeParts[#timeParts+1] = "---player-times---\n"
|
|
for _,player in pairs(game.players) do
|
|
timeParts[#timeParts+1] = ("player-time:%s:%d:%d"):format(player.name, player.index, player.online_time)
|
|
end
|
|
return table.concat(timeParts, "\n")
|
|
end |