fix serverside gateway error when no channels are present and improve default config
This commit is contained in:
parent
ee04d03bdb
commit
ab878b6718
2 changed files with 24 additions and 22 deletions
|
@ -123,6 +123,7 @@ class GatewayServer extends EventEmitter {
|
|||
let presence = {};
|
||||
const channel = channels[0];
|
||||
|
||||
if (channel) {
|
||||
this.inChannel(channel._id, (client) => {
|
||||
presence[client.session.user._id] = {
|
||||
_id: client.session.user._id,
|
||||
|
@ -141,6 +142,7 @@ class GatewayServer extends EventEmitter {
|
|||
});
|
||||
|
||||
ws.send(packet("EVENT_CHANNEL_MEMBERS", presence));
|
||||
}
|
||||
|
||||
console.log(`gateway: user ${user.username}: handshake complete`);
|
||||
} catch (e) {
|
||||
|
|
|
@ -2,20 +2,20 @@ module.exports = {
|
|||
ports: {
|
||||
mainServerPort: 3005,
|
||||
},
|
||||
address: 'localhost',
|
||||
address: "localhost",
|
||||
//restrictions: {
|
||||
// signup: {
|
||||
// specialCode: ''
|
||||
// }
|
||||
//},
|
||||
mongoUrl: 'mongodb://192.168.0.105:27017/app',
|
||||
mongoUrl: "mongodb://127.0.0.1:27017/app",
|
||||
bcryptRounds: 10,
|
||||
roleMap: {
|
||||
'BANNED': 0,
|
||||
'RESTRICTED': 1,
|
||||
'USER': 2,
|
||||
'BOT': 3,
|
||||
'ADMIN': 4
|
||||
"BANNED": 0,
|
||||
"RESTRICTED": 1,
|
||||
"USER": 2,
|
||||
"BOT": 3,
|
||||
"ADMIN": 4
|
||||
},
|
||||
gatewayStillNotConnectedTimeoutMS: 15*1000
|
||||
};
|
||||
|
|
Reference in a new issue