From 3f0f845bfd21b948f141fac97d3d97f2445aeb7b Mon Sep 17 00:00:00 2001 From: CWX Date: Sun, 5 Jan 2025 20:55:50 +0000 Subject: [PATCH] Converted Quests, Ragfair, Repeatable, Server to C# interface --- .../Spt/Quests/GetRepeatableByIdResult.cs | 12 ++ .../Models/Spt/Ragfair/RagfairServerPrices.cs | 12 ++ Core/Models/Spt/Ragfair/TplWithFleaPrice.cs | 13 ++ .../Spt/Repeatable/QuestRewardValues.cs | 27 ++++ Core/Models/Spt/Repeatable/QuestTypePool.cs | 79 ++++++++++ Core/Models/Spt/Server/ExhaustableArray.cs | 45 ++++++ Core/Models/Spt/Server/LocaleBase.cs | 19 +++ Core/Models/Spt/Server/Locations.cs | 64 ++++++++ Core/Models/Spt/Server/ServerBase.cs | 12 ++ Core/Models/Spt/Server/SettingsBase.cs | 147 ++++++++++++++++++ 10 files changed, 430 insertions(+) create mode 100644 Core/Models/Spt/Quests/GetRepeatableByIdResult.cs create mode 100644 Core/Models/Spt/Ragfair/RagfairServerPrices.cs create mode 100644 Core/Models/Spt/Ragfair/TplWithFleaPrice.cs create mode 100644 Core/Models/Spt/Repeatable/QuestRewardValues.cs create mode 100644 Core/Models/Spt/Repeatable/QuestTypePool.cs create mode 100644 Core/Models/Spt/Server/ExhaustableArray.cs create mode 100644 Core/Models/Spt/Server/LocaleBase.cs create mode 100644 Core/Models/Spt/Server/Locations.cs create mode 100644 Core/Models/Spt/Server/ServerBase.cs create mode 100644 Core/Models/Spt/Server/SettingsBase.cs diff --git a/Core/Models/Spt/Quests/GetRepeatableByIdResult.cs b/Core/Models/Spt/Quests/GetRepeatableByIdResult.cs new file mode 100644 index 00000000..c1abfe7d --- /dev/null +++ b/Core/Models/Spt/Quests/GetRepeatableByIdResult.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Quests; + +public class GetRepeatableByIdResult +{ + [JsonPropertyName("quest")] + public RepeatableQuest Quest { get; set; } + + [JsonPropertyName("repeatableType")] + public PmcDataRepeatableQuest RepeatableType { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Ragfair/RagfairServerPrices.cs b/Core/Models/Spt/Ragfair/RagfairServerPrices.cs new file mode 100644 index 00000000..c95c0236 --- /dev/null +++ b/Core/Models/Spt/Ragfair/RagfairServerPrices.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Ragfair; + +public class RagfairServerPrices +{ + [JsonPropertyName("static")] + public Dictionary Static { get; set; } + + [JsonPropertyName("dynamic")] + public Dictionary Dynamic { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Ragfair/TplWithFleaPrice.cs b/Core/Models/Spt/Ragfair/TplWithFleaPrice.cs new file mode 100644 index 00000000..a9181ade --- /dev/null +++ b/Core/Models/Spt/Ragfair/TplWithFleaPrice.cs @@ -0,0 +1,13 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Ragfair; + +public class TplWithFleaPrice +{ + [JsonPropertyName("tpl")] + public string Tpl { get; set; } + + // Roubles + [JsonPropertyName("price")] + public decimal Price { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Repeatable/QuestRewardValues.cs b/Core/Models/Spt/Repeatable/QuestRewardValues.cs new file mode 100644 index 00000000..89963dd6 --- /dev/null +++ b/Core/Models/Spt/Repeatable/QuestRewardValues.cs @@ -0,0 +1,27 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Repeatable; + +public class QuestRewardValues +{ + [JsonPropertyName("skillPointReward")] + public int SkillPointReward { get; set; } + + [JsonPropertyName("skillRewardChance")] + public int SkillRewardChance { get; set; } + + [JsonPropertyName("rewardReputation")] + public int RewardReputation { get; set; } + + [JsonPropertyName("rewardNumItems")] + public int RewardNumItems { get; set; } + + [JsonPropertyName("rewardRoubles")] + public int RewardRoubles { get; set; } + + [JsonPropertyName("gpCoinRewardCount")] + public int GpCoinRewardCount { get; set; } + + [JsonPropertyName("rewardXP")] + public int RewardXP { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Repeatable/QuestTypePool.cs b/Core/Models/Spt/Repeatable/QuestTypePool.cs new file mode 100644 index 00000000..ad73a0d7 --- /dev/null +++ b/Core/Models/Spt/Repeatable/QuestTypePool.cs @@ -0,0 +1,79 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Repeatable; + +public class QuestTypePool +{ + [JsonPropertyName("types")] + public List Types { get; set; } + + [JsonPropertyName("pool")] + public QuestPool Pool { get; set; } +} + +public class QuestPool +{ + [JsonPropertyName("Exploration")] + public ExplorationPool Exploration { get; set; } + + [JsonPropertyName("Elimination")] + public EliminationPool Elimination { get; set; } + + [JsonPropertyName("Pickup")] + public ExplorationPool Pickup { get; set; } +} + +public class ExplorationPool +{ + [JsonPropertyName("locations")] + public Dictionary> Locations { get; set; } +} + +public class EliminationPool +{ + [JsonPropertyName("targets")] + public EliminationTargetPool Targets { get; set; } +} + +public class EliminationTargetPool +{ + [JsonPropertyName("Savage")] + public TargetLocation Savage { get; set; } + + [JsonPropertyName("AnyPmc")] + public TargetLocation AnyPmc { get; set; } + + [JsonPropertyName("bossBully")] + public TargetLocation BossBully { get; set; } + + [JsonPropertyName("bossGluhar")] + public TargetLocation BossGluhar { get; set; } + + [JsonPropertyName("bossKilla")] + public TargetLocation BossKilla { get; set; } + + [JsonPropertyName("bossSanitar")] + public TargetLocation BossSanitar { get; set; } + + [JsonPropertyName("bossTagilla")] + public TargetLocation BossTagilla { get; set; } + + [JsonPropertyName("bossKnight")] + public TargetLocation BossKnight { get; set; } + + [JsonPropertyName("bossZryachiy")] + public TargetLocation BossZryachiy { get; set; } + + [JsonPropertyName("bossBoar")] + public TargetLocation BossBoar { get; set; } + + [JsonPropertyName("bossBoarSniper")] + public TargetLocation BossBoarSniper { get; set; } +} + +public class TargetLocation +{ + [JsonPropertyName("locations")] + public List Locations { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Server/ExhaustableArray.cs b/Core/Models/Spt/Server/ExhaustableArray.cs new file mode 100644 index 00000000..2ed7bcb9 --- /dev/null +++ b/Core/Models/Spt/Server/ExhaustableArray.cs @@ -0,0 +1,45 @@ +// using System.Collections.Generic; +// +// namespace Types.Models.Spt.Server; +// +// public class ExhaustableArray +// { +// private List pool; +// +// public ExhaustableArray(List itemPool, RandomUtil randomUtil, ICloner cloner) +// { +// this.pool = cloner.Clone(itemPool); +// } +// +// public T GetRandomValue() +// { +// if (pool == null || pool.Count == 0) +// { +// return default; +// } +// +// int index = randomUtil.GetInt(0, pool.Count - 1); +// T toReturn = cloner.Clone(pool[index]); +// pool.RemoveAt(index); +// return toReturn; +// } +// +// public T GetFirstValue() +// { +// if (pool == null || pool.Count == 0) +// { +// return default; +// } +// +// T toReturn = cloner.Clone(pool[0]); +// pool.RemoveAt(0); +// return toReturn; +// } +// +// public bool HasValues() +// { +// return pool != null && pool.Count > 0; +// } +// } + +// TODO: Convert this to C# properly \ No newline at end of file diff --git a/Core/Models/Spt/Server/LocaleBase.cs b/Core/Models/Spt/Server/LocaleBase.cs new file mode 100644 index 00000000..37feec9e --- /dev/null +++ b/Core/Models/Spt/Server/LocaleBase.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; +using System.Collections.Generic; + +namespace Types.Models.Spt.Server; + +public class LocaleBase +{ + [JsonPropertyName("global")] + public Dictionary> Global { get; set; } + + [JsonPropertyName("menu")] + public Dictionary Menu { get; set; } + + [JsonPropertyName("languages")] + public Dictionary Languages { get; set; } + + [JsonPropertyName("server")] + public Dictionary> Server { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Server/Locations.cs b/Core/Models/Spt/Server/Locations.cs new file mode 100644 index 00000000..89d7f8b7 --- /dev/null +++ b/Core/Models/Spt/Server/Locations.cs @@ -0,0 +1,64 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Server; + +public class Locations +{ + [JsonPropertyName("bigmap")] + public Location? Bigmap { get; set; } + + [JsonPropertyName("develop")] + public Location? Develop { get; set; } + + [JsonPropertyName("factory4_day")] + public Location? Factory4Day { get; set; } + + [JsonPropertyName("factory4_night")] + public Location? Factory4Night { get; set; } + + [JsonPropertyName("hideout")] + public Location? Hideout { get; set; } + + [JsonPropertyName("interchange")] + public Location? Interchange { get; set; } + + [JsonPropertyName("laboratory")] + public Location? Laboratory { get; set; } + + [JsonPropertyName("lighthouse")] + public Location? Lighthouse { get; set; } + + [JsonPropertyName("privatearea")] + public Location? PrivateArea { get; set; } + + [JsonPropertyName("rezervbase")] + public Location? RezervBase { get; set; } + + [JsonPropertyName("shoreline")] + public Location? Shoreline { get; set; } + + [JsonPropertyName("suburbs")] + public Location? Suburbs { get; set; } + + [JsonPropertyName("tarkovstreets")] + public Location? TarkovStreets { get; set; } + + [JsonPropertyName("terminal")] + public Location? Terminal { get; set; } + + [JsonPropertyName("town")] + public Location? Town { get; set; } + + [JsonPropertyName("woods")] + public Location? Woods { get; set; } + + [JsonPropertyName("sandbox")] + public Location? Sandbox { get; set; } + + [JsonPropertyName("sandbox_high")] + public Location? SandboxHigh { get; set; } + + /** Holds a mapping of the linkages between locations on the UI */ + [JsonPropertyName("base")] + public LocationsBase? Base { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Server/ServerBase.cs b/Core/Models/Spt/Server/ServerBase.cs new file mode 100644 index 00000000..3e12c4ad --- /dev/null +++ b/Core/Models/Spt/Server/ServerBase.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Server; + +public class ServerBase +{ + [JsonPropertyName("ip")] + public string Ip { get; set; } + + [JsonPropertyName("port")] + public int Port { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Server/SettingsBase.cs b/Core/Models/Spt/Server/SettingsBase.cs new file mode 100644 index 00000000..a41cc5cd --- /dev/null +++ b/Core/Models/Spt/Server/SettingsBase.cs @@ -0,0 +1,147 @@ +using System.Text.Json.Serialization; + +namespace Types.Models.Spt.Server; + +public class SettingsBase +{ + [JsonPropertyName("config")] + public Config Configuration { get; set; } +} + +public class Config +{ + [JsonPropertyName("AFKTimeoutSeconds")] + public int AFKTimeoutSeconds { get; set; } + + [JsonPropertyName("AdditionalRandomDelaySeconds")] + public int AdditionalRandomDelaySeconds { get; set; } + + [JsonPropertyName("ClientSendRateLimit")] + public int ClientSendRateLimit { get; set; } + + [JsonPropertyName("CriticalRetriesCount")] + public int CriticalRetriesCount { get; set; } + + [JsonPropertyName("DefaultRetriesCount")] + public int DefaultRetriesCount { get; set; } + + [JsonPropertyName("FirstCycleDelaySeconds")] + public int FirstCycleDelaySeconds { get; set; } + + [JsonPropertyName("FramerateLimit")] + public FramerateLimit FramerateLimit { get; set; } + + [JsonPropertyName("GroupStatusInterval")] + public int GroupStatusInterval { get; set; } + + [JsonPropertyName("GroupStatusButtonInterval")] + public int GroupStatusButtonInterval { get; set; } + + [JsonPropertyName("KeepAliveInterval")] + public int KeepAliveInterval { get; set; } + + [JsonPropertyName("LobbyKeepAliveInterval")] + public int LobbyKeepAliveInterval { get; set; } + + [JsonPropertyName("Mark502and504AsNonImportant")] + public bool Mark502and504AsNonImportant { get; set; } + + [JsonPropertyName("MemoryManagementSettings")] + public MemoryManagementSettings MemoryManagementSettings { get; set; } + + [JsonPropertyName("NVidiaHighlights")] + public bool NVidiaHighlights { get; set; } + + [JsonPropertyName("NextCycleDelaySeconds")] + public int NextCycleDelaySeconds { get; set; } + + [JsonPropertyName("PingServerResultSendInterval")] + public int PingServerResultSendInterval { get; set; } + + [JsonPropertyName("PingServersInterval")] + public int PingServersInterval { get; set; } + + [JsonPropertyName("ReleaseProfiler")] + public ReleaseProfiler ReleaseProfiler { get; set; } + + [JsonPropertyName("RequestConfirmationTimeouts")] + public List RequestConfirmationTimeouts { get; set; } + + [JsonPropertyName("RequestsMadeThroughLobby")] + public List RequestsMadeThroughLobby { get; set; } + + [JsonPropertyName("SecondCycleDelaySeconds")] + public int SecondCycleDelaySeconds { get; set; } + + [JsonPropertyName("ShouldEstablishLobbyConnection")] + public bool ShouldEstablishLobbyConnection { get; set; } + + [JsonPropertyName("TurnOffLogging")] + public bool TurnOffLogging { get; set; } + + [JsonPropertyName("WeaponOverlapDistanceCulling")] + public int WeaponOverlapDistanceCulling { get; set; } + + [JsonPropertyName("WebDiagnosticsEnabled")] + public bool WebDiagnosticsEnabled { get; set; } + + [JsonPropertyName("NetworkStateView")] + public NetworkStateView NetworkStateView { get; set; } + + [JsonPropertyName("WsReconnectionDelays")] + public List WsReconnectionDelays { get; set; } +} + +public class FramerateLimit +{ + [JsonPropertyName("MaxFramerateGameLimit")] + public int MaxFramerateGameLimit { get; set; } + + [JsonPropertyName("MaxFramerateLobbyLimit")] + public int MaxFramerateLobbyLimit { get; set; } + + [JsonPropertyName("MinFramerateLimit")] + public int MinFramerateLimit { get; set; } +} + +public class MemoryManagementSettings +{ + [JsonPropertyName("AggressiveGC")] + public bool AggressiveGC { get; set; } + + [JsonPropertyName("GigabytesRequiredToDisableGCDuringRaid")] + public int GigabytesRequiredToDisableGCDuringRaid { get; set; } + + [JsonPropertyName("HeapPreAllocationEnabled")] + public bool HeapPreAllocationEnabled { get; set; } + + [JsonPropertyName("HeapPreAllocationMB")] + public int HeapPreAllocationMB { get; set; } + + [JsonPropertyName("OverrideRamCleanerSettings")] + public bool OverrideRamCleanerSettings { get; set; } + + [JsonPropertyName("RamCleanerEnabled")] + public bool RamCleanerEnabled { get; set; } +} + +public class ReleaseProfiler +{ + [JsonPropertyName("Enabled")] + public bool Enabled { get; set; } + + [JsonPropertyName("MaxRecords")] + public int MaxRecords { get; set; } + + [JsonPropertyName("RecordTriggerValue")] + public int RecordTriggerValue { get; set; } +} + +public class NetworkStateView +{ + [JsonPropertyName("LossThreshold")] + public int LossThreshold { get; set; } + + [JsonPropertyName("RttThreshold")] + public int RttThreshold { get; set; } +} \ No newline at end of file