1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

Begin logging crash site game time to scenario data

Added lines to store the unix time the restart happens as well as how many ticks the game lasted. Starting storing these now so I have some interesting data to use in a week or two.
This commit is contained in:
Jayefuu 2020-10-29 16:26:27 +00:00 committed by GitHub
parent 4c9cc3ed4c
commit f1956c7224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,11 @@ callback =
local discord_crashsite_role = '<@&762441731194748958>' -- @crash_site local discord_crashsite_role = '<@&762441731194748958>' -- @crash_site
--local discord_crashsite_role = '<@&593534612051984431>' -- @test --local discord_crashsite_role = '<@&593534612051984431>' -- @test
Server.to_discord_raw(discord_crashsite_role .. ' **Crash Site has just restarted! Previous map lasted: ' .. time_string .. '!**') Server.to_discord_raw(discord_crashsite_role .. ' **Crash Site has just restarted! Previous map lasted: ' .. time_string .. '!**')
local unix_time = Server.get_current_time()
local game_time = game.ticks_played
Server.set_data('crash_site_data', tostring(unix_time), game_time) -- Store the server unix time as key and total game ticks in the Scenario Data
Popup.all('\nServer restarting!\nInitiated by ' .. data.name .. '\n') Popup.all('\nServer restarting!\nInitiated by ' .. data.name .. '\n')
end end