Added more functions
Streamlined the process
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user