Private
Public Access
1
0

Added more functions

Streamlined the process
This commit is contained in:
Jan Grießhaber
2025-12-29 16:32:47 +01:00
parent 149b085cb7
commit 5accb091b0
6 changed files with 133 additions and 112 deletions

View File

@@ -3,10 +3,13 @@ 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)
modstring = modstring .. ("%s:%s\n"):format(k,v)
end
helpers.send_udp(52555, modstring,1)
helpers.send_udp(udpAddress, modstring,serverIndex)
end
function GetMapSeed()
helpers.send_udp(udpAddress, ("---map-seed---\n%d"):format(game.surfaces["nauvis"].map_gen_settings.seed),serverIndex)
end
---Concats all player online times into a single string
@@ -16,7 +19,19 @@ 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)
timeParts[#timeParts+1] = ("%s:%d:%d"):format(player.name, player.index, player.online_time)
end
return table.concat(timeParts, "\n")
end
---comment
---@return string
function GetPlayerDeaths()
local deathParts = {}
deathParts[#deathParts+1] = "---player-deaths---\n"
for _,player in pairs(game.players) do
deathParts[#deathParts+1] = ("%s:%d:%d"):format(player.name, player.index, storage.playerDeathCount[player.index]or 0)
end
return table.concat(deathParts, "\n")
end