Skip to content

Commit

Permalink
Lucas/fix prem days and outfit (#17)
Browse files Browse the repository at this point in the history
* PremDays must be in unix seconds, no miliseconds
  • Loading branch information
lgrossi authored Nov 23, 2021
1 parent fd430b0 commit 6aa41f0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/database/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 6aa41f0

Please sign in to comment.