Short term additional fix for #583

The previous commits do not handle all of the edge cases of #583
appropriately.  This is a short term solution that will work, but is not
as efficient as it could be.  The whole refreshAccount function needs to
be reconsidered and replaced with a more sane way of handling atomic
updates to the user's account state.
This commit is contained in:
calzoneman 2016-06-29 22:00:25 -07:00
parent c70dc83504
commit 312892e56b
4 changed files with 39 additions and 55 deletions

View file

@ -213,8 +213,8 @@ function handleConnection(sock) {
if (sock.user) {
user.setFlag(Flags.U_REGISTERED);
user.clearFlag(Flags.U_READY);
user.refreshAccount({ name: sock.user.name },
function (err, account) {
user.account.name = sock.user.name;
user.refreshAccount(function (err, account) {
if (err) {
user.clearFlag(Flags.U_REGISTERED);
user.setFlag(Flags.U_READY);