forked from Hri7566/mpp-server-dev2
Attempt to fix race condition on channel join
This commit is contained in:
parent
5b30fbcd94
commit
0e67fb52cf
|
@ -93,14 +93,16 @@ export class Socket extends EventEmitter {
|
||||||
this.id = foundSocket.id;
|
this.id = foundSocket.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadUser();
|
(async () => {
|
||||||
|
await this.loadUser();
|
||||||
|
|
||||||
// TODO Permissions
|
// TODO Permissions
|
||||||
let isAdmin = false;
|
let isAdmin = false;
|
||||||
|
|
||||||
this.setRateLimits(isAdmin ? adminLimits : userLimits);
|
this.setRateLimits(isAdmin ? adminLimits : userLimits);
|
||||||
|
|
||||||
this.bindEventListeners();
|
this.bindEventListeners();
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getIP() {
|
public getIP() {
|
||||||
|
@ -133,7 +135,10 @@ export class Socket extends EventEmitter {
|
||||||
// Does channel exist?
|
// Does channel exist?
|
||||||
if (channel) {
|
if (channel) {
|
||||||
// Exists, join normally
|
// Exists, join normally
|
||||||
channel.join(this);
|
(async () => {
|
||||||
|
await this.loadUser();
|
||||||
|
channel.join(this);
|
||||||
|
})();
|
||||||
} else {
|
} else {
|
||||||
// Doesn't exist, create
|
// Doesn't exist, create
|
||||||
channel = new Channel(
|
channel = new Channel(
|
||||||
|
|
Loading…
Reference in New Issue