1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-11 14:49:24 +02:00

Server - add new backend commands

This commit is contained in:
Gerkiz 2022-10-21 21:49:49 +02:00
parent 28503e6a36
commit 2a3eab8521
2 changed files with 9 additions and 1 deletions

View File

@ -141,7 +141,11 @@ end
-- function()
-- Server.try_get_all_data('regulars', callback)
-- end)
Public.events = {on_server_started = Event.generate_event_name('on_server_started')}
-- Event.add(Server.events.on_changes_detected,
-- function()
-- Trigger some sort of automated restart whenever the game ends.
-- end)
Public.events = {on_server_started = Event.generate_event_name('on_server_started'), on_changes_detected = Event.generate_event_name('on_changes_detected')}
--- Sends a message to the linked discord channel. The message is sanitized of markdown server side.
-- @param message<string> message to send.

View File

@ -26,6 +26,10 @@ function ServerCommands.server_started()
script.raise_event(Server.events.on_server_started, {})
end
function ServerCommands.changes_detected()
script.raise_event(Server.events.on_changes_detected, {})
end
ServerCommands.set_time = Server.set_time
ServerCommands.set_ups = Server.set_ups
ServerCommands.get_ups = Server.get_ups