diff --git a/config/_file_loader.lua b/config/_file_loader.lua index 404261bf..bff9c441 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -50,6 +50,7 @@ return { 'modules.addons.afk-kick', 'modules.addons.report-jail', 'modules.addons.protection-jail', + 'modules.addons.deconlog', --- Data 'modules.data.statistics', @@ -71,6 +72,8 @@ return { 'modules.gui.server-ups', 'modules.commands.debug', + 'modules.graftorio.require', -- graftorio + --- Config Files 'config.expcore.command_auth_admin', -- commands tagged with admin_only are blocked for non admins 'config.expcore.command_auth_roles', -- commands must be allowed via the role config diff --git a/config/deconlog.lua b/config/deconlog.lua new file mode 100644 index 00000000..ca46a0e1 --- /dev/null +++ b/config/deconlog.lua @@ -0,0 +1,9 @@ +--- This config controls whether actions such as deconning by players without sufficient permissions is logged or not +-- @config Deconlog + +return { + decon_area = true, ---@setting decon_area whether to log when an area is being deconstructed + built_entity = true, ---@setting built_entity whether to log when an entity is built + mined_entity = true, ---@setting mined_entity whether to log when an entity is mined + fired_nuke = true, ---@setting fired_nuke whether to log when a nuke is fired +} \ No newline at end of file diff --git a/config/expcore/roles.lua b/config/expcore/roles.lua index 95b797bd..a89b92cc 100644 --- a/config/expcore/roles.lua +++ b/config/expcore/roles.lua @@ -52,6 +52,7 @@ Roles.new_role('Administrator','Admin') 'gui/warp-list/bypass-cooldown', 'gui/warp-list/bypass-proximity', 'command/connect-all', + 'command/collectdata' } Roles.new_role('Moderator','Mod') @@ -202,6 +203,7 @@ end) Roles.new_role('Member','Mem') :set_permission_group('Standard') :set_custom_color{r=24,g=172,b=188} +:set_flag("deconlog-bypass") :set_parent('Regular') :allow{ 'gui/task-list/add', diff --git a/config/graftorio.lua b/config/graftorio.lua new file mode 100644 index 00000000..20dca369 --- /dev/null +++ b/config/graftorio.lua @@ -0,0 +1,7 @@ +return { + modules = { + ["forcestats"] = true, + ["logistorage"] = false, + ["general"] = true, + } +} diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index eaa1f69a..7cac27f3 100644 --- a/docs/addons/Advanced-Start.html +++ b/docs/addons/Advanced-Start.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -348,7 +350,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Popups.html b/docs/addons/Chat-Popups.html index bbd7fbde..57689bf7 100644 --- a/docs/addons/Chat-Popups.html +++ b/docs/addons/Chat-Popups.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -377,7 +379,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html index 1870fb39..dd3be7aa 100644 --- a/docs/addons/Chat-Reply.html +++ b/docs/addons/Chat-Reply.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -376,7 +378,7 @@ generated by LDoc diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html index 85298376..382f862c 100644 --- a/docs/addons/Compilatron.html +++ b/docs/addons/Compilatron.html @@ -57,6 +57,7 @@ + @@ -169,6 +170,7 @@ + @@ -585,7 +587,7 @@ generated by LDoc diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html index 602cb920..062a5d6f 100644 --- a/docs/addons/Damage-Popups.html +++ b/docs/addons/Damage-Popups.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -377,7 +379,7 @@ generated by LDoc diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html index 0a63fa2a..fd729585 100644 --- a/docs/addons/Death-Logger.html +++ b/docs/addons/Death-Logger.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -404,7 +406,7 @@ generated by LDoc diff --git a/docs/addons/Deconlog.html b/docs/addons/Deconlog.html new file mode 100644 index 00000000..26be43b6 --- /dev/null +++ b/docs/addons/Deconlog.html @@ -0,0 +1,386 @@ + + + + + + + + Deconlog addon + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Deconlog addon

+

Log certain actions into a file when events are triggered

+

+ + + + + + + + + + + + + +

Dependencies

+ + + + + + + + + + + + + +
utils.event
expcore.roles
config.deconlog
+ + +
+ + +

Dependencies

+
+
+
+
+ # + utils.event +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.roles +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + config.deconlog +
+
+
+
+ + + + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html index 7c71b71e..38cf31e8 100644 --- a/docs/addons/Discord-Alerts.html +++ b/docs/addons/Discord-Alerts.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -488,7 +490,7 @@ generated by LDoc diff --git a/docs/addons/Inventory-Clear.html b/docs/addons/Inventory-Clear.html index ccec21b2..4e271c3e 100644 --- a/docs/addons/Inventory-Clear.html +++ b/docs/addons/Inventory-Clear.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -376,7 +378,7 @@ generated by LDoc diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html index 30685094..771ec366 100644 --- a/docs/addons/Pollution-Grading.html +++ b/docs/addons/Pollution-Grading.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -348,7 +350,7 @@ generated by LDoc diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html index 3da0e120..4f787100 100644 --- a/docs/addons/Scorched-Earth.html +++ b/docs/addons/Scorched-Earth.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -404,7 +406,7 @@ generated by LDoc diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html index cbbbdba1..53662bfa 100644 --- a/docs/addons/Spawn-Area.html +++ b/docs/addons/Spawn-Area.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -376,7 +378,7 @@ generated by LDoc diff --git a/docs/addons/Tree-Decon.html b/docs/addons/Tree-Decon.html index 385d4754..8346a48a 100644 --- a/docs/addons/Tree-Decon.html +++ b/docs/addons/Tree-Decon.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -277,6 +279,12 @@ expcore.roles + + expcore.gui + + + expcore.player_data + @@ -354,6 +362,56 @@ + + + + + + + +
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.player_data +
+
+
+
+ + + + + + + + + @@ -376,7 +434,7 @@ generated by LDoc
diff --git a/docs/addons/afk-kick.html b/docs/addons/afk-kick.html index 8166621d..cc6d0e1d 100644 --- a/docs/addons/afk-kick.html +++ b/docs/addons/afk-kick.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -404,7 +406,7 @@ generated by LDoc diff --git a/docs/addons/protection-jail.html b/docs/addons/protection-jail.html index 48dbbf9a..93556b02 100644 --- a/docs/addons/protection-jail.html +++ b/docs/addons/protection-jail.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -432,7 +434,7 @@ generated by LDoc diff --git a/docs/addons/report-jail.html b/docs/addons/report-jail.html index ce48219a..171d2616 100644 --- a/docs/addons/report-jail.html +++ b/docs/addons/report-jail.html @@ -56,6 +56,7 @@ + @@ -168,6 +169,7 @@ + @@ -404,7 +406,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html index 0f27a9d7..fafbb803 100644 --- a/docs/commands/Admin-Chat.html +++ b/docs/commands/Admin-Chat.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -416,7 +418,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Markers.html b/docs/commands/Admin-Markers.html index 0d44318d..ebd1d737 100644 --- a/docs/commands/Admin-Markers.html +++ b/docs/commands/Admin-Markers.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -421,7 +423,7 @@ generated by LDoc diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html index d68f8db1..ecf26d6b 100644 --- a/docs/commands/Cheat-Mode.html +++ b/docs/commands/Cheat-Mode.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -389,7 +391,7 @@ generated by LDoc diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html index 738f7e62..e20cdbc0 100644 --- a/docs/commands/Clear-Inventory.html +++ b/docs/commands/Clear-Inventory.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -416,7 +418,7 @@ generated by LDoc diff --git a/docs/commands/Connect.html b/docs/commands/Connect.html index be3cfd5d..4208cfed 100644 --- a/docs/commands/Connect.html +++ b/docs/commands/Connect.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -619,7 +621,7 @@ generated by LDoc diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html index 372d84ff..6eabccce 100644 --- a/docs/commands/Debug.html +++ b/docs/commands/Debug.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -393,7 +395,7 @@ generated by LDoc diff --git a/docs/commands/Find.html b/docs/commands/Find.html index 8c025525..d241e4bc 100644 --- a/docs/commands/Find.html +++ b/docs/commands/Find.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -388,7 +390,7 @@ generated by LDoc diff --git a/docs/commands/Help.html b/docs/commands/Help.html index 48d0f5a5..746fce88 100644 --- a/docs/commands/Help.html +++ b/docs/commands/Help.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -432,7 +434,7 @@ generated by LDoc diff --git a/docs/commands/Home.html b/docs/commands/Home.html index df7c3433..9cd2509b 100644 --- a/docs/commands/Home.html +++ b/docs/commands/Home.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -486,7 +488,7 @@ generated by LDoc diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html index 2ead05cd..00dc7c96 100644 --- a/docs/commands/Interface.html +++ b/docs/commands/Interface.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -416,7 +418,7 @@ generated by LDoc diff --git a/docs/commands/InventorySearch.html b/docs/commands/InventorySearch.html index 91fc7713..24a5eb5e 100644 --- a/docs/commands/InventorySearch.html +++ b/docs/commands/InventorySearch.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -606,7 +608,7 @@ generated by LDoc diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html index 38b19a15..fa424ce3 100644 --- a/docs/commands/Jail.html +++ b/docs/commands/Jail.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -515,7 +517,7 @@ generated by LDoc diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html index c4481352..5b578ea8 100644 --- a/docs/commands/Kill.html +++ b/docs/commands/Kill.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -417,7 +419,7 @@ generated by LDoc diff --git a/docs/commands/LastLocation.html b/docs/commands/LastLocation.html index f7278a0e..4baba3df 100644 --- a/docs/commands/LastLocation.html +++ b/docs/commands/LastLocation.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -416,7 +418,7 @@ generated by LDoc diff --git a/docs/commands/Me.html b/docs/commands/Me.html index 6a64ca7a..dcc1529f 100644 --- a/docs/commands/Me.html +++ b/docs/commands/Me.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -388,7 +390,7 @@ generated by LDoc diff --git a/docs/commands/Protection.html b/docs/commands/Protection.html index 1337c08d..156d6904 100644 --- a/docs/commands/Protection.html +++ b/docs/commands/Protection.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -564,7 +566,7 @@ generated by LDoc diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html index 6f940c36..f9f8434c 100644 --- a/docs/commands/Rainbow.html +++ b/docs/commands/Rainbow.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -416,7 +418,7 @@ generated by LDoc diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html index e30a7425..91989405 100644 --- a/docs/commands/Repair.html +++ b/docs/commands/Repair.html @@ -119,6 +119,7 @@ + @@ -168,6 +169,7 @@ + @@ -349,7 +351,7 @@ generated by LDoc diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html index 427f70e9..6923d0ea 100644 --- a/docs/commands/Reports.html +++ b/docs/commands/Reports.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -613,7 +615,7 @@ generated by LDoc diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html index c4fc2a1a..5e5f0445 100644 --- a/docs/commands/Roles.html +++ b/docs/commands/Roles.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -585,7 +587,7 @@ generated by LDoc diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html index a8a7f128..8271e300 100644 --- a/docs/commands/Spawn.html +++ b/docs/commands/Spawn.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -417,7 +419,7 @@ generated by LDoc diff --git a/docs/commands/Spectate.html b/docs/commands/Spectate.html index 521007cb..5d5ba9b7 100644 --- a/docs/commands/Spectate.html +++ b/docs/commands/Spectate.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -447,7 +449,7 @@ generated by LDoc diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html index bcac895d..2d618df5 100644 --- a/docs/commands/Teleport.html +++ b/docs/commands/Teleport.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -512,7 +514,7 @@ generated by LDoc diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html index f3f0b53e..71fe8da6 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -120,6 +120,7 @@ + @@ -169,6 +170,7 @@ + @@ -597,7 +599,7 @@ generated by LDoc diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index ba719a1e..139da2ce 100644 --- a/docs/configs/Advanced-Start.html +++ b/docs/configs/Advanced-Start.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -534,7 +536,7 @@ generated by LDoc diff --git a/docs/configs/Autofill.html b/docs/configs/Autofill.html index f1544643..37ee980b 100644 --- a/docs/configs/Autofill.html +++ b/docs/configs/Autofill.html @@ -47,6 +47,7 @@ + @@ -118,6 +119,7 @@ + @@ -265,7 +267,7 @@ generated by LDoc diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html index 327043f7..2b701bbe 100644 --- a/docs/configs/Bonuses.html +++ b/docs/configs/Bonuses.html @@ -47,6 +47,7 @@ + @@ -118,6 +119,7 @@ + @@ -265,7 +267,7 @@ generated by LDoc diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html index 8b791627..8010ab5a 100644 --- a/docs/configs/Chat-Reply.html +++ b/docs/configs/Chat-Reply.html @@ -56,6 +56,7 @@ + @@ -127,6 +128,7 @@ + @@ -513,7 +515,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html index 9d46f5ef..a30e9984 100644 --- a/docs/configs/Commands-Auth-Admin.html +++ b/docs/configs/Commands-Auth-Admin.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -322,7 +324,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html index 540edd78..1059b1c8 100644 --- a/docs/configs/Commands-Auth-Roles.html +++ b/docs/configs/Commands-Auth-Roles.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -348,7 +350,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html index 87e02ee0..b264e0f5 100644 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ b/docs/configs/Commands-Auth-Runtime-Disable.html @@ -56,6 +56,7 @@ + @@ -127,6 +128,7 @@ + @@ -470,7 +472,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Color-Parse.html b/docs/configs/Commands-Color-Parse.html index a073af1d..8716bb93 100644 --- a/docs/configs/Commands-Color-Parse.html +++ b/docs/configs/Commands-Color-Parse.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -348,7 +350,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html index 3aabc43f..107750cd 100644 --- a/docs/configs/Commands-Parse-Roles.html +++ b/docs/configs/Commands-Parse-Roles.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -382,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html index 523252b5..31f59d03 100644 --- a/docs/configs/Commands-Parse.html +++ b/docs/configs/Commands-Parse.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -338,7 +340,7 @@ see ./expcore/commands.lua for more details

generated by LDoc diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html index 4621b79b..8a99edd4 100644 --- a/docs/configs/Compilatron.html +++ b/docs/configs/Compilatron.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -382,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html index 577ffe91..5a9ca46d 100644 --- a/docs/configs/Death-Logger.html +++ b/docs/configs/Death-Logger.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -504,7 +506,7 @@ generated by LDoc diff --git a/docs/configs/Deconlog.html b/docs/configs/Deconlog.html new file mode 100644 index 00000000..e21fc96a --- /dev/null +++ b/docs/configs/Deconlog.html @@ -0,0 +1,422 @@ + + + + + + + + Deconlog config + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Deconlog config

+

This config controls whether actions such as deconning by players without sufficient permissions is logged or not

+

+ + + + + + + + + + + + + +

Settings

+ + + + + + + + + + + + + + + + +
decon_area
built_entity
mined_entity
fired_nuke
+ + +
+ + +

Settings

+
+
+
+
+ # + decon_area +
+
+
+
+ +

+

whether to log when an area is being deconstructed

+ + + + + + + + + + + + + + +
+
+
+
+ # + built_entity +
+
+
+
+ +

+

whether to log when an entity is built

+ + + + + + + + + + + + + + +
+
+
+
+ # + mined_entity +
+
+
+
+ +

+

whether to log when an entity is mined

+ + + + + + + + + + + + + + +
+
+
+
+ # + fired_nuke +
+
+
+
+ +

+

whether to log when a nuke is fired

+ + + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html index 6cdc7719..b5193df1 100644 --- a/docs/configs/Discord-Alerts.html +++ b/docs/configs/Discord-Alerts.html @@ -47,6 +47,7 @@ + @@ -118,6 +119,7 @@ + @@ -265,7 +267,7 @@ generated by LDoc diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html index 5362ae20..03e3ea86 100644 --- a/docs/configs/File-Loader.html +++ b/docs/configs/File-Loader.html @@ -47,6 +47,7 @@ + @@ -118,6 +119,7 @@ + @@ -268,7 +270,7 @@ generated by LDoc diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html index 51ab4a7d..d350b318 100644 --- a/docs/configs/Permission-Groups.html +++ b/docs/configs/Permission-Groups.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -323,7 +325,7 @@ generated by LDoc diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html index a3aa7ae4..f20f3142 100644 --- a/docs/configs/Player-List.html +++ b/docs/configs/Player-List.html @@ -56,6 +56,7 @@ + @@ -127,6 +128,7 @@ + @@ -722,7 +724,7 @@ generated by LDoc diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html index 02dae974..3ddee680 100644 --- a/docs/configs/Pollution-Grading.html +++ b/docs/configs/Pollution-Grading.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -412,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html index f70d9b21..f32db796 100644 --- a/docs/configs/Popup-Messages.html +++ b/docs/configs/Popup-Messages.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -442,7 +444,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html index ed4ddf67..59daea0b 100644 --- a/docs/configs/Preset-Player-Colours.html +++ b/docs/configs/Preset-Player-Colours.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -352,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Quickbar.html b/docs/configs/Preset-Player-Quickbar.html index 283e1ce7..abf5e254 100644 --- a/docs/configs/Preset-Player-Quickbar.html +++ b/docs/configs/Preset-Player-Quickbar.html @@ -47,6 +47,7 @@ + @@ -118,6 +119,7 @@ + @@ -265,7 +267,7 @@ generated by LDoc diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html index da08932f..52bf69c4 100644 --- a/docs/configs/Repair.html +++ b/docs/configs/Repair.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -442,7 +444,7 @@ generated by LDoc diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html index 5813fc40..caed3b2c 100644 --- a/docs/configs/Rockets.html +++ b/docs/configs/Rockets.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -862,7 +864,7 @@ generated by LDoc diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html index 47ce1156..6b617f55 100644 --- a/docs/configs/Roles.html +++ b/docs/configs/Roles.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -348,7 +350,7 @@ generated by LDoc diff --git a/docs/configs/Science.html b/docs/configs/Science.html index aaa7028e..969c6188 100644 --- a/docs/configs/Science.html +++ b/docs/configs/Science.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -382,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html index b1b8321c..b43575d7 100644 --- a/docs/configs/Scorched-Earth.html +++ b/docs/configs/Scorched-Earth.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -416,7 +418,7 @@ generated by LDoc diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html index 57b79c94..cd89b6cd 100644 --- a/docs/configs/Spawn-Area.html +++ b/docs/configs/Spawn-Area.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -1223,7 +1225,7 @@ generated by LDoc diff --git a/docs/configs/Statistics.html b/docs/configs/Statistics.html index b885b0cf..318a678f 100644 --- a/docs/configs/Statistics.html +++ b/docs/configs/Statistics.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -682,7 +684,7 @@ generated by LDoc diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html index 2b0be78c..c0043c24 100644 --- a/docs/configs/Tasks.html +++ b/docs/configs/Tasks.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -412,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html index 0c9dcf06..6e6e5d6d 100644 --- a/docs/configs/Warnings.html +++ b/docs/configs/Warnings.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -383,7 +385,7 @@ generated by LDoc diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html index 22afb90a..0401708b 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -55,6 +55,7 @@ + @@ -126,6 +127,7 @@ + @@ -772,7 +774,7 @@ generated by LDoc diff --git a/docs/configs/inventory_clear.html b/docs/configs/inventory_clear.html index 4e7912d6..479b1d68 100644 --- a/docs/configs/inventory_clear.html +++ b/docs/configs/inventory_clear.html @@ -47,6 +47,7 @@ + @@ -118,6 +119,7 @@ + @@ -265,7 +267,7 @@ generated by LDoc diff --git a/docs/control/Jail.html b/docs/control/Jail.html index 662c83a8..7446603f 100644 --- a/docs/control/Jail.html +++ b/docs/control/Jail.html @@ -90,6 +90,7 @@ + @@ -170,6 +171,7 @@ + @@ -803,7 +805,7 @@ generated by LDoc diff --git a/docs/control/Production.html b/docs/control/Production.html index f65a298c..9ca55560 100644 --- a/docs/control/Production.html +++ b/docs/control/Production.html @@ -91,6 +91,7 @@ + @@ -171,6 +172,7 @@ + @@ -1357,7 +1359,7 @@ generated by LDoc diff --git a/docs/control/Protection.html b/docs/control/Protection.html index 7a2aa367..fb3c6ae4 100644 --- a/docs/control/Protection.html +++ b/docs/control/Protection.html @@ -90,6 +90,7 @@ + @@ -170,6 +171,7 @@ + @@ -1029,7 +1031,7 @@ generated by LDoc diff --git a/docs/control/Reports.html b/docs/control/Reports.html index 9ef164d0..70fa898d 100644 --- a/docs/control/Reports.html +++ b/docs/control/Reports.html @@ -91,6 +91,7 @@ + @@ -171,6 +172,7 @@ + @@ -1170,7 +1172,7 @@ generated by LDoc diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html index 5e3882e8..866f970b 100644 --- a/docs/control/Rockets.html +++ b/docs/control/Rockets.html @@ -90,6 +90,7 @@ + @@ -170,6 +171,7 @@ + @@ -1012,7 +1014,7 @@ generated by LDoc diff --git a/docs/control/Selection.html b/docs/control/Selection.html index 61a84b63..dd70acca 100644 --- a/docs/control/Selection.html +++ b/docs/control/Selection.html @@ -90,6 +90,7 @@ + @@ -170,6 +171,7 @@ + @@ -919,7 +921,7 @@ generated by LDoc diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html index e5d7ae8c..202f08d3 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -90,6 +90,7 @@ + @@ -170,6 +171,7 @@ + @@ -1013,7 +1015,7 @@ Tasks.update_task(task_id, 'We need more iron!', gam generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index 52bd7736..8e0bef3a 100644 --- a/docs/control/Warnings.html +++ b/docs/control/Warnings.html @@ -90,6 +90,7 @@ + @@ -170,6 +171,7 @@ + @@ -1553,7 +1555,7 @@ generated by LDoc diff --git a/docs/control/Warps.html b/docs/control/Warps.html index 0e3aeb55..8f0a4eea 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -91,6 +91,7 @@ + @@ -171,6 +172,7 @@ + @@ -1535,7 +1537,7 @@ Warps.make_warp_tag(warp_id) generated by LDoc diff --git a/docs/core/Async.html b/docs/core/Async.html index ef413dca..e46de6af 100644 --- a/docs/core/Async.html +++ b/docs/core/Async.html @@ -89,6 +89,7 @@ + @@ -169,6 +170,7 @@ + @@ -626,7 +628,7 @@ Async.register(function(player, message) generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index 7037015d..42141eef 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -95,6 +95,7 @@ + @@ -175,6 +176,7 @@ + @@ -2441,7 +2443,7 @@ nb: use error(error_message) within your callback to trigger do not trigger dire generated by LDoc diff --git a/docs/core/Common.html b/docs/core/Common.html index 9658dbfc..423ec0b9 100644 --- a/docs/core/Common.html +++ b/docs/core/Common.html @@ -92,6 +92,7 @@ + @@ -172,6 +173,7 @@ + @@ -422,7 +424,13 @@ move_items(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) - Moves items to the position and stores them in the closest entity of the type given + Moves items to the position and stores them in the closest entity of the type given +-- Copies the items by prototype name, but keeps them in the original inventory + + + move_items_stack(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) + Moves items to the position and stores them in the closest entity of the type given +-- Differs from move_items by accepting a table of LuaItemStack and transferring them into the inventory - not copying print_grid_value(value, surface, position[, scale=1][, offset=0][, immutable=false]) @@ -2456,7 +2464,8 @@
-

Moves items to the position and stores them in the closest entity of the type given

+

Moves items to the position and stores them in the closest entity of the type given +-- Copies the items by prototype name, but keeps them in the original inventory

@@ -2573,6 +2582,135 @@ move_items(game.player.get_main_inventory().get_contents()) +
+
+
+
+ # + move_items_stack(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) +
+
+
+
+ +

Moves items to the position and stores them in the closest entity of the type given +-- Differs from move_items by accepting a table of LuaItemStack and transferring them into the inventory - not copying

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Copy all the items in a players inventory and place them in chests at {0, 0}
+move_items(game.player.get_main_inventory())
+ +
@@ -2780,7 +2918,7 @@ https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4 generated by LDoc diff --git a/docs/core/Datastore.html b/docs/core/Datastore.html index 882df70a..9c0a77c1 100644 --- a/docs/core/Datastore.html +++ b/docs/core/Datastore.html @@ -94,6 +94,7 @@ + @@ -174,6 +175,7 @@ + @@ -2977,7 +2979,7 @@ ExampleData:on_update(function(key, value) generated by LDoc diff --git a/docs/core/External.html b/docs/core/External.html index d62b22e7..5f82eb6b 100644 --- a/docs/core/External.html +++ b/docs/core/External.html @@ -88,6 +88,7 @@ + @@ -168,6 +169,7 @@ + @@ -761,7 +763,7 @@ generated by LDoc diff --git a/docs/core/Groups.html b/docs/core/Groups.html index 2e48c8f9..78c41aa6 100644 --- a/docs/core/Groups.html +++ b/docs/core/Groups.html @@ -92,6 +92,7 @@ + @@ -172,6 +173,7 @@ + @@ -1456,7 +1458,7 @@ generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index 6d325610..0b5412af 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -97,6 +97,7 @@ + @@ -177,6 +178,7 @@ + @@ -4434,7 +4436,7 @@ Gui.left_toolbar_button('entity/inserter', generated by LDoc diff --git a/docs/core/PlayerData.html b/docs/core/PlayerData.html index 3f628c7c..da1a21d5 100644 --- a/docs/core/PlayerData.html +++ b/docs/core/PlayerData.html @@ -89,6 +89,7 @@ + @@ -169,6 +170,7 @@ + @@ -544,7 +546,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index 5799836b..944b64f1 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -96,6 +96,7 @@ + @@ -176,6 +177,7 @@ + @@ -3404,7 +3406,7 @@ nb: this is one way, failing false after already gaining the role will not revok generated by LDoc diff --git a/docs/data/Alt-View.html b/docs/data/Alt-View.html index f374bb9b..8dba5a81 100644 --- a/docs/data/Alt-View.html +++ b/docs/data/Alt-View.html @@ -101,6 +101,7 @@ + @@ -168,6 +169,7 @@ + @@ -348,7 +350,7 @@ generated by LDoc diff --git a/docs/data/Bonus.html b/docs/data/Bonus.html index 062d599c..d7efcb51 100644 --- a/docs/data/Bonus.html +++ b/docs/data/Bonus.html @@ -102,6 +102,7 @@ + @@ -169,6 +170,7 @@ + @@ -500,7 +502,7 @@ generated by LDoc diff --git a/docs/data/Greetings.html b/docs/data/Greetings.html index fa3a9d0c..73191694 100644 --- a/docs/data/Greetings.html +++ b/docs/data/Greetings.html @@ -102,6 +102,7 @@ + @@ -169,6 +170,7 @@ + @@ -443,7 +445,7 @@ generated by LDoc diff --git a/docs/data/Player-Colours.html b/docs/data/Player-Colours.html index 55d0521a..3ccda7a2 100644 --- a/docs/data/Player-Colours.html +++ b/docs/data/Player-Colours.html @@ -101,6 +101,7 @@ + @@ -168,6 +169,7 @@ + @@ -404,7 +406,7 @@ generated by LDoc diff --git a/docs/data/Quickbar.html b/docs/data/Quickbar.html index 9611b402..0e00dd51 100644 --- a/docs/data/Quickbar.html +++ b/docs/data/Quickbar.html @@ -102,6 +102,7 @@ + @@ -169,6 +170,7 @@ + @@ -421,7 +423,7 @@ generated by LDoc diff --git a/docs/data/Tag.html b/docs/data/Tag.html index a1b00a19..07029761 100644 --- a/docs/data/Tag.html +++ b/docs/data/Tag.html @@ -102,6 +102,7 @@ + @@ -169,6 +170,7 @@ + @@ -553,7 +555,7 @@ generated by LDoc diff --git a/docs/guis/Autofill.html b/docs/guis/Autofill.html index 510177d5..eb6140c7 100644 --- a/docs/guis/Autofill.html +++ b/docs/guis/Autofill.html @@ -103,6 +103,7 @@ + @@ -168,6 +169,7 @@ + @@ -605,7 +607,7 @@ generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index d10d67d5..b0f2a91e 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -104,6 +104,7 @@ + @@ -169,6 +170,7 @@ + @@ -719,7 +721,7 @@ generated by LDoc diff --git a/docs/guis/Readme.html b/docs/guis/Readme.html index ec8c908e..cc2097ac 100644 --- a/docs/guis/Readme.html +++ b/docs/guis/Readme.html @@ -106,6 +106,7 @@ + @@ -171,6 +172,7 @@ + @@ -1011,7 +1013,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index 99d4b07f..fc3d2872 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -104,6 +104,7 @@ + @@ -169,6 +170,7 @@ + @@ -719,7 +721,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 22245738..6e88d06a 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -104,6 +104,7 @@ + @@ -169,6 +170,7 @@ + @@ -598,7 +600,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index 6e93746f..45521c0d 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -104,6 +104,7 @@ + @@ -169,6 +170,7 @@ + @@ -1122,7 +1124,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index 1c919cfe..273e0479 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -105,6 +105,7 @@ + @@ -170,6 +171,7 @@ + @@ -1088,7 +1090,7 @@ generated by LDoc diff --git a/docs/guis/server-ups.html b/docs/guis/server-ups.html index b3d9d2c1..88d50bee 100644 --- a/docs/guis/server-ups.html +++ b/docs/guis/server-ups.html @@ -105,6 +105,7 @@ + @@ -170,6 +171,7 @@ + @@ -521,7 +523,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index bbc1f3c8..0ed036bf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -171,6 +171,10 @@ Makes markers on the map where places have died and reclaims items if not recovered + Deconlog + Log certain actions into a file when events are triggered + + Discord-Alerts Sends alert messages to our discord server when certain events are triggered @@ -429,6 +433,10 @@ This config controls what happens when a player dies mostly about map markers and item collection; allow_teleport_to_body_command and allow_collect_bodies_command can be over ridden if command_auth_runtime_disable is present; if not present then the commands will not be loaded into the game + + + Deconlog + This config controls whether actions such as deconning by players without sufficient permissions is logged or not Discord-Alerts @@ -610,7 +618,7 @@ Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name generated by LDoc diff --git a/docs/modules/control.html b/docs/modules/control.html index 86af035b..e7908c04 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -95,6 +95,7 @@ + @@ -175,6 +176,7 @@ + @@ -268,7 +270,7 @@ generated by LDoc diff --git a/docs/modules/modules.addons.station-auto-name.html b/docs/modules/modules.addons.station-auto-name.html index af0bfa48..e163b90b 100644 --- a/docs/modules/modules.addons.station-auto-name.html +++ b/docs/modules/modules.addons.station-auto-name.html @@ -103,6 +103,7 @@ + @@ -183,6 +184,7 @@ + @@ -321,7 +323,7 @@ Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name generated by LDoc diff --git a/docs/modules/overrides.debug.html b/docs/modules/overrides.debug.html index 6ca4f3b6..181e3b2a 100644 --- a/docs/modules/overrides.debug.html +++ b/docs/modules/overrides.debug.html @@ -103,6 +103,7 @@ + @@ -183,6 +184,7 @@ + @@ -682,7 +684,7 @@ generated by LDoc diff --git a/docs/modules/overrides.math.html b/docs/modules/overrides.math.html index 4cafb848..650cca9c 100644 --- a/docs/modules/overrides.math.html +++ b/docs/modules/overrides.math.html @@ -103,6 +103,7 @@ + @@ -183,6 +184,7 @@ + @@ -381,7 +383,7 @@ generated by LDoc diff --git a/docs/modules/overrides.table.html b/docs/modules/overrides.table.html index 288285e0..9b94f6c3 100644 --- a/docs/modules/overrides.table.html +++ b/docs/modules/overrides.table.html @@ -105,6 +105,7 @@ + @@ -185,6 +186,7 @@ + @@ -2036,7 +2038,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index 30a897ec..4b8dfa40 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -104,6 +104,7 @@ + @@ -184,6 +185,7 @@ + @@ -1320,7 +1322,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index 8b3c86b2..a843a562 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -103,6 +103,7 @@ + @@ -183,6 +184,7 @@ + @@ -462,7 +464,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index f57d3076..ad616393 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -104,6 +104,7 @@ + @@ -184,6 +185,7 @@ + @@ -679,7 +681,7 @@ generated by LDoc diff --git a/docs/topics/LICENSE.html b/docs/topics/LICENSE.html index 853e049d..efb2a02b 100644 --- a/docs/topics/LICENSE.html +++ b/docs/topics/LICENSE.html @@ -89,6 +89,7 @@ + @@ -169,6 +170,7 @@ + @@ -817,7 +819,7 @@ Public License instead of this License. But first, please read generated by LDoc diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html index 71e3386f..05c29cf7 100644 --- a/docs/topics/README.md.html +++ b/docs/topics/README.md.html @@ -89,6 +89,7 @@ + @@ -169,6 +170,7 @@ + @@ -377,7 +379,7 @@ generated by LDoc diff --git a/expcore/common.lua b/expcore/common.lua index 64886316..38d58e52 100644 --- a/expcore/common.lua +++ b/expcore/common.lua @@ -539,6 +539,7 @@ end -- @section factorio --[[-- Moves items to the position and stores them in the closest entity of the type given +-- Copies the items by prototype name, but keeps them in the original inventory @tparam table items items which are to be added to the chests, ['name']=count @tparam[opt=navies] LuaSurface surface the surface that the items will be moved to @tparam[opt={0, 0}] table position the position that the items will be moved to {x=100, y=100} @@ -595,6 +596,67 @@ function Common.move_items(items, surface, position, radius, chest_type) return last_chest end +--[[-- Moves items to the position and stores them in the closest entity of the type given +-- Differs from move_items by accepting a table of LuaItemStack and transferring them into the inventory - not copying +@tparam table items items which are to be added to the chests, an array of LuaItemStack +@tparam[opt=navies] LuaSurface surface the surface that the items will be moved to +@tparam[opt={0, 0}] table position the position that the items will be moved to {x=100, y=100} +@tparam[opt=32] number radius the radius in which the items are allowed to be placed +@tparam[opt=iron-chest] string chest_type the chest type that the items should be moved into +@treturn LuaEntity the last chest that had items inserted into it + +@usage-- Copy all the items in a players inventory and place them in chests at {0, 0} +move_items(game.player.get_main_inventory()) + +]] +function Common.move_items_stack(items, surface, position, radius, chest_type) + chest_type = chest_type or 'iron-chest' + surface = surface or game.surfaces[1] + if position and type(position) ~= 'table' then return end + if type(items) ~= 'table' then return end + -- Finds all entities of the given type + local p = position or {x=0, y=0} + local r = radius or 32 + local entities = surface.find_entities_filtered{area={{p.x-r, p.y-r}, {p.x+r, p.y+r}}, name=chest_type} or {} + local count = #entities + local current = 1 + -- Makes a new empty chest when it is needed + local function make_new_chest() + local pos = surface.find_non_colliding_position(chest_type, position, 32, 1) + local chest = surface.create_entity{name=chest_type, position=pos, force='neutral'} + table.insert(entities, chest) + count = count + 1 + return chest + end + -- Function used to round robin the items into all chests + local function next_chest(item) + local chest = entities[current] + if count == 0 then return make_new_chest() end + if chest.get_inventory(defines.inventory.chest).can_insert(item) then + -- If the item can be inserted then the chest is returned + current = current+1 + if current > count then current = 1 end + return chest + else + -- Other wise it is removed from the list + table.remove(entities, current) + count = count - 1 + end + end + -- Inserts the items into the chests + local last_chest + for i=1,#items do + local item = items[i] + if item.valid_for_read then + local chest = next_chest(item) + if not chest or not chest.valid then return error(string.format('Cant move item %s to %s{%s, %s} no valid chest in radius', item.name, surface.name, p.x, p.y)) end + chest.insert(item) + last_chest = chest + end + end + return last_chest +end + --[[-- Prints a colored value on a location, color is based on the value. nb: src is below but the gradent has been edited https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4a2/map_gen/maps/diggy/debug.lua#L31 diff --git a/locale/en/gui.cfg b/locale/en/gui.cfg index 8a822b82..5a638410 100644 --- a/locale/en/gui.cfg +++ b/locale/en/gui.cfg @@ -200,4 +200,10 @@ data-settings=Settings data-statistics=Statistics data-required=Required data-misc=Miscellaneous -data-format=__1____2__ \ No newline at end of file +data-format=__1____2__ + +[tree-decon] +main-tooltip=Toggle fast tree decon +enabled=enabled +disabled=disabled +toggle-msg=Fast decon has been __1__ \ No newline at end of file diff --git a/modules/addons/death-logger.lua b/modules/addons/death-logger.lua index 97c057fe..092bcd4a 100644 --- a/modules/addons/death-logger.lua +++ b/modules/addons/death-logger.lua @@ -4,7 +4,7 @@ local Event = require 'utils.event' --- @dep utils.event local Global = require 'utils.global' --- @dep utils.global local config = require 'config.death_logger' --- @dep config.death_logger -local format_time, move_items = _C.format_time, _C.move_items --- @dep expcore.common +local format_time, move_items = _C.format_time, _C.move_items_stack --- @dep expcore.common -- Max amount of ticks a corpse can be alive local corpse_lifetime = 60*60*15 @@ -64,7 +64,7 @@ Event.add(defines.events.on_player_died, function(event) local player = game.players[event.player_index] local corpse = player.surface.find_entity('character-corpse', player.position) if config.use_chests_as_bodies then - local items = corpse.get_inventory(defines.inventory.character_corpse).get_contents() + local items = corpse.get_inventory(defines.inventory.character_corpse) local chest = move_items(items, corpse.surface, corpse.position) chest.destructible = false corpse.destroy() @@ -140,7 +140,7 @@ end if config.auto_collect_bodies then Event.add(defines.events.on_character_corpse_expired, function(event) local corpse = event.corpse - local items = corpse.get_inventory(defines.inventory.character_corpse).get_contents() + local items = corpse.get_inventory(defines.inventory.character_corpse) move_items(items, corpse.surface, {x=0, y=0}) end) end diff --git a/modules/addons/deconlog.lua b/modules/addons/deconlog.lua new file mode 100644 index 00000000..4b2529d6 --- /dev/null +++ b/modules/addons/deconlog.lua @@ -0,0 +1,64 @@ +--- Log certain actions into a file when events are triggered +-- @addon Deconlog + +local Event = require 'utils.event' --- @dep utils.event +local Roles = require 'expcore.roles' --- @dep expcore.roles +local format_time = _C.format_time +local config = require 'config.deconlog' --- @dep config.deconlog + +local filepath = "log/decon.log" + +local function add_log(data) + game.write_file(filepath, data .. "\n", true, 0) -- write data +end +local function get_secs () + return format_time(game.tick, { hours = true, minutes = true, seconds = true, string = true }) +end +local function pos_tostring (pos) + return tostring(pos.x) .. "," .. tostring(pos.y) +end + +Event.on_init(function() + game.write_file(filepath, "\n", false, 0) -- write data +end) + +if config.decon_area then + Event.add(defines.events.on_player_deconstructed_area, function (e) + local player = game.get_player(e.player_index) + if Roles.player_has_flag(player, "deconlog-bypass") then return end + add_log(get_secs() .. player.name .. ",decon_area," .. pos_tostring(e.area.left_top) .. "," .. pos_tostring(e.area.right_bottom)) + end) +end + +if config.built_entity then + Event.add(defines.events.on_built_entity, function (e) + if not e.player_index then return end + local player = game.get_player(e.player_index) + if Roles.player_has_flag(player, "deconlog-bypass") then return end + local ent = e.created_entity + add_log(get_secs() .. player.name .. ",built_entity," .. ent.name .. "," .. pos_tostring(ent.position) .. "," .. tostring(ent.direction) .. "," .. tostring(ent.orientation)) + end) +end + +if config.mined_entity then + Event.add(defines.events.on_player_mined_entity, function (e) + local player = game.get_player(e.player_index) + if Roles.player_has_flag(player, "deconlog-bypass") then return end + local ent = e.entity + add_log(get_secs() .. player.name .. ",mined_entity," .. ent.name .. "," .. pos_tostring(ent.position) .. "," .. tostring(ent.direction) .. "," .. tostring(ent.orientation)) + end) +end + +if config.fired_nuke then + Event.add(defines.events.on_player_ammo_inventory_changed, function (e) + -- this works only if the player took more than one nuke, which they usually do + local player = game.get_player(e.player_index) + if Roles.player_has_flag(player, "deconlog-bypass") then return end + local ammo_inv = player.get_inventory(defines.inventory.character_ammo) + local item = ammo_inv[player.character.selected_gun_index] + if not item or not item.valid or not item.valid_for_read then return end + if item.name == "atomic-bomb" then + add_log(get_secs() .. player.name .. ",shot-bomb," .. pos_tostring(player.position) .. "," .. pos_tostring(player.shooting_state.position)) + end + end) +end \ No newline at end of file diff --git a/modules/addons/inventory-clear.lua b/modules/addons/inventory-clear.lua index 57ae4958..51dc18e2 100644 --- a/modules/addons/inventory-clear.lua +++ b/modules/addons/inventory-clear.lua @@ -3,13 +3,13 @@ local Event = require 'utils.event' --- @dep utils.event local events = require 'config.inventory_clear' --- @dep config.inventory_clear -local move_items = _C.move_items --- @dep expcore.common +local move_items_stack = _C.move_items_stack --- @dep expcore.common local function clear_items(event) local player = game.players[event.player_index] local inv = player.get_main_inventory() - move_items(inv.get_contents()) + move_items_stack(inv) inv.clear() end -for _, event_name in ipairs(events) do Event.add(event_name, clear_items) end \ No newline at end of file +for _, event_name in ipairs(events) do Event.add(event_name, clear_items) end diff --git a/modules/addons/tree-decon.lua b/modules/addons/tree-decon.lua index 29e13707..95a34396 100644 --- a/modules/addons/tree-decon.lua +++ b/modules/addons/tree-decon.lua @@ -4,6 +4,8 @@ local Event = require 'utils.event' --- @dep utils.event local Global = require 'utils.global' --- @dep utils.global local Roles = require 'expcore.roles' --- @dep expcore.roles +local Gui = require 'expcore.gui' --- @dep expcore.gui +local PlayerData = require 'expcore.player_data' --- @dep expcore.player_data -- Global queue used to store trees that need to be removed, also chache for player roles local chache = {} @@ -13,6 +15,22 @@ Global.register({ tree_queue, chache }, function(tbl) chache = tbl[2] end) + +-- Left menu button to toggle between fast decon and normal decon marking +local HasEnabledDecon = PlayerData.Settings:combine('HasEnabledDecon') +HasEnabledDecon:set_default(false) + +Gui.toolbar_button("entity/tree-01", {'tree-decon.main-tooltip'}, function (player) + return Roles.player_allowed(player, "fast-tree-decon") +end) +:on_click(function(player, element) + local status = HasEnabledDecon:get(player) + HasEnabledDecon:set(player, not status) + Gui.toolbar_button_style(element, not status) + player.print(status and {'tree-decon.toggle-msg', {'tree-decon.disabled'}} or {'tree-decon.toggle-msg', {'tree-decon.enabled'}}) +end) + + -- Add trees to queue when marked, only allows simple entities and for players with role permission Event.add(defines.events.on_marked_for_deconstruction, function(event) -- Check which type of decon a player is allowed @@ -40,6 +58,10 @@ Event.add(defines.events.on_marked_for_deconstruction, function(event) -- Allowed to decon this entity, but not fast if allow ~= 'fast' then return end + + local player = game.get_player(index) + if not HasEnabledDecon:get(player) then return end + -- Allowed fast decon on this entity, just trees local head = tree_queue._head + 1 if not last_user and entity.type ~= 'cliff' then diff --git a/modules/commands/clear-inventory.lua b/modules/commands/clear-inventory.lua index 04155978..ceb6b3e9 100644 --- a/modules/commands/clear-inventory.lua +++ b/modules/commands/clear-inventory.lua @@ -4,7 +4,7 @@ ]] local Commands = require 'expcore.commands' --- @dep expcore.commands -local move_items = _C.move_items --- @dep expcore.common +local move_items_stack = _C.move_items_stack --- @dep expcore.common require 'config.expcore.command_role_parse' --- Clears a players inventory @@ -14,10 +14,10 @@ Commands.new_command('clear-inventory', 'Clears a players inventory') :add_param('player', false, 'player-role') :add_alias('clear-inv', 'move-inventory', 'move-inv') :register(function(_, player) - local inv = player.get_main_inventory() - if not inv then - return Commands.error{'expcore-commands.reject-player-alive'} - end - move_items(inv.get_contents()) - inv.clear() -end) \ No newline at end of file + local inv = player.get_main_inventory() + if not inv then + return Commands.error{'expcore-commands.reject-player-alive'} + end + move_items_stack(inv) + inv.clear() +end) diff --git a/modules/graftorio/forcestats.lua b/modules/graftorio/forcestats.lua new file mode 100644 index 00000000..9839a484 --- /dev/null +++ b/modules/graftorio/forcestats.lua @@ -0,0 +1,190 @@ +local Event = require("utils.event") +local general = require("modules.graftorio.general") +local config = require("config.graftorio") + +local lib = {} + +lib.collect_production = function() + for _, force in pairs(game.forces) do + ---@class ProductionStatistics + ---@field item_input table + ---@field item_output table + ---@field fluid_input table + ---@field fluid_output table + ---@field kill_input table + ---@field kill_output table + ---@field build_input table + ---@field build_output table + local stats = { + item_input = {}, + item_output = {}, + fluid_input = {}, + fluid_output = {}, + kill_input = {}, + kill_output = {}, + build_input = {}, + build_output = {}, + } + + for name, count in pairs(force.item_production_statistics.input_counts) do + local itemstats = stats.item_input[name] or {} + itemstats.count = count + stats.item_input[name] = itemstats + end + for name, count in pairs(force.item_production_statistics.output_counts) do + local itemstats = stats.item_output[name] or {} + itemstats.count = count + stats.item_output[name] = itemstats + end + + for name, count in pairs(force.fluid_production_statistics.input_counts) do + local fluidstats = stats.fluid_input[name] or {} + fluidstats.count = count + stats.fluid_input[name] = fluidstats + end + for name, count in pairs(force.fluid_production_statistics.output_counts) do + local fluidstats = stats.fluid_output[name] or {} + fluidstats.count = count + stats.fluid_output[name] = fluidstats + end + + for name, count in pairs(force.kill_count_statistics.input_counts) do + local killstats = stats.kill_input[name] or {} + killstats.count = count + stats.kill_input[name] = killstats + end + for name, count in pairs(force.kill_count_statistics.output_counts) do + local killstats = stats.kill_output[name] or {} + killstats.count = count + stats.kill_output[name] = killstats + end + + for name, count in pairs(force.entity_build_count_statistics.input_counts) do + local buildstats = stats.build_input[name] or {} + buildstats.count = count + stats.build_input[name] = buildstats + end + for name, count in pairs(force.entity_build_count_statistics.output_counts) do + local buildstats = stats.build_output[name] or {} + buildstats.count = count + stats.build_output[name] = buildstats + end + + general.data.output[force.name].production = stats + end +end + +lib.collect_loginet = function() + for _, force in pairs(game.forces) do + ---@class RobotStatistics + ---@field all_construction_robots uint + ---@field available_construction_robot uint + ---@field all_logistic_robots uint + ---@field available_logistic_robots uint + ---@field charging_robot_count uint + ---@field to_charge_robot_count uint + ---@field items table + ---@field pickups table + ---@field deliveries table + local stats = { + all_construction_robots = 0, + available_construction_robots = 0, + + all_logistic_robots = 0, + available_logistic_robots = 0, + + charging_robot_count = 0, + to_charge_robot_count = 0, + + items = {}, + pickups = {}, + deliveries = {}, + } + for _, networks in pairs(force.logistic_networks) do + for _, network in pairs(networks) do + stats.available_construction_robots = network.available_construction_robots + stats.all_construction_robots = network.all_construction_robots + + stats.available_logistic_robots = network.available_logistic_robots + stats.all_logistic_robots = network.all_logistic_robots + + stats.charging_robot_count = 0 + stats.to_charge_robot_count = 0 + for _, cell in pairs(network.cells) do + stats.charging_robot_count = (stats.charging_robot_count) + cell.charging_robot_count + stats.to_charge_robot_count = (stats.to_charge_robot_count) + cell.to_charge_robot_count + end + + if config.modules.logistorage then + for name, v in pairs(network.get_contents()) do + stats.items[name] = (stats.items[name] or 0) + v + end + + -- pickups and deliveries of items + for _, point_list in pairs({ network.provider_points, network.requester_points, network.storage_points }) do + for _, point in pairs(point_list) do + for name, qty in pairs(point.targeted_items_pickup) do + stats.pickups[name] = (stats.pickups[name] or 0) + qty + end + for name, qty in pairs(point.targeted_items_deliver) do + stats.deliveries[name] = (stats.deliveries[name] or 0) + qty + end + end + end + end + end + end + general.data.output[force.name].robots = stats + end +end + + +---@class ResearchStatistics +---@field current Research +---@field queue Research[] + +---@class Research +---@field name string +---@field level uint +---@field progress double + + +Event.add(defines.events.on_research_finished, function(evt) + local research = evt.research + if not general.data.output[research.force.name] then general.data.output[research.force.name] = {} end + if not general.data.output[research.force.name].research then general.data.output[research.force.name].research = {} end + + local force_research = general.data.output[research.force.name].research or {} + table.remove(force_research, 1) + general.data.output[research.force.name].research = force_research +end) + +Event.add(defines.events.on_research_started, function(evt) + -- move queue up + local research = evt.research + if not general.data.output[research.force.name].research then general.data.output[research.force.name].research = {} end + + local force_research = general.data.output[research.force.name].research or {} + table.remove(force_research, 1) + general.data.output[research.force.name].research = force_research +end) + +Event.on_nth_tick(60, function() + for _, force in pairs(game.forces) do + if not general.data.output[force.name].research then general.data.output[force.name].research = {} end + + local force_research = {} + -- this works even if the queue is disabled, but it will always be just 1 long in that case + for _, research in pairs(force.research_queue) do + table.insert(force_research, { + name = research.name, + level = research.level, + progress = force.get_saved_technology_progress(research) or 0, + }) + end + + general.data.output[force.name].research = force_research + end +end) + +return lib diff --git a/modules/graftorio/general.lua b/modules/graftorio/general.lua new file mode 100644 index 00000000..29c9ca1f --- /dev/null +++ b/modules/graftorio/general.lua @@ -0,0 +1,65 @@ +local Event = require("utils.event") +local Global = require("utils.global") + +local lib = {} + +lib.data = { + output = {} +} + +Global.register(lib.data, function(tbl) + lib.data = tbl +end) + +---@class Statistics +---@field trains TrainStatistics +---@field power PowerStatistics +---@field production ProductionStatistics +---@field robots RobotStatistics +---@field other OtherStatistics + +Event.on_init(function() + ---@type table + lib.data.output = {} + for _, force in pairs(game.forces) do + lib.data.output[force.name] = {} + end +end) + +---@class OtherStatistics +---@field tick uint +---@field evolution EvolutionStatistics +---@field research ResearchStatistics + +---@class EvolutionStatistics +---@field evolution_factor double +---@field evolution_factor_by_pollution double +---@field evolution_factor_by_time double +---@field evolution_factor_by_killing_spawners double + +lib.collect_other = function() + for _, force in pairs(game.forces) do + ---@type OtherStatistics + local other = lib.data.output[force.name].other or {} + + other.evolution = { + evolution_factor = force.evolution_factor, + evolution_factor_by_pollution = force.evolution_factor_by_pollution, + evolution_factor_by_time = force.evolution_factor_by_time, + evolution_factor_by_killing_spawners = force.evolution_factor_by_killing_spawners + } + for k, v in pairs(other) do + lib.data.output[force.name].other[k] = v + end + end +end + +Event.add(defines.events.on_force_created, function(evt) + lib.data.output[evt.force.name] = {} +end) + +Event.add(defines.events.on_forces_merged, function(evt) + lib.data.output[evt.source_name] = nil +end) + +return lib diff --git a/modules/graftorio/require.lua b/modules/graftorio/require.lua new file mode 100644 index 00000000..d4c05257 --- /dev/null +++ b/modules/graftorio/require.lua @@ -0,0 +1,26 @@ +local Commands = require("expcore.commands") +local config = require("config.graftorio") +local statics = require("modules.graftorio.statics") +local forcestats = nil +local general = nil +if config.modules.forcestats then + forcestats = require("modules.graftorio.forcestats") +end +if config.modules.general then + general = require("modules.graftorio.general") +end + +Commands.new_command("collectdata", "Collect data for RCON usage") + :add_param("location", true) + :register(function() + -- this must be first as it overwrites the stats + -- also makes the .other table for all forces + statics.collect_statics() + if config.modules.general then general.collect_other() end + if config.modules.forcestats then + forcestats.collect_production() + forcestats.collect_loginet() + end + rcon.print(game.table_to_json(general.data.output)) + return Commands.success() + end) diff --git a/modules/graftorio/statics.lua b/modules/graftorio/statics.lua new file mode 100644 index 00000000..3f065e47 --- /dev/null +++ b/modules/graftorio/statics.lua @@ -0,0 +1,35 @@ +local general = require("modules.graftorio.general") + +local lib = {} + +---@class StaticStatistics +---@field tick uint +---@field online_players string[] +---@field mods table +---@field seed table + +lib.collect_statics = function() + local stats = {} + stats.tick = game.tick + + stats.online_players = {} + for _, player in pairs(game.connected_players) do + table.insert(stats.online_players, player.name) + end + + stats.mods = {} + for name, version in pairs(game.active_mods) do + stats.mods[name] = version + end + + -- reason behind this is that the map gen settings can be changed during runtime so just get them fresh + stats.seed = {} + for _, surface in pairs(game.surfaces) do + stats.seed[surface.name] = surface.map_gen_settings.seed + end + for _, force in pairs(game.forces) do + general.data.output[force.name].other = stats + end +end + +return lib diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index e95e4589..9763233f 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -764,8 +764,8 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function() end -- Check if the force has any warps - local closest_warp - local closest_distance + local closest_warp = nil + local closest_distance = nil if #warp_ids > 0 then local surface = player.surface local pos = player.position @@ -794,7 +794,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function() end -- Check the dist to the closest warp - local in_range = closest_warp.warp_id == warp_ids.spawn and closest_distance < rs2 or closest_distance < r2 + local in_range = closest_warp ~= nil and (closest_warp.warp_id == warp_ids.spawn and closest_distance < rs2 or closest_distance < r2) if was_in_range and not in_range then PlayerInRange:set(player, nil) elseif not was_in_range and in_range then @@ -804,17 +804,16 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function() -- Change the enabled state of the add warp button local frame = Gui.get_left_element(player, warp_list_container) local add_warp_element = frame.container.header.alignment[add_new_warp.name] - local old_closest_warp_name = add_warp_element.tooltip[2] or closest_warp.name + local old_closest_warp_name = add_warp_element.tooltip[2] or closest_warp and closest_warp.name local was_able_to_make_warp = add_warp_element.enabled - local can_make_warp = closest_distance > mr2 + local can_make_warp = closest_distance == nil or closest_distance > mr2 if can_make_warp and not was_able_to_make_warp then add_warp_element.enabled = true add_warp_element.tooltip = {'warp-list.add-tooltip'} - elseif not can_make_warp and was_able_to_make_warp or old_closest_warp_name ~= closest_warp.name then + elseif not can_make_warp and was_able_to_make_warp or closest_warp and (old_closest_warp_name ~= closest_warp.name) then add_warp_element.enabled = false add_warp_element.tooltip = {'warp-list.too-close', closest_warp.name} end - end end