aboutsummaryrefslogtreecommitdiff
path: root/webAO/master.js
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2020-03-25 23:12:27 +0100
committersD <stoned@derpymail.org>2020-03-25 23:12:27 +0100
commit2ed9af82f21f1390d507f04638157b63bfd4b949 (patch)
tree5cef9436218f376f32ba4c8cb2ef8911a626abc9 /webAO/master.js
parent419ab5ba4e9de9726aacc4ad4a69a9809be27f65 (diff)
move encoding stuff to seperate js file
Diffstat (limited to 'webAO/master.js')
-rw-r--r--webAO/master.js16
1 files changed, 2 insertions, 14 deletions
diff --git a/webAO/master.js b/webAO/master.js
index 7ceb748..660b6e2 100644
--- a/webAO/master.js
+++ b/webAO/master.js
@@ -1,7 +1,7 @@
const MASTERSERVER_IP = "master.aceattorneyonline.com:27014";
-const version = 2.4;
import Fingerprint2 from 'fingerprintjs2';
+import { unescapeChat } from './encoding.js';
let masterserver;
@@ -14,18 +14,6 @@ const server_description = [];
server_description[-1] = "This is your computer on port 50001";
const online_counter = [];
-/**
- * Unescapes a string to AO1 escape codes.
- * @param {string} estring the string to be unescaped
- */
-function unescapeChat(estring) {
- return estring
- .replace(/<num>/g, "#")
- .replace(/<and>/g, "&")
- .replace(/<percent>/g, "%")
- .replace(/<dollar>/g, "$");
-}
-
if (window.requestIdleCallback) {
requestIdleCallback(function () {
Fingerprint2.get(options, function (components) {
@@ -170,7 +158,7 @@ function onMessage(e) {
}
else if (header === "servercheok") {
const args = msg.split("#").slice(1);
- document.getElementById("clientinfo").innerHTML = `Client version: ${args[0]}`;
+ document.getElementById("clientinfo").innerHTML = `Client version: ${version} expected: ${args[0]}`;
}
else if (header === "SV") {
const args = msg.split("#").slice(1);