mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-12 14:34:39 +01:00
JSON data table parsing stuff
This commit is contained in:
@@ -11,4 +11,16 @@
|
|||||||
<PackageReference Include="protobuf-net" Version="3.2.30" />
|
<PackageReference Include="protobuf-net" Version="3.2.30" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="Resources\sharecfgdata\chapter_template.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="Resources\sharecfgdata\ship_data_statistics.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="Resources\sharecfgdata\task_data_template.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace BLHX.Server.Common.Utils;
|
using BLHX.Server.Common.Utils;
|
||||||
|
|
||||||
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
public class Config : Singleton<Config>
|
public class Config : Singleton<Config>
|
||||||
{
|
{
|
||||||
@@ -9,17 +11,13 @@ public class Config : Singleton<Config>
|
|||||||
{
|
{
|
||||||
Instance = JSON.Load<Config>(JSON.ConfigPath);
|
Instance = JSON.Load<Config>(JSON.ConfigPath);
|
||||||
|
|
||||||
#if DEBUG
|
Logger.c.Log($"Config loaded");
|
||||||
Logger.c.Log($"Loaded Config:\n{JSON.Stringify(Instance)}");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Save()
|
public static void Save()
|
||||||
{
|
{
|
||||||
JSON.Save(JSON.ConfigPath, Instance);
|
JSON.Save(JSON.ConfigPath, Instance);
|
||||||
|
|
||||||
#if DEBUG
|
Logger.c.Log("Config saved");
|
||||||
Logger.c.Log("Saved Config");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
34
BLHX.Server.Common/Data/Data.cs
Normal file
34
BLHX.Server.Common/Data/Data.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
using BLHX.Server.Common.Utils;
|
||||||
|
|
||||||
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
|
public static class Data
|
||||||
|
{
|
||||||
|
static readonly Logger c = new(nameof(Data), ConsoleColor.Yellow);
|
||||||
|
|
||||||
|
public static Dictionary<int, ChapterTemplate> ChapterTemplate;
|
||||||
|
public static Dictionary<int, ShipDataStatistics> ShipDataStatistics;
|
||||||
|
public static Dictionary<int, TaskDateTemplate> TaskDataTemplate;
|
||||||
|
|
||||||
|
public static void Load()
|
||||||
|
{
|
||||||
|
LoadData(ref ChapterTemplate, "chapter_template.json", nameof(ChapterTemplate));
|
||||||
|
LoadData(ref ShipDataStatistics, "ship_data_statistics.json", nameof(ShipDataStatistics));
|
||||||
|
LoadData(ref TaskDataTemplate, "task_data_template.json", nameof(TaskDataTemplate));
|
||||||
|
|
||||||
|
c.Log("All data tables loaded");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LoadData<T>(ref Dictionary<int, T> data, string fileName, string dataName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = JSON.Load<Dictionary<int, T>>(Path.Combine(JSON.ShareConfigPath, fileName));
|
||||||
|
c.Warn($"Loaded {data.Count} {dataName}");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
c.Error(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace BLHX.Server.Common.Utils;
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
public static class JSON
|
public static class JSON
|
||||||
{
|
{
|
||||||
public static string ConfigPath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json");
|
public static string ConfigPath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json");
|
||||||
|
public static string ShareConfigPath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\sharecfgdata\\");
|
||||||
|
|
||||||
public static T Load<T>(string path) where T : new()
|
public static T Load<T>(string path, bool create = true) where T : new()
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path) && create)
|
||||||
{
|
{
|
||||||
T obj = new T();
|
T obj = new T();
|
||||||
Save(path, obj);
|
Save(path, obj);
|
||||||
5
BLHX.Server.Common/Data/Model.cs
Normal file
5
BLHX.Server.Common/Data/Model.cs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
|
public abstract class Model
|
||||||
|
{
|
||||||
|
}
|
||||||
205
BLHX.Server.Common/Data/Model/ChapterTemplate.cs
Normal file
205
BLHX.Server.Common/Data/Model/ChapterTemplate.cs
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
|
public class ChapterTemplate : Model
|
||||||
|
{
|
||||||
|
[JsonPropertyName("ItemTransformPattern")]
|
||||||
|
public object ItemTransformPattern { get; set; }
|
||||||
|
[JsonPropertyName("act_id")]
|
||||||
|
public int ActId { get; set; }
|
||||||
|
[JsonPropertyName("ai_expedition_list")]
|
||||||
|
public int[] AiExpeditionList { get; set; }
|
||||||
|
[JsonPropertyName("ai_refresh")]
|
||||||
|
public int[] AiRefresh { get; set; }
|
||||||
|
[JsonPropertyName("air_dominance")]
|
||||||
|
public int AirDominance { get; set; }
|
||||||
|
[JsonPropertyName("alarm_cell")]
|
||||||
|
public object AlarmCell { get; set; }
|
||||||
|
[JsonPropertyName("ambush_event_ratio")]
|
||||||
|
public object AmbushEventRatio { get; set; }
|
||||||
|
[JsonPropertyName("ambush_expedition_list")]
|
||||||
|
public int[] AmbushExpeditionList { get; set; }
|
||||||
|
[JsonPropertyName("ambush_ratio_extra")]
|
||||||
|
public int[][] AmbushRatioExtra { get; set; }
|
||||||
|
[JsonPropertyName("ammo_submarine")]
|
||||||
|
public int AmmoSubmarine { get; set; }
|
||||||
|
[JsonPropertyName("ammo_total")]
|
||||||
|
public int AmmoTotal { get; set; }
|
||||||
|
[JsonPropertyName("avoid_ratio")]
|
||||||
|
public int AvoidRatio { get; set; }
|
||||||
|
[JsonPropertyName("avoid_require")]
|
||||||
|
public int AvoidRequire { get; set; }
|
||||||
|
[JsonPropertyName("awards")]
|
||||||
|
public int[][] Awards { get; set; }
|
||||||
|
[JsonPropertyName("best_air_dominance")]
|
||||||
|
public int BestAirDominance { get; set; }
|
||||||
|
[JsonPropertyName("bg")]
|
||||||
|
public string Background { get; set; }
|
||||||
|
[JsonPropertyName("bgm")]
|
||||||
|
public string BackgroundMusic { get; set; }
|
||||||
|
[JsonPropertyName("boss_expedition_id")]
|
||||||
|
public int[] BossExpeditionId { get; set; }
|
||||||
|
[JsonPropertyName("boss_refresh")]
|
||||||
|
public int BossRefresh { get; set; }
|
||||||
|
[JsonPropertyName("box_list")]
|
||||||
|
public object BoxList { get; set; }
|
||||||
|
[JsonPropertyName("box_refresh")]
|
||||||
|
public int[] BoxRefresh { get; set; }
|
||||||
|
[JsonPropertyName("chapter_fx")]
|
||||||
|
public object ChapterFx { get; set; }
|
||||||
|
[JsonPropertyName("chapter_name")]
|
||||||
|
public string ChapterName { get; set; }
|
||||||
|
[JsonPropertyName("chapter_strategy")]
|
||||||
|
public object ChapterStrategy { get; set; }
|
||||||
|
[JsonPropertyName("chapter_tag")]
|
||||||
|
public int ChapterTag { get; set; }
|
||||||
|
[JsonPropertyName("collection_team")]
|
||||||
|
public int CollectionTeam { get; set; }
|
||||||
|
[JsonPropertyName("count")]
|
||||||
|
public int Count { get; set; }
|
||||||
|
[JsonPropertyName("defeat_story")]
|
||||||
|
public object DefeatStory { get; set; }
|
||||||
|
[JsonPropertyName("defeat_story_count")]
|
||||||
|
public object DefeatStoryCount { get; set; }
|
||||||
|
[JsonPropertyName("difficulty")]
|
||||||
|
public int Difficulty { get; set; }
|
||||||
|
[JsonPropertyName("elite_expedition_list")]
|
||||||
|
public int[] EliteExpeditionList { get; set; }
|
||||||
|
[JsonPropertyName("elite_refresh")]
|
||||||
|
public int[] EliteRefresh { get; set; }
|
||||||
|
[JsonPropertyName("enemy_refresh")]
|
||||||
|
public int[] EnemyRefresh { get; set; }
|
||||||
|
[JsonPropertyName("enter_story")]
|
||||||
|
public string EnterStory { get; set; }
|
||||||
|
[JsonPropertyName("enter_story_limit")]
|
||||||
|
public string EnterStoryLimit { get; set; }
|
||||||
|
[JsonPropertyName("event_skip")]
|
||||||
|
public int EventSkip { get; set; }
|
||||||
|
[JsonPropertyName("expedition_id_weight_list")]
|
||||||
|
public int[][] ExpeditionIdWeightList { get; set; }
|
||||||
|
[JsonPropertyName("float_items")]
|
||||||
|
public object FloatItems { get; set; }
|
||||||
|
[JsonPropertyName("formation")]
|
||||||
|
public int Formation { get; set; }
|
||||||
|
[JsonPropertyName("friendly_id")]
|
||||||
|
public int FriendlyId { get; set; }
|
||||||
|
[JsonPropertyName("grids")]
|
||||||
|
public object[][] Grids { get; set; }
|
||||||
|
[JsonPropertyName("group_num")]
|
||||||
|
public int GroupNum { get; set; }
|
||||||
|
[JsonPropertyName("guarder_expedition_list")]
|
||||||
|
public int[] GuarderExpeditionList { get; set; }
|
||||||
|
[JsonPropertyName("icon")]
|
||||||
|
public string[] Icon { get; set; }
|
||||||
|
[JsonPropertyName("icon_outline")]
|
||||||
|
public int IconOutline { get; set; }
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
[JsonPropertyName("investigation_ratio")]
|
||||||
|
public int InvestigationRatio { get; set; }
|
||||||
|
[JsonPropertyName("is_ai")]
|
||||||
|
public int IsAi { get; set; }
|
||||||
|
[JsonPropertyName("is_air_attack")]
|
||||||
|
public int IsAirAttack { get; set; }
|
||||||
|
[JsonPropertyName("is_ambush")]
|
||||||
|
public int IsAmbush { get; set; }
|
||||||
|
[JsonPropertyName("is_limit_move")]
|
||||||
|
public int IsLimitMove { get; set; }
|
||||||
|
[JsonPropertyName("land_based")]
|
||||||
|
public object LandBased { get; set; }
|
||||||
|
[JsonPropertyName("levelstage_bar")]
|
||||||
|
public string LevelStageBar { get; set; }
|
||||||
|
[JsonPropertyName("limitation")]
|
||||||
|
public object Limitation { get; set; }
|
||||||
|
[JsonPropertyName("lose_condition")]
|
||||||
|
public int[][] LoseCondition { get; set; }
|
||||||
|
[JsonPropertyName("lose_condition_display")]
|
||||||
|
public string LoseConditionDisplay { get; set; }
|
||||||
|
[JsonPropertyName("map")]
|
||||||
|
public int Map { get; set; }
|
||||||
|
[JsonPropertyName("mitigation_level")]
|
||||||
|
public int MitigationLevel { get; set; }
|
||||||
|
[JsonPropertyName("mitigation_rate")]
|
||||||
|
public int MitigationRate { get; set; }
|
||||||
|
[JsonPropertyName("model")]
|
||||||
|
public int Model { get; set; }
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
[JsonPropertyName("npc_data")]
|
||||||
|
public object NpcData { get; set; }
|
||||||
|
[JsonPropertyName("num_1")]
|
||||||
|
public int Num1 { get; set; }
|
||||||
|
[JsonPropertyName("num_2")]
|
||||||
|
public int Num2 { get; set; }
|
||||||
|
[JsonPropertyName("num_3")]
|
||||||
|
public int Num3 { get; set; }
|
||||||
|
[JsonPropertyName("oil")]
|
||||||
|
public int Oil { get; set; }
|
||||||
|
[JsonPropertyName("patrolai_expedition_list")]
|
||||||
|
public int[] PatrolAiExpeditionList { get; set; }
|
||||||
|
[JsonPropertyName("patrolai_refresh")]
|
||||||
|
public int[] PatrolAiRefresh { get; set; }
|
||||||
|
[JsonPropertyName("pop_pic")]
|
||||||
|
public string PopPic { get; set; }
|
||||||
|
[JsonPropertyName("pos_x")]
|
||||||
|
public string PosX { get; set; }
|
||||||
|
[JsonPropertyName("pos_y")]
|
||||||
|
public string PosY { get; set; }
|
||||||
|
[JsonPropertyName("pre_chapter")]
|
||||||
|
public int PreChapter { get; set; }
|
||||||
|
[JsonPropertyName("pre_story")]
|
||||||
|
public int PreStory { get; set; }
|
||||||
|
[JsonPropertyName("profiles")]
|
||||||
|
public string Profiles { get; set; }
|
||||||
|
[JsonPropertyName("progress_boss")]
|
||||||
|
public int ProgressBoss { get; set; }
|
||||||
|
[JsonPropertyName("property_limitation")]
|
||||||
|
public object PropertyLimitation { get; set; }
|
||||||
|
[JsonPropertyName("random_box_list")]
|
||||||
|
public int[] RandomBoxList { get; set; }
|
||||||
|
[JsonPropertyName("risk_levels")]
|
||||||
|
public int[][] RiskLevels { get; set; }
|
||||||
|
[JsonPropertyName("scale")]
|
||||||
|
public double[] Scale { get; set; }
|
||||||
|
[JsonPropertyName("special_operation_list")]
|
||||||
|
public string SpecialOperationList { get; set; }
|
||||||
|
[JsonPropertyName("star_require_1")]
|
||||||
|
public int StarRequire1 { get; set; }
|
||||||
|
[JsonPropertyName("star_require_2")]
|
||||||
|
public int StarRequire2 { get; set; }
|
||||||
|
[JsonPropertyName("star_require_3")]
|
||||||
|
public int StarRequire3 { get; set; }
|
||||||
|
[JsonPropertyName("story_refresh")]
|
||||||
|
public object StoryRefresh { get; set; }
|
||||||
|
[JsonPropertyName("story_refresh_boss")]
|
||||||
|
public string StoryRefreshBoss { get; set; }
|
||||||
|
[JsonPropertyName("submarine_expedition_list")]
|
||||||
|
public int[] SubmarineExpeditionList { get; set; }
|
||||||
|
[JsonPropertyName("submarine_num")]
|
||||||
|
public int SubmarineNum { get; set; }
|
||||||
|
[JsonPropertyName("submarine_refresh")]
|
||||||
|
public int[] SubmarineRefresh { get; set; }
|
||||||
|
[JsonPropertyName("support_group_num")]
|
||||||
|
public int SupportGroupNum { get; set; }
|
||||||
|
[JsonPropertyName("theme")]
|
||||||
|
public object Theme { get; set; }
|
||||||
|
[JsonPropertyName("time")]
|
||||||
|
public int Time { get; set; }
|
||||||
|
[JsonPropertyName("type")]
|
||||||
|
public int Type { get; set; }
|
||||||
|
[JsonPropertyName("uifx")]
|
||||||
|
public string UiFx { get; set; }
|
||||||
|
[JsonPropertyName("unlocklevel")]
|
||||||
|
public int UnlockLevel { get; set; }
|
||||||
|
[JsonPropertyName("use_oil_limit")]
|
||||||
|
public object UseOilLimit { get; set; }
|
||||||
|
[JsonPropertyName("wall_prefab")]
|
||||||
|
public object WallPrefab { get; set; }
|
||||||
|
[JsonPropertyName("weather_grids")]
|
||||||
|
public object WeatherGrids { get; set; }
|
||||||
|
[JsonPropertyName("win_condition")]
|
||||||
|
public object WinCondition { get; set; }
|
||||||
|
[JsonPropertyName("win_condition_display")]
|
||||||
|
public string WinConditionDisplay { get; set; }
|
||||||
|
}
|
||||||
85
BLHX.Server.Common/Data/Model/ShipDataStatistics.cs
Normal file
85
BLHX.Server.Common/Data/Model/ShipDataStatistics.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
|
public class ShipDataStatistics : Model
|
||||||
|
{
|
||||||
|
[JsonPropertyName("aim_offset")]
|
||||||
|
public int[] AimOffset { get; set; }
|
||||||
|
[JsonPropertyName("ammo")]
|
||||||
|
public int Ammo { get; set; }
|
||||||
|
[JsonPropertyName("armor_type")]
|
||||||
|
public int ArmorType { get; set; }
|
||||||
|
[JsonPropertyName("attack_duration")]
|
||||||
|
public int AttackDuration { get; set; }
|
||||||
|
[JsonPropertyName("attrs")]
|
||||||
|
public float[] Attrs { get; set; }
|
||||||
|
[JsonPropertyName("attrs_growth")]
|
||||||
|
public float[] AttrsGrowth { get; set; }
|
||||||
|
[JsonPropertyName("attrs_growth_extra")]
|
||||||
|
public float[] AttrsGrowthExtra { get; set; }
|
||||||
|
[JsonPropertyName("backyard_speed")]
|
||||||
|
public string BackyardSpeed { get; set; }
|
||||||
|
[JsonPropertyName("base_list")]
|
||||||
|
public int[] BaseList { get; set; }
|
||||||
|
[JsonPropertyName("cld_box")]
|
||||||
|
public int[] CldBox { get; set; }
|
||||||
|
[JsonPropertyName("cld_offset")]
|
||||||
|
public int[] CldOffset { get; set; }
|
||||||
|
[JsonPropertyName("default_equip_list")]
|
||||||
|
public int[] DefaultEquipList { get; set; }
|
||||||
|
[JsonPropertyName("depth_charge_list")]
|
||||||
|
public int[] DepthChargeList { get; set; }
|
||||||
|
[JsonPropertyName("english_name")]
|
||||||
|
public string EnglishName { get; set; }
|
||||||
|
[JsonPropertyName("equipment_proficiency")]
|
||||||
|
public float[] EquipmentProficiency { get; set; }
|
||||||
|
[JsonPropertyName("fix_equip_list")]
|
||||||
|
public int[] FixEquipList { get; set; }
|
||||||
|
[JsonPropertyName("hunting_range")]
|
||||||
|
public object HuntingRange { get; set; }
|
||||||
|
[JsonPropertyName("huntingrange_level")]
|
||||||
|
public int HuntingRangeLevel { get; set; }
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
[JsonPropertyName("lock")]
|
||||||
|
public string[] Lock { get; set; }
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
[JsonPropertyName("nationality")]
|
||||||
|
public int Nationality { get; set; }
|
||||||
|
[JsonPropertyName("oxy_cost")]
|
||||||
|
public int OxyCost { get; set; }
|
||||||
|
[JsonPropertyName("oxy_max")]
|
||||||
|
public int OxyMax { get; set; }
|
||||||
|
[JsonPropertyName("oxy_recovery")]
|
||||||
|
public int OxyRecovery { get; set; }
|
||||||
|
[JsonPropertyName("oxy_recovery_bench")]
|
||||||
|
public int OxyRecoveryBench { get; set; }
|
||||||
|
[JsonPropertyName("oxy_recovery_surface")]
|
||||||
|
public int OxyRecoverySurface { get; set; }
|
||||||
|
[JsonPropertyName("parallel_max")]
|
||||||
|
public int[] ParallelMax { get; set; }
|
||||||
|
[JsonPropertyName("position_offset")]
|
||||||
|
public int[] PositionOffset { get; set; }
|
||||||
|
[JsonPropertyName("preload_count")]
|
||||||
|
public int[] PreloadCount { get; set; }
|
||||||
|
[JsonPropertyName("raid_distance")]
|
||||||
|
public int RaidDistance { get; set; }
|
||||||
|
[JsonPropertyName("rarity")]
|
||||||
|
public int Rarity { get; set; }
|
||||||
|
[JsonPropertyName("scale")]
|
||||||
|
public int Scale { get; set; }
|
||||||
|
[JsonPropertyName("skin_id")]
|
||||||
|
public int SkinId { get; set; }
|
||||||
|
[JsonPropertyName("star")]
|
||||||
|
public int Star { get; set; }
|
||||||
|
[JsonPropertyName("strategy_list")]
|
||||||
|
public int[][] StrategyList { get; set; }
|
||||||
|
[JsonPropertyName("summon_offset")]
|
||||||
|
public int SummonOffset { get; set; }
|
||||||
|
[JsonPropertyName("tag_list")]
|
||||||
|
public string[] TagList { get; set; }
|
||||||
|
[JsonPropertyName("type")]
|
||||||
|
public int Type { get; set; }
|
||||||
|
}
|
||||||
69
BLHX.Server.Common/Data/Model/TaskDateTemplate.cs
Normal file
69
BLHX.Server.Common/Data/Model/TaskDateTemplate.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace BLHX.Server.Common.Data;
|
||||||
|
|
||||||
|
public class TaskDateTemplate : Model
|
||||||
|
{
|
||||||
|
[JsonPropertyName("activity_client_config")]
|
||||||
|
public object ActivityClientConfig { get; set; }
|
||||||
|
[JsonPropertyName("added_tip")]
|
||||||
|
public int AddedTip { get; set; }
|
||||||
|
[JsonPropertyName("auto_commit")]
|
||||||
|
public int AutoCommit { get; set; }
|
||||||
|
[JsonPropertyName("award")]
|
||||||
|
public int Award { get; set; }
|
||||||
|
[JsonPropertyName("award_choice")]
|
||||||
|
public object AwardChoice { get; set; }
|
||||||
|
[JsonPropertyName("award_display")]
|
||||||
|
public object AwardDisplay { get; set; }
|
||||||
|
[JsonPropertyName("count_inherit")]
|
||||||
|
public int CountInherit { get; set; }
|
||||||
|
[JsonPropertyName("desc")]
|
||||||
|
public string Description { get; set; }
|
||||||
|
[JsonPropertyName("fix_task")]
|
||||||
|
public int FixTask { get; set; }
|
||||||
|
[JsonPropertyName("guild_coin_award")]
|
||||||
|
public int GuildCoinAward { get; set; }
|
||||||
|
[JsonPropertyName("id")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
[JsonPropertyName("is_head")]
|
||||||
|
public int IsHead { get; set; }
|
||||||
|
[JsonPropertyName("level")]
|
||||||
|
public int Level { get; set; }
|
||||||
|
[JsonPropertyName("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
[JsonPropertyName("next_task")]
|
||||||
|
public string NextTask { get; set; }
|
||||||
|
[JsonPropertyName("open_need")]
|
||||||
|
public object OpenNeed { get; set; }
|
||||||
|
[JsonPropertyName("priority_type")]
|
||||||
|
public int PriorityType { get; set; }
|
||||||
|
[JsonPropertyName("quick_finish")]
|
||||||
|
public int QuickFinish { get; set; }
|
||||||
|
[JsonPropertyName("ryza_icon")]
|
||||||
|
public string RyzaIcon { get; set; }
|
||||||
|
[JsonPropertyName("ryza_type")]
|
||||||
|
public int RyzaType { get; set; }
|
||||||
|
[JsonPropertyName("scene")]
|
||||||
|
public object Scene { get; set; }
|
||||||
|
[JsonPropertyName("story_icon")]
|
||||||
|
public string StoryIcon { get; set; }
|
||||||
|
[JsonPropertyName("story_icon_shift")]
|
||||||
|
public object StoryIconShift { get; set; }
|
||||||
|
[JsonPropertyName("story_id")]
|
||||||
|
public string StoryId { get; set; }
|
||||||
|
[JsonPropertyName("sub_type")]
|
||||||
|
public int SubType { get; set; }
|
||||||
|
[JsonPropertyName("target_id")]
|
||||||
|
public object TargetId { get; set; }
|
||||||
|
[JsonPropertyName("target_id_2")]
|
||||||
|
public object TargetId2 { get; set; }
|
||||||
|
[JsonPropertyName("target_num")]
|
||||||
|
public int TargetNum { get; set; }
|
||||||
|
[JsonPropertyName("task_fold")]
|
||||||
|
public int TaskFold { get; set; }
|
||||||
|
[JsonPropertyName("type")]
|
||||||
|
public int Type { get; set; }
|
||||||
|
[JsonPropertyName("visibility")]
|
||||||
|
public int Visibility { get; set; }
|
||||||
|
}
|
||||||
774515
BLHX.Server.Common/Resources/sharecfgdata/chapter_template.json
Normal file
774515
BLHX.Server.Common/Resources/sharecfgdata/chapter_template.json
Normal file
File diff suppressed because it is too large
Load Diff
398697
BLHX.Server.Common/Resources/sharecfgdata/ship_data_statistics.json
Normal file
398697
BLHX.Server.Common/Resources/sharecfgdata/ship_data_statistics.json
Normal file
File diff suppressed because it is too large
Load Diff
218638
BLHX.Server.Common/Resources/sharecfgdata/task_data_template.json
Normal file
218638
BLHX.Server.Common/Resources/sharecfgdata/task_data_template.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
using BLHX.Server.Common.Utils;
|
using BLHX.Server.Common.Data;
|
||||||
|
using BLHX.Server.Common.Utils;
|
||||||
|
|
||||||
namespace BLHX.Server.Game.Commands;
|
namespace BLHX.Server.Game.Commands;
|
||||||
|
|
||||||
@@ -10,11 +11,14 @@ public class TestCommand : Command
|
|||||||
[Argument("type")]
|
[Argument("type")]
|
||||||
public string? Type { get; set; }
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
[Argument("verbose")]
|
||||||
|
public string? Verbose { get; set; }
|
||||||
|
|
||||||
[Argument("count")]
|
[Argument("count")]
|
||||||
public string? Count { get; set; }
|
public string? Count { get; set; }
|
||||||
|
|
||||||
[Argument("verbose")]
|
[Argument("value")]
|
||||||
public string? Verbose { get; set; }
|
public string? Value { get; set; }
|
||||||
|
|
||||||
public override void Execute(Dictionary<string, string> args)
|
public override void Execute(Dictionary<string, string> args)
|
||||||
{
|
{
|
||||||
@@ -25,6 +29,9 @@ public class TestCommand : Command
|
|||||||
case "gacha":
|
case "gacha":
|
||||||
TestGacha(Parse(Count, 1000000), Parse(Verbose, false));
|
TestGacha(Parse(Count, 1000000), Parse(Verbose, false));
|
||||||
break;
|
break;
|
||||||
|
case "lookup":
|
||||||
|
LookupShip(Parse(Value, 1));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Logger.c.Warn("Unknown test type");
|
Logger.c.Warn("Unknown test type");
|
||||||
break;
|
break;
|
||||||
@@ -59,4 +66,14 @@ public class TestCommand : Command
|
|||||||
Logger.c.Log($"{RarityStrings[i]}: {counts[i]} ({percentage}%)");
|
Logger.c.Log($"{RarityStrings[i]}: {counts[i]} ({percentage}%)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LookupShip(int id)
|
||||||
|
{
|
||||||
|
ShipDataStatistics? ship = Data.ShipDataStatistics.GetValueOrDefault(id);
|
||||||
|
|
||||||
|
if (ship != null)
|
||||||
|
Logger.c.Log($"Ship {id} ({ship.EnglishName}):\n{JSON.Stringify(ship)}");
|
||||||
|
else
|
||||||
|
Logger.c.Warn($"Ship {id} not found");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
using BLHX.Server.Common.Data;
|
||||||
using BLHX.Server.Common.Utils;
|
using BLHX.Server.Common.Utils;
|
||||||
|
|
||||||
namespace BLHX.Server.Game
|
namespace BLHX.Server.Game
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using BLHX.Server.Common.Proto.p10;
|
using BLHX.Server.Common.Proto.p10;
|
||||||
using BLHX.Server.Common.Database;
|
using BLHX.Server.Common.Database;
|
||||||
using BLHX.Server.Common.Proto;
|
using BLHX.Server.Common.Proto;
|
||||||
using BLHX.Server.Common.Utils;
|
using BLHX.Server.Common.Data;
|
||||||
|
|
||||||
namespace BLHX.Server.Game.Handlers
|
namespace BLHX.Server.Game.Handlers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace BLHX.Server.Sdk
|
|||||||
}
|
}
|
||||||
|
|
||||||
runTask = app.RunAsync();
|
runTask = app.RunAsync();
|
||||||
c.Log($"{nameof(SDKServer)} started in port {string.Join(", ", app.Urls.Select(x => x.Split(':').Last()))}!");
|
c.Log($"{nameof(SDKServer)} started on port {string.Join(", ", app.Urls.Select(x => x.Split(':').Last()))}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private class RequestLoggingMiddleware(RequestDelegate next)
|
private class RequestLoggingMiddleware(RequestDelegate next)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using BLHX.Server.Common.Utils;
|
using BLHX.Server.Common.Data;
|
||||||
|
using BLHX.Server.Common.Utils;
|
||||||
using BLHX.Server.Game;
|
using BLHX.Server.Game;
|
||||||
using BLHX.Server.Sdk;
|
using BLHX.Server.Sdk;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
@@ -18,6 +19,8 @@ internal class Program
|
|||||||
Config.Save();
|
Config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Data.Load();
|
||||||
|
|
||||||
Task.Run(GameServer.Start);
|
Task.Run(GameServer.Start);
|
||||||
SDKServer.Main(args);
|
SDKServer.Main(args);
|
||||||
Task.Run(InputSystem.Start).Wait();
|
Task.Run(InputSystem.Start).Wait();
|
||||||
|
|||||||
Reference in New Issue
Block a user