From e5481361cff5dcd11e22680c69d1d178b5eb0824 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 19:49:49 -0500 Subject: [PATCH 1/9] Add BuildController.cs --- Core/Controllers/BotController.cs | 9 +++- Core/Controllers/BuildController.cs | 66 +++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 Core/Controllers/BuildController.cs diff --git a/Core/Controllers/BotController.cs b/Core/Controllers/BotController.cs index dbffe2b7..1b3a809a 100644 --- a/Core/Controllers/BotController.cs +++ b/Core/Controllers/BotController.cs @@ -1,4 +1,5 @@ using Core.Models.Common; +using Core.Models.Eft.Common; using Core.Models.Eft.Common.Tables; using Core.Models.Spt.Config; @@ -83,10 +84,14 @@ public class BotController { throw new NotImplementedException(); } - - + public int GetBotCap() { throw new NotImplementedException(); } + + public object GetAiBotBrainTypes() // TODO: Returns `any` in the node server + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/BuildController.cs b/Core/Controllers/BuildController.cs new file mode 100644 index 00000000..91299800 --- /dev/null +++ b/Core/Controllers/BuildController.cs @@ -0,0 +1,66 @@ +using Core.Models.Eft.Profile; + +namespace Core.Controllers; + +public class BuildController +{ + /// + /// Handle client/handbook/builds/my/list + /// + /// + /// + public UserBuilds GetUserBuilds(string sessionID) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/builds/weapon/save + /// + /// + /// + public void SaveWeaponBuild(string sessionId, PresetBuildActionRequestData body) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/builds/equipment/save event + /// + /// + /// + public void SaveEquipmentBuild(string sessionId, PresetBuildActionRequestData request) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/builds/delete + /// + /// + /// + public void RemoveBuild(string sessionId, RemoveBuildReqestData request) + { + RemovePlayerBuild(request.id, sessionId); + } + + /// + /// Handle client/builds/magazine/save + /// + /// + /// + public void CreateMagazineTemplate(string sessionId, SetMagazineRequest request) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + private void RemovePlayerBuild(string idToRemove, string sessionId) + { + throw new NotImplementedException(); + } +} \ No newline at end of file From a1cad6b2dc5bd99302d9dacd18ebcc1116d0ef96 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 20:22:50 -0500 Subject: [PATCH 2/9] More controllers --- Core/Controllers/ClientLogController.cs | 15 +++ Core/Controllers/CustomizationController.cs | 141 ++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 Core/Controllers/ClientLogController.cs create mode 100644 Core/Controllers/CustomizationController.cs diff --git a/Core/Controllers/ClientLogController.cs b/Core/Controllers/ClientLogController.cs new file mode 100644 index 00000000..3dcab6af --- /dev/null +++ b/Core/Controllers/ClientLogController.cs @@ -0,0 +1,15 @@ +using Core.Models.Spt.Logging; + +namespace Core.Controllers; + +public class ClientLogController +{ + /// + /// Handle /singleplayer/log + /// + /// + public void ClientLog(ClientLogRequest logRequest) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Core/Controllers/CustomizationController.cs b/Core/Controllers/CustomizationController.cs new file mode 100644 index 00000000..f8e7307b --- /dev/null +++ b/Core/Controllers/CustomizationController.cs @@ -0,0 +1,141 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Hideout; +using Core.Models.Eft.Profile; + +namespace Core.Controllers; + +public class CustomizationController +{ + /// + /// Get purchasable clothing items from trader that match players side (usec/bear) + /// + /// trader to look up clothing for + /// Session id + /// Suit array + public Suit GetTraderSuits(string traderId, string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle CustomizationBuy event + /// Purchase/unlock a clothing item from a trader + /// + /// Player profile + /// Request object + /// Session id + /// ItemEventRouterResponse + public ItemEventRouterResponse BuyClothing( + PmcData pmcData, + BuyClothingRequest buyClothingRequest, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Update output object and player profile with purchase details + /// + /// Session id + /// Player profile + /// Clothing purchased + /// Client response + private void PayForClothingItems( + string sessionId, + PmcData pmcData, + List itemsToPayForClothingWith, + ItemEventRouterResponse output) + { + throw new NotImplementedException(); + } + + /// + /// Update output object and player profile with purchase details for single piece of clothing + /// + /// Session id + /// Player profile + /// Payment details + /// Client response + private void PayForClothingItem( + string sessionId, + PmcData pmcData, + PaymentItemForClothing paymentItemDetails, + ItemEventRouterResponse output) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + private List GetAllTraderSuits(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/hideout/customization/offer/list + /// + /// + /// + /// + public HideoutCustomisationStorage GetHideoutCustomisation( + string sessionId, + EmptyRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/customization/storage + /// + /// + /// + /// + public List GetCustomisationStorage( + string sessionId, + EmptyRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + private string GetGameEdition(SptProfile profile) + { + throw new NotImplementedException(); + } + + /// + /// Handle CustomizationSet event + /// + /// + /// + /// + /// + public ItemEventRouterResponse SetClothing( + string sessionId, + CustomizationSetRequest request, + PmcData pmcData) + { + throw new NotImplementedException(); + } + + /// + /// Applies a purchased suit to the players doll + /// + /// Suit to apply to profile + /// Profile to update + private void ApplyClothingItemToProfile( + CustomizationSetOption customization, + PmcData pmcData) + { + throw new NotImplementedException(); + } +} \ No newline at end of file From 99c0743b2b927dfac4f238c52b9172e62414ddca Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:15:12 -0500 Subject: [PATCH 3/9] Add DialogueController.cs --- Core/Controllers/DialogueController.cs | 250 +++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 Core/Controllers/DialogueController.cs diff --git a/Core/Controllers/DialogueController.cs b/Core/Controllers/DialogueController.cs new file mode 100644 index 00000000..5780e3b8 --- /dev/null +++ b/Core/Controllers/DialogueController.cs @@ -0,0 +1,250 @@ +using Core.Models.Eft.Profile; +using Core.Models.Enums; + +namespace Core.Controllers; + +public class DialogueController +{ + /// + /// + /// + /// + public void RegisterChatBot(DialogueChatBot chatBot) + { + throw new NotImplementedException(); + } + + /// + /// Handle onUpdate spt event + /// + public void Update() + { + throw new NotImplementedException(); + } + + /// + /// Handle client/friend/list + /// + /// session id + /// GetFriendListDataResponse + public GetFriendListDataResponse GetFriendList(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/mail/dialog/list + /// Create array holding trader dialogs and mail interactions with player + /// Set the content of the dialogue on the list tab. + /// + /// Session Id + /// list of dialogs + public List GenerateDialogueList(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Get the content of a dialogue + /// + /// Dialog id + /// Session Id + /// DialogueInfo + public DialogueInfo GetDialogueInfo( + string dialogueId, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Get the users involved in a dialog (player + other party) + /// + /// The dialog to check for users + /// What type of message is being sent + /// Player id + /// UserDialogInfo list + public List GetDialogueUsers( + Dialogue dialogue, + MessageType messageType, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/mail/dialog/view + /// Handle player clicking 'messenger' and seeing all the messages they've received + /// Set the content of the dialogue on the details panel, showing all the messages + /// for the specified dialogue. + /// + /// Get dialog request + /// Session id + /// GetMailDialogViewResponseData object + public GetMailDialogViewResponseData GenerateDialogueView( + GetMailDialogViewResponseData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Get dialog from player profile, create if doesn't exist + /// + /// Player profile + /// get dialog request + /// Dialogue + private Dialogue GetDialogByIdFromProfile( + SptProfile profile, + GetMailDialogViewRequestData request) + { + throw new NotImplementedException(); + } + + /// + /// Get the users involved in a mail between two entities + /// + /// Player profile + /// The participants of the mail + /// UserDialogInfo list + private List GetProfilesForMail( + SptProfile fullProfile, + List? userDialogs) + { + throw new NotImplementedException(); + } + + /// + /// Get a count of messages with attachments from a particular dialog + /// + /// Session id + /// Dialog id + /// Count of messages with attachments + private int GetUnreadMessagesWithAttachmentsCount( + string sessionId, + string dialogueId) + { + throw new NotImplementedException(); + } + + /// + /// Does list have messages with uncollected rewards (includes expired rewards) + /// + /// Messages to check + /// true if uncollected rewards found + private bool MessagesHaveUncollectedRewards(List messages) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/mail/dialog/remove + /// Remove an entire dialog with an entity (trader/user) + /// + /// id of the dialog to remove + /// Player id + public void RemoveDialogue( + string dialogueId, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/mail/dialog/pin && Handle client/mail/dialog/unpin + /// + /// + /// + /// + public void SetDialoguePin( + string dialogueId, + bool shouldPin, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/mail/dialog/read + /// Set a dialog to be read (no number alert/attachment alert) + /// + /// Dialog ids to set as read + /// Player profile id + public void SetRead( + HashSet dialogueIds, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/mail/dialog/getAllAttachments + /// Get all uncollected items attached to mail in a particular dialog + /// + /// Dialog to get mail attachments from + /// Session id + /// GetAllAttachmentsResponse or null if dialogue doesnt exist + public GetAllAttachmentsResponse? GetAllAttachments( + string dialogueId, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// handle client/mail/msg/send + /// + /// + /// + /// + public string SendMessage( + string sessionId, + SendMessageRequest request) + { + throw new NotImplementedException(); + } + + /// + /// Get messages from a specific dialog that have items not expired + /// + /// Session id + /// Dialog to get mail attachments from + /// message list + private List GetActiveMessagesFromDialogue( + string sessionId, + string dialogueId) + { + throw new NotImplementedException(); + } + + /// + /// Return list of messages with uncollected items (includes expired) + /// + /// Messages to parse + /// messages with items to collect + private List GetMessageWithAttachments(List messages) + { + throw new NotImplementedException(); + } + + /// + /// Delete expired items from all messages in player profile. triggers when updating traders. + /// + /// Session id + private void RemoveExpiredItemsFromMessages(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Removes expired items from a message in player profile + /// + /// Session id + /// Dialog id + private void RemoveExpiredItemsFromMessage( + string sessionId, + string dialogueId) + { + throw new NotImplementedException(); + } +} \ No newline at end of file From a3aee5dcf67321430980833281899698c54a59aa Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:46:30 -0500 Subject: [PATCH 4/9] Moreeee controllers --- Core/Controllers/GameController.cs | 182 +++++++++++++++++++++++++ Core/Controllers/HandBookController.cs | 10 ++ Core/Controllers/HealthController.cs | 68 +++++++++ 3 files changed, 260 insertions(+) create mode 100644 Core/Controllers/GameController.cs create mode 100644 Core/Controllers/HandBookController.cs create mode 100644 Core/Controllers/HealthController.cs diff --git a/Core/Controllers/GameController.cs b/Core/Controllers/GameController.cs new file mode 100644 index 00000000..845bfb8c --- /dev/null +++ b/Core/Controllers/GameController.cs @@ -0,0 +1,182 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.Profile; + +namespace Core.Controllers; + +public class GameController +{ + /// + /// Handle client/game/start + /// + /// + /// + /// + /// + public void GameStart( + string url, + EmptyRequestData info, + string sessionId, + long startTimeStampMs) + { + throw new NotImplementedException(); + } + + /// + /// Handles migrating profiles from older SPT versions + /// + /// + /// Formerly migrate39xProfile in node server + private void MigrateProfile(SptProfile fullProfile) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/game/config + /// + /// + /// + public GameConfigResponse GetGameConfig(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/game/mode + /// + /// + /// + /// + public object GetGameMode( // TODO: Returns `any` in node server + string sessionId, + GameModeRequestData requestData) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/server/list + /// + /// + /// + public List GetServer(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/match/group/current + /// + /// + /// + public CurrentGroupResponse GetCurrentGroup(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/checkVersion + /// + /// + /// + public CheckVersionResponse GetValidGameVersion(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/game/keepalive + /// + /// + /// + public GameKeepAliveResponse GetKeepAlive(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle singleplayer/settings/getRaidTime + /// + /// + /// + /// + public GetRaidTimeResponse GetRaidTime( + string sessionId, + GetRaidTimeRequest request) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public SurveyResponseData GetSurvey(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it + /// + /// Player profile + private void WarnOnActiveBotReloadSkill(PmcData pmcProfile) + { + throw new NotImplementedException(); + } + + /// + /// When player logs in, iterate over all active effects and reduce timer + /// + /// Profile to adjust values for + private void UpdateProfileHealthValues(PmcData pmcProfile) + { + throw new NotImplementedException(); + } + + /// + /// Send starting gifts to profile after x days + /// + /// Profile to add gifts to + private void SendPraporGiftsToNewProfiles(PmcData pmcProfile) + { + throw new NotImplementedException(); + } + + /// + /// Get a list of installed mods and save their details to the profile being used + /// + /// Profile to add mod details to + private void SaveActiveModsToProfile(SptProfile fullProfile) + { + throw new NotImplementedException(); + } + + /// + /// Add the logged in players name to PMC name pool + /// + /// Profile of player to get name from + private void AddPlayerToPmcNames(PmcData pmcProfile) + { + throw new NotImplementedException(); + } + + /// + /// Check for a dialog with the key 'undefined', and remove it + /// + /// Profile to check for dialog in + private void CheckForAndRemoveUndefinedDialogues(SptProfile fullProfile) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + private void LogProfileDetails(SptProfile fullProfile) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Core/Controllers/HandBookController.cs b/Core/Controllers/HandBookController.cs new file mode 100644 index 00000000..e12cea12 --- /dev/null +++ b/Core/Controllers/HandBookController.cs @@ -0,0 +1,10 @@ +namespace Core.Controllers; + +// TODO: This seems unused, is it even needed? +public class HandBookController +{ + public void Load() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Core/Controllers/HealthController.cs b/Core/Controllers/HealthController.cs new file mode 100644 index 00000000..a4cf719c --- /dev/null +++ b/Core/Controllers/HealthController.cs @@ -0,0 +1,68 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.Health; + +namespace Core.Controllers; + +public class HealthController +{ + /// + /// When healing in menu + /// + /// Player profile + /// Healing request + /// Player id + /// ItemEventRouterResponse + public ItemEventRouterResponse OffRaidHeal( + PmcData pmcData, + OffraidHealRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle Eat event + /// Consume food/water outside of a raid + /// + /// Player profile + /// Eat request + /// Session id + /// ItemEventRouterResponse + public ItemEventRouterResponse OffRaidEat( + PmcData pmcData, + OffraidEatRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle RestoreHealth event + /// Occurs on post-raid healing page + /// + /// player profile + /// Request data from client + /// Session id + /// + public ItemEventRouterResponse HealthTreatment( + PmcData pmcData, + HealthTreatmentRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// applies skills from hideout workout. + /// + /// Player profile + /// Request data + /// session id + public void ApplyWorkoutChanges( + PmcData pmcData, + WorkoutData info, + string sessionId) + { + throw new NotImplementedException(); + } +} \ No newline at end of file From f3aa6e09d4091ac7999db07f457267b570d4a37f Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:52:57 -0500 Subject: [PATCH 5/9] Add the rest of the controller classes, currently empty --- Core/Controllers/HideoutController.cs | 6 ++++++ Core/Controllers/InRaidController.cs | 6 ++++++ Core/Controllers/InsuranceController.cs | 6 ++++++ Core/Controllers/InventoryController.cs | 6 ++++++ Core/Controllers/LauncherController.cs | 6 ++++++ Core/Controllers/LocationController.cs | 6 ++++++ Core/Controllers/MatchController.cs | 6 ++++++ Core/Controllers/NoteController.cs | 6 ++++++ Core/Controllers/NotifierController.cs | 6 ++++++ Core/Controllers/PresetController.cs | 6 ++++++ Core/Controllers/PrestigeController.cs | 6 ++++++ Core/Controllers/ProfileController.cs | 6 ++++++ Core/Controllers/QuestController.cs | 6 ++++++ Core/Controllers/RagfairController.cs | 6 ++++++ Core/Controllers/RepairController.cs | 6 ++++++ Core/Controllers/RepeatableQuestController.cs | 6 ++++++ Core/Controllers/TradeController.cs | 6 ++++++ Core/Controllers/TraderController.cs | 6 ++++++ Core/Controllers/WeatherController.cs | 6 ++++++ Core/Controllers/WishlistController.cs | 6 ++++++ 20 files changed, 120 insertions(+) create mode 100644 Core/Controllers/HideoutController.cs create mode 100644 Core/Controllers/InRaidController.cs create mode 100644 Core/Controllers/InsuranceController.cs create mode 100644 Core/Controllers/InventoryController.cs create mode 100644 Core/Controllers/LauncherController.cs create mode 100644 Core/Controllers/LocationController.cs create mode 100644 Core/Controllers/MatchController.cs create mode 100644 Core/Controllers/NoteController.cs create mode 100644 Core/Controllers/NotifierController.cs create mode 100644 Core/Controllers/PresetController.cs create mode 100644 Core/Controllers/PrestigeController.cs create mode 100644 Core/Controllers/ProfileController.cs create mode 100644 Core/Controllers/QuestController.cs create mode 100644 Core/Controllers/RagfairController.cs create mode 100644 Core/Controllers/RepairController.cs create mode 100644 Core/Controllers/RepeatableQuestController.cs create mode 100644 Core/Controllers/TradeController.cs create mode 100644 Core/Controllers/TraderController.cs create mode 100644 Core/Controllers/WeatherController.cs create mode 100644 Core/Controllers/WishlistController.cs diff --git a/Core/Controllers/HideoutController.cs b/Core/Controllers/HideoutController.cs new file mode 100644 index 00000000..e672d1fd --- /dev/null +++ b/Core/Controllers/HideoutController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class HideoutController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/InRaidController.cs b/Core/Controllers/InRaidController.cs new file mode 100644 index 00000000..b0dc011f --- /dev/null +++ b/Core/Controllers/InRaidController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class InRaidController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/InsuranceController.cs b/Core/Controllers/InsuranceController.cs new file mode 100644 index 00000000..58bdb714 --- /dev/null +++ b/Core/Controllers/InsuranceController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class InsuranceController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/InventoryController.cs b/Core/Controllers/InventoryController.cs new file mode 100644 index 00000000..3cad5447 --- /dev/null +++ b/Core/Controllers/InventoryController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class InventoryController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/LauncherController.cs b/Core/Controllers/LauncherController.cs new file mode 100644 index 00000000..5255d2be --- /dev/null +++ b/Core/Controllers/LauncherController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class LauncherController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/LocationController.cs b/Core/Controllers/LocationController.cs new file mode 100644 index 00000000..d8fe53b2 --- /dev/null +++ b/Core/Controllers/LocationController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class LocationController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/MatchController.cs b/Core/Controllers/MatchController.cs new file mode 100644 index 00000000..020017bb --- /dev/null +++ b/Core/Controllers/MatchController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class MatchController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/NoteController.cs b/Core/Controllers/NoteController.cs new file mode 100644 index 00000000..53f655f5 --- /dev/null +++ b/Core/Controllers/NoteController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class NoteController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/NotifierController.cs b/Core/Controllers/NotifierController.cs new file mode 100644 index 00000000..3124c340 --- /dev/null +++ b/Core/Controllers/NotifierController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class NotifierController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/PresetController.cs b/Core/Controllers/PresetController.cs new file mode 100644 index 00000000..64000ba5 --- /dev/null +++ b/Core/Controllers/PresetController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class PresetController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/PrestigeController.cs b/Core/Controllers/PrestigeController.cs new file mode 100644 index 00000000..c4973ab2 --- /dev/null +++ b/Core/Controllers/PrestigeController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class PrestigeController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/ProfileController.cs b/Core/Controllers/ProfileController.cs new file mode 100644 index 00000000..f468531a --- /dev/null +++ b/Core/Controllers/ProfileController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class ProfileController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/QuestController.cs b/Core/Controllers/QuestController.cs new file mode 100644 index 00000000..50b51de4 --- /dev/null +++ b/Core/Controllers/QuestController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class QuestController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/RagfairController.cs b/Core/Controllers/RagfairController.cs new file mode 100644 index 00000000..7dc405fd --- /dev/null +++ b/Core/Controllers/RagfairController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class RagfairController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/RepairController.cs b/Core/Controllers/RepairController.cs new file mode 100644 index 00000000..633517c1 --- /dev/null +++ b/Core/Controllers/RepairController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class RepairController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/RepeatableQuestController.cs b/Core/Controllers/RepeatableQuestController.cs new file mode 100644 index 00000000..0c3c57ab --- /dev/null +++ b/Core/Controllers/RepeatableQuestController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class RepeatableQuestController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/TradeController.cs b/Core/Controllers/TradeController.cs new file mode 100644 index 00000000..265ab05f --- /dev/null +++ b/Core/Controllers/TradeController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class TradeController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/TraderController.cs b/Core/Controllers/TraderController.cs new file mode 100644 index 00000000..0a7e5655 --- /dev/null +++ b/Core/Controllers/TraderController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class TraderController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/WeatherController.cs b/Core/Controllers/WeatherController.cs new file mode 100644 index 00000000..2f47d67e --- /dev/null +++ b/Core/Controllers/WeatherController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class WeatherController +{ + // TODO +} \ No newline at end of file diff --git a/Core/Controllers/WishlistController.cs b/Core/Controllers/WishlistController.cs new file mode 100644 index 00000000..c7a498c8 --- /dev/null +++ b/Core/Controllers/WishlistController.cs @@ -0,0 +1,6 @@ +namespace Core.Controllers; + +public class WishlistController +{ + // TODO +} \ No newline at end of file From 7b752970ffebc088d50d9913a58397e5751b3ea8 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:32:42 -0500 Subject: [PATCH 6/9] More prototypes --- Core/Controllers/InRaidController.cs | 60 ++++++++++- Core/Controllers/LauncherController.cs | 142 ++++++++++++++++++++++++- Core/Controllers/LocationController.cs | 21 +++- 3 files changed, 220 insertions(+), 3 deletions(-) diff --git a/Core/Controllers/InRaidController.cs b/Core/Controllers/InRaidController.cs index b0dc011f..1644f02f 100644 --- a/Core/Controllers/InRaidController.cs +++ b/Core/Controllers/InRaidController.cs @@ -2,5 +2,63 @@ namespace Core.Controllers; public class InRaidController { - // TODO + /// + /// Save locationId to active profiles in-raid object AND app context + /// + /// Session id + /// Register player request + public void AddPlayer( + string sessionId, + RegisterPlayerRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// Handle raid/profile/scavsave + /// Save profile state to disk + /// Handles pmc/pscav + /// + /// + /// + public void SavePostRaidProfileForScav( + ScavSaveRequestData offRaidProfileData, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Get the inraid config from configs/inraid.json + /// + public void GetInRaidConfig() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public float GetTraitorScavHostileChance( + string url, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + public List GetBossConvertSettings( + string url, + string sessionId) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/LauncherController.cs b/Core/Controllers/LauncherController.cs index 5255d2be..cb2d4ac2 100644 --- a/Core/Controllers/LauncherController.cs +++ b/Core/Controllers/LauncherController.cs @@ -1,6 +1,146 @@ +using Core.Models.Eft.Profile; +using Core.Models.Spt.Mod; + namespace Core.Controllers; public class LauncherController { - // TODO + /// + /// + /// + /// + public ConnectResponse Connect() + { + throw new NotImplementedException(); + } + + /// + /// Get descriptive text for each of the profile edtions a player can choose, keyed by profile.json profile type + /// e.g. "Edge Of Darkness" + /// + /// Dictionary of profile types with related descriptive text + private Dictionary GetProfileDescriptions() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public Info Find(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public string Login(LoginRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public string Register(RegisterData info) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + private string CreateAccount(RegisterData info) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + private string GenerateProfileId() + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + private string FormatId( + long timeStamp, + int counter) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public string ChangeUsername(ChangeRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public string ChangePassword(ChangeRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// Handle launcher requesting profile be wiped + /// + /// RegisterData + /// Session id + public string Wipe(RegisterData info) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + public string GetCompatibleTarkovVersion() + { + throw new NotImplementedException(); + } + + /// + /// Get the mods the server has currently loaded + /// + /// Dictionary of mod name and mod details + public Dictionary GetLoadedServerMods() // TODO: We no longer use a package.json + { + throw new NotImplementedException(); + } + + /// + /// Get the mods a profile has ever loaded into game with + /// + /// Player id + /// List of mod details + public List GetServerModsProfileUsed(string sessionId) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/LocationController.cs b/Core/Controllers/LocationController.cs index d8fe53b2..4f17a525 100644 --- a/Core/Controllers/LocationController.cs +++ b/Core/Controllers/LocationController.cs @@ -2,5 +2,24 @@ namespace Core.Controllers; public class LocationController { - // TODO + /// + /// Handle client/locations + /// Get all maps base location properties without loot data + /// + /// Players Id + /// LocationsGenerateAllResponse + public LocationsGenerateAllResponse GenerateAll(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/airdrop/loot + /// + /// + /// + public GetAirDropLootResponse GetAirDropLoot(GetAirDropLootRequest request) + { + throw new NotImplementedException(); + } } \ No newline at end of file From 51bdca38fad904d211e764a663cc14b66033b7f9 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:58:14 -0500 Subject: [PATCH 7/9] More controller prototypes --- Core/Controllers/MatchController.cs | 90 +++++++++++++++++++++++++- Core/Controllers/NoteController.cs | 47 +++++++++++++- Core/Controllers/NotifierController.cs | 33 +++++++++- Core/Controllers/PresetController.cs | 8 ++- Core/Controllers/PrestigeController.cs | 28 +++++++- Core/Controllers/WeatherController.cs | 19 +++++- Core/Controllers/WishlistController.cs | 47 +++++++++++++- 7 files changed, 265 insertions(+), 7 deletions(-) diff --git a/Core/Controllers/MatchController.cs b/Core/Controllers/MatchController.cs index 020017bb..13c5854d 100644 --- a/Core/Controllers/MatchController.cs +++ b/Core/Controllers/MatchController.cs @@ -2,5 +2,93 @@ namespace Core.Controllers; public class MatchController { - // TODO + /// + /// + /// + /// + public bool GetEnabled() + { + throw new NotImplementedException(); + } + + /// + /// Handle client/match/group/delete + /// + /// + public void DeleteGroup(object info) // TODO: info is `any` in the node server + { + throw new NotImplementedException(); + } + + /// + /// Handle match/group/start_game + /// + /// + /// + /// + public ProfileStatusResponse JoinMatch( + MatchGroupStartGameRequest info, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/match/group/status + /// + /// + /// + public MatchGroupStatusReponse GetGroupStatus( + MatchGroupStatusRequest info) + { + throw new NotImplementedException(); + } + + /// + /// Handle /client/raid/configuration + /// + /// + /// + public void ConfigureOfflineRaid( + GetRaidConfigurationRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Convert a difficulty value from pre-raid screen to a bot difficulty + /// + /// dropdown difficulty value + /// bot difficulty + private string ConvertDifficultyDropdownIntoBotDifficulty( + string botDifficulty) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/match/local/start + /// + /// + /// + /// + public StartLocalRaidResponseData StartLocalRaid( + string sessionId, + StartLocalRaidRequestData request) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/match/local/end + /// + /// + /// + public void EndLocalRaid( + string sessionId, + EndLocalRaidRequestData request) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/NoteController.cs b/Core/Controllers/NoteController.cs index 53f655f5..075a889b 100644 --- a/Core/Controllers/NoteController.cs +++ b/Core/Controllers/NoteController.cs @@ -1,6 +1,51 @@ +using Core.Models.Eft.Common; + namespace Core.Controllers; public class NoteController { - // TODO + /// + /// + /// + /// + /// + /// + /// + public ItemEventRouterResponse AddNote( + PmcData pmcData, + NoteActionBody body, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + /// + public ItemEventRouterResponse EditNote( + PmcData pmcData, + NoteActionBody body, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + /// + /// + public ItemEventRouterResponse DeleteNote( + PmcData pmcData, + NoteActionBody body, + string sessionId) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/NotifierController.cs b/Core/Controllers/NotifierController.cs index 3124c340..4f0bc33f 100644 --- a/Core/Controllers/NotifierController.cs +++ b/Core/Controllers/NotifierController.cs @@ -2,5 +2,36 @@ namespace Core.Controllers; public class NotifierController { - // TODO + /// + /// Resolve an array of session notifications. + /// + /// If no notifications are currently queued then intermittently check for new notifications until either + /// one or more appear or when a timeout expires. + /// If no notifications are available after the timeout, use a default message. + /// + /// + public async Task NotifyAsync(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// + /// + /// + /// + public string GetServer(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/notifier/channel/create + /// + /// + /// + public NotifierChannel GetChannel(string sessionId) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/PresetController.cs b/Core/Controllers/PresetController.cs index 64000ba5..f33380da 100644 --- a/Core/Controllers/PresetController.cs +++ b/Core/Controllers/PresetController.cs @@ -2,5 +2,11 @@ namespace Core.Controllers; public class PresetController { - // TODO + /// + /// + /// + public void Initialize() + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/PrestigeController.cs b/Core/Controllers/PrestigeController.cs index c4973ab2..2e8d95f3 100644 --- a/Core/Controllers/PrestigeController.cs +++ b/Core/Controllers/PrestigeController.cs @@ -1,6 +1,32 @@ +using Core.Models.Eft.Common.Tables; + namespace Core.Controllers; public class PrestigeController { - // TODO + /// + /// Handle /client/prestige/list + /// + /// + /// + /// + public Prestige GetPrestige( + string sessionId, + EmptyRequestData info) + { + throw new NotImplementedException(); + } + + /// + /// Handle /client/prestige/obtain + /// + /// + /// + /// + public object ObtainPrestige( // TODO: returns `any` in the node server, not implemented either + string sessionId, + EmptyRequestData info) + { + throw new NotImplementedException("Method not Implemented"); + } } \ No newline at end of file diff --git a/Core/Controllers/WeatherController.cs b/Core/Controllers/WeatherController.cs index 2f47d67e..a5ab2d39 100644 --- a/Core/Controllers/WeatherController.cs +++ b/Core/Controllers/WeatherController.cs @@ -2,5 +2,22 @@ namespace Core.Controllers; public class WeatherController { - // TODO + /// + /// Handle client/weather + /// + /// + public WeatherData Generate() + { + throw new NotImplementedException(); + } + + /// + /// Handle client/localGame/weather + /// + /// + /// + public GetLocalWeatherResponseData GenerateLocal(string sessionId) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/WishlistController.cs b/Core/Controllers/WishlistController.cs index c7a498c8..64386856 100644 --- a/Core/Controllers/WishlistController.cs +++ b/Core/Controllers/WishlistController.cs @@ -1,6 +1,51 @@ +using Core.Models.Eft.Common; + namespace Core.Controllers; public class WishlistController { - // TODO + /// + /// Handle AddToWishList + /// + /// + /// + /// + /// + public ItemEventRouterResponse AddToWishList( + PmcData pmcData, + AddItemToWishlistRequest request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle RemoveFromWishList event + /// + /// + /// + /// + /// + public ItemEventRouterResponse RemoveFromWishList( + PmcData pmcData, + RemoveFromWishlistRequest request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle changeWishlistItemCategory event + /// + /// + /// + /// + /// + public ItemEventRouterResponse ChangeWishListItemCategory( + PmcData pmcData, + ChangeWishlistItemCategoryRequest request, + string sessionId) + { + throw new NotImplementedException(); + } } \ No newline at end of file From d9aa0c4f422c9acc315c8586365be640c440a9e9 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:25:13 -0500 Subject: [PATCH 8/9] Trade and Trader controllers --- Core/Controllers/TradeController.cs | 143 ++++++++++++++++++++++++++- Core/Controllers/TraderController.cs | 81 ++++++++++++++- 2 files changed, 222 insertions(+), 2 deletions(-) diff --git a/Core/Controllers/TradeController.cs b/Core/Controllers/TradeController.cs index 265ab05f..807767a0 100644 --- a/Core/Controllers/TradeController.cs +++ b/Core/Controllers/TradeController.cs @@ -1,6 +1,147 @@ +using Core.Models.Eft.Common; +using Core.Models.Eft.Common.Tables; +using Core.Models.Eft.Ragfair; +using Core.Models.Enums; + namespace Core.Controllers; public class TradeController { - // TODO + /// + /// Handle TradingConfirm event + /// + /// + /// + /// + /// + public ItemEventRouterResponse ConfirmTrading( + PmcData pmcData, + ProcessBaseTradeRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Handle RagFairBuyOffer event + /// + /// + /// + /// + /// + public ItemEventRouterResponse ConfirmRagfairTrading( + PmcData pmcData, + ProcessRagfairTradeRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Buy an item off the flea sold by a trader + /// + /// Session id + /// Player profile + /// Offer being purchased + /// request data from client + /// Output to send back to client + private void BuyTraderItemFromRagfair( + string sessionId, + PmcData pmcData, + RagfairOffer fleaOffer, + OfferRequest offerRequest, + ItemEventRouterResponse output) + { + throw new NotImplementedException(); + } + + /// + /// Buy an item off the flea sold by a PMC + /// + /// Session id + /// Player profile + /// Offer being purchased + /// request data from client + /// Output to send back to client + private void BuyPmcItemFromRagfair( + string sessionId, + PmcData pmcData, + RagfairOffer fleaOffer, + OfferRequest offerRequest, + ItemEventRouterResponse output) + { + throw new NotImplementedException(); + } + + /// + /// Is the provided offerid and ownerid from a player made offer + /// + /// id of the offer + /// Owner id + /// true if offer was made by a player + private bool IsPlayerOffer( + string offerId, + string offerOwnerId) + { + throw new NotImplementedException(); + } + + /// + /// Does Player have necessary trader loyalty to purchase flea offer + /// + /// Flea offer being bought + /// Player profile + /// True if player can buy offer + private bool PlayerLacksTraderLoyaltyLevelToBuyOffer( + RagfairOffer fleaOffer, + PmcData pmcData) + { + throw new NotImplementedException(); + } + + /// + /// Handle SellAllFromSavage event + /// + /// + /// + /// + /// + public ItemEventRouterResponse SellScavItemsToFence( + PmcData pmcData, + SellScavItemsToFenceRequestData request, + string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Send the specified rouble total to player as mail + /// + /// Session id + /// amount of roubles to send + /// Trader to sell items to + private void MailMoneyToPlayer( + string sessionId, + int roublesToSend, + Traders trader) // TODO: This is a static class now and cannot be passed as a param. + { + throw new NotImplementedException(); + } + + /// + /// Looks up an items children and gets total handbook price for them + /// + /// parent item that has children we want to sum price of + /// All items (parent + children) + /// Prices of items from handbook + /// Trader being sold to, to perform buy category check against + /// Rouble price + private int GetPriceOfItemAndChildren( + string parentItemId, + List items, + Dictionary handbookPrices, + TraderBase traderDetails) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Core/Controllers/TraderController.cs b/Core/Controllers/TraderController.cs index 0a7e5655..00effd9b 100644 --- a/Core/Controllers/TraderController.cs +++ b/Core/Controllers/TraderController.cs @@ -1,6 +1,85 @@ +using Core.Models.Eft.Common.Tables; + namespace Core.Controllers; public class TraderController { - // TODO + /// + /// Runs when onLoad event is fired + /// Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService + /// Store timestamp of next assort refresh in nextResupply property of traders .base object + /// + public void Load() + { + throw new NotImplementedException(); + } + + /// + /// Runs when onUpdate is fired + /// If current time is > nextResupply(expire) time of trader, refresh traders assorts and + /// Fence is handled slightly differently + /// + /// + public bool Update() + { + throw new NotImplementedException(); + } + + /// + /// Handle client/trading/api/traderSettings + /// + /// session id + /// Return a list of all traders + public List GetAllTraders(string sessionId) + { + throw new NotImplementedException(); + } + + /// + /// Order traders by their traderId (Ttid) + /// + /// First trader to compare + /// Second trader to compare + /// 1,-1 or 0 + private int SortByTraderId( + TraderBase traderA, + TraderBase traderB) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/trading/api/getTrader + /// + /// + /// + /// + public TraderBase GetTrader( + string sessionId, + string traderId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/trading/api/getTraderAssort + /// + /// + /// + /// + public TraderAssort GetAssort( + string sessionId, + string traderId) + { + throw new NotImplementedException(); + } + + /// + /// Handle client/items/prices/TRADERID + /// + /// + public GetItemPricesResponse GetItemPrices() + { + throw new NotImplementedException(); + } } \ No newline at end of file From 99ae3147fe2154c7f1c556d93db97ad5098ec80d Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Tue, 7 Jan 2025 01:41:07 -0500 Subject: [PATCH 9/9] Repair controller --- Core/Controllers/RepairController.cs | 35 +++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Core/Controllers/RepairController.cs b/Core/Controllers/RepairController.cs index 633517c1..584840bc 100644 --- a/Core/Controllers/RepairController.cs +++ b/Core/Controllers/RepairController.cs @@ -1,6 +1,39 @@ +using Core.Models.Eft.Common; + namespace Core.Controllers; public class RepairController { - // TODO + /// + /// Handle TraderRepair event + /// Repair with trader + /// + /// session id + /// endpoint request data + /// player profile + /// item event router action + public ItemEventRouterResponse TraderRepair( + string sessionId, + TraderRepairActionDataRequest body, + PmcData pmcData) + { + throw new NotImplementedException(); + } + + /// + /// Handle Repair event + /// Repair with repair kit + /// + /// session id + /// endpoint request data + /// player profile + /// + /// + public ItemEventRouterResponse RepairWithKit( + string sessionId, + RepairActionDataRequest body, + PmcData pmcData) + { + throw new NotImplementedException(); + } } \ No newline at end of file