add logout time and refactor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Timofey.Kovalev
2021-06-22 20:20:09 +03:00
parent f3b56bb7b7
commit 34c5271a62
3 changed files with 31 additions and 16 deletions

View File

@ -117,7 +117,7 @@ func (c *quitCommand) run(ctx context.Context) {
return
}
err = db.increasePlayerOnlineDuration(ctx, p.id, time.Now().Sub(p.lastOnline))
err = db.increasePlayerOnlineDuration(ctx, p.id, time.Now().Sub(p.lastLogin))
if err != nil {
log.Error(err)
return