mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Serve report aggregates through the database interface (#7845)
cmdReportStats and cmdReportUserInfo still ran their queries inline through Servatrice_DatabaseInterface and built the response in the socket handler. Add ReportStatsRecord, ReportUserInfoRecord and their count records to Server_DatabaseInterface with fail-closed defaults, implement getReportStats and getReportUserInfo with the previous statements and query order, and keep presence flags for the fields the old code set only on a successful query so the proto2 wire output is unchanged. The stats cache decision and every response code stay in the handler.
This commit is contained in:
parent
2ba80cb61d
commit
a54e13756c
4 changed files with 309 additions and 144 deletions
|
|
@ -301,6 +301,8 @@ public:
|
|||
Server_DatabaseInterface::ReportLookupResult
|
||||
getReportForDetails(int reportId, int &reporterId, ServerInfo_Report &report) override;
|
||||
bool getReportComments(int reportId, QList<ServerInfo_ReportComment> &comments) override;
|
||||
bool getReportStats(ReportStatsRecord &stats) override;
|
||||
bool getReportUserInfo(const QString &userName, ReportUserInfoRecord &info) override;
|
||||
bool addReport(int reporterId,
|
||||
const QString &reporterName,
|
||||
int reportedUserId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue