aboutsummaryrefslogtreecommitdiff
path: root/features/events
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-27 15:41:20 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-27 15:41:20 +0800
commit0cf3a67c2bbd4cdaa5d364436c9153e6456624f1 (patch)
tree03d6b37ee2f4109875050d61d63f363659031e6b /features/events
parentb94794a3de8827f4bddb5251b010dc32943d79a1 (diff)
downloadSoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.tar.gz
SoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.tar.bz2
SoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.zip
make network requests all go on one permenantly open thread
Diffstat (limited to 'features/events')
-rw-r--r--features/events/index.js14
1 files changed, 6 insertions, 8 deletions
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){