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 UAParser = require("ua-parser-js");
const MessageStorage = require("./plugins/sqlite");
const uuidv4 = require("uuid/v4");
module.exports = Client;
let id = 0;
const events = [
"away",
"connection",
@ -71,7 +71,7 @@ function Client(manager, name, config = {}) {
lastActiveChannel: -1,
attachedClients: {},
config: config,
id: id++,
id: uuidv4(),
name: name,
networks: [],
sockets: manager.sockets,

View file

@ -106,7 +106,7 @@ module.exports = function(irc, network) {
if (Helper.config.debug.ircFramework) {
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);
});
}