Fix race condition
This commit is contained in:
parent
aac8f3c671
commit
07819f0b14
|
|
@ -467,8 +467,16 @@ Channel.prototype.getIPRank = function (ip, callback) {
|
||||||
Channel.prototype.preJoin = function (user, password) {
|
Channel.prototype.preJoin = function (user, password) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.whenReady(function () {
|
self.whenReady(function () {
|
||||||
|
if (self.dead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
user.whenLoggedIn(function () {
|
user.whenLoggedIn(function () {
|
||||||
self.getRank(user.name, function (err, rank) {
|
self.getRank(user.name, function (err, rank) {
|
||||||
|
if (self.dead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
user.rank = user.global_rank;
|
user.rank = user.global_rank;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue