-
Notifications
You must be signed in to change notification settings - Fork 34
Track players who have participated in a score, remove score type 7 #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6b7482a
Use, sanitize and save score player lists, no more type 7
Toastbrot236 8b9aaaa
Ignore score type for versus game leaderboard retrieval, actually use…
Toastbrot236 a7d6e2e
Add and adjust score game tests
Toastbrot236 24aacf7
Add GameScore.PublisherId to database via migration
Toastbrot236 6d039ce
Annihilate score type 7
Toastbrot236 f0ec980
Adjust pin tests aswell
Toastbrot236 4f1794e
Continue supporting type 7 for APIv3, add Publisher to API score resp…
Toastbrot236 3f26d64
Improve overtake notifs and their tests
Toastbrot236 8283218
More consistent param naming
Toastbrot236 b87b844
Ensure that SubmitScore's player param is a list
Toastbrot236 42b0f62
Adjust tests to previous commit
Toastbrot236 57ecc60
Properly distinguish other scores from personal highscores
Toastbrot236 c55e5f2
Add additional overtake notif test
Toastbrot236 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
56 changes: 56 additions & 0 deletions
56
Refresh.Database/Migrations/20251007182051_ProperlyAddScorePlayerList.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||
| using Microsoft.EntityFrameworkCore.Migrations; | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Refresh.Database.Migrations | ||
| { | ||
| /// <inheritdoc /> | ||
| [DbContext(typeof(GameDatabaseContext))] | ||
| [Migration("20251007182051_ProperlyAddScorePlayerList")] | ||
| public partial class ProperlyAddScorePlayerList : Migration | ||
| { | ||
| /// <inheritdoc /> | ||
| protected override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.AddColumn<string>( | ||
| name: "PublisherId", | ||
| table: "GameScores", | ||
| type: "text", | ||
| nullable: false, | ||
| defaultValue: ""); | ||
|
|
||
| // SQL to copy publisher ID from player list to publisher ID attribute | ||
| migrationBuilder.Sql("UPDATE \"GameScores\" SET \"PublisherId\" = \"PlayerIdsRaw\"[1] WHERE \"PlayerIdsRaw\"[1] IS NOT NULL"); | ||
|
|
||
| migrationBuilder.CreateIndex( | ||
| name: "IX_GameScores_PublisherId", | ||
| table: "GameScores", | ||
| column: "PublisherId"); | ||
|
|
||
| migrationBuilder.AddForeignKey( | ||
| name: "FK_GameScores_GameUsers_PublisherId", | ||
| table: "GameScores", | ||
| column: "PublisherId", | ||
| principalTable: "GameUsers", | ||
| principalColumn: "UserId", | ||
| onDelete: ReferentialAction.Cascade); | ||
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override void Down(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.DropForeignKey( | ||
| name: "FK_GameScores_GameUsers_PublisherId", | ||
| table: "GameScores"); | ||
|
|
||
| migrationBuilder.DropIndex( | ||
| name: "IX_GameScores_PublisherId", | ||
| table: "GameScores"); | ||
|
|
||
| migrationBuilder.DropColumn( | ||
| name: "PublisherId", | ||
| table: "GameScores"); | ||
| } | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
Refresh.Database/Migrations/20251008175307_AnnihilateScoreType7.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||
| using Microsoft.EntityFrameworkCore.Migrations; | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Refresh.Database.Migrations | ||
| { | ||
| /// <inheritdoc /> | ||
| [DbContext(typeof(GameDatabaseContext))] | ||
| [Migration("20251008175307_AnnihilateScoreType7")] | ||
| public partial class AnnihilateScoreType7 : Migration | ||
| { | ||
| /// <inheritdoc /> | ||
| protected override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| // Just set all type 7 scores' type to 1 since we haven't tracked more than 1 user | ||
| // in the player list before anyway | ||
| migrationBuilder.Sql("UPDATE \"GameScores\" SET \"ScoreType\" = 1 WHERE \"ScoreType\" = 7"); | ||
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override void Down(MigrationBuilder migrationBuilder) | ||
| { | ||
| // Do nothing | ||
| } | ||
| } | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.