From 937546686314e8db3063f38153277b53032d30a7 Mon Sep 17 00:00:00 2001 From: asesidaa <1061472754@qq.com> Date: Sun, 31 Mar 2024 00:51:46 +0800 Subject: [PATCH] Add Locked items config --- Domain/Config/LockedItemConfig.cs | 14 ++++++++++++++ MainServer/Configurations/auth.json | 2 +- MainServer/Configurations/locked.json | 9 +++++++++ MainServer/Program.cs | 3 +++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Domain/Config/LockedItemConfig.cs create mode 100644 MainServer/Configurations/locked.json diff --git a/Domain/Config/LockedItemConfig.cs b/Domain/Config/LockedItemConfig.cs new file mode 100644 index 0000000..be733d5 --- /dev/null +++ b/Domain/Config/LockedItemConfig.cs @@ -0,0 +1,14 @@ +using System.Text.Json.Serialization; +using Domain.Enums; + +namespace Domain.Config; + +public class LockedItemConfig +{ + public const string LOCKED_SECTION = "Locked"; + + public int ItemId { get; set; } + + [JsonConverter(typeof(JsonStringEnumConverter))] + public UnlockType ItemType { get; set; } +} \ No newline at end of file diff --git a/MainServer/Configurations/auth.json b/MainServer/Configurations/auth.json index 98008be..6dc8297 100644 --- a/MainServer/Configurations/auth.json +++ b/MainServer/Configurations/auth.json @@ -7,7 +7,7 @@ "TenpoName": "店舗1", "Pref": "東京都", "Location": "渋谷区", - "Mac": "000000000000" + "Mac": "00155D6ACF78" } ] } diff --git a/MainServer/Configurations/locked.json b/MainServer/Configurations/locked.json new file mode 100644 index 0000000..ea1650f --- /dev/null +++ b/MainServer/Configurations/locked.json @@ -0,0 +1,9 @@ +{ + "Locked": + [ + { + "ItemId": 11, + "ItemType": "Avatar" + } + ] +} \ No newline at end of file diff --git a/MainServer/Program.cs b/MainServer/Program.cs index 347306d..c29676f 100644 --- a/MainServer/Program.cs +++ b/MainServer/Program.cs @@ -42,6 +42,7 @@ try .AddJsonFile($"{configurationsDirectory}/matching.json", optional: true, reloadOnChange: false) .AddJsonFile($"{configurationsDirectory}/auth.json", optional: true, reloadOnChange: false) .AddJsonFile($"{configurationsDirectory}/rank.json", optional: true, reloadOnChange: false) + .AddJsonFile($"{configurationsDirectory}/locked.json", optional: true, reloadOnChange: false) .AddJsonFile($"{configurationsDirectory}/server.json", optional: true, reloadOnChange: false); builder.Services.Configure( @@ -52,6 +53,8 @@ try builder.Configuration.GetSection(GameConfig.GAME_SECTION)); builder.Services.Configure( builder.Configuration.GetSection(AuthConfig.AUTH_SECTION)); + builder.Services.Configure( + builder.Configuration.GetSection(LockedItemConfig.LOCKED_SECTION)); builder.Services.AddOptions() .Bind(builder.Configuration.GetSection(RankConfig.RANK_SECTION)) .ValidateDataAnnotations()