Rename userSettingsDisabled to disableUserSettings

This commit is contained in:
7cc5c4f330d47060 2024-09-21 14:58:34 -04:00
parent 06cfc7347d
commit a71121225c
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
5 changed files with 6 additions and 6 deletions

View file

@ -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) {

View file

@ -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

View file

@ -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')

View file

@ -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`)

View file

@ -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