From fdf913c88c2ae830de2d84fdc214dece0297c538 Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 6 Jan 2025 22:15:13 +0000 Subject: [PATCH 1/4] more types --- Core/Callbacks/AchievementCallbacks.cs | 23 +++ Core/Callbacks/BotCallbacks.cs | 15 +- Core/Callbacks/BuildsCallbacks.cs | 20 +++ .../Models/Eft/Bot/GenerateBotsRequestData.cs | 24 ++++ Core/Models/Eft/Common/EmptyRequestData.cs | 6 + Core/Models/Eft/Common/Tables/BotBase.cs | 135 +++++++++++++++--- .../Eft/HttpResponse/GetBodyResponseData.cs | 15 ++ .../Profile/CompletedAchievementsResponse.cs | 9 ++ .../Eft/Profile/GetAchievementsResponse.cs | 8 ++ Core/Models/Spt/Config/GiftsConfig.cs | 2 + Core/Models/Spt/Dialog/SendMessageDetails.cs | 2 + Core/Models/Spt/Hideout/CircleCraftDetails.cs | 1 + Core/Models/Spt/Mod/NewItemDetails.cs | 3 +- 13 files changed, 242 insertions(+), 21 deletions(-) create mode 100644 Core/Callbacks/AchievementCallbacks.cs create mode 100644 Core/Callbacks/BuildsCallbacks.cs create mode 100644 Core/Models/Eft/Bot/GenerateBotsRequestData.cs create mode 100644 Core/Models/Eft/Common/EmptyRequestData.cs create mode 100644 Core/Models/Eft/HttpResponse/GetBodyResponseData.cs create mode 100644 Core/Models/Eft/Profile/CompletedAchievementsResponse.cs create mode 100644 Core/Models/Eft/Profile/GetAchievementsResponse.cs 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; From 211e68f3fc51bd9b7924d512a68fb47e5b584c81 Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 6 Jan 2025 22:52:49 +0000 Subject: [PATCH 2/4] more types --- Core/Callbacks/BuildsCallbacks.cs | 26 ++- Core/Callbacks/BundleCallbacks.cs | 11 +- Core/Callbacks/ClientLogCallbacks.cs | 27 +++ Core/Callbacks/CustomizationCallbacks.cs | 15 +- Core/Callbacks/DataCallbacks.cs | 86 ++++++++ Core/Callbacks/DialogCallbacks.cs | 9 +- Core/Models/Config/HttpConfig.cs | 8 - Core/Models/Eft/Builds/SetMagazineRequest.cs | 25 +++ .../Customization/BuyClothingRequestData.cs | 27 +++ .../Customization/CustomizationSetRequest.cs | 24 +++ .../Eft/Customization/GetSuitsResponse.cs | 12 ++ .../Customization/WearClothingRequestData.cs | 6 + Core/Models/Eft/Dialog/ChatServer.cs | 43 ++++ .../Dialog/GetChatServerListRequestData.cs | 9 + .../Eft/Dialog/GetFriendListDataResponse.cs | 16 ++ .../Dialog/GetMailDialogListRequestData.cs | 12 ++ Core/Models/Eft/Game/GetItemPricesResponse.cs | 15 ++ .../Eft/HttpResponse/NullResponseData.cs | 15 ++ .../ItemEvent/EmptyItemEventRouterResponse.cs | 9 + .../Eft/ItemEvent/ItemEventRouterBase.cs | 188 ++++++++++++++++++ .../Eft/ItemEvent/ItemEventRouterRequest.cs | 54 +++++ .../Eft/ItemEvent/ItemEventRouterResponse.cs | 6 + .../PresetBuildActionRequestData.cs | 23 +++ .../Eft/PresetBuild/RemoveBuildRequestData.cs | 9 + 24 files changed, 659 insertions(+), 16 deletions(-) create mode 100644 Core/Callbacks/ClientLogCallbacks.cs create mode 100644 Core/Callbacks/DataCallbacks.cs delete mode 100644 Core/Models/Config/HttpConfig.cs create mode 100644 Core/Models/Eft/Builds/SetMagazineRequest.cs create mode 100644 Core/Models/Eft/Customization/BuyClothingRequestData.cs create mode 100644 Core/Models/Eft/Customization/CustomizationSetRequest.cs create mode 100644 Core/Models/Eft/Customization/GetSuitsResponse.cs create mode 100644 Core/Models/Eft/Customization/WearClothingRequestData.cs create mode 100644 Core/Models/Eft/Dialog/ChatServer.cs create mode 100644 Core/Models/Eft/Dialog/GetChatServerListRequestData.cs create mode 100644 Core/Models/Eft/Dialog/GetFriendListDataResponse.cs create mode 100644 Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs create mode 100644 Core/Models/Eft/Game/GetItemPricesResponse.cs create mode 100644 Core/Models/Eft/HttpResponse/NullResponseData.cs create mode 100644 Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs create mode 100644 Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs create mode 100644 Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs create mode 100644 Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs create mode 100644 Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs create mode 100644 Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs diff --git a/Core/Callbacks/BuildsCallbacks.cs b/Core/Callbacks/BuildsCallbacks.cs index 611ed95e..7a59aa65 100644 --- a/Core/Callbacks/BuildsCallbacks.cs +++ b/Core/Callbacks/BuildsCallbacks.cs @@ -1,5 +1,7 @@ -using Core.Models.Eft.Common; +using Core.Models.Eft.Builds; +using Core.Models.Eft.Common; using Core.Models.Eft.HttpResponse; +using Core.Models.Eft.PresetBuild; using Core.Models.Eft.Profile; namespace Core.Callbacks; @@ -15,6 +17,24 @@ public class BuildsCallbacks { throw new NotImplementedException(); } - - + + public NullResponseData CreateMagazineTemplate(string url, SetMagazineRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData SetWeapon(string url, PresetBuildActionRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData SetEquipment(string url, PresetBuildActionRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData DeleteBuild(string url, RemoveBuildRequestData info, string sessionID) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Callbacks/BundleCallbacks.cs b/Core/Callbacks/BundleCallbacks.cs index e7a17424..2900670a 100644 --- a/Core/Callbacks/BundleCallbacks.cs +++ b/Core/Callbacks/BundleCallbacks.cs @@ -1,7 +1,16 @@ -namespace Core.Callbacks; +using Core.Models.Spt.Config; + +namespace Core.Callbacks; public class BundleCallbacks { + private HttpConfig _httpConfig; + + public BundleCallbacks() + { + + } + public object SendBundle(string sessionID, object req, object res, object body) { throw new NotImplementedException(); diff --git a/Core/Callbacks/ClientLogCallbacks.cs b/Core/Callbacks/ClientLogCallbacks.cs new file mode 100644 index 00000000..45294e54 --- /dev/null +++ b/Core/Callbacks/ClientLogCallbacks.cs @@ -0,0 +1,27 @@ +using Core.Models.Eft.HttpResponse; +using Core.Models.Spt.Logging; + +namespace Core.Callbacks; + +public class ClientLogCallbacks +{ + public ClientLogCallbacks() + { + + } + + public NullResponseData ClientLog(string url, ClientLogRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public string ReleaseNotes() + { + throw new NotImplementedException(); + } + + public string BsgLogging() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Core/Callbacks/CustomizationCallbacks.cs b/Core/Callbacks/CustomizationCallbacks.cs index 4856d34d..515f43c7 100644 --- a/Core/Callbacks/CustomizationCallbacks.cs +++ b/Core/Callbacks/CustomizationCallbacks.cs @@ -1,8 +1,19 @@ -namespace Core.Callbacks; +using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Customization; +using Core.Models.Eft.HttpResponse; +using Core.Models.Eft.ItemEvent; + +namespace Core.Callbacks; public class CustomizationCallbacks { - public GetBodyResponseData GetSuits(string url, object info, string sessionID) + public CustomizationCallbacks() + { + + } + + public GetBodyResponseData GetSuits(string url, EmptyRequestData info, string sessionID) { throw new NotImplementedException(); } diff --git a/Core/Callbacks/DataCallbacks.cs b/Core/Callbacks/DataCallbacks.cs new file mode 100644 index 00000000..ec352da2 --- /dev/null +++ b/Core/Callbacks/DataCallbacks.cs @@ -0,0 +1,86 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Game; +using Core.Models.Eft.Hideout; +using Core.Models.Eft.HttpResponse; +using Core.Models.Spt.Server; + +namespace Core.Callbacks; + +public class DataCallbacks +{ + public DataCallbacks() + { + + } + + public GetBodyResponseData GetSettings(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GetGlobals(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public string GetTemplateItems(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GetTemplateHandbook(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> GetTemplateSuits(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> GetTemplateCharacter(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GetHideoutSettings(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> GetHideoutAreas(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GetHideoutProduction(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> GetLocalesLanguages(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GetLocalesMenu(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public string GetLocalesGlobal(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public string GetQteList(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GetItemPrices(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Core/Callbacks/DialogCallbacks.cs b/Core/Callbacks/DialogCallbacks.cs index 89346a79..ea7efc7d 100644 --- a/Core/Callbacks/DialogCallbacks.cs +++ b/Core/Callbacks/DialogCallbacks.cs @@ -1,4 +1,9 @@ -namespace Core.Callbacks; +using Core.Models.Eft.Common; +using Core.Models.Eft.Dialog; +using Core.Models.Eft.HttpResponse; +using Core.Models.Eft.Profile; + +namespace Core.Callbacks; public class DialogCallbacks { @@ -7,7 +12,7 @@ public class DialogCallbacks throw new NotImplementedException(); } - public GetBodyResponseData> GetChatServerList(string url, GetChatServerListRequestData info, string sessionID) + public GetBodyResponseData> GetChatServerList(string url, GetChatServerListRequestData info, string sessionID) { throw new NotImplementedException(); } diff --git a/Core/Models/Config/HttpConfig.cs b/Core/Models/Config/HttpConfig.cs deleted file mode 100644 index b661f3b1..00000000 --- a/Core/Models/Config/HttpConfig.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Core.Models.Config; - -public class HttpConfig -{ - public int Port { get; set; } - public string Ip { get; set; } - public bool LogRequests { get; set; } -} \ No newline at end of file diff --git a/Core/Models/Eft/Builds/SetMagazineRequest.cs b/Core/Models/Eft/Builds/SetMagazineRequest.cs new file mode 100644 index 00000000..49f53fcc --- /dev/null +++ b/Core/Models/Eft/Builds/SetMagazineRequest.cs @@ -0,0 +1,25 @@ +using System.Text.Json.Serialization; +using Core.Models.Eft.Profile; + +namespace Core.Models.Eft.Builds; + +public class SetMagazineRequest +{ + [JsonPropertyName("Id")] + public string Id { get; set; } + + [JsonPropertyName("Name")] + public string Name { get; set; } + + [JsonPropertyName("Caliber")] + public string Caliber { get; set; } + + [JsonPropertyName("Items")] + public List Items { get; set; } + + [JsonPropertyName("TopCount")] + public int TopCount { get; set; } + + [JsonPropertyName("BottomCount")] + public int BottomCount { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Customization/BuyClothingRequestData.cs b/Core/Models/Eft/Customization/BuyClothingRequestData.cs new file mode 100644 index 00000000..3d22dcbc --- /dev/null +++ b/Core/Models/Eft/Customization/BuyClothingRequestData.cs @@ -0,0 +1,27 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Customization; + +public class BuyClothingRequestData +{ + [JsonPropertyName("Action")] + public string Action { get; set; } = "CustomizationBuy"; + + [JsonPropertyName("offer")] + public string Offer { get; set; } + + [JsonPropertyName("items")] + public List Items { get; set; } +} + +public class PaymentItemForClothing +{ + [JsonPropertyName("del")] + public bool Del { get; set; } + + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("count")] + public int Count { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Customization/CustomizationSetRequest.cs b/Core/Models/Eft/Customization/CustomizationSetRequest.cs new file mode 100644 index 00000000..ea01a9f7 --- /dev/null +++ b/Core/Models/Eft/Customization/CustomizationSetRequest.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Customization; + +public class CustomizationSetRequest +{ + [JsonPropertyName("Action")] + public string Action { get; set; } = "CustomizationSet"; + + [JsonPropertyName("customizations")] + public List Customizations { get; set; } +} + +public class CustomizationSetOption +{ + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("type")] + public string Type { get; set; } + + [JsonPropertyName("source")] + public string Source { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Customization/GetSuitsResponse.cs b/Core/Models/Eft/Customization/GetSuitsResponse.cs new file mode 100644 index 00000000..9565c089 --- /dev/null +++ b/Core/Models/Eft/Customization/GetSuitsResponse.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Customization; + +public class GetSuitsResponse +{ + [JsonPropertyName("_id")] + public string Id { get; set; } + + [JsonPropertyName("suites")] + public string[] Suites { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Customization/WearClothingRequestData.cs b/Core/Models/Eft/Customization/WearClothingRequestData.cs new file mode 100644 index 00000000..747d2994 --- /dev/null +++ b/Core/Models/Eft/Customization/WearClothingRequestData.cs @@ -0,0 +1,6 @@ +namespace Core.Models.Eft.Customization; + +public class WearClothingRequestData +{ + +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/ChatServer.cs b/Core/Models/Eft/Dialog/ChatServer.cs new file mode 100644 index 00000000..27b3bb67 --- /dev/null +++ b/Core/Models/Eft/Dialog/ChatServer.cs @@ -0,0 +1,43 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class ChatServer +{ + [JsonPropertyName("_id")] + public string Id { get; set; } + + [JsonPropertyName("RegistrationId")] + public int RegistrationId { get; set; } + + [JsonPropertyName("VersionId")] + public string VersionId { get; set; } + + [JsonPropertyName("Ip")] + public string Ip { get; set; } + + [JsonPropertyName("Port")] + public int Port { get; set; } + + [JsonPropertyName("DateTime")] + public long DateTime { get; set; } + + [JsonPropertyName("Chats")] + public List Chats { get; set; } + + [JsonPropertyName("Regions")] + public List Regions { get; set; } + + /** Possibly removed */ + [JsonPropertyName("IsDeveloper")] + public bool? IsDeveloper { get; set; } +} + +public class Chat +{ + [JsonPropertyName("_id")] + public string Id { get; set; } + + [JsonPropertyName("Members")] + public int Members { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/GetChatServerListRequestData.cs b/Core/Models/Eft/Dialog/GetChatServerListRequestData.cs new file mode 100644 index 00000000..86265d65 --- /dev/null +++ b/Core/Models/Eft/Dialog/GetChatServerListRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class GetChatServerListRequestData +{ + [JsonPropertyName("VersionId")] + public string VersionId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/GetFriendListDataResponse.cs b/Core/Models/Eft/Dialog/GetFriendListDataResponse.cs new file mode 100644 index 00000000..8c26afa7 --- /dev/null +++ b/Core/Models/Eft/Dialog/GetFriendListDataResponse.cs @@ -0,0 +1,16 @@ +using System.Text.Json.Serialization; +using Core.Models.Eft.Profile; + +namespace Core.Models.Eft.Dialog; + +public class GetFriendListDataResponse +{ + [JsonPropertyName("Friends")] + public List Friends { get; set; } + + [JsonPropertyName("Ignore")] + public List Ignore { get; set; } + + [JsonPropertyName("InIgnoreList")] + public List InIgnoreList { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs b/Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs new file mode 100644 index 00000000..90084b53 --- /dev/null +++ b/Core/Models/Eft/Dialog/GetMailDialogListRequestData.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class GetMailDialogListRequestData +{ + [JsonPropertyName("limit")] + public int Limit { get; set; } + + [JsonPropertyName("offset")] + public int Offset { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GetItemPricesResponse.cs b/Core/Models/Eft/Game/GetItemPricesResponse.cs new file mode 100644 index 00000000..00744a82 --- /dev/null +++ b/Core/Models/Eft/Game/GetItemPricesResponse.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GetItemPricesResponse +{ + [JsonPropertyName("supplyNextTime")] + public double SupplyNextTime { get; set; } + + [JsonPropertyName("prices")] + public Dictionary Prices { get; set; } + + [JsonPropertyName("currencyCourses")] + public Dictionary CurrencyCourses { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/HttpResponse/NullResponseData.cs b/Core/Models/Eft/HttpResponse/NullResponseData.cs new file mode 100644 index 00000000..9656a444 --- /dev/null +++ b/Core/Models/Eft/HttpResponse/NullResponseData.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.HttpResponse; + +public class NullResponseData +{ + [JsonPropertyName("err")] + public int Err { get; set; } + + [JsonPropertyName("errmsg")] + public object ErrMsg { get; set; } + + [JsonPropertyName("data")] + public object Data { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs b/Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs new file mode 100644 index 00000000..52cc74ce --- /dev/null +++ b/Core/Models/Eft/ItemEvent/EmptyItemEventRouterResponse.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.ItemEvent; + +public class EmptyItemEventRouterResponse : ItemEventRouterBase +{ + [JsonPropertyName("profileChanges")] + public string ProfileChanges { get; set; } = ""; +} \ No newline at end of file diff --git a/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs b/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs new file mode 100644 index 00000000..aeadcf82 --- /dev/null +++ b/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs @@ -0,0 +1,188 @@ +using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Ragfair; +using Core.Models.Enums; + +namespace Core.Models.Eft.ItemEvent; + +using System.Text.Json.Serialization; + +public class ItemEventRouterBase +{ + [JsonPropertyName("warnings")] + public List Warnings { get; set; } + + [JsonPropertyName("profileChanges")] + public object ProfileChanges { get; set; } // Note: using object to accommodate string or TProfileChanges +} + +public class TProfileChanges : Dictionary { } + +public class Warning +{ + [JsonPropertyName("index")] + public int Index { get; set; } + + [JsonPropertyName("errmsg")] + public string ErrorMessage { get; set; } + + [JsonPropertyName("code")] + public string Code { get; set; } + + [JsonPropertyName("data")] + public object Data { get; set; } +} + +public class ProfileChange +{ + [JsonPropertyName("_id")] + public string Id { get; set; } + + [JsonPropertyName("experience")] + public int Experience { get; set; } + + [JsonPropertyName("quests")] + public List Quests { get; set; } + + [JsonPropertyName("ragFairOffers")] + public List RagFairOffers { get; set; } + + [JsonPropertyName("weaponBuilds")] + public List WeaponBuilds { get; set; } + + [JsonPropertyName("equipmentBuilds")] + public List EquipmentBuilds { get; set; } + + [JsonPropertyName("items")] + public ItemChanges Items { get; set; } + + [JsonPropertyName("production")] + public Dictionary Production { get; set; } + + /** Hideout area improvement id */ + [JsonPropertyName("improvements")] + public Dictionary Improvements { get; set; } + + [JsonPropertyName("skills")] + public Skills Skills { get; set; } + + [JsonPropertyName("health")] + public Common.Health Health { get; set; } + + [JsonPropertyName("traderRelations")] + public Dictionary TraderRelations { get; set; } + + [JsonPropertyName("moneyTransferLimitData")] + public MoneyTransferLimits MoneyTransferLimitData { get; set; } + + [JsonPropertyName("repeatableQuests")] + public List RepeatableQuests { get; set; } + + [JsonPropertyName("recipeUnlocked")] + public Dictionary RecipeUnlocked { get; set; } + + [JsonPropertyName("changedHideoutStashes")] + public Dictionary ChangedHideoutStashes { get; set; } + + [JsonPropertyName("questsStatus")] + public List QuestsStatus { get; set; } +} + +public class HideoutStashItem +{ + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("tpl")] + public string Template { get; set; } +} + +public class WeaponBuildChange +{ + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("root")] + public string Root { get; set; } + + [JsonPropertyName("items")] + public List Items { get; set; } +} + +public class EquipmentBuildChange +{ + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("root")] + public string Root { get; set; } + + [JsonPropertyName("items")] + public List Items { get; set; } + + [JsonPropertyName("type")] + public string Type { get; set; } + + [JsonPropertyName("fastpanel")] + public List FastPanel { get; set; } + + [JsonPropertyName("buildType")] + public EquipmentBuildType BuildType { get; set; } +} + +public class ItemChanges +{ + [JsonPropertyName("new")] + public List NewItems { get; set; } + + [JsonPropertyName("change")] + public List ChangedItems { get; set; } + + [JsonPropertyName("del")] + public List DeletedItems { get; set; } // Only needs _id property +} + +/** Related to TraderInfo */ +public class TraderData +{ + [JsonPropertyName("salesSum")] + public double SalesSum { get; set; } + + [JsonPropertyName("standing")] + public double Standing { get; set; } + + [JsonPropertyName("loyalty")] + public double Loyalty { get; set; } + + [JsonPropertyName("unlocked")] + public bool Unlocked { get; set; } + + [JsonPropertyName("disabled")] + public bool Disabled { get; set; } +} + +public class Product +{ + [JsonPropertyName("_id")] + public string Id { get; set; } + + [JsonPropertyName("_tpl")] + public string Template { get; set; } + + [JsonPropertyName("parentId")] + public string ParentId { get; set; } + + [JsonPropertyName("slotId")] + public string SlotId { get; set; } + + [JsonPropertyName("location")] + public ItemLocation Location { get; set; } + + [JsonPropertyName("upd")] + public Upd Upd { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs b/Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs new file mode 100644 index 00000000..d0d855e9 --- /dev/null +++ b/Core/Models/Eft/ItemEvent/ItemEventRouterRequest.cs @@ -0,0 +1,54 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.ItemEvent; + +public class ItemEventRouterRequest +{ + [JsonPropertyName("data")] + public List Data { get; set; } + + [JsonPropertyName("tm")] + public int Time { get; set; } + + [JsonPropertyName("reload")] + public int Reload { get; set; } +} + +public class Daum +{ + [JsonPropertyName("Action")] + public string Action { get; set; } + + [JsonPropertyName("item")] + public string Item { get; set; } + + [JsonPropertyName("to")] + public To To { get; set; } +} + +public class To +{ + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("container")] + public string Container { get; set; } + + [JsonPropertyName("location")] + public Location Location { get; set; } +} + +public class Location +{ + [JsonPropertyName("x")] + public int X { get; set; } + + [JsonPropertyName("y")] + public int Y { get; set; } + + [JsonPropertyName("r")] + public string R { get; set; } + + [JsonPropertyName("isSearched")] + public bool IsSearched { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs b/Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs new file mode 100644 index 00000000..15c9baa7 --- /dev/null +++ b/Core/Models/Eft/ItemEvent/ItemEventRouterResponse.cs @@ -0,0 +1,6 @@ +namespace Core.Models.Eft.ItemEvent; + +public class ItemEventRouterResponse : ItemEventRouterBase +{ + +} \ No newline at end of file diff --git a/Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs b/Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs new file mode 100644 index 00000000..cfdeae9e --- /dev/null +++ b/Core/Models/Eft/PresetBuild/PresetBuildActionRequestData.cs @@ -0,0 +1,23 @@ +using System.Text.Json.Serialization; +using Core.Models.Eft.Common.Tables; + +namespace Core.Models.Eft.PresetBuild; + +public class PresetBuildActionRequestData +{ + [JsonPropertyName("Action")] + public string Action { get; set; } + + [JsonPropertyName("Id")] + public string Id { get; set; } + + /** name of preset given by player */ + [JsonPropertyName("Name")] + public string Name { get; set; } + + [JsonPropertyName("Root")] + public string Root { get; set; } + + [JsonPropertyName("Items")] + public List Items { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs b/Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs new file mode 100644 index 00000000..0ae98fac --- /dev/null +++ b/Core/Models/Eft/PresetBuild/RemoveBuildRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.PresetBuild; + +public class RemoveBuildRequestData +{ + [JsonPropertyName("id")] + public string Id { get; set; } +} \ No newline at end of file From 8b8fa6e4fd64e73a53c3703eaf9d2f175eb47afa Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 6 Jan 2025 23:49:14 +0000 Subject: [PATCH 3/4] More Types --- Core/Callbacks/DialogCallbacks.cs | 85 ++++++++++++++++-- Core/Callbacks/GameCallbacks.cs | 64 +++++++++++-- .../Eft/Common/Request/UIDRequestData.cs | 9 ++ .../Eft/Dialog/AcceptFriendRequestData.cs | 21 +++++ .../Eft/Dialog/AddUserGroupMailRequest.cs | 12 +++ .../Eft/Dialog/ChangeGroupMailOwnerRequest.cs | 12 +++ .../Eft/Dialog/ClearMailMessageRequest.cs | 9 ++ .../Eft/Dialog/CreateGroupMailRequest.cs | 12 +++ Core/Models/Eft/Dialog/DeleteFriendRequest.cs | 9 ++ Core/Models/Eft/Dialog/FriendRequestData.cs | 15 ++++ .../Eft/Dialog/FriendRequestSendResponse.cs | 15 ++++ .../Dialog/GetMailDialogInfoRequestData.cs | 9 ++ .../Dialog/GetMailDialogViewRequestData.cs | 19 ++++ .../Dialog/GetMailDialogViewResponseData.cs | 16 ++++ .../Models/Eft/Dialog/PinDialogRequestData.cs | 9 ++ .../Eft/Dialog/RemoveDialogRequestData.cs | 9 ++ .../Eft/Dialog/RemoveMailMessageRequest.cs | 9 ++ .../Eft/Dialog/RemoveUserGroupMailRequest.cs | 12 +++ Core/Models/Eft/Dialog/SendMessageRequest.cs | 18 ++++ .../Eft/Dialog/SetDialogReadRequestData.cs | 9 ++ Core/Models/Eft/Game/CheckVersionResponse.cs | 12 +++ Core/Models/Eft/Game/GameConfigResponse.cs | 76 ++++++++++++++++ .../Eft/Game/GameEmptyCrcRequestData.cs | 9 ++ Core/Models/Eft/Game/GameKeepAliveResponse.cs | 12 +++ .../Models/Eft/Game/GameLogoutResponseData.cs | 9 ++ Core/Models/Eft/Game/GameModeRequestData.cs | 9 ++ Core/Models/Eft/Game/GameModeResponse.cs | 18 ++++ Core/Models/Eft/Game/GameStartResponse.cs | 9 ++ Core/Models/Eft/Game/GetRaidTimeRequest.cs | 12 +++ Core/Models/Eft/Game/GetRaidTimeResponse.cs | 33 +++++++ .../Eft/Game/SendSurveyOpinionRequest.cs | 24 +++++ Core/Models/Eft/Game/ServerDetails.cs | 12 +++ Core/Models/Eft/Game/SurveyResponseData.cs | 90 +++++++++++++++++++ .../Eft/Game/VersionValidateRequestData.cs | 30 +++++++ 34 files changed, 714 insertions(+), 14 deletions(-) create mode 100644 Core/Models/Eft/Common/Request/UIDRequestData.cs create mode 100644 Core/Models/Eft/Dialog/AcceptFriendRequestData.cs create mode 100644 Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs create mode 100644 Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs create mode 100644 Core/Models/Eft/Dialog/ClearMailMessageRequest.cs create mode 100644 Core/Models/Eft/Dialog/CreateGroupMailRequest.cs create mode 100644 Core/Models/Eft/Dialog/DeleteFriendRequest.cs create mode 100644 Core/Models/Eft/Dialog/FriendRequestData.cs create mode 100644 Core/Models/Eft/Dialog/FriendRequestSendResponse.cs create mode 100644 Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs create mode 100644 Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs create mode 100644 Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs create mode 100644 Core/Models/Eft/Dialog/PinDialogRequestData.cs create mode 100644 Core/Models/Eft/Dialog/RemoveDialogRequestData.cs create mode 100644 Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs create mode 100644 Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs create mode 100644 Core/Models/Eft/Dialog/SendMessageRequest.cs create mode 100644 Core/Models/Eft/Dialog/SetDialogReadRequestData.cs create mode 100644 Core/Models/Eft/Game/CheckVersionResponse.cs create mode 100644 Core/Models/Eft/Game/GameConfigResponse.cs create mode 100644 Core/Models/Eft/Game/GameEmptyCrcRequestData.cs create mode 100644 Core/Models/Eft/Game/GameKeepAliveResponse.cs create mode 100644 Core/Models/Eft/Game/GameLogoutResponseData.cs create mode 100644 Core/Models/Eft/Game/GameModeRequestData.cs create mode 100644 Core/Models/Eft/Game/GameModeResponse.cs create mode 100644 Core/Models/Eft/Game/GameStartResponse.cs create mode 100644 Core/Models/Eft/Game/GetRaidTimeRequest.cs create mode 100644 Core/Models/Eft/Game/GetRaidTimeResponse.cs create mode 100644 Core/Models/Eft/Game/SendSurveyOpinionRequest.cs create mode 100644 Core/Models/Eft/Game/ServerDetails.cs create mode 100644 Core/Models/Eft/Game/SurveyResponseData.cs create mode 100644 Core/Models/Eft/Game/VersionValidateRequestData.cs diff --git a/Core/Callbacks/DialogCallbacks.cs b/Core/Callbacks/DialogCallbacks.cs index ea7efc7d..e1d68160 100644 --- a/Core/Callbacks/DialogCallbacks.cs +++ b/Core/Callbacks/DialogCallbacks.cs @@ -1,4 +1,5 @@ using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Request; using Core.Models.Eft.Dialog; using Core.Models.Eft.HttpResponse; using Core.Models.Eft.Profile; @@ -27,7 +28,7 @@ public class DialogCallbacks throw new NotImplementedException(); } - public GetBodyResponseData GetMailDialogInfo(string url, GetMailDialogInfoRequestData info, string sessionID) + public GetBodyResponseData GetMailDialogInfo(string url, GetMailDialogInfoRequestData info, string sessionID) { throw new NotImplementedException(); } @@ -52,11 +53,16 @@ public class DialogCallbacks throw new NotImplementedException(); } - public GetBodyResponseData GetAllAttachments(string url, EmptyRequestData info, string sessionID) + public GetBodyResponseData GetAllAttachments(string url, EmptyRequestData info, string sessionID) // TODO: Fix type - GetBodyResponseData { throw new NotImplementedException(); } + public GetBodyResponseData SendMessage(string url, SendMessageRequest info, string sessionID) + { + throw new NotImplementedException(); + } + public GetBodyResponseData> ListOutbox(string url, EmptyRequestData info, string sessionID) { throw new NotImplementedException(); @@ -64,20 +70,85 @@ public class DialogCallbacks public GetBodyResponseData> ListInbox(string url, EmptyRequestData info, string sessionID) { - + throw new NotImplementedException(); } - - public NullResponseData SendFriendRequest(string url, FriendRequestData info, string sessionID) + + public GetBodyResponseData SendFriendRequest(string url, FriendRequestData info, string sessionID) { throw new NotImplementedException(); } - public GetBodyResponseData SendMessage(string url, SendMessageRequest info, string sessionID) + public NullResponseData AcceptAllFriendRequests(string url, EmptyRequestData info, string sessionID) { throw new NotImplementedException(); } - public bool Update() + public GetBodyResponseData AcceptFriendRequest(string url, AcceptFriendRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData DeclineFriendRequest(string url, DeclineFriendRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData CancelFriendRequest(string url, CancelFriendRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData DeleteFriend(string url, DeleteFriendRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData IgnoreFriend(string url, UIDRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData UnIgnoreFriend(string url, UIDRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> ClearMail(string url, ClearMailMessageRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> RemoveMail(string url, RemoveMailMessageRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> CreateGroupMail(string url, CreateGroupMailRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> ChangeMailGroupOwner(string url, ChangeGroupMailOwnerRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> AddUserToMail(string url, AddUserGroupMailRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData> RemoveUserFromMail(string url, RemoveUserGroupMailRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public async Task OnUpdate(int timeSinceLastRun) + { + throw new NotImplementedException(); + } + + public string GetRoute() { throw new NotImplementedException(); } diff --git a/Core/Callbacks/GameCallbacks.cs b/Core/Callbacks/GameCallbacks.cs index 166f5219..81e37135 100644 --- a/Core/Callbacks/GameCallbacks.cs +++ b/Core/Callbacks/GameCallbacks.cs @@ -1,18 +1,38 @@ -namespace Core.Callbacks; +using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Request; +using Core.Models.Eft.Game; +using Core.Models.Eft.HttpResponse; + +namespace Core.Callbacks; public class GameCallbacks { - public NullResponseData VersionValidata(string url, VersionValidaterequestData info, string sessionID) + public GameCallbacks() + { + + } + + public async Task OnLoad() { throw new NotImplementedException(); } - public GetBodyResponseData GameStart(string url, EmptyRequestData info, string sessionID) + public string GetRoute() + { + throw new NotImplementedException(); + } + + public NullResponseData VersionValidata(string url, VersionValidateRequestData info, string sessionID) { throw new NotImplementedException(); } - public GetBodyResponseData GameLogout(string url, EmptyRequestData info, string sessionID) + public GetBodyResponseData GameStart(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GameLogout(string url, EmptyRequestData info, string sessionID) { throw new NotImplementedException(); } @@ -22,17 +42,22 @@ public class GameCallbacks throw new NotImplementedException(); } - public GetBodyResponseData GetServer(string url, EmptyRequestData info, string sessionID) + public GetBodyResponseData GetGameMode(string url, GameModeRequestData info, string sessionID) { throw new NotImplementedException(); } - public GetBodyResponseData ValidateGameVersion(string url, EmptyRequestData info, string sessionID) + public GetBodyResponseData> GetServer(string url, EmptyRequestData info, string sessionID) { throw new NotImplementedException(); } - public GetBodyResponseData GameKeepalive(string url, EmptyRequestData info, string sessionID) + public GetBodyResponseData ValidateGameVersion(string url, EmptyRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetBodyResponseData GameKeepalive(string url, EmptyRequestData info, string sessionID) { throw new NotImplementedException(); } @@ -41,4 +66,29 @@ public class GameCallbacks { throw new NotImplementedException(); } + + public NullResponseData ReportNickname(string url, UIDRequestData info, string sessionID) + { + throw new NotImplementedException(); + } + + public GetRaidTimeResponse GetRaidTime(string url, GetRaidTimeRequest info, string sessionID) + { + throw new NotImplementedException(); + } + + public object GetSurvey(string url, EmptyRequestData info, string sessionID) // TODO: Types given was NullResponseData | GetBodyResponseData + { + throw new NotImplementedException(); + } + + public NullResponseData GetSurveyView(string url, object info, string sessionID) + { + throw new NotImplementedException(); + } + + public NullResponseData SendSurveyOpinion(string url, SendSurveyOpinionRequest info, string sessionID) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Models/Eft/Common/Request/UIDRequestData.cs b/Core/Models/Eft/Common/Request/UIDRequestData.cs new file mode 100644 index 00000000..c209c9f0 --- /dev/null +++ b/Core/Models/Eft/Common/Request/UIDRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Common.Request; + +public class UIDRequestData +{ + [JsonPropertyName("uid")] + public string Uid { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/AcceptFriendRequestData.cs b/Core/Models/Eft/Dialog/AcceptFriendRequestData.cs new file mode 100644 index 00000000..880d01aa --- /dev/null +++ b/Core/Models/Eft/Dialog/AcceptFriendRequestData.cs @@ -0,0 +1,21 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class AcceptFriendRequestData : BaseFriendRequest +{ +} + +public class CancelFriendRequestData : BaseFriendRequest +{ +} + +public class DeclineFriendRequestData : BaseFriendRequest +{ +} + +public class BaseFriendRequest +{ + [JsonPropertyName("profileId")] + public string ProfileId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs b/Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs new file mode 100644 index 00000000..f11c58c3 --- /dev/null +++ b/Core/Models/Eft/Dialog/AddUserGroupMailRequest.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class AddUserGroupMailRequest +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } + + [JsonPropertyName("uid")] + public string Uid { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs b/Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs new file mode 100644 index 00000000..15cc6839 --- /dev/null +++ b/Core/Models/Eft/Dialog/ChangeGroupMailOwnerRequest.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class ChangeGroupMailOwnerRequest +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } + + [JsonPropertyName("uid")] + public string Uid { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/ClearMailMessageRequest.cs b/Core/Models/Eft/Dialog/ClearMailMessageRequest.cs new file mode 100644 index 00000000..58c7bd8a --- /dev/null +++ b/Core/Models/Eft/Dialog/ClearMailMessageRequest.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class ClearMailMessageRequest +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/CreateGroupMailRequest.cs b/Core/Models/Eft/Dialog/CreateGroupMailRequest.cs new file mode 100644 index 00000000..d5db07c2 --- /dev/null +++ b/Core/Models/Eft/Dialog/CreateGroupMailRequest.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class CreateGroupMailRequest +{ + [JsonPropertyName("Name")] + public string Name { get; set; } + + [JsonPropertyName("Users")] + public List Users { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/DeleteFriendRequest.cs b/Core/Models/Eft/Dialog/DeleteFriendRequest.cs new file mode 100644 index 00000000..27fa4ae1 --- /dev/null +++ b/Core/Models/Eft/Dialog/DeleteFriendRequest.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class DeleteFriendRequest +{ + [JsonPropertyName("friend_id")] + public string FriendId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/FriendRequestData.cs b/Core/Models/Eft/Dialog/FriendRequestData.cs new file mode 100644 index 00000000..3b010663 --- /dev/null +++ b/Core/Models/Eft/Dialog/FriendRequestData.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class FriendRequestData +{ + [JsonPropertyName("status")] + public int Status { get; set; } + + [JsonPropertyName("requestId")] + public string RequestId { get; set; } + + [JsonPropertyName("retryAfter")] + public int RetryAfter { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/FriendRequestSendResponse.cs b/Core/Models/Eft/Dialog/FriendRequestSendResponse.cs new file mode 100644 index 00000000..2a2fb774 --- /dev/null +++ b/Core/Models/Eft/Dialog/FriendRequestSendResponse.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class FriendRequestSendResponse +{ + [JsonPropertyName("status")] + public int Status { get; set; } + + [JsonPropertyName("requestId")] + public string RequestId { get; set; } + + [JsonPropertyName("retryAfter")] + public int RetryAfter { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs b/Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs new file mode 100644 index 00000000..a4b83c62 --- /dev/null +++ b/Core/Models/Eft/Dialog/GetMailDialogInfoRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class GetMailDialogInfoRequestData +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs b/Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs new file mode 100644 index 00000000..9684be00 --- /dev/null +++ b/Core/Models/Eft/Dialog/GetMailDialogViewRequestData.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; +using Core.Models.Enums; + +namespace Core.Models.Eft.Dialog; + +public class GetMailDialogViewRequestData +{ + [JsonPropertyName("type")] + public MessageType Type { get; set; } + + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } + + [JsonPropertyName("limit")] + public int Limit { get; set; } + + [JsonPropertyName("time")] + public decimal Time { get; set; } // decimal +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs b/Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs new file mode 100644 index 00000000..379f489f --- /dev/null +++ b/Core/Models/Eft/Dialog/GetMailDialogViewResponseData.cs @@ -0,0 +1,16 @@ +using System.Text.Json.Serialization; +using Core.Models.Eft.Profile; + +namespace Core.Models.Eft.Dialog; + +public class GetMailDialogViewResponseData +{ + [JsonPropertyName("messages")] + public List Messages { get; set; } + + [JsonPropertyName("profiles")] + public List Profiles { get; set; } + + [JsonPropertyName("hasMessagesWithRewards")] + public bool HasMessagesWithRewards { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/PinDialogRequestData.cs b/Core/Models/Eft/Dialog/PinDialogRequestData.cs new file mode 100644 index 00000000..1a2980e2 --- /dev/null +++ b/Core/Models/Eft/Dialog/PinDialogRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class PinDialogRequestData +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/RemoveDialogRequestData.cs b/Core/Models/Eft/Dialog/RemoveDialogRequestData.cs new file mode 100644 index 00000000..dacdb9d2 --- /dev/null +++ b/Core/Models/Eft/Dialog/RemoveDialogRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class RemoveDialogRequestData +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs b/Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs new file mode 100644 index 00000000..a0a42650 --- /dev/null +++ b/Core/Models/Eft/Dialog/RemoveMailMessageRequest.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class RemoveMailMessageRequest +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs b/Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs new file mode 100644 index 00000000..8b768067 --- /dev/null +++ b/Core/Models/Eft/Dialog/RemoveUserGroupMailRequest.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class RemoveUserGroupMailRequest +{ + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } + + [JsonPropertyName("uid")] + public string Uid { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/SendMessageRequest.cs b/Core/Models/Eft/Dialog/SendMessageRequest.cs new file mode 100644 index 00000000..1e3c0299 --- /dev/null +++ b/Core/Models/Eft/Dialog/SendMessageRequest.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using Core.Models.Enums; + +namespace Core.Models.Eft.Dialog; + +public class SendMessageRequest { + [JsonPropertyName("dialogId")] + public string DialogId { get; set; } + + [JsonPropertyName("type")] + public MessageType Type { get; set; } + + [JsonPropertyName("text")] + public string Text { get; set; } + + [JsonPropertyName("replyTo")] + public string ReplyTo { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Dialog/SetDialogReadRequestData.cs b/Core/Models/Eft/Dialog/SetDialogReadRequestData.cs new file mode 100644 index 00000000..d1192c9f --- /dev/null +++ b/Core/Models/Eft/Dialog/SetDialogReadRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Dialog; + +public class SetDialogReadRequestData +{ + [JsonPropertyName("dialogId")] + public List DialogId { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/CheckVersionResponse.cs b/Core/Models/Eft/Game/CheckVersionResponse.cs new file mode 100644 index 00000000..bcf70dfa --- /dev/null +++ b/Core/Models/Eft/Game/CheckVersionResponse.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class CheckVersionResponse +{ + [JsonPropertyName("isvalid")] + public bool IsValid { get; set; } + + [JsonPropertyName("latestVersion")] + public string LatestVersion { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameConfigResponse.cs b/Core/Models/Eft/Game/GameConfigResponse.cs new file mode 100644 index 00000000..fff5fadb --- /dev/null +++ b/Core/Models/Eft/Game/GameConfigResponse.cs @@ -0,0 +1,76 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GameConfigResponse +{ + [JsonPropertyName("aid")] + public int Aid { get; set; } + + [JsonPropertyName("lang")] + public string Language { get; set; } + + [JsonPropertyName("languages")] + public Dictionary Languages { get; set; } + + [JsonPropertyName("ndaFree")] + public bool IsNdaFree { get; set; } + + [JsonPropertyName("taxonomy")] + public int Taxonomy { get; set; } + + [JsonPropertyName("activeProfileId")] + public string ActiveProfileId { get; set; } + + [JsonPropertyName("backend")] + public Backend Backend { get; set; } + + [JsonPropertyName("useProtobuf")] + public bool UseProtobuf { get; set; } + + [JsonPropertyName("utc_time")] + public long UtcTime { get; set; } + + /** Total in game time */ + [JsonPropertyName("totalInGame")] + public int TotalInGame { get; set; } + + [JsonPropertyName("reportAvailable")] + public bool IsReportAvailable { get; set; } + + [JsonPropertyName("twitchEventMember")] + public bool IsTwitchEventMember { get; set; } + + [JsonPropertyName("sessionMode")] + public string SessionMode { get; set; } + + [JsonPropertyName("purchasedGames")] + public PurchasedGames PurchasedGames { get; set; } +} + +public class PurchasedGames +{ + [JsonPropertyName("eft")] + public bool IsEftPurchased { get; set; } + + [JsonPropertyName("arena")] + public bool IsArenaPurchased { get; set; } +} + +public class Backend +{ + [JsonPropertyName("Lobby")] + public string Lobby { get; set; } + + [JsonPropertyName("Trading")] + public string Trading { get; set; } + + [JsonPropertyName("Messaging")] + public string Messaging { get; set; } + + [JsonPropertyName("Main")] + public string Main { get; set; } + + [JsonPropertyName("RagFair")] + public string RagFair { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameEmptyCrcRequestData.cs b/Core/Models/Eft/Game/GameEmptyCrcRequestData.cs new file mode 100644 index 00000000..d06653b2 --- /dev/null +++ b/Core/Models/Eft/Game/GameEmptyCrcRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GameEmptyCrcRequestData +{ + [JsonPropertyName("crc")] + public int Crc { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameKeepAliveResponse.cs b/Core/Models/Eft/Game/GameKeepAliveResponse.cs new file mode 100644 index 00000000..23b44449 --- /dev/null +++ b/Core/Models/Eft/Game/GameKeepAliveResponse.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GameKeepAliveResponse +{ + [JsonPropertyName("msg")] + public string Message { get; set; } + + [JsonPropertyName("utc_time")] + public double UtcTime { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameLogoutResponseData.cs b/Core/Models/Eft/Game/GameLogoutResponseData.cs new file mode 100644 index 00000000..74772b66 --- /dev/null +++ b/Core/Models/Eft/Game/GameLogoutResponseData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GameLogoutResponseData +{ + [JsonPropertyName("status")] + public string Status { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameModeRequestData.cs b/Core/Models/Eft/Game/GameModeRequestData.cs new file mode 100644 index 00000000..37c9b125 --- /dev/null +++ b/Core/Models/Eft/Game/GameModeRequestData.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GameModeRequestData +{ + [JsonPropertyName("sessionMode")] + public string? SessionMode { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameModeResponse.cs b/Core/Models/Eft/Game/GameModeResponse.cs new file mode 100644 index 00000000..298e8134 --- /dev/null +++ b/Core/Models/Eft/Game/GameModeResponse.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public enum SessionMode +{ + REGULAR, + PVE +} + +public class GameModeResponse +{ + [JsonPropertyName("gameMode")] + public SessionMode GameMode { get; set; } + + [JsonPropertyName("backendUrl")] + public string BackendUrl { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GameStartResponse.cs b/Core/Models/Eft/Game/GameStartResponse.cs new file mode 100644 index 00000000..c5718bcd --- /dev/null +++ b/Core/Models/Eft/Game/GameStartResponse.cs @@ -0,0 +1,9 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GameStartResponse +{ + [JsonPropertyName("utc_time")] + public double UtcTime { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GetRaidTimeRequest.cs b/Core/Models/Eft/Game/GetRaidTimeRequest.cs new file mode 100644 index 00000000..953a6285 --- /dev/null +++ b/Core/Models/Eft/Game/GetRaidTimeRequest.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GetRaidTimeRequest +{ + [JsonPropertyName("Side")] + public string Side { get; set; } + + [JsonPropertyName("Location")] + public string Location { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/GetRaidTimeResponse.cs b/Core/Models/Eft/Game/GetRaidTimeResponse.cs new file mode 100644 index 00000000..a1a99c68 --- /dev/null +++ b/Core/Models/Eft/Game/GetRaidTimeResponse.cs @@ -0,0 +1,33 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class GetRaidTimeResponse +{ + [JsonPropertyName("RaidTimeMinutes")] + public int RaidTimeMinutes { get; set; } + + [JsonPropertyName("NewSurviveTimeSeconds")] + public int? NewSurviveTimeSeconds { get; set; } + + [JsonPropertyName("OriginalSurvivalTimeSeconds")] + public int OriginalSurvivalTimeSeconds { get; set; } + + [JsonPropertyName("ExitChanges")] + public List ExitChanges { get; set; } +} + +public class ExtractChange +{ + [JsonPropertyName("Name")] + public string Name { get; set; } + + [JsonPropertyName("MinTime")] + public int? MinTime { get; set; } + + [JsonPropertyName("MaxTime")] + public int? MaxTime { get; set; } + + [JsonPropertyName("Chance")] + public int? Chance { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/SendSurveyOpinionRequest.cs b/Core/Models/Eft/Game/SendSurveyOpinionRequest.cs new file mode 100644 index 00000000..0d3337af --- /dev/null +++ b/Core/Models/Eft/Game/SendSurveyOpinionRequest.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class SendSurveyOpinionRequest +{ + [JsonPropertyName("surveyId")] + public int SurveyId { get; set; } + + [JsonPropertyName("answers")] + public List Answers { get; set; } +} + +public class SurveyOpinionAnswer +{ + [JsonPropertyName("questionId")] + public int QuestionId { get; set; } + + [JsonPropertyName("answerType")] + public string AnswerType { get; set; } + + [JsonPropertyName("answers")] + public object Answers { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/ServerDetails.cs b/Core/Models/Eft/Game/ServerDetails.cs new file mode 100644 index 00000000..2b0448b9 --- /dev/null +++ b/Core/Models/Eft/Game/ServerDetails.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class ServerDetails +{ + [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/Eft/Game/SurveyResponseData.cs b/Core/Models/Eft/Game/SurveyResponseData.cs new file mode 100644 index 00000000..91dfae4b --- /dev/null +++ b/Core/Models/Eft/Game/SurveyResponseData.cs @@ -0,0 +1,90 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class SurveyResponseData +{ + [JsonPropertyName("locale")] + public Dictionary> Locale { get; set; } + + [JsonPropertyName("survey")] + public Survey Survey { get; set; } +} + +public class Survey +{ + [JsonPropertyName("id")] + public int Id { get; set; } + + [JsonPropertyName("welcomePageData")] + public WelcomePageData WelcomePageData { get; set; } + + [JsonPropertyName("farewellPageData")] + public FarewellPageData FarewellPageData { get; set; } + + [JsonPropertyName("pages")] + public List> Pages { get; set; } + + [JsonPropertyName("questions")] + public List Questions { get; set; } + + [JsonPropertyName("isNew")] + public bool IsNew { get; set; } +} + +public class WelcomePageData +{ + [JsonPropertyName("titleLocaleKey")] + public string TitleLocaleKey { get; set; } + + [JsonPropertyName("timeLocaleKey")] + public string TimeLocaleKey { get; set; } + + [JsonPropertyName("descriptionLocaleKey")] + public string DescriptionLocaleKey { get; set; } +} + +public class FarewellPageData +{ + [JsonPropertyName("textLocaleKey")] + public string TextLocaleKey { get; set; } +} + +public class SurveyQuestion +{ + [JsonPropertyName("id")] + public int Id { get; set; } + + [JsonPropertyName("sortIndex")] + public int SortIndex { get; set; } + + [JsonPropertyName("titleLocaleKey")] + public string TitleLocaleKey { get; set; } + + [JsonPropertyName("hintLocaleKey")] + public string HintLocaleKey { get; set; } + + [JsonPropertyName("answerLimit")] + public int AnswerLimit { get; set; } + + [JsonPropertyName("answerType")] + public string AnswerType { get; set; } + + [JsonPropertyName("answers")] + public List Answers { get; set; } +} + +public class SurveyAnswer +{ + [JsonPropertyName("id")] + public int Id { get; set; } + + [JsonPropertyName("questionId")] + public int QuestionId { get; set; } + + [JsonPropertyName("sortIndex")] + public int SortIndex { get; set; } + + [JsonPropertyName("localeKey")] + public string LocaleKey { get; set; } +} \ No newline at end of file diff --git a/Core/Models/Eft/Game/VersionValidateRequestData.cs b/Core/Models/Eft/Game/VersionValidateRequestData.cs new file mode 100644 index 00000000..8470f201 --- /dev/null +++ b/Core/Models/Eft/Game/VersionValidateRequestData.cs @@ -0,0 +1,30 @@ +using System.Text.Json.Serialization; + +namespace Core.Models.Eft.Game; + +public class VersionValidateRequestData +{ + [JsonPropertyName("version")] + public Version Version { get; set; } + + [JsonPropertyName("develop")] + public bool Develop { get; set; } +} + +public class Version +{ + [JsonPropertyName("major")] + public string Major { get; set; } + + [JsonPropertyName("minor")] + public string Minor { get; set; } + + [JsonPropertyName("game")] + public string Game { get; set; } + + [JsonPropertyName("backend")] + public string Backend { get; set; } + + [JsonPropertyName("taxonomy")] + public string Taxonomy { get; set; } +} \ No newline at end of file From aef23c9ce132df296c8b29817ce4c1039c0c2bf0 Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 6 Jan 2025 23:58:18 +0000 Subject: [PATCH 4/4] Fix up a few types and comments --- .../Eft/Customization/GetSuitsResponse.cs | 2 +- .../Eft/ItemEvent/ItemEventRouterBase.cs | 88 ++++++++++--------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/Core/Models/Eft/Customization/GetSuitsResponse.cs b/Core/Models/Eft/Customization/GetSuitsResponse.cs index 9565c089..f7efeffe 100644 --- a/Core/Models/Eft/Customization/GetSuitsResponse.cs +++ b/Core/Models/Eft/Customization/GetSuitsResponse.cs @@ -8,5 +8,5 @@ public class GetSuitsResponse public string Id { get; set; } [JsonPropertyName("suites")] - public string[] Suites { get; set; } + public List Suites { get; set; } } \ No newline at end of file diff --git a/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs b/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs index aeadcf82..c2a0bf81 100644 --- a/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs +++ b/Core/Models/Eft/ItemEvent/ItemEventRouterBase.cs @@ -10,24 +10,26 @@ public class ItemEventRouterBase { [JsonPropertyName("warnings")] public List Warnings { get; set; } - + [JsonPropertyName("profileChanges")] - public object ProfileChanges { get; set; } // Note: using object to accommodate string or TProfileChanges + public object ProfileChanges { get; set; } // TODO: Types given TProfileChanges | "" } -public class TProfileChanges : Dictionary { } +public class TProfileChanges : Dictionary +{ +} public class Warning { [JsonPropertyName("index")] public int Index { get; set; } - + [JsonPropertyName("errmsg")] public string ErrorMessage { get; set; } - + [JsonPropertyName("code")] public string Code { get; set; } - + [JsonPropertyName("data")] public object Data { get; set; } } @@ -36,53 +38,53 @@ public class ProfileChange { [JsonPropertyName("_id")] public string Id { get; set; } - + [JsonPropertyName("experience")] public int Experience { get; set; } - + [JsonPropertyName("quests")] public List Quests { get; set; } - + [JsonPropertyName("ragFairOffers")] public List RagFairOffers { get; set; } - + [JsonPropertyName("weaponBuilds")] public List WeaponBuilds { get; set; } - + [JsonPropertyName("equipmentBuilds")] public List EquipmentBuilds { get; set; } - + [JsonPropertyName("items")] public ItemChanges Items { get; set; } - + [JsonPropertyName("production")] public Dictionary Production { get; set; } - + /** Hideout area improvement id */ [JsonPropertyName("improvements")] public Dictionary Improvements { get; set; } - + [JsonPropertyName("skills")] public Skills Skills { get; set; } - + [JsonPropertyName("health")] public Common.Health Health { get; set; } - + [JsonPropertyName("traderRelations")] public Dictionary TraderRelations { get; set; } - + [JsonPropertyName("moneyTransferLimitData")] public MoneyTransferLimits MoneyTransferLimitData { get; set; } - + [JsonPropertyName("repeatableQuests")] public List RepeatableQuests { get; set; } - + [JsonPropertyName("recipeUnlocked")] public Dictionary RecipeUnlocked { get; set; } - + [JsonPropertyName("changedHideoutStashes")] public Dictionary ChangedHideoutStashes { get; set; } - + [JsonPropertyName("questsStatus")] public List QuestsStatus { get; set; } } @@ -91,7 +93,7 @@ public class HideoutStashItem { [JsonPropertyName("id")] public string Id { get; set; } - + [JsonPropertyName("tpl")] public string Template { get; set; } } @@ -100,13 +102,13 @@ public class WeaponBuildChange { [JsonPropertyName("id")] public string Id { get; set; } - + [JsonPropertyName("name")] public string Name { get; set; } - + [JsonPropertyName("root")] public string Root { get; set; } - + [JsonPropertyName("items")] public List Items { get; set; } } @@ -115,22 +117,22 @@ public class EquipmentBuildChange { [JsonPropertyName("id")] public string Id { get; set; } - + [JsonPropertyName("name")] public string Name { get; set; } - + [JsonPropertyName("root")] public string Root { get; set; } - + [JsonPropertyName("items")] public List Items { get; set; } - + [JsonPropertyName("type")] public string Type { get; set; } - + [JsonPropertyName("fastpanel")] public List FastPanel { get; set; } - + [JsonPropertyName("buildType")] public EquipmentBuildType BuildType { get; set; } } @@ -139,10 +141,10 @@ public class ItemChanges { [JsonPropertyName("new")] public List NewItems { get; set; } - + [JsonPropertyName("change")] public List ChangedItems { get; set; } - + [JsonPropertyName("del")] public List DeletedItems { get; set; } // Only needs _id property } @@ -152,16 +154,16 @@ public class TraderData { [JsonPropertyName("salesSum")] public double SalesSum { get; set; } - + [JsonPropertyName("standing")] public double Standing { get; set; } - + [JsonPropertyName("loyalty")] public double Loyalty { get; set; } - + [JsonPropertyName("unlocked")] public bool Unlocked { get; set; } - + [JsonPropertyName("disabled")] public bool Disabled { get; set; } } @@ -170,19 +172,19 @@ public class Product { [JsonPropertyName("_id")] public string Id { get; set; } - + [JsonPropertyName("_tpl")] public string Template { get; set; } - + [JsonPropertyName("parentId")] public string ParentId { get; set; } - + [JsonPropertyName("slotId")] public string SlotId { get; set; } - + [JsonPropertyName("location")] public ItemLocation Location { get; set; } - + [JsonPropertyName("upd")] public Upd Upd { get; set; } } \ No newline at end of file