From 6a24543e4bb0c89f241bef0fc62ee8a992e86abd Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 23 May 2018 14:40:41 +0200 Subject: Revert "hashing useragent" This reverts commit 2630392deef2fbaea192ef2572714b307d676356. --- client.js | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/client.js b/client.js index 4fe2cad..e67fa23 100644 --- a/client.js +++ b/client.js @@ -69,21 +69,6 @@ if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phon var carea = 0; var linifile; var pinifile; -var hdid; - -hashCode = function(str) { - var hash = 0, i, chr, len; - if (str.length === 0) return hash; - for (i = 0, len = str.length; i < len; i++) { - chr = str.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; - hash |= 0; // Convert to 32bit integer - } - return hash; - }; - -hdid = hashCode(navigator.userAgent); - serv.onopen = function(evt) { onOpen(evt) }; @@ -350,7 +335,7 @@ function updateText() { function onOpen(e) { if (mode == "join") { - serv.send("HI#" + hdid + "#%"); + serv.send("HI#" + navigator.userAgent + "#%"); serv.send("ID#webAO#2.4.5#%"); } else { document.getElementById("client_loading").style.display = "none"; @@ -365,13 +350,13 @@ function onClose(e) { function ReconnectButton() { serv = new WebSocket("ws://" + serverIP); if (serv) { - serv.send("HI#" + hdid + "#%"); + serv.send("HI#" + navigator.userAgent + "#%"); document.getElementById("client_error").style.display = "none"; } } function RetryButton() { -serv.send("HI#" + hdid + "#%"); +serv.send("HI#" + navigator.userAgent + "#%"); } function onError(e) { -- cgit