aboutsummaryrefslogtreecommitdiff
path: root/socketConnection.js
diff options
context:
space:
mode:
Diffstat (limited to 'socketConnection.js')
-rw-r--r--socketConnection.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/socketConnection.js b/socketConnection.js
index a7524a9..f8c61b4 100644
--- a/socketConnection.js
+++ b/socketConnection.js
@@ -13,6 +13,8 @@ class SoopyV2Server extends WebsiteCommunicator {
this.errorsToReport = []
this.reportErrorsSetting = undefined
+
+ this.onPlayerStatsLoaded = undefined
}
onData(data){
@@ -22,6 +24,9 @@ class SoopyV2Server extends WebsiteCommunicator {
if(data.type === "spammedmessage"){
this.spammedMessages.push(...data.messages)
}
+ if(data.type === "playerStatsQuick"){
+ if(this.onPlayerStatsLoaded) this.onPlayerStatsLoaded(data.data)
+ }
}
onConnect(){
@@ -73,6 +78,12 @@ class SoopyV2Server extends WebsiteCommunicator {
}
}
+ requestPlayerStats(uuid){
+ this.sendData({
+ type: "loadStatsQuick",
+ uuid: uuid
+ })
+ }
}
let soopyV2Server = new SoopyV2Server()