From 6aa41f0ded48d83c1593748a9b90325d5b3b77d1 Mon Sep 17 00:00:00 2001 From: Lucas Grossi <34237492+lgrossi@users.noreply.github.com> Date: Tue, 23 Nov 2021 01:01:22 +0100 Subject: [PATCH] Lucas/fix prem days and outfit (#17) * PremDays must be in unix seconds, no miliseconds --- src/database/account.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/database/account.go b/src/database/account.go index 3854c52..d37be08 100644 --- a/src/database/account.go +++ b/src/database/account.go @@ -20,7 +20,6 @@ type Account struct { } const secondsInADay = 24 * 60 * 60 -const million = 1e6 func (acc *Account) Authenticate(db *sql.DB) error { h := sha1.New() @@ -53,7 +52,7 @@ func (acc *Account) GetGrpcSession() *login_proto_messages.Session { func (acc *Account) GetPremiumTime() uint64 { if acc.PremDays > 0 { - return uint64(time.Now().UnixNano()/million) + uint64(acc.PremDays * secondsInADay) + return uint64(time.Now().Unix()) + uint64(acc.PremDays * secondsInADay) } return 0 }