Skip to content

Commit

Permalink
Moved startup functions to beginning of script
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekMR3 committed Apr 11, 2020
1 parent 9487a96 commit 57f6e1c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions TS3_Ranking.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ var client_db = store.get('client_db');
// Log erros
if (!channel) engine.log("Channel ID isn't defined!");

// Start adding time 60s after saving changes.
setTimeout(add_time_loop, delayTime*1000);
setTimeout(save_db_loop, delayTime*1000);
// Run these functions instantly on start / saving changes.
channel_loop();
rank_guardian_loop();

// On client join, add/remove levels.
event.on('clientMove', (ev) => {
var channel = ev.fromChannel;
Expand Down Expand Up @@ -339,13 +346,6 @@ function save_db_loop() {
setTimeout(save_db_loop, delayTime*1000);
}

// Start adding time 60s after saving changes.
setTimeout(add_time_loop, delayTime*1000);
setTimeout(save_db_loop, delayTime*1000);
// Run these functions instantly on start / saving changes.
channel_loop();
rank_guardian_loop();

function DB_Client(nick, time) {
this.nick = nick;
this.time = time;
Expand Down

0 comments on commit 57f6e1c

Please sign in to comment.