Make sure server is running before loading users
This commit is contained in:
parent
aa49856446
commit
684f1a641d
@ -89,28 +89,32 @@ module.exports = function() {
|
|||||||
}, () => {
|
}, () => {
|
||||||
const protocol = config.https.enable ? "https" : "http";
|
const protocol = config.https.enable ? "https" : "http";
|
||||||
var address = server.address();
|
var address = server.address();
|
||||||
log.info(`Available on ${colors.green(protocol + "://" + address.address + ":" + address.port + "/")} \
|
|
||||||
in ${config.public ? "public" : "private"} mode`);
|
|
||||||
});
|
|
||||||
|
|
||||||
var sockets = io(server, {
|
log.info(
|
||||||
serveClient: false,
|
"Available at " +
|
||||||
transports: config.transports
|
colors.green(`${protocol}://${address.address}:${address.port}/`) +
|
||||||
});
|
` in ${colors.bold(config.public ? "public" : "private")} mode`
|
||||||
|
);
|
||||||
|
|
||||||
sockets.on("connect", function(socket) {
|
const sockets = io(server, {
|
||||||
if (config.public) {
|
serveClient: false,
|
||||||
performAuthentication.call(socket, {});
|
transports: config.transports
|
||||||
} else {
|
});
|
||||||
socket.emit("auth", {success: true});
|
|
||||||
socket.on("auth", performAuthentication);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
manager = new ClientManager();
|
sockets.on("connect", (socket) => {
|
||||||
|
if (config.public) {
|
||||||
|
performAuthentication.call(socket, {});
|
||||||
|
} else {
|
||||||
|
socket.emit("auth", {success: true});
|
||||||
|
socket.on("auth", performAuthentication);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
new Identification((identHandler) => {
|
manager = new ClientManager();
|
||||||
manager.init(identHandler, sockets);
|
|
||||||
|
new Identification((identHandler) => {
|
||||||
|
manager.init(identHandler, sockets);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user