diff --git a/db/account.go b/db/account.go index 789d2f9..e709d13 100644 --- a/db/account.go +++ b/db/account.go @@ -199,11 +199,11 @@ func FetchLastLoggedInDateByUsername(username string) (string, error) { } type AdminSearchResponse struct { - Username string `json:"username"` - DiscordId string `json:"discordId"` - GoogleId string `json:"googleId"` - LastActivity string `json:"lastLoggedIn"` // TODO: this is currently lastLoggedIn to match server PR #54 with pokerogue PR #4198. We're hotfixing the server with this PR to return lastActivity, but we're not hotfixing the client, so are leaving this as lastLoggedIn so that it still talks to the client properly - Registered string `json:"registered"` + Username string `json:"username"` + DiscordId string `json:"discordId"` + GoogleId string `json:"googleId"` + LastActivity string `json:"lastLoggedIn"` // TODO: this is currently lastLoggedIn to match server PR #54 with pokerogue PR #4198. We're hotfixing the server with this PR to return lastActivity, but we're not hotfixing the client, so are leaving this as lastLoggedIn so that it still talks to the client properly + Registered string `json:"registered"` } func FetchAdminDetailsByUsername(dbUsername string) (AdminSearchResponse, error) { @@ -216,11 +216,11 @@ func FetchAdminDetailsByUsername(dbUsername string) (AdminSearchResponse, error) } adminResponse = AdminSearchResponse{ - Username: username.String, - DiscordId: discordId.String, - GoogleId: googleId.String, - LastActivity: lastActivity.String, - Registered: registered.String, + Username: username.String, + DiscordId: discordId.String, + GoogleId: googleId.String, + LastActivity: lastActivity.String, + Registered: registered.String, } return adminResponse, nil diff --git a/db/savedata.go b/db/savedata.go index 9a1c45d..9f77ed8 100644 --- a/db/savedata.go +++ b/db/savedata.go @@ -219,13 +219,12 @@ func DeleteSessionSaveData(uuid []byte, slot int) error { } func RetrievePlaytime(uuid []byte) (int, error) { - var playtime int - err := handle.QueryRow("SELECT playTime FROM accountStats WHERE uuid = ?", uuid).Scan(&playtime) + system, err := ReadSystemSaveData(uuid) if err != nil { return 0, err } - return playtime, nil + return int(system.GameStats.(map[string]interface{})["playTime"].(float64)), nil } func GetSystemSaveFromS3(uuid []byte) (defs.SystemSaveData, error) {