Making guid somewhat more unique, and not using connection, but cookie instead

This commit is contained in:
Kasper Rynning-Tønnesen
2018-08-28 14:46:39 +02:00
parent 6e09c6d59f
commit 8e9a76eb48
2 changed files with 4 additions and 2 deletions

View File

@@ -31,7 +31,9 @@ module.exports = function() {
socket.zoff_id = socket.id; socket.zoff_id = socket.id;
socket.emit("get_list"); socket.emit("get_list");
var guid = Functions.hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]); var guid = socket.cookie_id;
if(guid == "empty") guid = Functions.hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]);
socket.guid = guid; socket.guid = guid;
socket.on('close', function() { socket.on('close', function() {
}); });

View File

@@ -282,7 +282,7 @@ window.addEventListener("DOMContentLoaded", function() {
M.toast({ html: "Connected!", displayLength: 2000, classes: "green lighten"}); M.toast({ html: "Connected!", displayLength: 2000, classes: "green lighten"});
//before_toast(); //before_toast();
} }
Chat.namechange("", true, true); //Chat.namechange("", true, true);
}); });
/*socket.on("name", function(data) { /*socket.on("name", function(data) {