diff --git a/packages/net/server/socket.js b/packages/net/server/socket.js index 2b39300..690a8de 100644 --- a/packages/net/server/socket.js +++ b/packages/net/server/socket.js @@ -48,8 +48,8 @@ class ServerSocket extends decorateSocket(class {}) { this.socket = socket; for (const Packet of allPackets()) { const id = idFromPacket(Packet); - this.socket.on(id, (packet) => { - this.emit('packet', packet); + this.socket.on(id, (data) => { + this.emit('packet', new Packet(data)); }); } this.socket.on('disconnect', (...args) => {