Replace client ids with guids

This commit is contained in:
Pavel Djundik 2018-04-10 16:15:44 +03:00
parent ff5a231ea0
commit 99386510d8
2 changed files with 3 additions and 3 deletions

View File

@ -11,10 +11,10 @@ const ircFramework = require("irc-framework");
const Helper = require("./helper"); const Helper = require("./helper");
const UAParser = require("ua-parser-js"); const UAParser = require("ua-parser-js");
const MessageStorage = require("./plugins/sqlite"); const MessageStorage = require("./plugins/sqlite");
const uuidv4 = require("uuid/v4");
module.exports = Client; module.exports = Client;
let id = 0;
const events = [ const events = [
"away", "away",
"connection", "connection",
@ -71,7 +71,7 @@ function Client(manager, name, config = {}) {
lastActiveChannel: -1, lastActiveChannel: -1,
attachedClients: {}, attachedClients: {},
config: config, config: config,
id: id++, id: uuidv4(),
name: name, name: name,
networks: [], networks: [],
sockets: manager.sockets, sockets: manager.sockets,

View File

@ -106,7 +106,7 @@ module.exports = function(irc, network) {
if (Helper.config.debug.ircFramework) { if (Helper.config.debug.ircFramework) {
irc.on("debug", function(message) { irc.on("debug", function(message) {
log.debug("[" + client.name + " (#" + client.id + ") on " + network.name + " (#" + network.id + ")]", message); log.debug("[" + client.name + " (" + client.id + ") on " + network.name + " (#" + network.id + ")]", message);
}); });
} }