Merge pull request #1 from CWXDEV/main

Converted Quests, Ragfair, Repeatable, Server to C# interface
This commit is contained in:
clodanSPT
2025-01-05 21:59:11 +00:00
committed by GitHub
10 changed files with 430 additions and 0 deletions
@@ -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; }
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace Types.Models.Spt.Ragfair;
public class RagfairServerPrices
{
[JsonPropertyName("static")]
public Dictionary<string, int> Static { get; set; }
[JsonPropertyName("dynamic")]
public Dictionary<string, int> Dynamic { get; set; }
}
@@ -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; }
}
@@ -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; }
}
@@ -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<string> 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<ELocationName, List<string>> 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<string> Locations { get; set; }
}
@@ -0,0 +1,45 @@
// using System.Collections.Generic;
//
// namespace Types.Models.Spt.Server;
//
// public class ExhaustableArray<T>
// {
// private List<T> pool;
//
// public ExhaustableArray(List<T> 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
+19
View File
@@ -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<string, Dictionary<string, string>> Global { get; set; }
[JsonPropertyName("menu")]
public Dictionary<string, string> Menu { get; set; }
[JsonPropertyName("languages")]
public Dictionary<string, string> Languages { get; set; }
[JsonPropertyName("server")]
public Dictionary<string, Dictionary<string, string>> Server { get; set; }
}
+64
View File
@@ -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; }
}
+12
View File
@@ -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; }
}
+147
View File
@@ -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<int> RequestConfirmationTimeouts { get; set; }
[JsonPropertyName("RequestsMadeThroughLobby")]
public List<string> 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<string> 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; }
}