105 lines
2.7 KiB
JavaScript
105 lines
2.7 KiB
JavaScript
// ===========================================================================
|
|
// Asshat-Gaming Roleplay
|
|
// https://github.com/VortrexFTW/gtac_asshat_rp
|
|
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
|
// ---------------------------------------------------------------------------
|
|
// FILE: startup.js
|
|
// DESC: Provides startup/shutdown procedures
|
|
// TYPE: Server (JavaScript)
|
|
// ===========================================================================
|
|
|
|
function initServerScripts() {
|
|
|
|
checkForAllRequiredModules();
|
|
initDatabaseScript();
|
|
initConfigScript();
|
|
initEmailScript();
|
|
initClassScript();
|
|
initBitFlagScript();
|
|
initBusinessScript();
|
|
initClanScript();
|
|
initHouseScript();
|
|
initChatScript();
|
|
initModerationScript();
|
|
initAccountScript();
|
|
initSubAccountScript();
|
|
initChatScript();
|
|
initJobScript();
|
|
initVehicleScript();
|
|
initDeveloperScript();
|
|
initKeyBindScript();
|
|
initEventScript();
|
|
initAntiCheatScript();
|
|
initItemScript();
|
|
initClientScript();
|
|
|
|
initTimers();
|
|
|
|
loadGameFixesResource();
|
|
|
|
serverStartTime = new Date().getTime()/1000;
|
|
|
|
initCommandScript();
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function checkForHashingModule() {
|
|
if(typeof module.hashing == "undefined") {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function checkForMySQLModule() {
|
|
if(typeof module.mysql == "undefined") {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function checkForSMTPModule() {
|
|
if(typeof module.smtp == "undefined") {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function checkForAllRequiredModules() {
|
|
logToConsole(LOG_DEBUG, "[Asshat.Startup]: Checking for required modules ...");
|
|
|
|
if(!checkForHashingModule()) {
|
|
console.warn("[Asshat.Startup]: Hashing module is not loaded!");
|
|
console.warn("[Asshat.Startup]: This resource will now shutdown.");
|
|
thisResource.stop();
|
|
}
|
|
|
|
if(!checkForMySQLModule()) {
|
|
console.warn("[Asshat.Startup]: MySQL module is not loaded!");
|
|
console.warn("[Asshat.Startup]: This resource will now shutdown.");
|
|
thisResource.stop();
|
|
}
|
|
|
|
if(!checkForSMTPModule()) {
|
|
console.warn("[Asshat.Startup]: SMTP Email module is not loaded!");
|
|
console.warn("[Asshat.Startup]: This resource will now shutdown.");
|
|
thisResource.stop();
|
|
}
|
|
|
|
logToConsole(LOG_DEBUG, "[Asshat.Startup]: All required modules loaded!");
|
|
return true;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
initServerScripts();
|
|
|
|
// ---------------------------------------------------------------------------
|