Start working on custom classes for native wrapping
This commit is contained in:
@@ -7,6 +7,25 @@
|
||||
// TYPE: Server (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
class vPlayer {
|
||||
constructor(id, name = "", object = null) {
|
||||
object: null;
|
||||
name: null;
|
||||
id: -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
class vVehicle {
|
||||
constructor(id, object = null) {
|
||||
object: null;
|
||||
id: -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
let builtInCommands = [
|
||||
"refresh",
|
||||
"restart",
|
||||
@@ -827,7 +846,7 @@ function connectToDatabase() {
|
||||
if (getDatabaseConfig().usePersistentConnection) {
|
||||
if (persistentDatabaseConnection == null) {
|
||||
logToConsole(LOG_DEBUG, `[V.RP.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, getDatabaseConfig().useSSL);
|
||||
if (persistentDatabaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
persistentDatabaseConnection = null;
|
||||
@@ -841,7 +860,7 @@ function connectToDatabase() {
|
||||
return persistentDatabaseConnection;
|
||||
}
|
||||
} 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, getDatabaseConfig().useSSL);
|
||||
if (databaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
return false;
|
||||
|
||||
@@ -7,6 +7,26 @@
|
||||
// TYPE: Server (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
class vPlayer {
|
||||
constructor(id, name = "", object = null) {
|
||||
object: null;
|
||||
name: null;
|
||||
id: -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
class vVehicle {
|
||||
constructor(id, object = null) {
|
||||
object: null;
|
||||
id: -1;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
// Needs updated for RAGEMP
|
||||
let builtInCommands = [
|
||||
"refresh",
|
||||
"restart",
|
||||
@@ -743,7 +763,7 @@ function connectToDatabase() {
|
||||
if (getDatabaseConfig().usePersistentConnection) {
|
||||
if (persistentDatabaseConnection == null) {
|
||||
logToConsole(LOG_DEBUG, `[V.RP.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, getDatabaseConfig().useSSL);
|
||||
if (persistentDatabaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
persistentDatabaseConnection = null;
|
||||
@@ -757,7 +777,7 @@ function connectToDatabase() {
|
||||
return persistentDatabaseConnection;
|
||||
}
|
||||
} 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, getDatabaseConfig().useSSL);
|
||||
if (databaseConnection.error) {
|
||||
logToConsole(LOG_ERROR, `[V.RP.Database] Database connection error: ${persistentDatabaseConnection.error}`);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user