1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-30 04:30:58 +02:00

added command logging

This commit is contained in:
grilledham 2018-07-02 16:34:46 +01:00
parent aea7bc2d0f
commit 9630cc4d1b

View File

@ -159,6 +159,23 @@ Event.add(
local gui = player.gui
gui.top.style = 'slot_table_spacing_horizontal_flow'
gui.left.style = 'slot_table_spacing_vertical_flow'
gui.left.style = 'slot_table_spacing_vertical_flow'
end
)
Event.add(
defines.events.on_console_command,
function(event)
local command = event.command
if command == 'c' or command == 'command' or command == 'silent-command' or command == 'hax' then
local player = game.players[event.player_index]
if player then
player = player.name
else
player = '<server>'
end
local s = table.concat {'[Command] ', player, ' /', command, ' ', event.parameters}
log(s)
end
end
)