Added msgpack socket parser

This commit is contained in:
Mitchell McCaffrey 2021-03-19 12:22:59 +11:00
parent 1567a069cc
commit 1eab3e66a2
3 changed files with 16 additions and 0 deletions

View File

@ -53,6 +53,7 @@
"simplebar-react": "^2.1.0",
"simplify-js": "^1.2.4",
"socket.io-client": "^4.0.0",
"socket.io-msgpack-parser": "^3.0.1",
"source-map-explorer": "^2.5.2",
"theme-ui": "^0.3.1",
"use-image": "^1.0.7",

View File

@ -1,4 +1,5 @@
import io from "socket.io-client";
import msgParser from "socket.io-msgpack-parser";
import { EventEmitter } from "events";
import Connection from "./Connection";
@ -89,6 +90,7 @@ class Session extends EventEmitter {
this.socket = io(process.env.REACT_APP_BROKER_URL, {
withCredentials: true,
parser: msgParser,
});
this.socket.on("player_joined", this._handlePlayerJoined.bind(this));

View File

@ -9123,6 +9123,11 @@ normalize-wheel@^1.0.1:
resolved "https://registry.yarnpkg.com/normalize-wheel/-/normalize-wheel-1.0.1.tgz#aec886affdb045070d856447df62ecf86146ec45"
integrity sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU=
notepack.io@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/notepack.io/-/notepack.io-2.2.0.tgz#d7ea71d1cb90094f88c6f3c8d84277c2d0cd101c"
integrity sha512-9b5w3t5VSH6ZPosoYnyDONnUTF8o0UkBw7JLA6eBlYJWyGT1Q3vQa8Hmuj1/X6RYvHjjygBDgw6fJhe0JEojfw==
npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
@ -11850,6 +11855,14 @@ socket.io-client@^4.0.0:
parseuri "0.0.6"
socket.io-parser "~4.0.4"
socket.io-msgpack-parser@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/socket.io-msgpack-parser/-/socket.io-msgpack-parser-3.0.1.tgz#48ea37b51f1fa1b09253bc97073be9204664f3c6"
integrity sha512-H/tlF8kp0TKcfiXEBvBE7fiHK+S0sgtG5zk6W+pWsJL+OggtiJLAatZE1YdvNmv274mSsgFzCrz39cYXFnyudQ==
dependencies:
component-emitter "~1.3.0"
notepack.io "~2.2.0"
socket.io-parser@~4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0"