Use console output utils
This commit is contained in:
@@ -427,6 +427,18 @@ function consolePrint(text) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function consoleWarn(text) {
|
||||||
|
console.warn(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function consoleError(text) {
|
||||||
|
console.error(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function getPlayerName(client) {
|
function getPlayerName(client) {
|
||||||
return client.name;
|
return client.name;
|
||||||
}
|
}
|
||||||
@@ -749,7 +761,7 @@ function connectToDatabase() {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`);
|
logToConsole(LOG_DEBUG, `[VRR.Database] Initializing database connection ...`);
|
||||||
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
persistentDatabaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||||
if(persistentDatabaseConnection.error) {
|
if(persistentDatabaseConnection.error) {
|
||||||
console.warn(`[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||||
persistentDatabaseConnection = null;
|
persistentDatabaseConnection = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -763,7 +775,7 @@ function connectToDatabase() {
|
|||||||
} else {
|
} else {
|
||||||
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
let databaseConnection = module.mysql.connect(getDatabaseConfig().host, getDatabaseConfig().user, getDatabaseConfig().pass, getDatabaseConfig().name, getDatabaseConfig().port);
|
||||||
if(databaseConnection.error) {
|
if(databaseConnection.error) {
|
||||||
console.warn(`[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
logToConsole(LOG_ERROR, `[VRR.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return databaseConnection;
|
return databaseConnection;
|
||||||
|
|||||||
Reference in New Issue
Block a user