From a71121225c66a067efb630eef1bbf3c31e74d814 Mon Sep 17 00:00:00 2001 From: 7cc5c4f330d47060 Date: Sat, 21 Sep 2024 14:58:34 -0400 Subject: [PATCH] Rename userSettingsDisabled to disableUserSettings --- commands/help.js | 2 +- commands/settings.js | 2 +- index.js | 2 +- plugins/command.js | 4 ++-- util/commands.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/help.js b/commands/help.js index d718827..ab22558 100755 --- a/commands/help.js +++ b/commands/help.js @@ -16,7 +16,7 @@ for (const plugin of bpl) { } try { const commandName = plugin.split('.js')[0] - if (commandName === 'settings' && settings.userSettingsDisabled) continue + if (commandName === 'settings' && settings.disableUserSettings) continue if (commandName !== 'help') { cmds[commandName] = require(`./${plugin}`) if (cmds[commandName].level === undefined) { diff --git a/commands/settings.js b/commands/settings.js index 09ed03c..64b5e74 100755 --- a/commands/settings.js +++ b/commands/settings.js @@ -10,7 +10,7 @@ module.exports = { }) return } - if (settings.userSettingsDisabled) { + if (settings.disableUserSettings) { c.reply({ text: getMessage(c.lang, 'command.settings.disabled.global'), color: c.colors.secondary diff --git a/index.js b/index.js index 37e0d53..cc1b8b4 100755 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ if (!fs.readdirSync('.').includes('settings.json')) { if (!fs.readdirSync('.').includes('secret.json')) { console.log('Secrets file is missing, using defaults.') fs.copyFileSync('secret_example.json', 'secret.json') - console.log('Please change the hashing keys in the secrets file.') + console.log('Please change the hashing keys in the secrets file. It is also recommended to remove permissions of other users to read from this file, for example, by giving it 600 permissions if running on a Unix or Unix-like OS.') } const m = require('minecraft-protocol') diff --git a/plugins/command.js b/plugins/command.js index 40b89bf..dff4df6 100755 --- a/plugins/command.js +++ b/plugins/command.js @@ -4,11 +4,11 @@ const { getMessage } = require('../util/lang.js') const cmds = require('../util/commands.js') const fs = require('fs') -if (!fs.readdirSync('.').includes('userPref') && !settings.userSettingsDisabled) fs.mkdirSync('userPref') +if (!fs.readdirSync('.').includes('userPref') && !settings.disableUserSettings) fs.mkdirSync('userPref') const loadSettings = function (uuid) { try { - if (settings.userSettingsDisabled) { + if (settings.disableUserSettings) { return {} } else { return require(`../userPref/${uuid}.json`) diff --git a/util/commands.js b/util/commands.js index e88f460..dad7dde 100755 --- a/util/commands.js +++ b/util/commands.js @@ -8,7 +8,7 @@ for (const plugin of bpl) { } try { const commandName = plugin.split('.js')[0] - if (commandName === 'settings' && settings.userSettingsDisabled) continue + if (commandName === 'settings' && settings.disableUserSettings) continue cmds[commandName] = require(`../commands/${plugin}`) if (cmds[commandName].level === undefined) { cmds[commandName].level = 0