diff --git a/Libraries/Core/Routers/ItemEvents/CustomizationItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/CustomizationItemEventRouter.cs index d8435e20..def5055b 100644 --- a/Libraries/Core/Routers/ItemEvents/CustomizationItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/CustomizationItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.Customization; using Core.Models.Eft.ItemEvent; +using Core.Models.Enums; using Core.Models.Utils; namespace Core.Routers.ItemEvents; @@ -29,8 +30,8 @@ public class CustomizationItemEventRouter : ItemEventRouterDefinition { return new List { - new("CustomizationBuy", false), - new("CustomizationSet", false) + new(ItemEventActions.CUSTOMIZATION_BUY, false), + new(ItemEventActions.CUSTOMIZATION_SET, false) }; } @@ -39,9 +40,9 @@ public class CustomizationItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "CustomizationBuy": + case ItemEventActions.CUSTOMIZATION_BUY: return _customizationCallbacks.BuyCustomisation(pmcData, body as BuyClothingRequestData, sessionID); - case "CustomizationSet": + case ItemEventActions.CUSTOMIZATION_SET: return _customizationCallbacks.SetCustomisation(pmcData, body as CustomizationSetRequest, sessionID); default: throw new Exception($"CustomizationItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/HealthItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/HealthItemEventRouter.cs index c8698077..bc87b1fa 100644 --- a/Libraries/Core/Routers/ItemEvents/HealthItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/HealthItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.Health; using Core.Models.Eft.ItemEvent; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,9 +26,9 @@ public class HealthItemEventRouter : ItemEventRouterDefinition { return [ - new HandledRoute("Eat", false), - new HandledRoute("Heal", false), - new HandledRoute("RestoreHealth", false) + new HandledRoute(ItemEventActions.EAT, false), + new HandledRoute(ItemEventActions.HEAL, false), + new HandledRoute(ItemEventActions.RESTORE_HEALTH, false) ]; } @@ -36,11 +37,11 @@ public class HealthItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "Eat": + case ItemEventActions.EAT: return _healthCallbacks.OffraidEat(pmcData, body as OffraidEatRequestData, sessionID); - case "Heal": + case ItemEventActions.HEAL: return _healthCallbacks.OffraidHeal(pmcData, body as OffraidHealRequestData, sessionID); - case "RestoreHealth": + case ItemEventActions.RESTORE_HEALTH: return _healthCallbacks.HealthTreatment(pmcData, body as HealthTreatmentRequestData, sessionID); default: throw new Exception($"HealthItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/InsuranceItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/InsuranceItemEventRouter.cs index 6e54e642..94cd1120 100644 --- a/Libraries/Core/Routers/ItemEvents/InsuranceItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/InsuranceItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.Insurance; using Core.Models.Eft.ItemEvent; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,7 +26,7 @@ public class InsuranceItemEventRouter : ItemEventRouterDefinition { return new List { - new("Insure", false) + new(ItemEventActions.INSURE, false) }; } @@ -34,7 +35,7 @@ public class InsuranceItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "Insure": + case ItemEventActions.INSURE: return _insuranceCallbacks.Insure(pmcData, body as InsureRequestData, sessionID); default: throw new Exception($"InsuranceItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/NoteItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/NoteItemEventRouter.cs index b1a2e6f8..c5e75684 100644 --- a/Libraries/Core/Routers/ItemEvents/NoteItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/NoteItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Notes; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,9 +26,9 @@ public class NoteItemEventRouter : ItemEventRouterDefinition { return new List { - new("AddNote", false), - new("EditNote", false), - new("DeleteNote", false) + new(ItemEventActions.ADD_NOTE, false), + new(ItemEventActions.EDIT_NOTE, false), + new(ItemEventActions.DELETE_NOTE, false) }; } @@ -36,11 +37,11 @@ public class NoteItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "AddNote": + case ItemEventActions.ADD_NOTE: return _noteCallbacks.AddNote(pmcData, body as NoteActionData, sessionID); - case "EditNote": + case ItemEventActions.EDIT_NOTE: return _noteCallbacks.EditNote(pmcData, body as NoteActionData, sessionID); - case "DeleteNote": + case ItemEventActions.DELETE_NOTE: return _noteCallbacks.DeleteNote(pmcData, body as NoteActionData, sessionID); default: throw new Exception($"NoteItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/QuestItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/QuestItemEventRouter.cs index b1e00ca9..a13b5d63 100644 --- a/Libraries/Core/Routers/ItemEvents/QuestItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/QuestItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Quests; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -26,10 +27,10 @@ public class QuestItemEventRouter : ItemEventRouterDefinition { return new List { - new("QuestAccept", false), - new("QuestComplete", false), - new("QuestHandover", false), - new("RepeatableQuestChange", false) + new(ItemEventActions.QUEST_ACCEPT, false), + new(ItemEventActions.QUEST_COMPLETE, false), + new(ItemEventActions.QUEST_HANDOVER, false), + new(ItemEventActions.REPEATABLE_QUEST_CHANGE, false) }; } @@ -38,13 +39,13 @@ public class QuestItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "QuestAccept": + case ItemEventActions.QUEST_ACCEPT: return _questCallbacks.AcceptQuest(pmcData, body as AcceptQuestRequestData, sessionID); - case "QuestComplete": + case ItemEventActions.QUEST_COMPLETE: return _questCallbacks.CompleteQuest(pmcData, body as CompleteQuestRequestData, sessionID); - case "QuestHandover": + case ItemEventActions.QUEST_HANDOVER: return _questCallbacks.HandoverQuest(pmcData, body as HandoverQuestRequestData, sessionID); - case "RepeatableQuestChange": + case ItemEventActions.REPEATABLE_QUEST_CHANGE: return _questCallbacks.ChangeRepeatableQuest(pmcData, body as RepeatableQuestChangeRequest, sessionID); default: throw new Exception($"QuestItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/RagfairItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/RagfairItemEventRouter.cs index 197044e8..d4ae5f1c 100644 --- a/Libraries/Core/Routers/ItemEvents/RagfairItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/RagfairItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Ragfair; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,9 +26,9 @@ public class RagfairItemEventRouter : ItemEventRouterDefinition { return new List { - new("RagFairAddOffer", false), - new("RagFairRemoveOffer", false), - new("RagFairRenewOffer", false) + new(ItemEventActions.RAGFAIR_ADD_OFFER, false), + new(ItemEventActions.RAGFAIR_REMOVE_OFFER, false), + new(ItemEventActions.RAGFAIR_RENEW_OFFER, false) }; } @@ -36,11 +37,11 @@ public class RagfairItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "RagFairAddOffer": + case ItemEventActions.RAGFAIR_ADD_OFFER: return _ragfairCallbacks.AddOffer(pmcData, body as AddOfferRequestData, sessionID); - case "RagFairRemoveOffer": + case ItemEventActions.RAGFAIR_REMOVE_OFFER: return _ragfairCallbacks.RemoveOffer(pmcData, body as RemoveOfferRequestData, sessionID); - case "RagFairRenewOffer": + case ItemEventActions.RAGFAIR_RENEW_OFFER: return _ragfairCallbacks.ExtendOffer(pmcData, body as ExtendOfferRequestData, sessionID); default: throw new Exception($"CustomizationItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/RepairItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/RepairItemEventRouter.cs index 1c729ab6..1a6387ec 100644 --- a/Libraries/Core/Routers/ItemEvents/RepairItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/RepairItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Repair; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,8 +26,8 @@ public class RepairItemEventRouter : ItemEventRouterDefinition { return new List { - new("Repair", false), - new("TraderRepair", false) + new(ItemEventActions.REPAIR, false), + new(ItemEventActions.TRADER_REPAIR, false) }; } @@ -35,9 +36,9 @@ public class RepairItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "Repair": + case ItemEventActions.REPAIR: return _repairCallbacks.Repair(pmcData, body as RepairActionDataRequest, sessionID); - case "TraderRepair": + case ItemEventActions.TRADER_REPAIR: return _repairCallbacks.TraderRepair(pmcData, body as TraderRepairActionDataRequest, sessionID); default: throw new Exception($"RepairItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/TradeItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/TradeItemEventRouter.cs index cbc471a9..13803b8e 100644 --- a/Libraries/Core/Routers/ItemEvents/TradeItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/TradeItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Trade; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,9 +26,9 @@ public class TradeItemEventRouter : ItemEventRouterDefinition { return new List { - new("TradingConfirm", false), - new("RagFairBuyOffer", false), - new("SellAllFromSavage", false) + new(ItemEventActions.TRADING_CONFIRM, false), + new(ItemEventActions.RAGFAIR_BUY_OFFER, false), + new(ItemEventActions.SELL_ALL_FROM_SAVAGE, false) }; } @@ -36,11 +37,11 @@ public class TradeItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "TradingConfirm": + case ItemEventActions.TRADING_CONFIRM: return _tradeCallbacks.ProcessTrade(pmcData, body as ProcessBaseTradeRequestData, sessionID); - case "RagFairBuyOffer": + case ItemEventActions.RAGFAIR_BUY_OFFER: return _tradeCallbacks.ProcessRagfairTrade(pmcData, body as ProcessRagfairTradeRequestData, sessionID); - case "SellAllFromSavage": + case ItemEventActions.SELL_ALL_FROM_SAVAGE: return _tradeCallbacks.SellAllFromSavage(pmcData, body as SellScavItemsToFenceRequestData, sessionID); default: throw new Exception($"TradeItemEventRouter being used when it cant handle route {url}"); diff --git a/Libraries/Core/Routers/ItemEvents/WishlistItemEventRouter.cs b/Libraries/Core/Routers/ItemEvents/WishlistItemEventRouter.cs index 882331e7..51bd1257 100644 --- a/Libraries/Core/Routers/ItemEvents/WishlistItemEventRouter.cs +++ b/Libraries/Core/Routers/ItemEvents/WishlistItemEventRouter.cs @@ -5,6 +5,7 @@ using Core.Models.Eft.Common; using Core.Models.Eft.Common.Request; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Wishlist; +using Core.Models.Enums; namespace Core.Routers.ItemEvents; @@ -25,9 +26,9 @@ public class WishlistItemEventRouter : ItemEventRouterDefinition { return new List { - new("AddToWishList", false), - new("RemoveFromWishList", false), - new("ChangeWishlistItemCategory", false) + new(ItemEventActions.ADD_TO_WISHLIST, false), + new(ItemEventActions.REMOVE_FROM_WISHLIST, false), + new(ItemEventActions.CHANGE_WISHLIST_ITEM_CATEGORY, false) }; } @@ -36,11 +37,11 @@ public class WishlistItemEventRouter : ItemEventRouterDefinition { switch (url) { - case "AddToWishList": + case ItemEventActions.ADD_TO_WISHLIST: return _wishlistCallbacks.AddToWishlist(pmcData, body as AddToWishlistRequest, sessionID); - case "RemoveFromWishList": + case ItemEventActions.REMOVE_FROM_WISHLIST: return _wishlistCallbacks.RemoveFromWishlist(pmcData, body as RemoveFromWishlistRequest, sessionID); - case "ChangeWishlistItemCategory": + case ItemEventActions.CHANGE_WISHLIST_ITEM_CATEGORY: return _wishlistCallbacks.ChangeWishlistItemCategory(pmcData, body as ChangeWishlistItemCategoryRequest, sessionID); default: throw new Exception($"CustomizationItemEventRouter being used when it cant handle route {url}");