From 56afe946ed7e165d7855efcb89ea2c4ce1e7b417 Mon Sep 17 00:00:00 2001 From: Someone Date: Sun, 17 Mar 2019 01:22:47 +0100 Subject: [PATCH] Add a check for admin status. But you should not use this mod in multiplayer --- changelog.txt | 13 +++++++++++++ control.lua | 10 ++++++++++ info.json | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 changelog.txt diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..1374648 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,13 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.17.2 +Date: 2019-03-17 + + Changed: + - Added check for admin status ... but this mod should not be used in multiplayer games anyway! + +--------------------------------------------------------------------------------------------------- +Version: 0.17.1 +Date: 2019-03-17 + + Changed: + - Polished, gitified and published my transition helper mod. diff --git a/control.lua b/control.lua index 05b8a9d..a9bb04f 100644 --- a/control.lua +++ b/control.lua @@ -1,4 +1,9 @@ function exec_command(player) + if not player.admin then + player.print('You are not an admin. You may not use this mod. :(') + return + end + local f, err, cmd cmd = player.gui.left.some_luaconsole.input.text:gsub('game%.player%.', 'game.players['..player.index..'].') @@ -47,6 +52,11 @@ function toggleGui (player) caption = {'some_luaconsole.exec'}, tooltip = {'some_luaconsole.exec_tooltip'} } + + if not player.admin then + player.gui.left.some_luaconsole.input.text = 'You are not an admin. You may not use this mod. :(' + player.gui.left.some_luaconsole.input.enabled = false + end end end diff --git a/info.json b/info.json index bdc7645..e578531 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "some-luaconsole", - "version": "0.17.1", + "version": "0.17.2", "title": "Someone's LUA-Console", "author": "someone1337", "homepage": "https://git.somenet.org/pub/jan/factorio_some-luaconsole.git", -- 2.43.0