From 683a2d306dccd445118a0a0f98a3753272e209a2 Mon Sep 17 00:00:00 2001 From: SeoheeKhang Date: Wed, 16 Aug 2023 03:32:57 +0900 Subject: [PATCH 1/9] Update ko-KR.xml Add translate text --- src/StatisticsAnalysisTool/Languages/ko-KR.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/StatisticsAnalysisTool/Languages/ko-KR.xml b/src/StatisticsAnalysisTool/Languages/ko-KR.xml index 335f1c381..4d4df56b0 100644 --- a/src/StatisticsAnalysisTool/Languages/ko-KR.xml +++ b/src/StatisticsAnalysisTool/Languages/ko-KR.xml @@ -782,4 +782,11 @@ 프로그램을 시작할 수 있는 다른 경로 다른 경로에 있는 프로그램을 시작할 수 없습니다 낚시 + Albion Online 게임 폴더 선택 + 올바른 Albion Online 게임 폴더를 선택하세요. + 올바른 폴더를 선택하세요 + 기본 게임 폴더를 선택하세요.. + 확인 + 총 치유량 중 초과 치유량(Overheal) 비율 + 초과 치유를 제외한 치유량 From aa6ca2d1456601c7f3277fc4fc2dfb2b4148911c Mon Sep 17 00:00:00 2001 From: IsNULLibi Date: Tue, 15 Aug 2023 23:09:17 +0300 Subject: [PATCH 2/9] Update ru-RU.xml --- .../Languages/ru-RU.xml | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/StatisticsAnalysisTool/Languages/ru-RU.xml b/src/StatisticsAnalysisTool/Languages/ru-RU.xml index 37d068836..7cbce8c17 100644 --- a/src/StatisticsAnalysisTool/Languages/ru-RU.xml +++ b/src/StatisticsAnalysisTool/Languages/ru-RU.xml @@ -84,8 +84,8 @@ Правая рука Голова Обувь - Сумка - Плащ + Сумки + Плащи Еда Игрок Общая информация @@ -120,18 +120,18 @@ Загрузить все предметы Неизвестно - Тканевые мантии - Тканевые колпаки - Тканевые сандалии - Кожаные куртки - Кожаные капюшоны - Кожаные ботинки + Тканевая броня + Тканевый шлем + Тканевая обувь + Кожаная броня + Кожаный шлем + Кожаная обувь Латная броня - Латные шлемы - Латные сапоги + Латный шлем + Латная обувь Уникальная броня - Уникальная шлемы - Уникальная сапоги + Уникальные шлемы + Уникальные сапоги Броня Магия @@ -139,10 +139,10 @@ Левая рука Дальний бой - Звериное сердце + Сердце зверя Сердце горы - Каменное сердце - Древесное сердце + Сердце камня + Сердце древа Сердце лозы Еда @@ -170,34 +170,34 @@ Уникальное Одежда жнеца - Рюкзак жнеца - Шапка жнеца - Сапоги жнеца + Шапка жнеца + Сапоги жнеца + Рюкзак жнеца Одежда рыбака - Рюкзак рыбака - Шапка рыбака - Сапоги рыбака + Шапка рыбака + Сапоги рыбака + Рюкзак рыбака Одежда свежевателя - Рюкзак свежевателя - Шапка свежевателя - Сапоги свежевателя + Шапка свежевателя + Сапоги свежевателя + Рюкзак свежевателя Одежда шахтера - Рюкзак шахтера - Шапка шахтера - Сапоги шахтера + Шапка шахтера + Сапоги шахтера + Рюкзак шахтера Одежда каменолома - Рюкзак каменолома - Шапка каменолома - Сапоги каменолома + Шапка каменолома + Сапоги каменолома + Рюкзак каменолома Одежда дровосека - Рюкзак дровосека - Шапка дровосека - Сапоги дровосека + Шапка дровосека + Сапоги дровосека + Рюкзак дровосека Bridgewatch Caerleon @@ -247,13 +247,13 @@ Ткань Волокно - Шкуры + Шкура Кожа Слитки Руда Древесина Брусья - Камни + Камень Блоки Знак арены @@ -689,7 +689,7 @@ Отслеживать собирательство Эта неделя Прошлая неделя - Обычное + Общие сведения Больше всего собрано Большe всего собрано на локации Всего ресурсов @@ -786,4 +786,6 @@ Пожалуста, выберите правильную папку Выбрать папку с игрой... Подтвердить + Процент перехила от общего значения лечения + Лечение без перехила From 08ebf0bad9c9adc7c6587dfbeeddd5af450d87eb Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 16 Aug 2023 09:00:27 +0200 Subject: [PATCH 3/9] EventCode adjustments --- .../Network/EventCodes.cs | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/StatisticsAnalysisTool/Network/EventCodes.cs b/src/StatisticsAnalysisTool/Network/EventCodes.cs index bcc186c85..8310a3143 100644 --- a/src/StatisticsAnalysisTool/Network/EventCodes.cs +++ b/src/StatisticsAnalysisTool/Network/EventCodes.cs @@ -262,9 +262,9 @@ public enum EventCodes InvitedToArenaMatch, PlayerCounts, OtherGrabbedLoot, - InCombatStateUpdate = 263, // map[0:671362 1:true 2:true 252:257] | 1 = true; player hits enemy | 2 = true; enemy hits player - GrabbedLoot = 264, // LOOT: map[0:424 1:Triky313 2:Bruno313 4:1841 5:1 252:256] | SILVER: map[0:6436 2:Triky313 3:true 5:1550115 252:256] (0: ObjectId, 1: LootedBody, 2: Looter, 4: ItemId, 5: Quantity) - SiegeCampClaimStart = 265, + InCombatStateUpdate = 262, // map[0:671362 1:true 2:true 252:257] | 1 = true; player hits enemy | 2 = true; enemy hits player + GrabbedLoot = 263, // LOOT: map[0:424 1:Triky313 2:Bruno313 4:1841 5:1 252:256] | SILVER: map[0:6436 2:Triky313 3:true 5:1550115 252:256] (0: ObjectId, 1: LootedBody, 2: Looter, 4: ItemId, 5: Quantity) + SiegeCampClaimStart = 264, SiegeCampClaimCancel, SiegeCampClaimFinished, SiegeCampScheduleResult, @@ -379,12 +379,12 @@ public enum EventCodes TutorialUpdate, TriggerHintBox, RandomDungeonPositionInfo, - NewLootChest = 378, // map[0:23 1:[20.5 177.5] 2:423 3:KEEPER_SOLO_BOOKCHEST_STANDARD 4:FOREST_GREEN_LOOTCHEST_KEEPER_SOLO_BOOKCHEST_STANDARD 5:4 6:637734315213820408 7:[] 8:[] 13:true 252:367] // map[0:4399 1:[165 -263] 3:TREASURE_SOLO_UNCOMMON 4:SWAMP_DEAD_LOOTCHEST_TREASURE_SOLO_UNCOMMON 5:4 6:637926439332719127 7:[] 8:[] 13:true 14:SWAMP_DEAD_TREASURE_SOLO 16:31ff503a-ded6-53d6-974a-7e32e3126457 252:370] - UpdateLootChest = 379, // 0=ObjectId, 3=PlayerGuid, 4=PlayerGuid, 7=Free4All map[0:4769 1:5 2:637927794424868192 3:[[-45 -35 124 14 -23 103 -41 74 -71 66 67 20 -12 60 44 -101]] 4:[[-45 -35 124 14 -23 103 -41 74 -71 66 67 20 -12 60 44 -101]] 6:true 7:true 8:2.6 9:true 252:371] - LootChestOpened = 380, // map[0:23 252:369] + NewLootChest = 377, // map[0:23 1:[20.5 177.5] 2:423 3:KEEPER_SOLO_BOOKCHEST_STANDARD 4:FOREST_GREEN_LOOTCHEST_KEEPER_SOLO_BOOKCHEST_STANDARD 5:4 6:637734315213820408 7:[] 8:[] 13:true 252:367] // map[0:4399 1:[165 -263] 3:TREASURE_SOLO_UNCOMMON 4:SWAMP_DEAD_LOOTCHEST_TREASURE_SOLO_UNCOMMON 5:4 6:637926439332719127 7:[] 8:[] 13:true 14:SWAMP_DEAD_TREASURE_SOLO 16:31ff503a-ded6-53d6-974a-7e32e3126457 252:370] + UpdateLootChest = 378, // 0=ObjectId, 3=PlayerGuid, 4=PlayerGuid, 7=Free4All map[0:4769 1:5 2:637927794424868192 3:[[-45 -35 124 14 -23 103 -41 74 -71 66 67 20 -12 60 44 -101]] 4:[[-45 -35 124 14 -23 103 -41 74 -71 66 67 20 -12 60 44 -101]] 6:true 7:true 8:2.6 9:true 252:371] + LootChestOpened = 379, // map[0:23 252:369] UpdateLootProtectedByMobsWithMinimapDisplay, - NewShrine = 382, // map[0:19 1:[-89 90] 2:180 3:GENERAL_SHRINE_COMBAT_BUFF 4:SHRINE_NON_COMBAT_BUFF 5:1 6:637734312344532502 252:371] - UpdateShrine = 383, // map[0:19 1:2 2:637734313445294913 252:372] + NewShrine = 381, // map[0:19 1:[-89 90] 2:180 3:GENERAL_SHRINE_COMBAT_BUFF 4:SHRINE_NON_COMBAT_BUFF 5:1 6:637734312344532502 252:371] + UpdateShrine = 382, // map[0:19 1:2 2:637734313445294913 252:372] UpdateRoom, NewMistDungeonRoomMobSoul, NewHellgateShrine, @@ -398,10 +398,10 @@ public enum EventCodes UnlockVanityUnlock, AvatarUnlocked, CustomizationChanged, - GuildVaultInfo = 398, - BaseVaultInfo = 399, + GuildVaultInfo = 397, + BaseVaultInfo = 398, BankVaultInfo, // map[0:6 1:6466931c-65a1-4c5d-870b-8724cf2611dc@3007 2:[] 3:[] 4:[] 5:[] 6:[] 7:[] 8:[] 252:390] - RecoveryVaultPlayerInfo = 401, + RecoveryVaultPlayerInfo = 400, RecoveryVaultGuildInfo, UpdateWardrobe, CastlePhaseChanged, @@ -481,7 +481,7 @@ public enum EventCodes DoSimpleActionCancel, DoSimpleActionFinished, NotifyGuestAccountVerified, - MightAndFavorReceivedEvent = 480, // map[0:63063 2:21021 3:16617 5:5539 6:349680 8:0 252:470] (0: Might, 2: Premium of might, 3: Favor, 5: Premium of favor, 6: Total favor, 8: ???) + MightAndFavorReceivedEvent = 479, // map[0:63063 2:21021 3:16617 5:5539 6:349680 8:0 252:470] (0: Might, 2: Premium of might, 3: Favor, 5: Premium of favor, 6: Total favor, 8: ???) WeeklyPvpChallengeRewardStateUpdate, NewUnlockedPvpSeasonChallengeRewards, StaticDungeonEntrancesDungeonEventStatusUpdates, @@ -531,5 +531,17 @@ public enum EventCodes Transformation, TransformationEnd, UpdateTrustlevel, - RevealHiddenTimeStamps + RevealHiddenTimeStamps, + ModifyItemTraitFinished, + RerollItemTraitValueFinished, + HuntQuestProgressInfo, + HuntStarted, + HuntFinished, + HuntAborted, + HuntMissionStepStateUpdate, + NewHuntTrack, + HuntMissionUpdate, + HuntQuestMissionProgressUpdate, + HuntTrackUsed, + LegendaryItemDestroyed } \ No newline at end of file From ac3b62ebba0be46f2866149367659f2e4391075c Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 16 Aug 2023 09:44:51 +0200 Subject: [PATCH 4/9] EventCode adjustments --- .../Network/OperationCodes.cs | 137 ++++++++++++++---- 1 file changed, 112 insertions(+), 25 deletions(-) diff --git a/src/StatisticsAnalysisTool/Network/OperationCodes.cs b/src/StatisticsAnalysisTool/Network/OperationCodes.cs index ea2425845..164b56b26 100644 --- a/src/StatisticsAnalysisTool/Network/OperationCodes.cs +++ b/src/StatisticsAnalysisTool/Network/OperationCodes.cs @@ -5,8 +5,10 @@ public enum OperationCodes Unused = 0, Ping, Join, + VersionedOperation, CreateAccount, Login, + CreateGuestAccount, SendCrashLog, SendTraceRoute, SendVfxStats, @@ -14,14 +16,12 @@ public enum OperationCodes CreateCharacter, DeleteCharacter, SelectCharacter, + AcceptPopups, RedeemKeycode, GetGameServerByCluster, - GetActiveSubscription, GetShopPurchaseUrl, - GetBuyTrialDetails, GetReferralSeasonDetails, GetReferralLink, - GetAvailableTrialKeys, GetShopTilesForCategory, Move = 21, AttackStart, @@ -53,8 +53,6 @@ public enum OperationCodes TakeSilver = 49, // map[0:638028282819317254 1:442 2:2 3:3 4:530000 5:[1571] 253:48] ActionOnBuildingStart, ActionOnBuildingCancel, - ItemRerollQualityStart, - ItemRerollQualityCancel, InstallResourceStart, InstallResourceCancel, InstallSilver, @@ -107,6 +105,7 @@ public enum OperationCodes InviteToGuild, DeclineGuildInvitation, KickFromGuild, + InstantJoinGuild, DuellingChallengePlayer, DuellingAcceptChallenge, DuellingDenyChallenge, @@ -138,7 +137,6 @@ public enum OperationCodes GetMyTerritories, MorganaCommand, GetServerInfo, - InviteMercenaryToMatch, SubscribeToCluster, AnswerMercenaryInvitation, GetCharacterEquipment = 137, @@ -155,6 +153,7 @@ public enum OperationCodes GetGvgSeasonHistoryRankings, GetGvgSeasonGuildMemberHistory, KickFromGvGMatch, + GetCrystalLeagueDailySeasonPoints, GetChestLogs, GetAccessRightLogs, GetGuildAccountLogs, @@ -180,12 +179,13 @@ public enum OperationCodes DeleteMail, MarkMailUnread, ClaimAttachmentFromMail, - UpdateLfgInfo, - GetLfgInfos, - GetMyGuildLfgInfo, - GetLfgDescriptionText, - LfgApplyToGuild, - AnswerLfgGuildApplication, + ApplyToGuild, + AnswerGuildApplication, + RequestGuildFinderFilteredList, + UpdateGuildRecruitmentInfo, + RequestGuildRecruitmentInfo, + RequestGuildFinderNameSearch, + RequestGuildFinderRecommendedList, RegisterChatPeer, SendChatMessage, JoinChatChannel, @@ -227,10 +227,12 @@ public enum OperationCodes TerritoryFillNutrition, TeleportBack, PartyInvitePlayer, + PartyRequestJoin, PartyAnswerInvitation, + PartyAnswerJoinRequest, PartyLeave, PartyKickPlayer, - PartyMakeLeader = 222, + PartyMakeLeader, PartyChangeLootSetting, PartyMarkObject, PartySetRole, @@ -256,6 +258,7 @@ public enum OperationCodes TreasureChestUsingCancel, UseLootChest, // <- LootLogger: https://github.com/EmeraldKnight79/AO-DU-LootLogger/blob/b1ab099e0d82bdee0a87c153f4bbae324295656e/LootLogger/PacketHandler.cs#L68 UseShrine = 248, + UseHellgateShrine, LaborerStartJob, LaborerTakeJobLoot, LaborerDismiss, @@ -273,6 +276,8 @@ public enum OperationCodes FriendRemove, InventoryStack, InventorySort, + InventoryDropAll, + InventoryAddToStacks, EquipmentItemChangeSpell, ExpeditionRegister, ExpeditionRegisterCancel, @@ -285,6 +290,7 @@ public enum OperationCodes EnteringExpeditionCancel, ActivateExpeditionCheckPoint, ArenaRegister, + ArenaAddInvite, ArenaRegisterCancel, ArenaLeave, JoinArenaMatch, @@ -292,7 +298,6 @@ public enum OperationCodes EnteringArenaStart, EnteringArenaCancel, ArenaCustomMatch, - ArenaCustomMatchCreate, UpdateCharacterStatement, BoostFarmable, GetStrikeHistory, @@ -301,13 +306,16 @@ public enum OperationCodes ResetPortalBinding, QueryPortalBinding, ClaimPaymentTransaction, + ReSpecBoost = 297, ChangeUseFlag, ClientPerformanceStats, - ReSpecBoost = 297, ExtendedHardwareStats = 300, // map[0:NVIDIA GeForce RTX 3090 1:AMD Ryzen 7 2700X Eight-Core Processor 2:Windows 10 (10.0.0) 64bit 3:3693 4:24348 5:16293 6:DE-DE 7:Custom 8:1746 10:-1 253:303] ClientLowMemoryWarning, TerritoryClaimStart, TerritoryClaimCancel, + ClaimPowerCrystalStart, + ClaimPowerCrystalCancel, + TerritoryUpgradeWithPowerCrystal, RequestAppStoreProducts, VerifyProductPurchase, QueryGuildPlayerStats, @@ -340,6 +348,12 @@ public enum OperationCodes SteamIdHasActiveAccount, CheckEmailAccountState, LinkAccountToSteamId, + InAppConfirmPaymentGooglePlay, + InAppConfirmPaymentAppleAppStore, + InAppPurchaseRequest, + InAppPurchaseFailed, + CharacterSubscriptionInfo, + AccountSubscriptionInfo, BuyGvgSeasonBooster, ChangeFlaggingPrepare, OverCharge, @@ -360,9 +374,12 @@ public enum OperationCodes PartyFinderFulltextSearch, PartyFinderRequestEquipmentSnapshot, GetPersonalSeasonTrackerData, + GetPersonalSeasonPastRewardData, UseConsumableFromInventory, ClaimPersonalSeasonReward, EasyAntiCheatMessageToServer, + XignCodeMessageToServer, + BattlEyeMessageToServer, SetNextTutorialState, AddPlayerToMuteList, RemovePlayerFromMuteList, @@ -373,9 +390,8 @@ public enum OperationCodes SetMountSkin, SetWardrobe, ChangeCustomization, - SetFavoriteIsland, + ChangePlayerIslandData, GetGuildChallengePoints, - TravelToHideout, SmartQueueJoin, SmartQueueLeave, SmartQueueSelectSpawnCluster, @@ -386,6 +402,12 @@ public enum OperationCodes HideoutGetInfo, HideoutGetOwnerInfo, HideoutSetTribute, + HideoutUpgradeWithPowerCrystal, + HideoutDeclareHQ, + HideoutUndeclareHQ, + HideoutGetHQRequirements, + HideoutBoost, + HideoutBoostConstruction, OpenWorldAttackScheduleStart, OpenWorldAttackScheduleCancel, OpenWorldAttackConquerStart, @@ -395,12 +417,77 @@ public enum OperationCodes RecoverVaultFromHideout, GetGuildEnergyDrainInfo, ChannelingUpdate, - Unknown394, - Unknown395, - Unknown396, - Unknown397, - Unknown398, - Unknown399, - Unknown400, - OpenItemWindow, + UseCorruptedShrine, + RequestEstimatedMarketValue, + LogFeedback, + GetInfamyInfo, + GetPartySmartClusterQueuePriority, + SetPartySmartClusterQueuePriority, + ClientAntiAutoClickerInfo, + ClientBotPatternDetectionInfo, + ClientAntiGatherClickerInfo, + LoadoutCreate, + LoadoutRead, + LoadoutReadHeaders, + LoadoutUpdate, + LoadoutDelete, + LoadoutOrderUpdate, + LoadoutEquip, + BatchUseItemCancel, + EnlistFactionWarfare, + GetFactionWarfareWeeklyReport, + ClaimFactionWarfareWeeklyReport, + GetFactionWarfareCampaignData, + ClaimFactionWarfareItemReward, + SendMemoryConsumption, + PickupPowerCrystalStart, + PickupPowerCrystalCancel, + SetSavingChestLogsFlag, + GetSavingChestLogsFlag, + RegisterGuestAccount, + ResendGuestAccountVerificationEmail, + DoSimpleActionStart, + DoSimpleActionCancel, + GetGvgSeasonContributionByActivity, + GetGvgSeasonContributionByCrystalLeague, + GetGuildMightCategoryContribution, + GetGuildMightCategoryOverview, + GetPvpChallengeData, + ClaimPvpChallengeWeeklyReward, + GetPersonalMightStats, + GetGvgSeasonGuildParticipationTime, + AuctionGetLoadoutOffers, + AuctionBuyLoadoutOffer, + AccountDeletionRequest, + AccountReactivationRequest, + GetModerationEscalationDefiniton, + EventBasedPopupAddSeen, + GetItemKillHistory, + GetVanityConsumables, + EquipKillEmote, + ChangeKillEmotePlayOnKnockdownSetting, + BuyVanityConsumableCharges, + GetArenaRankings, + GetCrystalLeagueStatistics, + SendOptionsLog, + SendControlsOptionsLog, + MistsUseImmediateReturnExit, + MistsUseStaticEntrance, + MistsUseCityRoadsEntrance, + ChangeNewGuildMemberMail, + GetNewGuildMemberMail, + ChangeGuildFactionAllegiance, + GetGuildFactionAllegiance, + GuildBannerChange, + GuildGetOptionalStats, + GuildSetOptionalStats, + GetPlayerInfoForStalk, + PayGoldForCharacterTypeChange, + QuickSellAuctionQueryAction, + QuickSellAuctionSellAction, + FcmTokenToServer, + ApnsTokenToServer, + DeathRecap, + AuctionFetchFinishedAuctions, + AbortAuctionFetchFinishedAuctions } \ No newline at end of file From f19c2c1935208468e46432c78f73f7097879de5f Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 16 Aug 2023 15:29:37 +0200 Subject: [PATCH 5/9] Added loadout buys to trades --- .../AuctionBuyLoadoutOfferResponseHandler.cs | 20 ++++ .../AuctionGetLoadoutOffersResponseHandler.cs | 21 +++++ .../UnRegisterFromObjectRequestHandler.cs | 1 + .../Network/NetworkManager.cs | 3 + .../Network/OperationCodes.cs | 4 +- .../AuctionBuyLoadoutOfferResponse.cs | 37 ++++++++ .../AuctionGetLoadoutOffersResponse.cs | 60 ++++++++++++ .../Trade/Mails/MailController.cs | 2 +- .../Trade/ManuallyTradeMenuObject.cs | 2 +- .../Trade/Market/MarketController.cs | 91 ++++++++++++++++++- .../Trade/TradeController.cs | 2 +- 11 files changed, 234 insertions(+), 9 deletions(-) create mode 100644 src/StatisticsAnalysisTool/Network/Handler/AuctionBuyLoadoutOfferResponseHandler.cs create mode 100644 src/StatisticsAnalysisTool/Network/Handler/AuctionGetLoadoutOffersResponseHandler.cs create mode 100644 src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionBuyLoadoutOfferResponse.cs create mode 100644 src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs diff --git a/src/StatisticsAnalysisTool/Network/Handler/AuctionBuyLoadoutOfferResponseHandler.cs b/src/StatisticsAnalysisTool/Network/Handler/AuctionBuyLoadoutOfferResponseHandler.cs new file mode 100644 index 000000000..32d0f42d6 --- /dev/null +++ b/src/StatisticsAnalysisTool/Network/Handler/AuctionBuyLoadoutOfferResponseHandler.cs @@ -0,0 +1,20 @@ +using StatisticsAnalysisTool.Network.Manager; +using StatisticsAnalysisTool.Network.Operations.Responses; +using System.Threading.Tasks; + +namespace StatisticsAnalysisTool.Network.Handler; + +public class AuctionBuyLoadoutOfferResponseHandler : ResponsePacketHandler +{ + private readonly TrackingController _trackingController; + + public AuctionBuyLoadoutOfferResponseHandler(TrackingController trackingController) : base((int) OperationCodes.AuctionBuyLoadoutOffer) + { + _trackingController = trackingController; + } + + protected override async Task OnActionAsync(AuctionBuyLoadoutOfferResponse value) + { + await _trackingController.MarketController.AddBuyAsync(value.PurchaseIds); + } +} \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Network/Handler/AuctionGetLoadoutOffersResponseHandler.cs b/src/StatisticsAnalysisTool/Network/Handler/AuctionGetLoadoutOffersResponseHandler.cs new file mode 100644 index 000000000..70597e75d --- /dev/null +++ b/src/StatisticsAnalysisTool/Network/Handler/AuctionGetLoadoutOffersResponseHandler.cs @@ -0,0 +1,21 @@ +using StatisticsAnalysisTool.Network.Manager; +using StatisticsAnalysisTool.Network.Operations.Responses; +using System.Threading.Tasks; + +namespace StatisticsAnalysisTool.Network.Handler; + +public class AuctionGetLoadoutOffersResponseHandler : ResponsePacketHandler +{ + private readonly TrackingController _trackingController; + + public AuctionGetLoadoutOffersResponseHandler(TrackingController trackingController) : base((int) OperationCodes.AuctionGetLoadoutOffers) + { + _trackingController = trackingController; + } + + protected override async Task OnActionAsync(AuctionGetLoadoutOffersResponse value) + { + _trackingController.MarketController.AddOffers(value.AuctionEntries, value.NumberToBuyList); + await Task.CompletedTask; + } +} \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Network/Handler/UnRegisterFromObjectRequestHandler.cs b/src/StatisticsAnalysisTool/Network/Handler/UnRegisterFromObjectRequestHandler.cs index d4d9fc4d1..c717cfe1f 100644 --- a/src/StatisticsAnalysisTool/Network/Handler/UnRegisterFromObjectRequestHandler.cs +++ b/src/StatisticsAnalysisTool/Network/Handler/UnRegisterFromObjectRequestHandler.cs @@ -19,6 +19,7 @@ protected override async Task OnActionAsync(UnRegisterFromObjectRequest value) _trackingController.MarketController.ResetTempOffers(); _trackingController.MarketController.ResetTempBuyOrders(); + _trackingController.MarketController.ResetTempNumberToBuyList(); await Task.CompletedTask; } } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Network/NetworkManager.cs b/src/StatisticsAnalysisTool/Network/NetworkManager.cs index 2e6e77994..5709a58c4 100644 --- a/src/StatisticsAnalysisTool/Network/NetworkManager.cs +++ b/src/StatisticsAnalysisTool/Network/NetworkManager.cs @@ -7,6 +7,7 @@ using StatisticsAnalysisTool.Exceptions; using StatisticsAnalysisTool.Network.Handler; using StatisticsAnalysisTool.Network.Manager; +using StatisticsAnalysisTool.Network.Operations.Responses; using StatisticsAnalysisTool.Notification; using StatisticsAnalysisTool.ViewModels; using System; @@ -94,6 +95,8 @@ public static void StartNetworkCapture(TrackingController trackingController) builder.AddResponseHandler(new AuctionGetResponseHandler(trackingController)); builder.AddResponseHandler(new GetCharacterEquipmentResponseHandler(trackingController)); builder.AddResponseHandler(new FishingFinishResponseHandler(trackingController)); + builder.AddResponseHandler(new AuctionGetLoadoutOffersResponseHandler(trackingController)); + builder.AddResponseHandler(new AuctionBuyLoadoutOfferResponseHandler(trackingController)); _receiver = builder.Build(); StartDeviceCapture(); diff --git a/src/StatisticsAnalysisTool/Network/OperationCodes.cs b/src/StatisticsAnalysisTool/Network/OperationCodes.cs index 164b56b26..d1ad20f3e 100644 --- a/src/StatisticsAnalysisTool/Network/OperationCodes.cs +++ b/src/StatisticsAnalysisTool/Network/OperationCodes.cs @@ -456,8 +456,8 @@ public enum OperationCodes ClaimPvpChallengeWeeklyReward, GetPersonalMightStats, GetGvgSeasonGuildParticipationTime, - AuctionGetLoadoutOffers, - AuctionBuyLoadoutOffer, + AuctionGetLoadoutOffers = 446, + AuctionBuyLoadoutOffer = 447, AccountDeletionRequest, AccountReactivationRequest, GetModerationEscalationDefiniton, diff --git a/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionBuyLoadoutOfferResponse.cs b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionBuyLoadoutOfferResponse.cs new file mode 100644 index 000000000..39f20d304 --- /dev/null +++ b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionBuyLoadoutOfferResponse.cs @@ -0,0 +1,37 @@ +using log4net; +using StatisticsAnalysisTool.Common; +using StatisticsAnalysisTool.Enumerations; +using StatisticsAnalysisTool.Models; +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace StatisticsAnalysisTool.Network.Operations.Responses; + +public class AuctionBuyLoadoutOfferResponse +{ + private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod()?.DeclaringType); + + public List PurchaseIds = new(); + + public AuctionBuyLoadoutOfferResponse(Dictionary parameters) + { + ConsoleManager.WriteLine(new ConsoleFragment(GetType().Name, parameters, ConsoleColorType.EventColor)); + + try + { + if (parameters.TryGetValue(3, out object numberToBuyArray)) + { + foreach (var numberToBuy in (IEnumerable) numberToBuyArray ?? new List()) + { + PurchaseIds.Add(numberToBuy); + } + } + + } + catch (Exception e) + { + Log.Error(nameof(ReadMailResponse), e); + } + } +} \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs new file mode 100644 index 000000000..2c95a6c9b --- /dev/null +++ b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs @@ -0,0 +1,60 @@ +using log4net; +using StatisticsAnalysisTool.Common; +using StatisticsAnalysisTool.Enumerations; +using StatisticsAnalysisTool.Models; +using StatisticsAnalysisTool.Trade.Market; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text.Json; + +namespace StatisticsAnalysisTool.Network.Operations.Responses; + +public class AuctionGetLoadoutOffersResponse +{ + private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod()?.DeclaringType); + + public readonly List AuctionEntries = new(); + public readonly List NumberToBuyList = new(); + + public AuctionGetLoadoutOffersResponse(Dictionary parameters) + { + ConsoleManager.WriteLine(new ConsoleFragment(GetType().Name, parameters, ConsoleColorType.EventColor)); + + try + { + if (parameters.TryGetValue(1, out object auctionEntries)) + { + var test = auctionEntries.GetType(); + + if (auctionEntries is string[][] auctionEntriesList) + { + var allRecords = auctionEntriesList.SelectMany(x => x).ToList(); + foreach (var auctionOfferString in allRecords) + { + AuctionEntries.Add(JsonSerializer.Deserialize(auctionOfferString ?? string.Empty)); + } + } + } + + if (parameters.TryGetValue(2, out object buyQuantityNumbers)) + { + if (buyQuantityNumbers is not short[][] quantity) + { + return; + } + + var allRecords = quantity.SelectMany(x => x).ToList(); + foreach (var auctionOfferString in allRecords) + { + NumberToBuyList.Add(JsonSerializer.Deserialize(auctionOfferString)); + } + } + } + catch (Exception e) + { + Log.Error(nameof(AuctionGetOffersResponse), e); + } + } +} \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Trade/Mails/MailController.cs b/src/StatisticsAnalysisTool/Trade/Mails/MailController.cs index 7b9168bfc..087489ef2 100644 --- a/src/StatisticsAnalysisTool/Trade/Mails/MailController.cs +++ b/src/StatisticsAnalysisTool/Trade/Mails/MailController.cs @@ -76,7 +76,7 @@ public async Task AddMailAsync(long mailId, string content) return; } - _ = _trackingController.TradeController.AddTradeToBindingCollection(trade); + _ = _trackingController.TradeController.AddTradeToBindingCollectionAsync(trade); await _trackingController.TradeController.SaveInFileAfterExceedingLimit(10); } diff --git a/src/StatisticsAnalysisTool/Trade/ManuallyTradeMenuObject.cs b/src/StatisticsAnalysisTool/Trade/ManuallyTradeMenuObject.cs index d4acd3aea..735021c3e 100644 --- a/src/StatisticsAnalysisTool/Trade/ManuallyTradeMenuObject.cs +++ b/src/StatisticsAnalysisTool/Trade/ManuallyTradeMenuObject.cs @@ -96,7 +96,7 @@ public void AddTrade(object obj) }; var trackingController = ServiceLocator.Resolve(); - trackingController?.TradeController?.AddTradeToBindingCollection(trade); + trackingController?.TradeController?.AddTradeToBindingCollectionAsync(trade); } private ICommand _addTradeCommand; diff --git a/src/StatisticsAnalysisTool/Trade/Market/MarketController.cs b/src/StatisticsAnalysisTool/Trade/Market/MarketController.cs index d6682e6e1..42455d8a0 100644 --- a/src/StatisticsAnalysisTool/Trade/Market/MarketController.cs +++ b/src/StatisticsAnalysisTool/Trade/Market/MarketController.cs @@ -1,19 +1,25 @@ -using StatisticsAnalysisTool.Cluster; +using log4net; +using StatisticsAnalysisTool.Cluster; +using StatisticsAnalysisTool.Common; using StatisticsAnalysisTool.Common.UserSettings; using StatisticsAnalysisTool.Network.Manager; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; +using System.Reflection; using System.Threading.Tasks; namespace StatisticsAnalysisTool.Trade.Market; public class MarketController { + private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod()?.DeclaringType); + private readonly TrackingController _trackingController; private ObservableCollection _tempOffers = new(); private ObservableCollection _tempBuyOrders = new(); + private ObservableCollection _tempNumberToBuyList = new(); public MarketController(TrackingController trackingController) { @@ -32,6 +38,17 @@ public void AddOffers(IEnumerable auctionOffers) _tempOffers = new ObservableCollection(auctionOffers); } + public void AddOffers(IEnumerable auctionOffers, IEnumerable numberToBuyList) + { + if (!SettingsController.CurrentSettings.IsTradeMonitoringActive) + { + return; + } + + _tempOffers = new ObservableCollection(auctionOffers); + _tempNumberToBuyList = new ObservableCollection(numberToBuyList); + } + public async Task AddBuyAsync(Purchase purchase) { if (!SettingsController.CurrentSettings.IsTradeMonitoringActive) @@ -59,16 +76,82 @@ public async Task AddBuyAsync(Purchase purchase) InstantBuySellContent = instantBuySellContent }; - _ = _trackingController.TradeController.AddTradeToBindingCollection(trade); - await _trackingController.TradeController.SaveInFileAfterExceedingLimit(10); + _ = _trackingController.TradeController.AddTradeToBindingCollectionAsync(trade); + await _trackingController.TradeController.SaveInFileAfterExceedingLimit(20); } } + public async Task AddBuyAsync(List purchaseIds) + { + if (!SettingsController.CurrentSettings.IsTradeMonitoringActive) + { + return; + } + + foreach (long purchaseId in purchaseIds) + { + var tempOffer = _tempOffers.FirstOrDefault(x => x.Id == purchaseId); + if (tempOffer == null) + { + continue; + } + + var quantity = GetQuantityOfTempNumberToBuyList(purchaseIds, purchaseId); + + if (quantity <= 0) + { + continue; + } + + var instantBuySellContent = new InstantBuySellContent() + { + Quantity = quantity, + InternalUnitPrice = tempOffer.UnitPriceSilver, + TaxRate = SettingsController.CurrentSettings.TradeMonitoringMarketTaxRate + }; + + var trade = new Trade() + { + Ticks = DateTime.UtcNow.Ticks, + Type = TradeType.InstantBuy, + Id = purchaseId, + ClusterIndex = ClusterController.CurrentCluster.MainClusterIndex ?? ClusterController.CurrentCluster.Index, + AuctionEntry = tempOffer, + InstantBuySellContent = instantBuySellContent + }; + + _ = _trackingController.TradeController.AddTradeToBindingCollectionAsync(trade); + } + + await _trackingController.TradeController.SaveInFileAfterExceedingLimit(20); + } + public void ResetTempOffers() { _tempOffers.Clear(); } + public void ResetTempNumberToBuyList() + { + _tempNumberToBuyList.Clear(); + } + + private int GetQuantityOfTempNumberToBuyList(IList purchaseIds, long currentPurchaseId) + { + try + { + var index = purchaseIds.IndexOf(currentPurchaseId); + return _tempNumberToBuyList[index]; + } + catch (Exception e) + { + ConsoleManager.WriteLineForError(MethodBase.GetCurrentMethod()?.DeclaringType, e); + Log.Error(MethodBase.GetCurrentMethod()?.DeclaringType, e); + } + + return 0; + } + #endregion #region Sell to market @@ -110,7 +193,7 @@ public async Task AddSaleAsync(Sale sale) InstantBuySellContent = instantBuySellContent }; - _ = _trackingController.TradeController.AddTradeToBindingCollection(trade); + _ = _trackingController.TradeController.AddTradeToBindingCollectionAsync(trade); await _trackingController.TradeController.SaveInFileAfterExceedingLimit(10); } } diff --git a/src/StatisticsAnalysisTool/Trade/TradeController.cs b/src/StatisticsAnalysisTool/Trade/TradeController.cs index d21123380..b2fcb216e 100644 --- a/src/StatisticsAnalysisTool/Trade/TradeController.cs +++ b/src/StatisticsAnalysisTool/Trade/TradeController.cs @@ -37,7 +37,7 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs _mainWindowViewModel?.TradeMonitoringBindings?.TradeStatsObject.SetTradeStats(_mainWindowViewModel?.TradeMonitoringBindings?.Trades); } - public async Task AddTradeToBindingCollection(Trade trade) + public async Task AddTradeToBindingCollectionAsync(Trade trade) { await Application.Current.Dispatcher.InvokeAsync(() => { From 08cd83fcac946e1c455bd5ca78b33437cd8dd0fd Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 16 Aug 2023 15:30:46 +0200 Subject: [PATCH 6/9] Cleanup --- .../Operations/Responses/AuctionGetLoadoutOffersResponse.cs | 2 -- .../Network/Operations/Responses/AuctionGetOffersResponse.cs | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs index 2c95a6c9b..bcaace657 100644 --- a/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs +++ b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetLoadoutOffersResponse.cs @@ -26,8 +26,6 @@ public AuctionGetLoadoutOffersResponse(Dictionary parameters) { if (parameters.TryGetValue(1, out object auctionEntries)) { - var test = auctionEntries.GetType(); - if (auctionEntries is string[][] auctionEntriesList) { var allRecords = auctionEntriesList.SelectMany(x => x).ToList(); diff --git a/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetOffersResponse.cs b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetOffersResponse.cs index f041907d0..af0c085e8 100644 --- a/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetOffersResponse.cs +++ b/src/StatisticsAnalysisTool/Network/Operations/Responses/AuctionGetOffersResponse.cs @@ -22,9 +22,9 @@ public AuctionGetOffersResponse(Dictionary parameters) try { - if (parameters.ContainsKey(0)) + if (parameters.TryGetValue(0, out object auctionOffers)) { - foreach (var auctionOfferString in (IEnumerable) parameters[0] ?? new List()) + foreach (var auctionOfferString in (IEnumerable) auctionOffers ?? new List()) { AuctionEntries.Add(JsonSerializer.Deserialize(auctionOfferString ?? string.Empty)); } From e313f5f7c247b0aa3f0cf7343b1f6ad7e9925531 Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 16 Aug 2023 15:49:14 +0200 Subject: [PATCH 7/9] Added icons to manual trades --- src/StatisticsAnalysisTool/App.xaml | 2 +- src/StatisticsAnalysisTool/StatisticsAnalysisTool.csproj | 2 +- ...MailMonitoringStyle.xaml => TradeMonitoringStyle.xaml} | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) rename src/StatisticsAnalysisTool/Styles/{MailMonitoringStyle.xaml => TradeMonitoringStyle.xaml} (99%) diff --git a/src/StatisticsAnalysisTool/App.xaml b/src/StatisticsAnalysisTool/App.xaml index 68e1e68f1..0bfacd64d 100644 --- a/src/StatisticsAnalysisTool/App.xaml +++ b/src/StatisticsAnalysisTool/App.xaml @@ -24,7 +24,7 @@ - + diff --git a/src/StatisticsAnalysisTool/StatisticsAnalysisTool.csproj b/src/StatisticsAnalysisTool/StatisticsAnalysisTool.csproj index 456b7e212..8ebff8637 100644 --- a/src/StatisticsAnalysisTool/StatisticsAnalysisTool.csproj +++ b/src/StatisticsAnalysisTool/StatisticsAnalysisTool.csproj @@ -694,7 +694,7 @@ $(DefaultXamlRuntime) Designer - + $(DefaultXamlRuntime) Designer diff --git a/src/StatisticsAnalysisTool/Styles/MailMonitoringStyle.xaml b/src/StatisticsAnalysisTool/Styles/TradeMonitoringStyle.xaml similarity index 99% rename from src/StatisticsAnalysisTool/Styles/MailMonitoringStyle.xaml rename to src/StatisticsAnalysisTool/Styles/TradeMonitoringStyle.xaml index cda2c2b8e..fe90b35e5 100644 --- a/src/StatisticsAnalysisTool/Styles/MailMonitoringStyle.xaml +++ b/src/StatisticsAnalysisTool/Styles/TradeMonitoringStyle.xaml @@ -1,7 +1,8 @@  + xmlns:trade="clr-namespace:StatisticsAnalysisTool.Trade" + xmlns:fa5="http://schemas.fontawesome.com/icons/">