From 1a5ced8160c66688c0737026be498a6f5c143af9 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Fri, 26 Jun 2020 15:46:47 +0200 Subject: [PATCH] import --- .github/workflows/luacheck.yml | 17 +++++++++++ .luacheckrc | 17 +++++++++++ init.lua | 10 ++++++ license.txt | 56 ++++++++++++++++++++++++++++++++++ mod.conf | 3 ++ readme.md | 14 +++++++++ 6 files changed, 117 insertions(+) create mode 100644 .github/workflows/luacheck.yml create mode 100644 .luacheckrc create mode 100644 init.lua create mode 100644 license.txt create mode 100644 mod.conf create mode 100644 readme.md diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..a03fe92 --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,17 @@ +name: luacheck + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: apt + run: sudo apt-get install -y luarocks + - name: luacheck install + run: luarocks install --local luacheck + - name: luacheck run + run: $HOME/.luarocks/bin/luacheck ./ diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..053a477 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,17 @@ +allow_defined_top = true + +globals = { + "monitoring", + "minetest" +} + +read_globals = { + -- Stdlib + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + -- Minetest + "vector", "ItemStack", + "dump" + +} diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..439ed8b --- /dev/null +++ b/init.lua @@ -0,0 +1,10 @@ + +print("[monitoring] protection extension loaded") + + +monitoring.wrap_global({"minetest", "is_protected"}, "is_protected") + + + + + diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..795da89 --- /dev/null +++ b/license.txt @@ -0,0 +1,56 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2018-2019 Thomas Rudin + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2019 Thomas Rudin + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..1d5d0df --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = monitoring_protection +depends = monitoring +optional_depends = protector_redo, protector, priv_protector, areas, xp_redo diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..a8fa064 --- /dev/null +++ b/readme.md @@ -0,0 +1,14 @@ + +# Monitoring extension for protectors + +Base-mod: https://github.com/thomasrudin-mt/monitoring + +# Metrics + +* **is_protected_count** number of is_protected calls +* **is_protected_time** time usage of is_protected calls + + +# License + +MIT