aboutsummaryrefslogtreecommitdiff
path: root/featureClass
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 /featureClass
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 'featureClass')
-rw-r--r--featureClass/featureManager.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js
index 200d413..934feca 100644
--- a/featureClass/featureManager.js
+++ b/featureClass/featureManager.js
@@ -5,6 +5,7 @@ import logger from "../logger";
const File = Java.type("java.io.File")
import metadata from "../metadata.js"
import soopyV2Server from "../socketConnection";
+import { fetch } from "../utils/networkUtils";
import { registerForge as registerForgeBase, unregisterForge as unregisterForgeBase} from "./forgeEvents.js"
const JSLoader = Java.type("com.chattriggers.ctjs.engine.langs.js.JSLoader")
@@ -73,7 +74,9 @@ class FeatureManager {
new Thread(()=>{
try{
- FileLib.getUrlContent("http://soopymc.my.to/api/soopyv2/ping")
+ if(fetch("http://soopymc.my.to/api/soopyv2/ping").responseCode() >= 400){
+ ChatLib.chat(this.messagePrefix + "&cError: Could not connect to Soopy's server. This may cause issues with features breaking but will (hopefully) be back soon.")
+ }
}catch(e){
ChatLib.chat(this.messagePrefix + "&cError: Could not connect to Soopy's server. This may cause issues with features breaking but will (hopefully) be back soon.")
}