From 0cf3a67c2bbd4cdaa5d364436c9153e6456624f1 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sun, 27 Mar 2022 15:41:20 +0800 Subject: make network requests all go on one permenantly open thread --- features/events/index.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'features/events') diff --git a/features/events/index.js b/features/events/index.js index 912e566..96a3de0 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -175,12 +175,16 @@ class Events extends Feature { step_5s(){ if(this.showingWaypoints){ if(this.burrialWaypointsPath.getValue() || this.burrialWaypointsNearest.getValue()){ - new Thread(()=>{ + new Thread(()=>{ //TODO: make 5head thing to re-use threads this.updateBurrialPath() }).start() } } this.sortBurrialLocations() + + if(this.nextUpdateApprox === -2){ + this.loadApi() + } } worldLoad(){ @@ -194,13 +198,7 @@ class Events extends Feature { } loadApi(){ - new Thread(()=>{ - while(this.nextUpdateApprox === -2){ - this.FeatureManager.features["dataLoader"].class.loadApiData("skyblock", false) - - Thread.sleep(5000) - } - }).start() + this.FeatureManager.features["dataLoader"].class.loadApiData("skyblock", false) } apiLoad(data, dataType, isSoopyServer, isLatest){ -- cgit