From cfd2caa4d3add406d6b0667574ce074da34d81e0 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 25 Oct 2019 19:39:54 +1100 Subject: [PATCH] throttle ready send --- client/src/components/welcome.jsx | 1 + client/src/socket.jsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/components/welcome.jsx b/client/src/components/welcome.jsx index 790fe3ae..077da507 100644 --- a/client/src/components/welcome.jsx +++ b/client/src/components/welcome.jsx @@ -62,6 +62,7 @@ function Welcome() {

Free to play, no pay to win. Register to start playing.

+ Tutorial Playthrough on YouTube {pageEl()} diff --git a/client/src/socket.jsx b/client/src/socket.jsx index adad1a66..517ee04f 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -1,6 +1,8 @@ const toast = require('izitoast'); const cbor = require('borc'); +const throttle = require('lodash/throttle'); + const SOCKET_URL = `${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}/api/ws`; @@ -363,7 +365,8 @@ function createSocket(events) { sendGameTarget, sendInstanceAbandon, - sendInstanceReady, + // some weird shit happening in face off + sendInstanceReady: throttle(sendInstanceReady, 500), sendInstancePractice, sendInstanceQueue, sendInstanceState,