aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-05-05 13:00:23 +0200
committerMinteck <nekostarfan@gmail.com>2021-05-05 13:00:23 +0200
commit971783dafcb441de323bd282c375830c852a5c75 (patch)
tree0c78b6719c554516b91c2acd7cea5b2c4b458e1d /index.js
parentf72770f62a1bde2b92d83561853f8996a48fd0e3 (diff)
downloadkartik-legacy-server-971783dafcb441de323bd282c375830c852a5c75.tar.gz
kartik-legacy-server-971783dafcb441de323bd282c375830c852a5c75.tar.bz2
kartik-legacy-server-971783dafcb441de323bd282c375830c852a5c75.zip
Commit
Diffstat (limited to 'index.js')
-rw-r--r--index.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/index.js b/index.js
index 86091c1..cf1e65f 100644
--- a/index.js
+++ b/index.js
@@ -269,7 +269,7 @@ server.on('connection', (socket) => {
) + "\n")
break;
case "link":
- if (typeof info['client'] !== "string" || isNaN(parseInt(info['client'], 16))) {
+ if (typeof info['client'] !== "string" || isNaN(parseInt(info['client'], 36))) {
throw new KartikError("Invalid client link ID", "net.minteckprojects.kartik.KartikServer.GuestIdentifierException");
}
if (typeof clients[info['client']] === "undefined") {
@@ -309,7 +309,7 @@ server.on('connection', (socket) => {
if (socket.linkedTo === null) {
throw new KartikError("Client not linked to another client", "net.minteckprojects.kartik.KartikServer.DataRoutingException");
} else {
- socket.linkedTo.write(JSON.stringify(info) + "\n");
+ socket.linkedTo.write(JSON.stringify(info).replaceAll("<", "-").replaceAll(">", "-") + "\n");
}
}
}
@@ -321,8 +321,8 @@ server.on('connection', (socket) => {
}
socket.write(JSON.stringify({
_type: "error",
- message: e.message,
- type: e.ktype
+ message: e.message.replaceAll("<", "-").replaceAll(">", "-"),
+ type: e.ktype.replaceAll("<", "-").replaceAll(">", "-")
}) + "\n")
socket.end();
}