From 3190646cd069bc7f0c73a2662dd3e8e535561c95 Mon Sep 17 00:00:00 2001 From: TetrisGG Date: Wed, 5 Mar 2025 20:28:25 +0100 Subject: [PATCH] Add Router Comments Add missing Router comments. --- Libraries/Core/Routers/EventOutputHolder.cs | 29 ++++++++++++++++++--- Libraries/Core/Routers/ItemEventRouter.cs | 8 +++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Libraries/Core/Routers/EventOutputHolder.cs b/Libraries/Core/Routers/EventOutputHolder.cs index 90023dfb..c3ba8932 100644 --- a/Libraries/Core/Routers/EventOutputHolder.cs +++ b/Libraries/Core/Routers/EventOutputHolder.cs @@ -81,7 +81,10 @@ public class EventOutputHolder } ); } - + /// + /// Update output object with most recent values from player profile + /// + /// Session id public void UpdateOutputProperties(string sessionId) { var pmcData = _profileHelper.GetPmcProfile(sessionId); @@ -107,6 +110,10 @@ public class EventOutputHolder CleanUpCompleteCraftsInProfile(pmcData.Hideout.Production); } + /// + /// Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started + /// + /// Productions in a profile private void CleanUpCompleteCraftsInProfile(Dictionary? productions) { foreach (var production in productions) @@ -123,7 +130,12 @@ public class EventOutputHolder productions.Remove(production.Key); } } - + + /// + /// Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true + /// + /// Player profile + /// Dictionary of hideout improvements private Dictionary? GetImprovementsFromProfileAndFlagComplete(PmcData pmcData) { foreach (var improvementKey in pmcData.Hideout.Improvements) @@ -139,6 +151,12 @@ public class EventOutputHolder return pmcData.Hideout.Improvements; } + /// + /// Return productions from player profile except those completed crafts the client has already seen + /// + /// Productions from player profile + /// Player session ID + /// Dictionary of hideout productions private Dictionary? GetProductionsFromProfileAndFlagComplete(Dictionary? productions, string sessionId) { foreach (var production in productions) @@ -185,7 +203,12 @@ public class EventOutputHolder limit.RemainingLimit = limit.TotalLimit; } } - + + /// + /// Convert the internal trader data object into an object we can send to the client + /// + /// Server data for traders + /// Dict of trader id + TraderData private Dictionary ConstructTraderRelations(Dictionary traderData) { return traderData.ToDictionary( diff --git a/Libraries/Core/Routers/ItemEventRouter.cs b/Libraries/Core/Routers/ItemEventRouter.cs index 823ebe52..02c30235 100644 --- a/Libraries/Core/Routers/ItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEventRouter.cs @@ -42,7 +42,13 @@ public class ItemEventRouter _itemEventRouters = itemEventRouters.ToList(); _cloner = cloner; } - + + /// + /// Handles ItemEventRouter Requests and processes them. + /// + /// Event request + /// Session ID + /// Item response public ItemEventRouterResponse HandleEvents(ItemEventRouterRequest info, string sessionID) { var output = _eventOutputHolder.GetOutput(sessionID);