1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-11-25 22:32:18 +02:00
Files
ComfyFactorio/utils/commands/halt_pause.lua

20 lines
775 B
Lua
Raw Normal View History

local Commands = require 'utils.commands'
local Server = require 'utils.server'
local Discord = require 'utils.discord_handler'
Commands.new('halt_pause', 'Resumes the game if the backend has paused it.')
:require_admin()
:require_backend()
:require_validation('This will resume the game from the script handler. Are you sure you want to continue?')
:callback(function (player)
if not Server.get_paused_state() or not game.tick_paused then
player.print('The game is currently not paused.')
return false
end
Discord.send_notification_raw(nil, player.name .. ' has triggered to unpause the game!')
Server.log_halt_pause(player.name)
player.print('[Handler] Game will shortly be unpaused. Please wait a moment for the game to resume.')
return true
end)