diff options
Diffstat (limited to 'features/waypoints/minewaypoints_socket.js')
-rw-r--r-- | features/waypoints/minewaypoints_socket.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/features/waypoints/minewaypoints_socket.js b/features/waypoints/minewaypoints_socket.js deleted file mode 100644 index 0cc31e5..0000000 --- a/features/waypoints/minewaypoints_socket.js +++ /dev/null @@ -1,49 +0,0 @@ -import socketData from "../../../soopyApis/socketData"; -import WebsiteCommunicator from "../../../soopyApis/websiteCommunicator"; - -class MineWayPointsServer extends WebsiteCommunicator { - constructor() { - super(socketData.serverNameToId.minewaypoints); - - this.setLocationHandler = undefined - this.hypixelServer = undefined - this.lastSend = Date.now() - } - - onConnect() { - this.hypixelServer = undefined - } - - onData(data) { - switch (data.type) { - case "setLocation": - if (this.setLocationHandler) { - this.setLocationHandler(data.area, data.location); - } - break; - } - } - - setLocation(area, loc) { - this.sendData({ - type: "setLocation", - area: area, - location: loc - }); - } - - setServer(server, worldTime) { - if (this.hypixelServer === server && Date.now() - this.lastSend < 10000) return; - - this.lastSend = Date.now() - this.hypixelServer = server - this.sendData({ - type: "setServer", - server: server, - time: worldTime - }); - } -} - -global.soopyV2mineWayPointsServer = new MineWayPointsServer() -export default global.soopyV2mineWayPointsServer;
\ No newline at end of file |