diff --git a/Core/Callbacks/AchievementCallbacks.cs b/Core/Callbacks/AchievementCallbacks.cs new file mode 100644 index 00000000..c55c9dc5 --- /dev/null +++ b/Core/Callbacks/AchievementCallbacks.cs @@ -0,0 +1,23 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.HttpResponse; +using Core.Models.Eft.Profile; + +namespace Core.Callbacks; + +public class AchievementCallbacks +{ + public AchievementCallbacks() + { + + } + + public GetBodyResponseData GetAchievements(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData Statistic(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Core/Callbacks/BotCallbacks.cs b/Core/Callbacks/BotCallbacks.cs index 4462ca7a..26cded72 100644 --- a/Core/Callbacks/BotCallbacks.cs +++ b/Core/Callbacks/BotCallbacks.cs @@ -1,4 +1,7 @@ -using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Bot; +using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.HttpResponse; namespace Core.Callbacks; @@ -14,6 +17,11 @@ public class BotCallbacks throw new NotImplementedException(); } + public Dictionary GetAllBotDifficulties(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + public GetBodyResponseData> GenerateBots(string url, GenerateBotsRequestData info, string sessionID) { throw new NotImplementedException(); @@ -23,4 +31,9 @@ public class BotCallbacks { throw new NotImplementedException(); } + + public string GetBotBehaviours() + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Callbacks/BuildsCallbacks.cs b/Core/Callbacks/BuildsCallbacks.cs new file mode 100644 index 00000000..611ed95e --- /dev/null +++ b/Core/Callbacks/BuildsCallbacks.cs @@ -0,0 +1,20 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.HttpResponse; +using Core.Models.Eft.Profile; + +namespace Core.Callbacks; + +public class BuildsCallbacks +{ + public BuildsCallbacks() + { + + } + + public GetBodyResponseData GetBuilds(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + +} \ No newline at end of file diff --git a/Core/Models/Eft/Bot/GenerateBotsRequestData.cs b/Core/Models/Eft/Bot/GenerateBotsRequestData.cs new file mode 100644 index 00000000..daee6fe9 --- /dev/null +++ b/Core/Models/Eft/Bot/GenerateBotsRequestData.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Bot; + +public class GenerateBotsRequestData +{ + [JsonPropertyName("conditions")] + public List Conditions { get; set; } +} + +public class Condition +{ + /// + /// e.g. assault/pmcBot/bossKilla + /// + [JsonPropertyName("Role")] + public string Role { get; set; } + + [JsonPropertyName("Limit")] + public int Limit { get; set; } + + [JsonPropertyName("Difficulty")] + public string Difficulty { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Common/EmptyRequestData.cs b/Core/Models/Eft/Common/EmptyRequestData.cs new file mode 100644 index 00000000..1aa37932 --- /dev/null +++ b/Core/Models/Eft/Common/EmptyRequestData.cs @@ -0,0 +1,6 @@ +namespace Core.Models.Eft.Common; + +public class EmptyRequestData +{ + +} \ No newline at end of file diff --git a/Core/Models/Eft/Common/Tables/BotBase.cs b/Core/Models/Eft/Common/Tables/BotBase.cs index 19d3e417..c6ffc216 100644 --- a/Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Core/Models/Eft/Common/Tables/BotBase.cs @@ -8,62 +8,90 @@ public class BotBase { [JsonPropertyName("_id")] public string Id { get; set; } + [JsonPropertyName("aid")] public int Aid { get; set; } + /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ [JsonPropertyName("sessionId")] public string SessionId { get; set; } + [JsonPropertyName("savage")] public string? Savage { get; set; } + [JsonPropertyName("karmaValue")] public int KarmaValue { get; set; } + [JsonPropertyName("Info")] public Info Info { get; set; } + [JsonPropertyName("Customization")] public Customization Customization { get; set; } + [JsonPropertyName("Health")] public BotBaseHealth Health { get; set; } + [JsonPropertyName("Inventory")] public BotBaseInventory Inventory { get; set; } + [JsonPropertyName("Skills")] public Skills Skills { get; set; } + [JsonPropertyName("Stats")] public Stats Stats { get; set; } + [JsonPropertyName("Encyclopedia")] public Dictionary Encyclopedia { get; set; } + [JsonPropertyName("TaskConditionCounters")] public Dictionary TaskConditionCounters { get; set; } + [JsonPropertyName("InsuredItems")] public List InsuredItems { get; set; } + [JsonPropertyName("Hideout")] public Hideout Hideout { get; set; } + [JsonPropertyName("Quests")] public List Quests { get; set; } + [JsonPropertyName("TradersInfo")] public Dictionary TradersInfo { get; set; } + [JsonPropertyName("UnlockedInfo")] public UnlockedInfo UnlockedInfo { get; set; } + [JsonPropertyName("RagfairInfo")] public RagfairInfo RagfairInfo { get; set; } + /** Achievement id and timestamp */ [JsonPropertyName("Achievements")] public Dictionary Achievements { get; set; } + [JsonPropertyName("RepeatableQuests")] public List RepeatableQuests { get; set; } + [JsonPropertyName("Bonuses")] public List Bonuses { get; set; } + [JsonPropertyName("Notes")] public Notes Notes { get; set; } + [JsonPropertyName("CarExtractCounts")] public Dictionary CarExtractCounts { get; set; } + [JsonPropertyName("CoopExtractCounts")] public Dictionary CoopExtractCounts { get; set; } + [JsonPropertyName("SurvivorClass")] public SurvivorClass SurvivorClass { get; set; } + [JsonPropertyName("WishList")] public Dictionary WishList { get; set; } + [JsonPropertyName("moneyTransferLimitData")] public MoneyTransferLimits MoneyTransferLimitData { get; set; } + /** SPT specific property used during bot generation in raid */ [JsonPropertyName("sptIsPmc")] public bool? IsPmc { get; set; } @@ -75,10 +103,13 @@ public class MoneyTransferLimits /** TODO: Implement */ [JsonPropertyName("nextResetTime")] public double NextResetTime { get; set; } + [JsonPropertyName("remainingLimit")] public double RemainingLimit { get; set; } + [JsonPropertyName("totalLimit")] public double TotalLimit { get; set; } + [JsonPropertyName("resetInterval")] public double ResetInterval { get; set; } } @@ -87,10 +118,13 @@ public class TaskConditionCounter { [JsonPropertyName("id")] public string Id { get; set; } + [JsonPropertyName("type")] public string Type { get; set; } + [JsonPropertyName("value")] public double Value { get; set; } + /** Quest id */ [JsonPropertyName("sourceId")] public string SourceId { get; set; } @@ -120,25 +154,27 @@ public class Info public int AccountType { get; set; } public MemberCategory MemberCategory { get; set; } public MemberCategory SelectedMemberCategory { get; set; } - + [JsonPropertyName("lockedMoveCommands")] public bool LockedMoveCommands { get; set; } + public long SavageLockTime { get; set; } public long LastTimePlayedAsSavage { get; set; } public BotInfoSettings Settings { get; set; } public long NicknameChangeDate { get; set; } public List NeedWipeOptions { get; set; } - + [JsonPropertyName("lastCompletedWipe")] public LastCompleted LastCompletedWipe { get; set; } + public List Bans { get; set; } public bool BannedState { get; set; } public long BannedUntil { get; set; } public bool IsStreamerModeAvailable { get; set; } - + [JsonPropertyName("lastCompletedEvent")] public LastCompleted? LastCompletedEvent { get; set; } - + [JsonPropertyName("isMigratedSkills")] public bool IsMigratedSkills { get; set; } } @@ -157,6 +193,7 @@ public class Ban { [JsonPropertyName("banType")] public BanType BanType { get; set; } + [JsonPropertyName("dateTime")] public long DateTime { get; set; } } @@ -220,57 +257,75 @@ public class CurrentMax public int Maximum { get; set; } } -public class BotBaseInventory { +public class BotBaseInventory +{ [JsonPropertyName("items")] public List Items { get; set; } + [JsonPropertyName("equipment")] public string Equipment { get; set; } + [JsonPropertyName("stash")] public string Stash { get; set; } + [JsonPropertyName("sortingTable")] public string SortingTable { get; set; } + [JsonPropertyName("questRaidItems")] public string QuestRaidItems { get; set; } + [JsonPropertyName("questStashItems")] public string QuestStashItems { get; set; } + /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ [JsonPropertyName("hideoutAreaStashes")] public Dictionary HideoutAreaStashes { get; set; } + [JsonPropertyName("fastPanel")] public Dictionary FastPanel { get; set; } + [JsonPropertyName("favoriteItems")] public List FavoriteItems { get; set; } } -public class BaseJsonSkills { +public class BaseJsonSkills +{ public Dictionary Common { get; set; } public Dictionary Mastering { get; set; } public int Points { get; set; } } -public class Skills { +public class Skills +{ public List Common { get; set; } public List Mastering { get; set; } public int Points { get; set; } } -public class BaseSkill { +public class BaseSkill +{ public string Id { get; set; } public int Progress { get; set; } + [JsonPropertyName("max")] public int? Max { get; set; } + [JsonPropertyName("min")] public int? Min { get; set; } } -public class Common : BaseSkill { +public class Common : BaseSkill +{ public int? PointsEarnedDuringSession { get; set; } public int? LastAccess { get; set; } } -public class Mastering : BaseSkill {} +public class Mastering : BaseSkill +{ +} -public class Stats { +public class Stats +{ public EftStats? Eft { get; set; } } @@ -292,6 +347,7 @@ public class EftStats public LastPlayerState? LastPlayerState { get; set; } public int TotalInGameTime { get; set; } public string? SurvivorClass { get; set; } + [JsonPropertyName("sptLastRaidFenceRepChange")] public float? SptLastRaidFenceRepChange { get; set; } } @@ -341,7 +397,7 @@ public class CounterKeyValue public int Value { get; set; } } -public class Aggressor +public class Aggressor { public string AccountId { get; set; } public string ProfileId { get; set; } @@ -354,7 +410,7 @@ public class Aggressor public string Category { get; set; } } -public class DamageHistory +public class DamageHistory { public string LethalDamagePart { get; set; } public LethalDamage LethalDamage { get; set; } @@ -362,7 +418,7 @@ public class DamageHistory } // TODO: this class seems exactly the same as DamageStats, why have it? -public class LethalDamage +public class LethalDamage { public int Amount { get; set; } public string Type { get; set; } @@ -423,8 +479,10 @@ public class BackendCounter { [JsonPropertyName("id")] public string Id { get; set; } + [JsonPropertyName("qid")] public string? QId { get; set; } + [JsonPropertyName("value")] public int Value { get; set; } } @@ -434,6 +492,7 @@ public class InsuredItem /** Trader Id item was insured by */ [JsonPropertyName("tid")] public string TId { get; set; } + [JsonPropertyName("itemId")] public string ItemId { get; set; } } @@ -446,6 +505,7 @@ public class Hideout public HideoutCounters HideoutCounters { get; set; } public int Seed { get; set; } public List MannequinPoses { get; set; } + [JsonPropertyName("sptUpdateLastRunTimestamp")] public long SptUpdateLastRunTimestamp { get; set; } } @@ -469,6 +529,7 @@ public class HideoutImprovement { [JsonPropertyName("completed")] public bool Completed { get; set; } + [JsonPropertyName("improveCompleteTimestamp")] public long ImproveCompleteTimestamp { get; set; } } @@ -498,8 +559,10 @@ public class Productive /** Used in hideout production.json */ public bool? needFuelForAllProductionTime { get; set; } + /** Used when sending data to client */ public bool? NeedFuelForAllProductionTime { get; set; } + [JsonPropertyName("sptIsScavCase")] public bool? SptIsScavCase { get; set; } @@ -536,8 +599,10 @@ public class Product { [JsonPropertyName("_id")] public string Id { get; set; } + [JsonPropertyName("_tpl")] public string Template { get; set; } + [JsonPropertyName("upd")] public Upd? Upd { get; set; } } @@ -546,19 +611,26 @@ public class BotHideoutArea { [JsonPropertyName("type")] public HideoutAreas Type { get; set; } + [JsonPropertyName("level")] public int Level { get; set; } + [JsonPropertyName("active")] public bool Active { get; set; } + [JsonPropertyName("passiveBonusesEnabled")] public bool PassiveBonusesEnabled { get; set; } + /** Must be integer */ [JsonPropertyName("completeTime")] public int CompleteTime { get; set; } + [JsonPropertyName("constructing")] public bool Constructing { get; set; } + [JsonPropertyName("slots")] public List Slots { get; set; } + [JsonPropertyName("lastRecipe")] public string LastRecipe { get; set; } } @@ -570,6 +642,7 @@ public class HideoutSlot /// [JsonPropertyName("locationIndex")] public int LocationIndex { get; set; } + [JsonPropertyName("item")] public List? Items { get; set; } } @@ -578,8 +651,10 @@ public class HideoutItem { [JsonPropertyName("_id")] public string Id { get; set; } + [JsonPropertyName("_tpl")] public string Template { get; set; } + [JsonPropertyName("upd")] public Upd? Upd { get; set; } } @@ -596,7 +671,8 @@ public class Notes public List DataNotes { get; set; } } -public enum SurvivorClass { +public enum SurvivorClass +{ UNKNOWN = 0, NEUTRALIZER = 1, MARAUDER = 2, @@ -608,71 +684,92 @@ public class Quests { [JsonPropertyName("qid")] public string QId { get; set; } + [JsonPropertyName("startTime")] public long StartTime { get; set; } + [JsonPropertyName("status")] public QuestStatus Status { get; set; } + [JsonPropertyName("statusTimers")] public Dictionary? StatusTimers { get; set; } + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ [JsonPropertyName("completedConditions")] public List? CompletedConditions { get; set; } + [JsonPropertyName("availableAfter")] public long? AvailableAfter { get; set; } } -public class TraderInfo +public class TraderInfo { [JsonPropertyName("loyaltyLevel")] public int? LoyaltyLevel { get; set; } + [JsonPropertyName("salesSum")] public int SalesSum { get; set; } + [JsonPropertyName("standing")] public int Standing { get; set; } + [JsonPropertyName("nextResupply")] public int NextResupply { get; set; } + [JsonPropertyName("unlocked")] public bool Unlocked { get; set; } + [JsonPropertyName("disabled")] public bool Disabled { get; set; } } -public class RagfairInfo +public class RagfairInfo { [JsonPropertyName("rating")] public double Rating { get; set; } + [JsonPropertyName("isRatingGrowing")] public bool IsRatingGrowing { get; set; } + [JsonPropertyName("offers")] public List Offers { get; set; } } - public class Bonus { [JsonPropertyName("id")] public string? Id { get; set; } + [JsonPropertyName("type")] public BonusType Type { get; set; } + [JsonPropertyName("templateId")] public string? TemplateId { get; set; } + [JsonPropertyName("passive")] public bool? IsPassive { get; set; } + [JsonPropertyName("production")] public bool? IsProduction { get; set; } + [JsonPropertyName("visible")] public bool? IsVisible { get; set; } + [JsonPropertyName("value")] public double? Value { get; set; } + [JsonPropertyName("icon")] public string? Icon { get; set; } + [JsonPropertyName("filter")] public List? Filter { get; set; } + [JsonPropertyName("skillType")] public BonusSkillType? SkillType { get; set; } } -public class Note { +public class Note +{ public double Time { get; set; } public string Text { get; set; } } \ No newline at end of file diff --git a/Core/Models/Eft/HttpResponse/GetBodyResponseData.cs b/Core/Models/Eft/HttpResponse/GetBodyResponseData.cs new file mode 100644 index 00000000..14dc6f2b --- /dev/null +++ b/Core/Models/Eft/HttpResponse/GetBodyResponseData.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.HttpResponse; + +public class GetBodyResponseData +{ + [JsonPropertyName("err")] + public int Err { get; set; } + + [JsonPropertyName("errmsg")] + public string ErrMsg { get; set; } + + [JsonPropertyName("data")] + public T Data { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Profile/CompletedAchievementsResponse.cs b/Core/Models/Eft/Profile/CompletedAchievementsResponse.cs new file mode 100644 index 00000000..b23c4d2a --- /dev/null +++ b/Core/Models/Eft/Profile/CompletedAchievementsResponse.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Profile; + +public class CompletedAchievementsResponse +{ + [JsonPropertyName("elements")] + public Dictionary Elements { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Profile/GetAchievementsResponse.cs b/Core/Models/Eft/Profile/GetAchievementsResponse.cs new file mode 100644 index 00000000..ce6063f9 --- /dev/null +++ b/Core/Models/Eft/Profile/GetAchievementsResponse.cs @@ -0,0 +1,8 @@ +using Core.Models.Eft.Common.Tables; + +namespace Core.Models.Eft.Profile; + +public class GetAchievementsResponse +{ + public List Achievements { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Spt/Config/GiftsConfig.cs b/Core/Models/Spt/Config/GiftsConfig.cs index 5a0d300d..31e09253 100644 --- a/Core/Models/Spt/Config/GiftsConfig.cs +++ b/Core/Models/Spt/Config/GiftsConfig.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Profile; +using Core.Models.Enums; using Core.Models.Spt.Dialog; namespace Core.Models.Spt.Config; diff --git a/Core/Models/Spt/Dialog/SendMessageDetails.cs b/Core/Models/Spt/Dialog/SendMessageDetails.cs index a0d24b7b..bffb1fdb 100644 --- a/Core/Models/Spt/Dialog/SendMessageDetails.cs +++ b/Core/Models/Spt/Dialog/SendMessageDetails.cs @@ -1,5 +1,7 @@ using System.Text.Json.Serialization; using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Profile; +using Core.Models.Enums; namespace Core.Models.Spt.Dialog; diff --git a/Core/Models/Spt/Hideout/CircleCraftDetails.cs b/Core/Models/Spt/Hideout/CircleCraftDetails.cs index c496ca3e..fc93efc1 100644 --- a/Core/Models/Spt/Hideout/CircleCraftDetails.cs +++ b/Core/Models/Spt/Hideout/CircleCraftDetails.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using Core.Models.Enums.Hideout; using Core.Models.Spt.Config; namespace Core.Models.Spt.Hideout; diff --git a/Core/Models/Spt/Mod/NewItemDetails.cs b/Core/Models/Spt/Mod/NewItemDetails.cs index d2617d07..dde52cad 100644 --- a/Core/Models/Spt/Mod/NewItemDetails.cs +++ b/Core/Models/Spt/Mod/NewItemDetails.cs @@ -1,5 +1,6 @@ using System.Text.Json.Serialization; -using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Tables; +using Props = Core.Models.Eft.Common.Props; namespace Core.Models.Spt.Mod;