More native utils + move startup stuff into startup.js
This commit is contained in:
@@ -8,11 +8,8 @@
|
||||
// ===========================================================================
|
||||
|
||||
function initRaceScript() {
|
||||
if(!getServerConfig().devServer) {
|
||||
getServerData().races = loadRacesFromDatabase();
|
||||
}
|
||||
|
||||
setRaceDataIndexes();
|
||||
logToConsole(LOG_INFO, "[VRR.Race]: Initializing race script ...");
|
||||
logToConsole(LOG_INFO, "[VRR.Race]: Race script initialized successfully!");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -28,4 +25,33 @@ function getRaceData(raceId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setAllRaceDataIndexes() {
|
||||
for(let i in getServerData().races) {
|
||||
getServerData().races[i].index = i;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadRacesFromDatabase() {
|
||||
// To-do
|
||||
return [];
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function saveRacesToDatabase() {
|
||||
for(let i in getServerData().races) {
|
||||
saveRaceToDatabase(getServerData().races[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function saveRaceToDatabase(raceData) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user