From 891508cca90fb2334625b9c3021b0a9a3ff9ef68 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 11 Aug 2024 16:04:47 -0400 Subject: [PATCH 1/2] Track level completions Closes #616 --- Refresh.GameServer/Database/GameDatabaseContext.Relations.cs | 3 +++ .../Endpoints/Game/DataTypes/Response/GameLevelResponse.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Refresh.GameServer/Database/GameDatabaseContext.Relations.cs b/Refresh.GameServer/Database/GameDatabaseContext.Relations.cs index a29b4a82..3b176b8c 100644 --- a/Refresh.GameServer/Database/GameDatabaseContext.Relations.cs +++ b/Refresh.GameServer/Database/GameDatabaseContext.Relations.cs @@ -414,6 +414,9 @@ public int GetTotalPlaysForLevelByUser(GameLevel level, GameUser user) => public int GetUniquePlaysForLevel(GameLevel level, bool includingAuthor = true) => this.UniquePlayLevelRelations.Count(r => r.Level == level && (includingAuthor || r.User != level.Publisher)); + public int GetTotalCompletionsForLevel(GameLevel level) => + this.GameSubmittedScores.Count(s => s.Level == level); + #endregion #region Comments diff --git a/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs b/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs index 0a207923..ae74c0dc 100644 --- a/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs +++ b/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs @@ -46,6 +46,7 @@ public class GameLevelResponse : IDataConvertableFrom Date: Sun, 11 Aug 2024 16:07:56 -0400 Subject: [PATCH 2/2] Implement yourlbp1PlayCount and yourlbp3PlayCount Closes #456. Hopefully. --- .../DataTypes/Response/GameLevelResponse.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs b/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs index ae74c0dc..b0435302 100644 --- a/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs +++ b/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs @@ -53,9 +53,10 @@ public class GameLevelResponse : IDataConvertableFrom