mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-10-14 15:20:42 +08:00
Send system data with admin request (#68)
This commit is contained in:
parent
e3cbd26e97
commit
992746d8ad
@ -938,6 +938,13 @@ func handleAdminSearch(w http.ResponseWriter, r *http.Request) {
|
|||||||
httpError(w, r, err, http.StatusInternalServerError)
|
httpError(w, r, err, http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
uuid, err = db.Store.FetchUUIDFromUsername(username)
|
||||||
|
if err == nil {
|
||||||
|
systemData, err := savedata.GetSystem(db.Store, uuid)
|
||||||
|
if err == nil {
|
||||||
|
adminSearchResult.SystemData = &systemData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
writeJSON(w, r, adminSearchResult)
|
writeJSON(w, r, adminSearchResult)
|
||||||
log.Printf("%s: %s searched for username %s", userDiscordId, r.URL.Path, username)
|
log.Printf("%s: %s searched for username %s", userDiscordId, r.URL.Path, username)
|
||||||
|
@ -204,6 +204,7 @@ type AdminSearchResponse struct {
|
|||||||
GoogleId string `json:"googleId"`
|
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
|
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"`
|
Registered string `json:"registered"`
|
||||||
|
SystemData *defs.SystemSaveData `json:"systemData,omitzero"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *store) FetchAdminDetailsByUsername(dbUsername string) (AdminSearchResponse, error) {
|
func (s *store) FetchAdminDetailsByUsername(dbUsername string) (AdminSearchResponse, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user