diff options
Diffstat (limited to 'socket.js')
-rw-r--r-- | socket.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -26,7 +26,6 @@ class retryws extends EventEmitter{ // a wrapper on ws that retries on failure } } - class Socket extends retryws { constructor(world='') { // Takes the name of the world, which can be an empty string. let loc = (world == '') ? '' : `/${world}`; @@ -59,8 +58,9 @@ class Socket extends retryws { throw "Too many characters to write"; } for (var i=0; i<chars.length; i++){ - chars[i] = chars[i].flat(); - chars[i].splice(4,0,0); // + let char = chars[i] + chars[i] = [char[0][0],char[0][1],char[1][0],char[1][1],char[2]]; + chars[i].splice(4,0,0); chars[i].push(i); } this.send(`{"edits":${JSON.stringify(chars)},"kind":"write"}`); |