We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f58ecc6 commit 9713553Copy full SHA for 9713553
server/socket.js
@@ -172,15 +172,7 @@ export class PlayerSocket{
172
this.arena.add(blob)
173
}
174
175
- send({buffer}, i, critical = true){
176
- if(this.ws._socket._writableState.buffered.length){
177
- //can't reuse buffer; must clone
178
- if(!critical)return //skip
179
- const b = Buffer.alloc(i)
180
- b.set(new Uint8Array(buffer, 0, i), 0)
181
- this.ws.send(b)
182
- }else this.ws.send(new Uint8Array(buffer, 0, i))
183
- }
+ send({buffer}, i){ this.ws.send(buffer.slice(0, i)) }
184
[Symbol.for('nodejs.util.inspect.custom')](){
185
return this.cells.size ? 'Player(\x1b[33m'+this.cells.size+'\x1b[m) [...]' : 'Player []'
186
0 commit comments