Decon log locale (#319)

* Update deconlog.lua

* Update addons.cfg

* Update addons.cfg

* Update addons.cfg

* Update deconlog.lua

* Update deconlog.lua

* Update addons.cfg

* Update addons.cfg

* Update addons.cfg

* Update modules/addons/deconlog.lua

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
2024-09-02 06:18:14 +09:00
committed by GitHub
parent b308b0020c
commit 1de395b614
4 changed files with 14 additions and 4 deletions

View File

@@ -86,3 +86,6 @@ jail=__1__ was jailed because they removed too many protected entities. Please w
[nukeprotect] [nukeprotect]
found=You cannot have __1__ in your inventory, so it was placed into the chests at spawn. found=You cannot have __1__ in your inventory, so it was placed into the chests at spawn.
[deconlog]
decon=__1__ tried to deconstruct on __2__ from __3__ to __4__ which has __5__ items.

View File

@@ -86,3 +86,6 @@ jail=__1__ 因被多次拆除受保護物體而被禁止行動。請等候管理
[nukeprotect] [nukeprotect]
found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。 found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。
[deconlog]
decon=__1__ 試圖拆除在 __2__ 上從 __3__ 到 __4__ ,有 __5__ 個物品。

View File

@@ -86,3 +86,6 @@ jail=__1__ 因被多次拆除受保護物體而被禁止行動。請等候管理
[nukeprotect] [nukeprotect]
found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。 found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。
[deconlog]
decon=__1__ 試圖拆除在 __2__ 上從 __3__ 到 __4__ ,有 __5__ 個物品。

View File

@@ -39,23 +39,24 @@ Event.on_init(function()
end) end)
if config.decon_area then if config.decon_area then
Event.add(defines.events.on_player_deconstructed_area, function (e) Event.add(defines.events.on_player_deconstructed_area, function(e)
if e.alt then if e.alt then
return return
end end
local player = game.get_player(e.player_index) local player = game.get_player(e.player_index)
if Roles.player_has_flag(player, "deconlog-bypass") then
if Roles.player_has_flag(player, 'deconlog-bypass') then
return return
end end
local items = e.surface.find_entities_filtered{area=e.area, force=player.force} local items = e.surface.find_entities_filtered{area=e.area, force=player.force}
if #items > 250 then if #items > 250 then
print_to_players(true, player.name .. ' tried to deconstruct the area ' .. pos_to_gps_string(e.area.left_top) .. ' to ' .. pos_to_gps_string(e.area.right_bottom) .. ' that have ' .. format_number(#items) .. ' items, but were not allowed.') print_to_players(true, {'deconlog.decon', player.name, e.surface.name, pos_to_gps_string(e.area.left_top), pos_to_gps_string(e.area.right_bottom), format_number(#items)})
end end
add_log(get_secs() .. "," .. player.name .. ",decon_area," .. pos_to_string(e.area.left_top) .. "," .. pos_to_string(e.area.right_bottom)) add_log(get_secs() .. ',' .. player.name .. ',decon_area,' .. e.surface.name .. ',' .. pos_to_string(e.area.left_top) .. ',' .. pos_to_string(e.area.right_bottom))
end) end)
end end