Fix lag; Camille forgot usleep(500)
This commit is contained in:
parent
c6990ebb3e
commit
0d69a63b62
@ -73,13 +73,10 @@ class Game
|
||||
if (this._socket === undefined)
|
||||
return;
|
||||
|
||||
const loop_id = setInterval(() => {
|
||||
if (this._socket.readyState === WebSocket.OPEN)
|
||||
{
|
||||
this._socket.send(JSON.stringify(data));
|
||||
clearInterval(loop_id);
|
||||
}
|
||||
}, 500);
|
||||
if (this._socket.readyState === WebSocket.OPEN)
|
||||
{
|
||||
this._socket.send(JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
_send_paddle_position(position, time)
|
||||
|
Loading…
Reference in New Issue
Block a user