Skip to content

Commit

Permalink
cache accountid
Browse files Browse the repository at this point in the history
  • Loading branch information
DeinFreund committed Jan 7, 2018
1 parent 8183233 commit 5d6ac27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ZkLobbyServer/ConnectedUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -629,15 +629,16 @@ public async Task RemoveConnection(ClientConnection con, string reason)

if (server.ConnectedUsers.TryRemove(Name, out connectedUser))
{
int accountID = User.AccountID;
connectedUser.ResetHasSeen();
connectedUser.User.AccountID = 0;

using (var db = new ZkDataContext())
{
var acc = await db.Accounts.FindAsync(User.AccountID);
var acc = await db.Accounts.FindAsync(accountID);
acc.LastLogout = DateTime.UtcNow;
await db.SaveChangesAsync();
}
connectedUser.User.AccountID = 0;
}
}
}
Expand Down

0 comments on commit 5d6ac27

Please sign in to comment.