diff options
Diffstat (limited to 'socketConnection.js')
-rw-r--r-- | socketConnection.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/socketConnection.js b/socketConnection.js index f73c3d4..0c1225d 100644 --- a/socketConnection.js +++ b/socketConnection.js @@ -1,9 +1,29 @@ import WebsiteCommunicator from "./../soopyApis/websiteCommunicator" import socketData from "../soopyApis/socketData" +const Cosmetics = require("./features/cosmetics/index.js") class SoopyV2Server extends WebsiteCommunicator { constructor(){ super(socketData.serverNameToId.soopyv2) + + this.spammedMessages = [] + } + + onData(data){ + if(data.type === "updateCosmetics"){ + Cosmetics.class.setUserCosmeticsInformation.call(Cosmetics.class, data.uuid, data.cosmetics) + } + if(data.type === "spammedmessage"){ + this.spammedMessages.push(...data.messages) + } + } + + sendMessageToServer(message, lobbyId){ + this.sendData(this.sendData({ + type: "chatMessage", + message: message, + lobbyId: lobbyId + })) } } |