diff --git a/TOOHUCardAPI/Controllers/GameConfigController.cs b/TOOHUCardAPI/Controllers/GameConfigController.cs index bf7aa7c..eda6a8b 100644 --- a/TOOHUCardAPI/Controllers/GameConfigController.cs +++ b/TOOHUCardAPI/Controllers/GameConfigController.cs @@ -15,7 +15,7 @@ namespace TOOHUCardAPI.Controllers [HttpGet] public async Task GetGameConfig() { - return GameConfigResponse.Default(); + return new GameConfigResponse(); } } } \ No newline at end of file diff --git a/TOOHUCardAPI/Models/GameConfigResponse.cs b/TOOHUCardAPI/Models/GameConfigResponse.cs index 077bac5..2568cbb 100644 --- a/TOOHUCardAPI/Models/GameConfigResponse.cs +++ b/TOOHUCardAPI/Models/GameConfigResponse.cs @@ -1,3 +1,4 @@ +using System; using System.Text.Json.Serialization; using Newtonsoft.Json; @@ -18,42 +19,16 @@ namespace TOOHUCardAPI.Models public class GameConfigResponse { private static string SUCCESS_CODE = "0000"; - [JsonPropertyName("code")] - public string Code { get; set; } - [JsonPropertyName("msg")] - public string Message { get; set; } - [JsonPropertyName("game_code")] - public string GameCode { get; set; } - [JsonPropertyName("game_msg")] - public string GameMessage { get; set; } - [JsonPropertyName("luck_card")] - public string LuckCard { get; set; } - [JsonPropertyName("luck_crit")] - public float LuckCrit { get; set; } - [JsonPropertyName("new_card_list")] - public string NewCardList { get; set; } - [JsonPropertyName("open_day_list")] - public string OpenDayList { get; set; } - [JsonPropertyName("is_open_day")] - public int IsOpenDay { get; set; } - [JsonPropertyName("server_time")] - public string ServerTime { get; set; } - - public static GameConfigResponse Default() - { - return new GameConfigResponse - { - Code = SUCCESS_CODE, - Message = string.Empty, - GameCode = string.Empty, - GameMessage = string.Empty, - LuckCard = string.Empty, - LuckCrit = 0, - NewCardList = string.Empty, - OpenDayList = string.Empty, - IsOpenDay = 0, - ServerTime = string.Empty, - }; - } + [JsonPropertyName("code")] public string Code { get; set; } = SUCCESS_CODE; + [JsonPropertyName("msg")] public string Message { get; set; } = string.Empty; + [JsonPropertyName("game_code")] public string GameCode { get; set; } = string.Empty; + [JsonPropertyName("game_msg")] public string GameMessage { get; set; } = string.Empty; + [JsonPropertyName("luck_card")] public string LuckCard { get; set; } = string.Empty; + [JsonPropertyName("luck_crit")] public float LuckCrit { get; set; } + [JsonPropertyName("new_card_list")] public string NewCardList { get; set; } = string.Empty; + [JsonPropertyName("open_day_list")] public string OpenDayList { get; set; } = String.Empty; + [JsonPropertyName("is_open_day")] public int IsOpenDay { get; set; } + [JsonPropertyName("server_time")] public string ServerTime { get; set; } = string.Empty; + } } \ No newline at end of file diff --git a/TOOHUCardAPI/Models/PlayerDataResponse.cs b/TOOHUCardAPI/Models/PlayerDataResponse.cs new file mode 100644 index 0000000..84d2e0f --- /dev/null +++ b/TOOHUCardAPI/Models/PlayerDataResponse.cs @@ -0,0 +1,23 @@ +namespace TOOHUCardAPI.Models +{ + /** + * Fields pulled from the game code + * Looking up Gamerules.Playerdata + */ + public class PlayerDataResponsePlayerObject + { + + public string Code { get; set; } + public string Message { get; set; } + public string SteamId { get; set; } + public int MaxWave { get; set; } + public int MaxTeamWave { get; set; } + public int PetLevel { get; set; } + public string EndTime { get; set; } + public int KeyTotal { get; set; } + public string KeySaveDate { get; set; } + public int Vip { get; set; } + public int Point { get; set; } + public string LevelList { get; set; } + } +} \ No newline at end of file diff --git a/TOOHUCardAPI/Program.cs b/TOOHUCardAPI/Program.cs index 3140165..166932c 100644 --- a/TOOHUCardAPI/Program.cs +++ b/TOOHUCardAPI/Program.cs @@ -18,6 +18,9 @@ namespace TOOHUCardAPI public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }); + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); } -} \ No newline at end of file +} diff --git a/TOOHUCardAPI/Properties/launchSettings.json b/TOOHUCardAPI/Properties/launchSettings.json index cd12d80..6041125 100644 --- a/TOOHUCardAPI/Properties/launchSettings.json +++ b/TOOHUCardAPI/Properties/launchSettings.json @@ -22,7 +22,7 @@ "dotnetRunMessages": "true", "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:5001;http://localhost:5000", + "applicationUrl": "https://192.168.1.103:5001;http://192.168.1.103:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }