From 39bb0548579f8eeca3d4e4c6413521e9bdf608a7 Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 4 Sep 2023 20:59:12 -0400 Subject: [PATCH] Add IsLocked, IsSubLevel, and IsCopyable to GameLevel --- Refresh.GameServer/Database/GameDatabaseProvider.cs | 2 +- .../ApiV3/DataTypes/Response/ApiGameLevelResponse.cs | 8 ++++++++ .../Endpoints/Game/DataTypes/Request/GameLevelRequest.cs | 7 +++++++ .../Game/DataTypes/Response/GameLevelResponse.cs | 7 +++++++ Refresh.GameServer/Types/Levels/GameLevel.cs | 4 ++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Refresh.GameServer/Database/GameDatabaseProvider.cs b/Refresh.GameServer/Database/GameDatabaseProvider.cs index e9e0754b..e0c36349 100644 --- a/Refresh.GameServer/Database/GameDatabaseProvider.cs +++ b/Refresh.GameServer/Database/GameDatabaseProvider.cs @@ -32,7 +32,7 @@ protected GameDatabaseProvider(IDateTimeProvider time) this._time = time; } - protected override ulong SchemaVersion => 84; + protected override ulong SchemaVersion => 85; protected override string Filename => "refreshGameServer.realm"; diff --git a/Refresh.GameServer/Endpoints/ApiV3/DataTypes/Response/ApiGameLevelResponse.cs b/Refresh.GameServer/Endpoints/ApiV3/DataTypes/Response/ApiGameLevelResponse.cs index 27be9586..0676bbc4 100644 --- a/Refresh.GameServer/Endpoints/ApiV3/DataTypes/Response/ApiGameLevelResponse.cs +++ b/Refresh.GameServer/Endpoints/ApiV3/DataTypes/Response/ApiGameLevelResponse.cs @@ -34,6 +34,10 @@ public class ApiGameLevelResponse : IApiResponse, IDataConvertableFrom XmlResources { get; set; } = new(); [XmlElement("leveltype")] public string? LevelType { get; set; } = ""; + [XmlElement("initiallyLocked")] public bool IsLocked { get; set; } + [XmlElement("isSubLevel")] public bool IsSubLevel { get; set; } + [XmlElement("shareable")] public int IsCopyable { get; set; } + public GameLevel ToGameLevel(GameUser publisher) => new() { @@ -58,5 +62,8 @@ public GameLevel ToGameLevel(GameUser publisher) => SkillRewards = this.SkillRewards.ToArray(), Publisher = publisher, LevelType = GameLevelTypeExtensions.FromGameString(this.LevelType), + IsLocked = this.IsLocked, + IsSubLevel = this.IsSubLevel, + IsCopyable = this.IsCopyable == 1, }; } \ No newline at end of file diff --git a/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs b/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs index b69f27ac..ab6426e3 100644 --- a/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs +++ b/Refresh.GameServer/Endpoints/Game/DataTypes/Response/GameLevelResponse.cs @@ -57,6 +57,10 @@ public class GameLevelResponse : IDataConvertableFrom LevelComments { get; }