Repository navigation
Various grief report fixes - #1154
Draft
Toastbrot236 wants to merge 15 commits into
Draft
Toastbrot236 wants to merge 15 commits into
Toastbrot236 wants to merge 15 commits into
Conversation
…ype on GamePhoto and ApiGamePhotoResponse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes multiple issues that were left in the grief report reimplementation from forever ago. Most notably, it does these changes:
Serializedand ones related to internal/DB stuff are prefixed withGamenow.Reportstable was renamed toGameGriefReportsfor consistencyReportPlayersRelationstable was renamed toReportPlayerRelationsto fix the annoying typoReportPlayerRelation.Timestampwas removed since it wasn't set or used anywhere (meaning all rows had it set to-infinity), and the game doesn't actually send any player-specific timestamps, so this column was also pointless. The report's own upload date is enough.ReportPlayerRelation.UserIdis now nullable to allow the server to store report players who don't have a correspondingGameUserentity on the server. This can likely happen if the report includes players from another server, and idk whether reports also include local guests or not.ReportPlayerRelation.UserIdis no longer part of its primary key, instead it now consists ofReportIdandPlayerNumber, similarly to how it's now done inGamePhotoSubject. Since we can't rely on the game to send unique player numbers (due to potentially bugged or forged requests), the player number sent by the game is no longer directly saved to DB. Instead, we use it to order the player list, and then we create our own unique player numbers.ReportPlayerRelationnow stores the username originally included in the request, so we could identify players incase theirUserIds are null (similarly to how we also store the username separately inGamePhotoSubjects)This needs a few unit tests, and the DB migrations also have to be tested (I have tested some of the SQL statements in the
Up()methods separately, but the migrations should still be tested in their entirety).