From 5d0ef2f11a0ad6741dfa9a36e849cbe3ce3db831 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 29 Jun 2019 01:28:17 +0100 Subject: [PATCH] Added warnings to control --- config/action_buttons.lua | 4 +- config/warnings.lua | 4 +- doc/index.html | 11 +- doc/modules/Jail.html | 5 +- doc/modules/Reports.html | 5 +- doc/modules/Warnings.html | 1269 +++++++++++++++++ doc/modules/config._file_loader.html | 3 +- doc/modules/config.action_buttons.html | 3 +- doc/modules/config.advanced_start.html | 3 +- doc/modules/config.bonuses.html | 3 +- doc/modules/config.chat_reply.html | 3 +- doc/modules/config.death_logger.html | 3 +- doc/modules/config.discord_alerts.html | 3 +- .../config.expcore-commands.auth_admin.html | 3 +- .../config.expcore-commands.auth_roles.html | 3 +- ...expcore-commands.auth_runtime_disable.html | 3 +- ...config.expcore-commands.parse_general.html | 3 +- .../config.expcore-commands.parse_roles.html | 3 +- doc/modules/config.permission_groups.html | 3 +- doc/modules/config.popup_messages.html | 3 +- doc/modules/config.rockets.html | 3 +- doc/modules/config.roles.html | 3 +- doc/modules/config.scorched_earth.html | 3 +- doc/modules/config.spawn_area.html | 3 +- doc/modules/config.warnings.html | 3 +- doc/modules/config.warps.html | 3 +- doc/modules/control.html | 3 +- doc/modules/expcore.commands.html | 3 +- doc/modules/expcore.common.html | 3 +- doc/modules/expcore.gui.concepts.center.html | 3 +- doc/modules/expcore.gui.concepts.left.html | 3 +- doc/modules/expcore.gui.concepts.popups.html | 3 +- doc/modules/expcore.gui.concepts.toolbar.html | 3 +- doc/modules/expcore.gui.core.html | 3 +- doc/modules/expcore.gui.elements.buttons.html | 3 +- .../expcore.gui.elements.checkboxs.html | 3 +- .../expcore.gui.elements.dropdown.html | 3 +- .../expcore.gui.elements.elem-button.html | 3 +- .../expcore.gui.elements.progress-bar.html | 3 +- doc/modules/expcore.gui.elements.slider.html | 3 +- doc/modules/expcore.gui.elements.text.html | 3 +- doc/modules/expcore.gui.html | 3 +- doc/modules/expcore.gui.instances.html | 3 +- doc/modules/expcore.gui.prototype.html | 3 +- doc/modules/expcore.gui.test.html | 3 +- doc/modules/expcore.permission_groups.html | 3 +- doc/modules/expcore.roles.html | 3 +- doc/modules/expcore.store.html | 3 +- doc/modules/expcore.sudo.html | 3 +- .../modules.addons.advanced-start.html | 3 +- doc/modules/modules.addons.chat-popups.html | 3 +- doc/modules/modules.addons.damage-popups.html | 3 +- doc/modules/modules.gui.player-list.html | 3 +- doc/modules/modules.gui.rocket-info.html | 3 +- doc/modules/modules.gui.science-info.html | 3 +- doc/modules/modules.gui.task-list.html | 3 +- .../utils.alien_evolution_progress.html | 3 +- doc/modules/utils.core.html | 3 +- doc/modules/utils.debug.html | 3 +- doc/modules/utils.event.html | 3 +- doc/modules/utils.event_core.html | 3 +- doc/modules/utils.math.html | 3 +- doc/modules/utils.recipe_locker.html | 3 +- doc/modules/utils.state_machine.html | 3 +- doc/modules/utils.table.html | 3 +- doc/modules/utils.task.html | 3 +- doc/modules/utils.timestamp.html | 3 +- doc/topics/license.html | 3 +- doc/topics/readme.md.html | 3 +- modules/addons/discord-alerts.lua | 9 +- modules/addons/jail-control.lua | 99 -- modules/addons/warnings-control.lua | 221 --- modules/commands/warnings.lua | 18 +- modules/control/jail.lua | 2 +- modules/control/reports.lua | 2 +- modules/control/warnings.lua | 309 ++++ 76 files changed, 1738 insertions(+), 409 deletions(-) create mode 100644 doc/modules/Warnings.html delete mode 100644 modules/addons/jail-control.lua delete mode 100644 modules/addons/warnings-control.lua create mode 100644 modules/control/warnings.lua diff --git a/config/action_buttons.lua b/config/action_buttons.lua index 4e821e1f..f48606d3 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -8,7 +8,7 @@ local Roles = require 'expcore.roles' local Store = require 'expcore.store' local Game = require 'utils.game' local Reports = require 'modules.control.reports' -local Warnings = require 'modules.addons.warnings-control' +local Warnings = require 'modules.addons.warnings' local Jail = require 'modules.control.jail' local Colors = require 'resources.color_presets' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') @@ -135,7 +135,7 @@ local function warn_player_callback(player,reason) local action_player_name,action_player_name_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) game.print{'expcom-warnings.received',action_player_name_color,by_player_name_color,reason} - Warnings.add_warnings(action_player_name,player.name) + Warnings.add_warning(action_player_name,player.name,reason) end -- jails the action player, requires a reason diff --git a/config/warnings.lua b/config/warnings.lua index 7fd627a4..73696544 100644 --- a/config/warnings.lua +++ b/config/warnings.lua @@ -14,6 +14,6 @@ return { game.ban_player(player,{'warnings.received',by_player_name,number_of_warnings,{'warnings.ban',{'links.website'}}}) end }, - temp_warning_cool_down=30, -- time for a temp warning (given by script) to be removed (in minutes) - temp_warning_limit=5 -- the number of temp warnings (given by script) that are allowed before full warnings are given + script_warning_cool_down=30, -- time for a script warning (given by script) to be removed (in minutes) + script_warning_limit=5 -- the number of script warnings (given by script) that are allowed before full warnings are given } \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 13ec6e62..6e2fc4e9 100644 --- a/doc/index.html +++ b/doc/index.html @@ -278,12 +278,17 @@ Jail Control Module - Jail - Adds a way to jail players and temp ban players. + - Adds a way to jail players and temp ban players. Reports Control Module - Reports - Adds a way to report players and store report messages. + - Adds a way to report players and store report messages. + + + Warnings + Control Module - Warnings + - Adds a way to give and remove warnings to players. modules.gui.player-list @@ -375,7 +380,7 @@ generated by LDoc diff --git a/doc/modules/Jail.html b/doc/modules/Jail.html index 5af00326..f36043a8 100644 --- a/doc/modules/Jail.html +++ b/doc/modules/Jail.html @@ -42,6 +42,7 @@