mirror of https://github.com/calzoneman/sync.git
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) {
|
||||
var self = this;
|
||||
self.whenReady(function () {
|
||||
if (self.dead) {
|
||||
return;
|
||||
}
|
||||
|
||||
user.whenLoggedIn(function () {
|
||||
self.getRank(user.name, function (err, rank) {
|
||||
if (self.dead) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
user.rank = user.global_rank;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue