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

29 lines
922 B
Lua
Raw Normal View History

2018-11-16 16:46:17 +00:00
local Poll = require 'features.gui.poll'
local UserGroups = require 'features.user_groups'
2018-11-27 17:12:00 -05:00
local Token = require 'utils.token'
local Server = require 'features.server'
2018-09-21 19:48:12 +01:00
2018-11-26 16:07:24 +00:00
--- This module is for the web server to call functions and raise events.
-- Not intended to be called by scripts.
-- Needs to be in the _G table so it can be accessed by the web server.
ServerCommands = {}
2018-09-21 19:48:12 +01:00
2018-11-26 16:07:24 +00:00
ServerCommands.get_poll_result = Poll.send_poll_result_to_discord
2018-09-21 19:48:12 +01:00
2018-11-26 16:07:24 +00:00
ServerCommands.regular_sync = UserGroups.sync_regulars
ServerCommands.donator_sync = UserGroups.sync_donators
2018-10-02 00:10:53 +01:00
2018-11-26 16:07:24 +00:00
function ServerCommands.raise_callback(func_token, data)
2018-11-19 20:13:45 +00:00
local func = Token.get(func_token)
func(data)
end
2018-11-26 16:07:24 +00:00
ServerCommands.raise_data_set = Server.raise_data_set
ServerCommands.get_tracked_data_sets = Server.get_tracked_data_sets
2018-11-24 14:15:14 +00:00
2018-11-26 16:07:24 +00:00
function ServerCommands.server_started()
2018-11-24 14:15:14 +00:00
script.raise_event(Server.events.on_server_started, {})
end
2018-11-26 16:07:24 +00:00
return ServerCommands