From dc10718e802659bb2fd5d2b7d9a703b6420ebfe5 Mon Sep 17 00:00:00 2001 From: tabarra Date: Wed, 2 Aug 2023 01:29:58 -0300 Subject: [PATCH] tweak: changed a few strings --- LICENSE | 2 +- core/webroutes/deployer/actions.js | 16 +++++++++------- docs/dev_notes.md | 2 +- resource/menu/client/cl_spectate.lua | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index 101907fd0..f7ffb058c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019-2023 André Tabarra +Copyright (c) 2019-2023 André Tabarra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/core/webroutes/deployer/actions.js b/core/webroutes/deployer/actions.js index 6210edc45..7ad78b69d 100644 --- a/core/webroutes/deployer/actions.js +++ b/core/webroutes/deployer/actions.js @@ -1,8 +1,8 @@ const modulename = 'WebServer:DeployerActions'; import path from 'path'; -import { cloneDeep } from 'lodash-es'; +import { cloneDeep } from 'lodash-es'; import slash from 'slash'; -import mysql from 'mysql2/promise' +import mysql from 'mysql2/promise'; import consts from '@core/extras/consts'; import { txEnv, convars } from '@core/globalData'; import { validateModifyServerConfig } from '../../extras/fxsConfigHelper'; @@ -113,18 +113,20 @@ async function handleSetVariables(ctx) { }; await mysql.createConnection(mysqlOptions); } catch (error) { - const msgHeader = `Database connection failed: ${error.message}`; - if (error.code == 'ECONNREFUSED') { + let outMessage = error?.message ?? 'Unknown error occurred.'; + if (error?.code === 'ECONNREFUSED') { let specificError = (txEnv.isWindows) ? 'If you do not have a database installed, you can download and run XAMPP.' : 'If you do not have a database installed, you must download and run MySQL or MariaDB.'; if (userVars.dbPort !== 3306) { specificError += '
\nYou are not using the default DB port 3306, make sure it is correct!'; } - return ctx.send({ type: 'danger', message: `${msgHeader}
\n${specificError}` }); - } else { - return ctx.send({ type: 'danger', message: msgHeader }); + outMessage = `${error?.message}
\n${specificError}`; + } else if (error.message?.includes('auth_gssapi_client')) { + outMessage = `Your database does not accept the required authentication method. Please update your MySQL/MariaDB server and try again.`; } + + return ctx.send({ type: 'danger', message: `Database connection failed: ${outMessage}` }); } //Setting connection string diff --git a/docs/dev_notes.md b/docs/dev_notes.md index 660c085fc..3c2f6b78e 100644 --- a/docs/dev_notes.md +++ b/docs/dev_notes.md @@ -1,5 +1,5 @@ # TODO: -- [ ] xxx +- [ ] add `cache-control` and/or `vary` to all pages > next up - [ ] Add a tracking for % of redm/fivem/libertym servers to txTracker diff --git a/resource/menu/client/cl_spectate.lua b/resource/menu/client/cl_spectate.lua index 675ddc6d3..6c54fb80a 100644 --- a/resource/menu/client/cl_spectate.lua +++ b/resource/menu/client/cl_spectate.lua @@ -316,7 +316,7 @@ RegisterNetEvent('txcl:spectate:start', function(targetServerId, targetCoords) Wait(50) end - --If failed to resolve the targer + --If failed to resolve the target if (resolvedPlayerId <= 0 or resolvedPed <= 0) then debugPrint('Failed to resolve target PlayerId or Ped') -- reset spectator