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