mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
feat: add FAGC logging
This commit is contained in:
19
modules/addons/fagc.lua
Normal file
19
modules/addons/fagc.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
--- Allows the FAGC clientside bot to receive information about bans and unbans and propagate that information to other servers
|
||||
-- @addon FAGC
|
||||
|
||||
local Event = require 'utils.event' --- @dep utils.event
|
||||
|
||||
-- Clear the file on startup to minimize its size
|
||||
Event.on_init(function(e)
|
||||
game.write_file("fagc-actions.txt", "", true, 0)
|
||||
end)
|
||||
|
||||
Event.add(defines.events.on_player_banned, function(e)
|
||||
local text = "ban;\"" .. e.player_name .. "\";\"" .. (e.by_player or "") .. "\";\"" .. (e.reason or "") .. "\""
|
||||
game.write_file("fagc-actions.txt", text, true, 0)
|
||||
end)
|
||||
|
||||
Event.add(defines.events.on_player_unbanned, function(e)
|
||||
local text = "unban;\"" .. e.player_name .. "\";\"" .. (e.by_player or "") .. "\";\"" .. (e.reason or "") .. "\""
|
||||
game.write_file("fagc-actions.txt", text, true, 0)
|
||||
end)
|
||||
Reference in New Issue
Block a user