aboutsummaryrefslogtreecommitdiff
path: root/socket.js
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-18 00:38:52 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-18 00:38:52 -0500
commitc090e4911c92c00134542362aec43903f3739764 (patch)
treea48293ecf1880bbff2e657fcf7a80625503f973b /socket.js
parent360bb20a3dd428b4f7ac06d97927c54ba1f4e52c (diff)
bugfixes
Diffstat (limited to 'socket.js')
-rw-r--r--socket.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/socket.js b/socket.js
index 0e84222..29bab25 100644
--- a/socket.js
+++ b/socket.js
@@ -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"}`);