Add last activity update on verify

pull/14/head
Flashfyre 8 months ago
parent 509ca8df12
commit df92ff8b6f

@ -693,6 +693,12 @@ func handleSystemVerify(w http.ResponseWriter, r *http.Request) {
response.SystemData = &storedSaveData response.SystemData = &storedSaveData
} }
err = db.UpdateAccountLastActivity(uuid)
if err != nil {
httpError(w, r, fmt.Errorf("failed to update account last activity: %s", err), http.StatusInternalServerError)
return
}
jsonResponse(w, r, response) jsonResponse(w, r, response)
} }

@ -29,7 +29,7 @@ func FetchPlayerCount() (int, error) {
func FetchBattleCount() (int, error) { func FetchBattleCount() (int, error) {
var battleCount int var battleCount int
err := handle.QueryRow("SELECT COALESCE(SUM(battles), 0) FROM accountStats").Scan(&battleCount) err := handle.QueryRow("SELECT COALESCE(SUM(s.battles), 0) FROM accountStats s JOIN accounts a ON a.uuid = s.uuid WHERE a.banned = 0").Scan(&battleCount)
if err != nil { if err != nil {
return 0, err return 0, err
} }
@ -39,7 +39,7 @@ func FetchBattleCount() (int, error) {
func FetchClassicSessionCount() (int, error) { func FetchClassicSessionCount() (int, error) {
var classicSessionCount int var classicSessionCount int
err := handle.QueryRow("SELECT COALESCE(SUM(classicSessionsPlayed), 0) FROM accountStats").Scan(&classicSessionCount) err := handle.QueryRow("SELECT COALESCE(SUM(s.classicSessionsPlayed), 0) FROM accountStats s JOIN accounts a ON a.uuid = s.uuid WHERE a.banned = 0").Scan(&classicSessionCount)
if err != nil { if err != nil {
return 0, err return 0, err
} }

Loading…
Cancel
Save