From c093a56b67500f919e4c52732473009101ac424c Mon Sep 17 00:00:00 2001 From: Blowa Date: Thu, 18 Apr 2019 11:52:26 +0800 Subject: [PATCH 01/24] start moving to nuget packages --- SaltyEmu.sln | 18 +--- src/ChickenAPI.Data/ChickenAPI.Data.csproj | 5 +- .../Game/Entity/EntityType.cs | 3 - .../Game/Entity/VisualType.cs | 13 --- .../ChickenAPI.Game.Extensions.csproj | 6 +- .../Helpers/CellonGeneratorHelper.cs | 0 .../Helpers/EmojiHelper.cs | 0 .../Helpers/ShellGeneratorHelper.cs | 0 .../Helpers/TeleportationHelper.cs | 1 - .../Helpers/UIHelper.cs | 0 .../PacketGeneration/TcInfoPacketExtension.cs | 97 +++++++++++++++++ .../_TOCLEAN}/BattleBuffExtensions.cs | 0 .../_TOCLEAN}/BattleCheckExtensions.cs | 0 .../_TOCLEAN}/BattleEntityStatsManagement.cs | 0 .../_TOCLEAN}/CInfoPacketExtension.cs | 0 .../_TOCLEAN}/CModePacketExtension.cs | 2 +- .../_TOCLEAN}/CancelPacketExtension.cs | 0 .../_TOCLEAN}/CtPacketExtensions.cs | 0 .../_TOCLEAN}/DropExtensions.cs | 0 .../_TOCLEAN}/ExperienceManagerExtensions.cs | 0 .../_TOCLEAN}/FamilyCheckExtensions.cs | 0 .../_TOCLEAN}/FdPacketExtension.cs | 0 .../_TOCLEAN}/FsPacketExtension.cs | 0 .../_TOCLEAN}/GInfoPacketExtensions.cs | 0 .../_TOCLEAN}/GetPacketExtension.cs | 0 .../_TOCLEAN}/GidxPacketExtensions.cs | 0 .../_TOCLEAN}/GroupPlayerExtension.cs | 4 +- .../_TOCLEAN}/GuriPacketExtensions.cs | 0 .../_TOCLEAN}/LanguageServiceExtensions.cs | 0 .../_TOCLEAN}/LevPacketExtension.cs | 0 .../MapLayerInformationsExtensions.cs | 4 +- .../_TOCLEAN}/MateExtension.cs | 0 .../_TOCLEAN}/MovablePlayerExtensions.cs | 0 .../_TOCLEAN}/MoveChecksExtensions.cs | 0 .../_TOCLEAN}/NInvPacketExtensions.cs | 0 .../_TOCLEAN}/NpcExtensions.cs | 0 .../_TOCLEAN}/PacketExtensions.cs | 0 .../_TOCLEAN}/PairyPacketExtension.cs | 4 +- .../_TOCLEAN}/PlayerExtension.cs | 82 -------------- .../_TOCLEAN}/PlayerGroupExtensions.cs | 0 .../_TOCLEAN}/PlayerInteractionExtensions.cs | 0 .../_TOCLEAN}/PlayerMatesExtensions.cs | 0 .../_TOCLEAN}/PlayerUiExtension.cs | 0 .../_TOCLEAN}/QsetGenerationExtension.cs | 0 .../_TOCLEAN}/QuicklistPacketExtension.cs | 0 .../_TOCLEAN}/RestEntityExtensions.cs | 2 +- .../_TOCLEAN}/ShopPacketExtensions.cs | 0 .../_TOCLEAN}/SkiPacketExtensions.cs | 0 .../_TOCLEAN}/SkillExtensions.cs | 0 .../_TOCLEAN}/SpPacketExtension.cs | 0 .../_TOCLEAN}/SpecialistExtensions.cs | 0 .../_TOCLEAN}/SpecialistPacketExtensions.cs | 0 .../_TOCLEAN}/StPacketExtensions.cs | 0 .../_TOCLEAN}/StatCharExtensions.cs | 0 .../_TOCLEAN}/StatPacketExtensions.cs | 0 .../_TOCLEAN}/SuPacketExtensions.cs | 0 .../_TOCLEAN}/TargetExtensions.cs | 0 .../_TOCLEAN}/TpPacketExtension.cs | 3 +- .../BCards/BasicBCardHandler.cs | 2 - src/ChickenAPI.Game/ChickenAPI.Game.csproj | 7 +- src/ChickenAPI.Game/Effects/EffectSystem.cs | 2 +- .../Effects/EntityExtensionEffect.cs | 30 ++---- .../Entities/Player/IPlayerEntity.cs | 1 + .../Entities/Player/PlayerEntity.cs | 11 +- src/ChickenAPI.Game/IAs/IASystem.cs | 4 +- .../Extensions/EInfoPacketExtensions.cs | 1 - .../Extensions/EqPacketExtensions.cs | 74 ++++++++++--- .../Extensions/MovableEntityExtensions.cs | 2 +- .../Extensions/VisibleEntityExtensions.cs | 2 +- src/ChickenAPI.Game/Maps/SimpleMapLayer.cs | 2 +- .../Movements/MovableSystem.cs | 2 +- .../Specialists/SpecialistSystem.cs | 2 +- .../_ECS/Entities/EntityBase.cs | 2 +- .../_ECS/Entities/EntityManagerBase.cs | 6 +- src/ChickenAPI.Game/_ECS/Entities/IEntity.cs | 1 + .../_Network/IBroadcastable.cs | 1 + src/ChickenAPI.Game/_Network/ISession.cs | 1 + src/Plugins/Essentials/Essentials.csproj | 5 +- .../SaltyEmu.BasicAlgorithmPlugin.csproj | 4 + .../SaltyEmu.DatabasePlugin.csproj | 1 + .../NW.Plugins.PacketHandling.csproj | 6 +- .../Shops/NpcReqPacketHandling.cs | 2 +- .../Skill/UseSkillPacketHandling.cs | 4 +- .../SaltyEmu.PathfinderPlugin.csproj | 4 + .../SaltyEmu.RedisWrappers.csproj | 1 + .../Battle_ProcessHitRequest_Handler.cs | 2 +- .../EventHandlers/Shops/Shop_Buy_Event.cs | 4 +- .../Skills/Skill_UseSkill_Handler.cs | 2 +- .../ItemUsageHandlers/Handler/WingsSpCard.cs | 2 +- .../NpcDialogHandlers/WopenHandler.cs | 2 +- .../SaltyEmu.BasicPlugin.csproj | 4 + .../SaltyEmu.FamilyPlugin.csproj | 1 - .../SaltyEmu.FriendsPlugin.csproj | 3 + .../SaltyEmu.Commands.csproj | 1 - .../SaltyEmu.Communication.csproj | 1 - src/libs/SaltyEmu.Core/Logging/Logger.cs | 101 ++++++++++++++++++ .../Plugins/SimplePluginManager.cs | 1 + src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj | 7 +- .../SaltyEmu.FamilyService.csproj | 1 - .../SaltyEmu.RelationService.csproj | 1 - 100 files changed, 347 insertions(+), 210 deletions(-) delete mode 100644 src/ChickenAPI.Enums/Game/Entity/EntityType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Entity/VisualType.cs rename src/{ChickenAPI.Game => ChickenAPI.Game.Extensions}/Helpers/CellonGeneratorHelper.cs (100%) rename src/{ChickenAPI.Game => ChickenAPI.Game.Extensions}/Helpers/EmojiHelper.cs (100%) rename src/{ChickenAPI.Game => ChickenAPI.Game.Extensions}/Helpers/ShellGeneratorHelper.cs (100%) rename src/{ChickenAPI.Game => ChickenAPI.Game.Extensions}/Helpers/TeleportationHelper.cs (96%) rename src/{ChickenAPI.Game => ChickenAPI.Game.Extensions}/Helpers/UIHelper.cs (100%) create mode 100644 src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/BattleBuffExtensions.cs (100%) rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/BattleCheckExtensions.cs (100%) rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/BattleEntityStatsManagement.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/CInfoPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/CModePacketExtension.cs (92%) rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/CancelPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/CtPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Drop/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/DropExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/ExperienceManagerExtensions.cs (100%) rename src/{ChickenAPI.Game/Families/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/FamilyCheckExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/FdPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/FsPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Families/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GInfoPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GetPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Families/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GidxPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Groups/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GroupPlayerExtension.cs (98%) rename src/{ChickenAPI.Game/GuriHandling/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GuriPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/LanguageServiceExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/LevPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Maps/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MapLayerInformationsExtensions.cs (90%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MateExtension.cs (100%) rename src/{ChickenAPI.Game/Movements/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MovablePlayerExtensions.cs (100%) rename src/{ChickenAPI.Game/Movements/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MoveChecksExtensions.cs (100%) rename src/{ChickenAPI.Game/Shops/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/NInvPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Npc/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/NpcExtensions.cs (100%) rename src/{ChickenAPI.Game/Relations/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PairyPacketExtension.cs (91%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PlayerExtension.cs (62%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PlayerGroupExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PlayerInteractionExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PlayerMatesExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PlayerUiExtension.cs (100%) rename src/{ChickenAPI.Game/Quicklist/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/QsetGenerationExtension.cs (100%) rename src/{ChickenAPI.Game/Skills/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/QuicklistPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Movements/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/RestEntityExtensions.cs (95%) rename src/{ChickenAPI.Game/Shops/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/ShopPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Skills/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SkiPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Skills/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SkillExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SpPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Specialists/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SpecialistExtensions.cs (100%) rename src/{ChickenAPI.Game/Specialists/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SpecialistPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/StPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Player/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/StatCharExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/StatPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SuPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Battle/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/TargetExtensions.cs (100%) rename src/{ChickenAPI.Game/Entities/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/TpPacketExtension.cs (92%) create mode 100644 src/libs/SaltyEmu.Core/Logging/Logger.cs diff --git a/SaltyEmu.sln b/SaltyEmu.sln index c252cdf3..a9ca83f1 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -21,10 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.BasicAlgorithmPlug EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game", "src\ChickenAPI.Game\ChickenAPI.Game.csproj", "{34BBD274-3133-4894-8776-783731D126BC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Core", "src\ChickenAPI.Core\ChickenAPI.Core.csproj", "{3DC7543A-221A-4491-962C-C1E04A24F69F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Packets", "src\ChickenAPI.Packets\ChickenAPI.Packets.csproj", "{C376CC67-DA69-4509-B2CF-D84077157055}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Enums", "src\ChickenAPI.Enums\ChickenAPI.Enums.csproj", "{2C706520-AA6F-45FA-910F-DCDD42C52192}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit", "src\Toolkit\Toolkit.csproj", "{5F14B226-7842-4F6E-BE2E-1CC01C530F3B}" @@ -73,9 +69,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SaltyEmu", "SaltyEmu", "{9F EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.InventoryService", "src\services\SaltyEmu.InventoryService\SaltyEmu.InventoryService.csproj", "{45C3099C-13FB-47C1-94A8-074445608329}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaltyEmu.CharacterSkillService", "src\services\SaltyEmu.CharacterSkillService\SaltyEmu.CharacterSkillService.csproj", "{7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.CharacterSkillService", "src\services\SaltyEmu.CharacterSkillService\SaltyEmu.CharacterSkillService.csproj", "{7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SaltyEmu.Database.MongoDB", "src\libs\SaltyEmu.Database.MongoDB\SaltyEmu.Database.MongoDB.csproj", "{48886586-562B-4CE6-B105-3F231FE6C97E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Database.MongoDB", "src\libs\SaltyEmu.Database.MongoDB\SaltyEmu.Database.MongoDB.csproj", "{48886586-562B-4CE6-B105-3F231FE6C97E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -115,14 +111,6 @@ Global {34BBD274-3133-4894-8776-783731D126BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {34BBD274-3133-4894-8776-783731D126BC}.Release|Any CPU.ActiveCfg = Release|Any CPU {34BBD274-3133-4894-8776-783731D126BC}.Release|Any CPU.Build.0 = Release|Any CPU - {3DC7543A-221A-4491-962C-C1E04A24F69F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3DC7543A-221A-4491-962C-C1E04A24F69F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3DC7543A-221A-4491-962C-C1E04A24F69F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3DC7543A-221A-4491-962C-C1E04A24F69F}.Release|Any CPU.Build.0 = Release|Any CPU - {C376CC67-DA69-4509-B2CF-D84077157055}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C376CC67-DA69-4509-B2CF-D84077157055}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C376CC67-DA69-4509-B2CF-D84077157055}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C376CC67-DA69-4509-B2CF-D84077157055}.Release|Any CPU.Build.0 = Release|Any CPU {2C706520-AA6F-45FA-910F-DCDD42C52192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2C706520-AA6F-45FA-910F-DCDD42C52192}.Debug|Any CPU.Build.0 = Debug|Any CPU {2C706520-AA6F-45FA-910F-DCDD42C52192}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -218,8 +206,6 @@ Global {45E04475-DFC4-400A-9D35-44BAF5180ACD} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {28B389E6-9863-4306-B32E-756A2C6D9E99} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {34BBD274-3133-4894-8776-783731D126BC} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} - {3DC7543A-221A-4491-962C-C1E04A24F69F} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} - {C376CC67-DA69-4509-B2CF-D84077157055} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} {2C706520-AA6F-45FA-910F-DCDD42C52192} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} {48D59236-CC25-497E-A98D-DAB290E4A8B7} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {AA0972AB-A59A-4EB7-AF5A-B31F61D25644} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} diff --git a/src/ChickenAPI.Data/ChickenAPI.Data.csproj b/src/ChickenAPI.Data/ChickenAPI.Data.csproj index effee951..a1e6dba1 100644 --- a/src/ChickenAPI.Data/ChickenAPI.Data.csproj +++ b/src/ChickenAPI.Data/ChickenAPI.Data.csproj @@ -5,7 +5,10 @@ - + + + + diff --git a/src/ChickenAPI.Enums/Game/Entity/EntityType.cs b/src/ChickenAPI.Enums/Game/Entity/EntityType.cs deleted file mode 100644 index 72cbfc06..00000000 --- a/src/ChickenAPI.Enums/Game/Entity/EntityType.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace ChickenAPI.Enums.Game.Entity -{ -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Entity/VisualType.cs b/src/ChickenAPI.Enums/Game/Entity/VisualType.cs deleted file mode 100644 index 1616d90e..00000000 --- a/src/ChickenAPI.Enums/Game/Entity/VisualType.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace ChickenAPI.Enums.Game.Entity -{ - public enum VisualType - { - Character = 1, - Npc = 2, - Monster = 3, - MapObject = 9, - - - Portal = 1000 // unknown yet - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj b/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj index e4c1e83a..9f88a74c 100644 --- a/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj +++ b/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj @@ -4,9 +4,13 @@ netstandard2.0 + + + + + - diff --git a/src/ChickenAPI.Game/Helpers/CellonGeneratorHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/CellonGeneratorHelper.cs similarity index 100% rename from src/ChickenAPI.Game/Helpers/CellonGeneratorHelper.cs rename to src/ChickenAPI.Game.Extensions/Helpers/CellonGeneratorHelper.cs diff --git a/src/ChickenAPI.Game/Helpers/EmojiHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs similarity index 100% rename from src/ChickenAPI.Game/Helpers/EmojiHelper.cs rename to src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs diff --git a/src/ChickenAPI.Game/Helpers/ShellGeneratorHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/ShellGeneratorHelper.cs similarity index 100% rename from src/ChickenAPI.Game/Helpers/ShellGeneratorHelper.cs rename to src/ChickenAPI.Game.Extensions/Helpers/ShellGeneratorHelper.cs diff --git a/src/ChickenAPI.Game/Helpers/TeleportationHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs similarity index 96% rename from src/ChickenAPI.Game/Helpers/TeleportationHelper.cs rename to src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs index 2573b6b1..f0197ccb 100644 --- a/src/ChickenAPI.Game/Helpers/TeleportationHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Autofac; using ChickenAPI.Core.IoC; -using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Managers; using ChickenAPI.Game._ECS.Entities; diff --git a/src/ChickenAPI.Game/Helpers/UIHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs similarity index 100% rename from src/ChickenAPI.Game/Helpers/UIHelper.cs rename to src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs new file mode 100644 index 00000000..8279531a --- /dev/null +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs @@ -0,0 +1,97 @@ +using ChickenAPI.Data.Item; +using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Game.Entities.Player.Extensions; +using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.ServerPackets.Player; + +namespace ChickenAPI.Game.Extensions.PacketGeneration +{ + public static class TcInfoPacketExtension + { + public static TitPacket GenerateTitPacket(this IPlayerEntity player) + { + return new TitPacket + { + ClassType = player.Character.Class == CharacterClassType.Adventurer ? "Adventurer" : + player.Character.Class == CharacterClassType.Archer ? "Archer" : + player.Character.Class == CharacterClassType.Magician ? "Mage" : + player.Character.Class == CharacterClassType.Swordman ? "Swordman" : "Martial", + Name = player.Character.Name + }; + } + + public static TcInfoPacket GenerateTcInfo(this IPlayerEntity charac) + { + ItemInstanceDto fairy = null; + ItemInstanceDto armor = null; + ItemInstanceDto weapon2 = null; + ItemInstanceDto weapon = null; + if (charac.Inventory != null) + { + fairy = charac.Inventory.GetWeared(EquipmentType.Fairy); + armor = charac.Inventory.GetWeared(EquipmentType.Armor); + weapon2 = charac.Inventory.GetWeared(EquipmentType.SecondaryWeapon); + weapon = charac.Inventory.GetWeared(EquipmentType.MainWeapon); + } + + bool isPvpPrimary = false; + bool isPvpSecondary = false; + bool isPvpArmor = false; + + if (weapon?.Item.Name.Contains(": ") == true) + { + isPvpPrimary = true; + } + + isPvpSecondary |= weapon2?.Item.Name.Contains(": ") == true; + isPvpArmor |= armor?.Item.Name.Contains(": ") == true; + + // tc_info 0 name 0 0 0 0 -1 - 0 0 0 0 0 0 0 0 0 0 0 wins deaths reput 0 0 0 morph + // talentwin talentlose capitul rankingpoints arenapoints 0 0 ispvpprimary ispvpsecondary + // ispvparmor herolvl desc + return new TcInfoPacket + { + Level = charac.Level, + Name = charac.Character.Name, + Element = fairy?.ElementType ?? ElementType.Neutral, + ElementRate = fairy?.ElementRate ?? 0, + Class = charac.Character.Class, + Gender = charac.Character.Gender, + Family = charac.HasFamily ? charac.Family.Name : "-1 -", + ReputationIco = charac.GetReputIcon(), + DignityIco = charac.GetDignityIcon(), + HaveWeapon = weapon != null ? 1 : 0, + WeaponRare = weapon?.Rarity ?? 0, + WeaponUpgrade = weapon?.Upgrade ?? 0, + HaveSecondary = weapon2 != null ? 1 : 0, + SecondaryRare = weapon2?.Rarity ?? 0, + SecondaryUpgrade = weapon?.Upgrade ?? 0, + HaveArmor = armor != null ? 1 : 0, + ArmorRare = armor?.Rarity ?? 0, + ArmorUpgrade = armor?.Upgrade ?? 0, + Act4Kill = charac.Character.Act4Kill, + Act4Dead = charac.Character.Act4Dead, + Reputation = charac.Character.Reput, + Unknow = 0, + Unknow2 = 0, + Unknow3 = 0, + Unknow4 = 0, + Morph = charac.MorphId, + TalentLose = charac.Character.TalentLose, + TalentSurrender = charac.Character.TalentSurrender, + TalentWin = charac.Character.TalentWin, + MasterPoints = charac.Character.MasterPoints, + Compliments = charac.Character.Compliment, + Act4Points = charac.Character.Act4Points, + isPvpArmor = isPvpArmor, + isPvpPrimary = isPvpPrimary, + isPvpSecondary = isPvpSecondary, + HeroLevel = charac.HeroLevel, + Biography = string.IsNullOrEmpty(charac.Character.Biography) ? " REKT BOY" : charac.Character.Biography + }; + } + } +} \ No newline at end of file diff --git a/src/ChickenAPI.Game/Battle/Extensions/BattleBuffExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/BattleBuffExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/BattleBuffExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/BattleBuffExtensions.cs diff --git a/src/ChickenAPI.Game/Battle/Extensions/BattleCheckExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/BattleCheckExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/BattleCheckExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/BattleCheckExtensions.cs diff --git a/src/ChickenAPI.Game/Battle/Extensions/BattleEntityStatsManagement.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/BattleEntityStatsManagement.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/BattleEntityStatsManagement.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/BattleEntityStatsManagement.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/CInfoPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/CInfoPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/CModePacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs similarity index 92% rename from src/ChickenAPI.Game/Entities/Player/Extensions/CModePacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs index 02cac01a..63bd932d 100644 --- a/src/ChickenAPI.Game/Entities/Player/Extensions/CModePacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs @@ -7,7 +7,7 @@ public static class CModePacketExtension { public static CModePacketBase GenerateCModePacket(this IPlayerEntity player) => new CModePacketBase { - VisualType = VisualType.Character, + VisualType = VisualType.Player, CharacterId = player.Id, Morph = player.MorphId, SpUpgrade = player.Sp?.Upgrade ?? 0, diff --git a/src/ChickenAPI.Game/Battle/Extensions/CancelPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CancelPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/CancelPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/CancelPacketExtension.cs diff --git a/src/ChickenAPI.Game/Battle/Extensions/CtPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CtPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/CtPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/CtPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Drop/Extensions/DropExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/DropExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Drop/Extensions/DropExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/DropExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/ExperienceManagerExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ExperienceManagerExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/ExperienceManagerExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/ExperienceManagerExtensions.cs diff --git a/src/ChickenAPI.Game/Families/Extensions/FamilyCheckExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FamilyCheckExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Families/Extensions/FamilyCheckExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/FamilyCheckExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/FdPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/FdPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/FsPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FsPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/FsPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/FsPacketExtension.cs diff --git a/src/ChickenAPI.Game/Families/Extensions/GInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Families/Extensions/GInfoPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/GetPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GetPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/GetPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GetPacketExtension.cs diff --git a/src/ChickenAPI.Game/Families/Extensions/GidxPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GidxPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Families/Extensions/GidxPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GidxPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Groups/Extensions/GroupPlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs similarity index 98% rename from src/ChickenAPI.Game/Groups/Extensions/GroupPlayerExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs index a3c93010..85a1e9bb 100644 --- a/src/ChickenAPI.Game/Groups/Extensions/GroupPlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs @@ -19,7 +19,7 @@ public static PstPacket GeneratePstPacket(this IPlayerEntity entity, ref int ico return new PstPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, GroupIndex = ++iconIndex, VisualId = entity.Id, HpPercentage = entity.HpPercentage, @@ -42,7 +42,7 @@ public static PstPacket GeneratePstPacket(this IMateEntity entity, ref int iconI return new PstPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, GroupIndex = iconIndex++, VisualId = entity.Id, HpPercentage = entity.HpPercentage, diff --git a/src/ChickenAPI.Game/GuriHandling/Extensions/GuriPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GuriPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/GuriHandling/Extensions/GuriPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GuriPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/LanguageServiceExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/LanguageServiceExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/LanguageServiceExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/LanguageServiceExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/LevPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/LevPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/LevPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/LevPacketExtension.cs diff --git a/src/ChickenAPI.Game/Maps/Extensions/MapLayerInformationsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs similarity index 90% rename from src/ChickenAPI.Game/Maps/Extensions/MapLayerInformationsExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs index 117e34a3..2aaacc86 100644 --- a/src/ChickenAPI.Game/Maps/Extensions/MapLayerInformationsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs @@ -21,13 +21,13 @@ public static class MapLayerInformationsExtensions public static IEnumerable GetShopsPackets(this IMapLayer layer) { IEnumerable tmp = layer.GetEntitiesByType(VisualType.Npc).Where(s => s.HasShop).Select(s => s.GenerateShopPacket()); - IEnumerable players = layer.GetEntitiesByType(VisualType.Character).Where(s => s.HasShop).Select(s => s.GenerateShopPacket()); + IEnumerable players = layer.GetEntitiesByType(VisualType.Player).Where(s => s.HasShop).Select(s => s.GenerateShopPacket()); return tmp.Union(players); } public static IEnumerable GetPairyPackets(this IMapLayer layer, IPlayerEntity player) { - return layer.GetEntitiesByType(VisualType.Character).Select(s => s == player ? null : s.GeneratePairyPacket()); + return layer.GetEntitiesByType(VisualType.Player).Select(s => s == player ? null : s.GeneratePairyPacket()); } public static IEnumerable GetEntitiesPackets(this IMapLayer layer) diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/MateExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/MateExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs diff --git a/src/ChickenAPI.Game/Movements/Extensions/MovablePlayerExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Movements/Extensions/MovablePlayerExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs diff --git a/src/ChickenAPI.Game/Movements/Extensions/MoveChecksExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveChecksExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Movements/Extensions/MoveChecksExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveChecksExtensions.cs diff --git a/src/ChickenAPI.Game/Shops/Extensions/NInvPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Shops/Extensions/NInvPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Npc/Extensions/NpcExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Npc/Extensions/NpcExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs diff --git a/src/ChickenAPI.Game/Relations/Extensions/PacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Relations/Extensions/PacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/PairyPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs similarity index 91% rename from src/ChickenAPI.Game/Entities/Player/Extensions/PairyPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs index e763d10c..987c930b 100644 --- a/src/ChickenAPI.Game/Entities/Player/Extensions/PairyPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs @@ -15,7 +15,7 @@ public static PairyPacket GeneratePairyPacket(this IPlayerEntity player) { return new PairyPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, CharacterId = player.Character.Id, FairyMoveType = 0, ElementType = 0, @@ -27,7 +27,7 @@ public static PairyPacket GeneratePairyPacket(this IPlayerEntity player) return new PairyPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, CharacterId = player.Character.Id, ElementType = fairy.ElementType, FairyLevel = fairy.Upgrade, diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/PlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs similarity index 62% rename from src/ChickenAPI.Game/Entities/Player/Extensions/PlayerExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs index 6a849a23..d613152d 100644 --- a/src/ChickenAPI.Game/Entities/Player/Extensions/PlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs @@ -28,88 +28,6 @@ public static class PlayerExtension private static readonly IRandomGenerator _randomGenerator = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; private static readonly IAlgorithmService Algorithm = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; - public static TcInfoPacket GenerateTcInfo(this IPlayerEntity charac) - { - ItemInstanceDto fairy = null; - ItemInstanceDto armor = null; - ItemInstanceDto weapon2 = null; - ItemInstanceDto weapon = null; - if (charac.Inventory != null) - { - fairy = charac.Inventory.GetWeared(EquipmentType.Fairy); - armor = charac.Inventory.GetWeared(EquipmentType.Armor); - weapon2 = charac.Inventory.GetWeared(EquipmentType.SecondaryWeapon); - weapon = charac.Inventory.GetWeared(EquipmentType.MainWeapon); - } - - bool isPvpPrimary = false; - bool isPvpSecondary = false; - bool isPvpArmor = false; - - if (weapon?.Item.Name.Contains(": ") == true) - { - isPvpPrimary = true; - } - - isPvpSecondary |= weapon2?.Item.Name.Contains(": ") == true; - isPvpArmor |= armor?.Item.Name.Contains(": ") == true; - - // tc_info 0 name 0 0 0 0 -1 - 0 0 0 0 0 0 0 0 0 0 0 wins deaths reput 0 0 0 morph - // talentwin talentlose capitul rankingpoints arenapoints 0 0 ispvpprimary ispvpsecondary - // ispvparmor herolvl desc - return new TcInfoPacket - { - Level = charac.Level, - Name = charac.Character.Name, - Element = fairy?.ElementType ?? ElementType.Neutral, - ElementRate = fairy?.ElementRate ?? 0, - Class = charac.Character.Class, - Gender = charac.Character.Gender, - Family = charac.HasFamily ? charac.Family.Name : "-1 -", - ReputationIco = charac.GetReputIcon(), - DignityIco = charac.GetDignityIcon(), - HaveWeapon = weapon != null ? 1 : 0, - WeaponRare = weapon?.Rarity ?? 0, - WeaponUpgrade = weapon?.Upgrade ?? 0, - HaveSecondary = weapon2 != null ? 1 : 0, - SecondaryRare = weapon2?.Rarity ?? 0, - SecondaryUpgrade = weapon?.Upgrade ?? 0, - HaveArmor = armor != null ? 1 : 0, - ArmorRare = armor?.Rarity ?? 0, - ArmorUpgrade = armor?.Upgrade ?? 0, - Act4Kill = charac.Character.Act4Kill, - Act4Dead = charac.Character.Act4Dead, - Reputation = charac.Character.Reput, - Unknow = 0, - Unknow2 = 0, - Unknow3 = 0, - Unknow4 = 0, - Morph = charac.MorphId, - TalentLose = charac.Character.TalentLose, - TalentSurrender = charac.Character.TalentSurrender, - TalentWin = charac.Character.TalentWin, - MasterPoints = charac.Character.MasterPoints, - Compliments = charac.Character.Compliment, - Act4Points = charac.Character.Act4Points, - isPvpArmor = isPvpArmor, - isPvpPrimary = isPvpPrimary, - isPvpSecondary = isPvpSecondary, - HeroLevel = charac.HeroLevel, - Biography = string.IsNullOrEmpty(charac.Character.Biography) ? " REKT BOY" : charac.Character.Biography - }; - } - - public static TitPacket GenerateTitPacket(this IPlayerEntity player) - { - return new TitPacket - { - ClassType = player.Character.Class == CharacterClassType.Adventurer ? "Adventurer" : - player.Character.Class == CharacterClassType.Archer ? "Archer" : - player.Character.Class == CharacterClassType.Magician ? "Mage" : - player.Character.Class == CharacterClassType.Swordman ? "Swordman" : "Martial", - Name = player.Character.Name - }; - } public static async Task ChangeClass(this IPlayerEntity player, CharacterClassType type) { diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/PlayerGroupExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerGroupExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/PlayerGroupExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerGroupExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/PlayerInteractionExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/PlayerInteractionExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/PlayerMatesExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerMatesExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/PlayerMatesExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerMatesExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/PlayerUiExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/PlayerUiExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs diff --git a/src/ChickenAPI.Game/Quicklist/Extensions/QsetGenerationExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Quicklist/Extensions/QsetGenerationExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs diff --git a/src/ChickenAPI.Game/Skills/Extensions/QuicklistPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Skills/Extensions/QuicklistPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs diff --git a/src/ChickenAPI.Game/Movements/Extensions/RestEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs similarity index 95% rename from src/ChickenAPI.Game/Movements/Extensions/RestEntityExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs index 67cf715e..77506c53 100644 --- a/src/ChickenAPI.Game/Movements/Extensions/RestEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs @@ -31,7 +31,7 @@ public static RestPacket GenerateRestPacket(this IEntity entity) case IPlayerEntity player: return new RestPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, VisualId = player.Character.Id, IsSitting = player.IsSitting }; diff --git a/src/ChickenAPI.Game/Shops/Extensions/ShopPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Shops/Extensions/ShopPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Skills/Extensions/SkiPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkiPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Skills/Extensions/SkiPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SkiPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Skills/Extensions/SkillExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Skills/Extensions/SkillExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/SpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/SpPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs diff --git a/src/ChickenAPI.Game/Specialists/Extensions/SpecialistExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Specialists/Extensions/SpecialistExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs diff --git a/src/ChickenAPI.Game/Specialists/Extensions/SpecialistPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Specialists/Extensions/SpecialistPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Extensions/StPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Extensions/StPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Player/Extensions/StatCharExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/Extensions/StatCharExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Extensions/StatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Extensions/StatPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Battle/Extensions/SuPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/SuPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Battle/Extensions/TargetExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TargetExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Battle/Extensions/TargetExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/TargetExtensions.cs diff --git a/src/ChickenAPI.Game/Entities/Extensions/TpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs similarity index 92% rename from src/ChickenAPI.Game/Entities/Extensions/TpPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs index faec7457..834a1468 100644 --- a/src/ChickenAPI.Game/Entities/Extensions/TpPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs @@ -4,7 +4,6 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Server.Entities; namespace ChickenAPI.Game.Entities.Extensions { @@ -27,7 +26,7 @@ public static TpPacket GenerateTpPacket(this IEntity entity, short x, short y) { case IPlayerEntity player: packet.VisualId = player.Character.Id; - packet.VisualType = VisualType.Character; + packet.VisualType = VisualType.Player; return packet; case IMonsterEntity monster: packet.VisualType = VisualType.Monster; diff --git a/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs b/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs index 62935648..4098dc6a 100644 --- a/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs +++ b/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs @@ -1,7 +1,6 @@ using System; using System.Reflection; using System.Threading.Tasks; -using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; using ChickenAPI.Enums.Game.BCard; using ChickenAPI.Game.Battle.Interfaces; @@ -10,7 +9,6 @@ namespace ChickenAPI.Game.BCards { public class BasicBCardHandler : IBCardEffectHandler { - private readonly Logger Log = Logger.GetLogger(); private readonly Action _func; public BasicBCardHandler(MethodInfo method) : this(method.GetCustomAttribute(), method) diff --git a/src/ChickenAPI.Game/ChickenAPI.Game.csproj b/src/ChickenAPI.Game/ChickenAPI.Game.csproj index c89b5356..d8462855 100644 --- a/src/ChickenAPI.Game/ChickenAPI.Game.csproj +++ b/src/ChickenAPI.Game/ChickenAPI.Game.csproj @@ -25,15 +25,12 @@ - - - + + - - diff --git a/src/ChickenAPI.Game/Effects/EffectSystem.cs b/src/ChickenAPI.Game/Effects/EffectSystem.cs index 16c22a89..7e985fb9 100644 --- a/src/ChickenAPI.Game/Effects/EffectSystem.cs +++ b/src/ChickenAPI.Game/Effects/EffectSystem.cs @@ -3,7 +3,7 @@ using System.Linq.Expressions; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; -using ChickenAPI.Packets.Game.Client.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Effects { diff --git a/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs b/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs index bc4801cd..83353abf 100644 --- a/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs +++ b/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs @@ -3,38 +3,20 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Client.Player; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Effects { public static class EntityExtensionEffect { - public static EffectPacket GenerateEffectPacket(this IEntity entity, long id) + public static EffectPacket GenerateEffectPacket(this IEntity entity, int id) { - long visualId = 0; - var visualType = VisualType.Character; - switch (entity) - - { - case IPlayerEntity player: - visualId = player.Character.Id; - visualType = VisualType.Character; - break; - case IMonsterEntity monster: - visualId = monster.MapMonster.Id; - visualType = VisualType.Monster; - break; - case INpcEntity npc: - visualId = npc.MapNpc.Id; - visualType = VisualType.Monster; - break; - } - return new EffectPacket { - CharacterId = visualId, - EffectId = id, - EffectType = visualType + VisualEntityId = entity.Id, + EffectType = entity.Type, + Id = id, }; } } diff --git a/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs b/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs index 7f64cf82..234fd396 100644 --- a/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs +++ b/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs @@ -15,6 +15,7 @@ using ChickenAPI.Game.Specialists; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace ChickenAPI.Game.Entities.Player { diff --git a/src/ChickenAPI.Game/Entities/Player/PlayerEntity.cs b/src/ChickenAPI.Game/Entities/Player/PlayerEntity.cs index 7383a889..72081d3f 100644 --- a/src/ChickenAPI.Game/Entities/Player/PlayerEntity.cs +++ b/src/ChickenAPI.Game/Entities/Player/PlayerEntity.cs @@ -12,8 +12,6 @@ using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Families; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Enums.Game.Visibility; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Buffs; @@ -35,7 +33,10 @@ using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._Network; -using ChickenAPI.Packets; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Interfaces; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using FamilyAuthority = ChickenAPI.Enums.Game.Families.FamilyAuthority; namespace ChickenAPI.Game.Entities.Player { @@ -52,7 +53,7 @@ private static readonly ICharacterQuickListService private static readonly IPlayerManager PlayerManager = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; - public PlayerEntity(ISession session, CharacterDto dto, IEnumerable skills, IEnumerable quicklist) : base(VisualType.Character, dto.Id) + public PlayerEntity(ISession session, CharacterDto dto, IEnumerable skills, IEnumerable quicklist) : base(VisualType.Player, dto.Id) { Session = session; Character = dto; @@ -193,7 +194,7 @@ public void Save() CharacterSkillService.Save(SkillComponent.CharacterSkills.Values); CharacterQuicklistService.Save(Quicklist.Quicklist); ItemInstance.Save(Inventory.GetItems()); - Log.Info($"[SAVE] {Character.Name} saved in {(DateTime.UtcNow - before).TotalMilliseconds} ms"); + // Log.Info($"[SAVE] {Character.Name} saved in {(DateTime.UtcNow - before).TotalMilliseconds} ms"); } public double LastPortal { get; set; } diff --git a/src/ChickenAPI.Game/IAs/IASystem.cs b/src/ChickenAPI.Game/IAs/IASystem.cs index 5debacf0..ec575475 100644 --- a/src/ChickenAPI.Game/IAs/IASystem.cs +++ b/src/ChickenAPI.Game/IAs/IASystem.cs @@ -41,7 +41,7 @@ public IASystem(IEntityManager entityManager, IMap map) : base(entityManager) private static bool MovableFilter(IEntity entity) { - if (entity.Type == VisualType.Character) + if (entity.Type == VisualType.Player) { return false; } @@ -122,7 +122,7 @@ private void ProcessAiWithoutTarget(IAiEntity mov) return; } // supposedly should never enter here - if (mov.Type == VisualType.Character || mov.Speed == 0) + if (mov.Type == VisualType.Player || mov.Speed == 0) { return; } diff --git a/src/ChickenAPI.Game/Inventory/Extensions/EInfoPacketExtensions.cs b/src/ChickenAPI.Game/Inventory/Extensions/EInfoPacketExtensions.cs index dcdd87ed..575d236c 100644 --- a/src/ChickenAPI.Game/Inventory/Extensions/EInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game/Inventory/Extensions/EInfoPacketExtensions.cs @@ -1,6 +1,5 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Game.Server.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game/Inventory/Extensions/EqPacketExtensions.cs b/src/ChickenAPI.Game/Inventory/Extensions/EqPacketExtensions.cs index 7ce94266..61c5e8b2 100644 --- a/src/ChickenAPI.Game/Inventory/Extensions/EqPacketExtensions.cs +++ b/src/ChickenAPI.Game/Inventory/Extensions/EqPacketExtensions.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Text; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { @@ -32,11 +31,11 @@ public static class EqPacketExtensions public static EqPacket GenerateEqPacket(this IPlayerEntity player) => new EqPacket { - CharacterId = player.Id, + VisualId = player.Id, NameAppearance = player.NameAppearance, - GenderType = player.Character.Gender, - HairStyleType = player.Character.HairStyle, - HairColorType = player.Character.HairColor, + Gender = player.Character.Gender, + HairStyle = player.Character.HairStyle, + Haircolor = player.Character.HairColor, CharacterClassType = player.Character.Class, EqList = player.Inventory.GenerateEqListInfoPacket(), EqInfo = player.Inventory.GenerateEqRareInfoPacket() @@ -49,7 +48,25 @@ public static class EqPacketExtensions /// public static EquipPacket GenerateEquipPacket(this IPlayerEntity player) { - List tmp = new List(); + EquipmentSubPacket generateEquipmentSubPacket(EquipmentType eqType) + { + ItemInstanceDto eq = player.Inventory.Equipment[((short)eqType)]; + if (eq == null) + { + return null; + } + + return new EquipmentSubPacket + { + EquipmentType = eqType, + VNum = (short)eq.ItemId, + Rare = eq.Rarity, + Upgrade = (eq?.Item.IsColored == true ? eq?.Design : eq?.Upgrade) ?? 0, + Unknown = 0, + }; + } + + List tmp = new List(); ItemInstanceDto[] subInventory = player.Inventory.Wear; for (int i = 0; i < subInventory.Length; i++) @@ -60,20 +77,47 @@ public static EquipPacket GenerateEquipPacket(this IPlayerEntity player) continue; } - tmp.Add(new EquipPacket.EquipSubPacket + tmp.Add(new EquipmentSubPacket() { - WearIndex = i, - ItemId = item.ItemId, - ItemRarity = (byte)item.Rarity, - UpgradeOrDesign = item.Item.IsColored ? item.Design : item.Upgrade, + EquipmentType = (EquipmentType)i, + VNum = (short)item.ItemId, + Rare = (byte)item.Rarity, + Upgrade = item.Item.IsColored ? item.Design : item.Upgrade, Unknown = 0 }); } + var weapon = new UpgradeRareSubPacket + { + Upgrade = player.Weapon?.Upgrade ?? 0, + Rare = (byte)(player.Weapon?.Rarity ?? 0) + }; + var armor = new UpgradeRareSubPacket + { + Upgrade = player.Armor?.Upgrade ?? 0, + Rare = (byte)(player.Armor?.Rarity ?? 0) + }; + return new EquipPacket { - EqRare = player.Inventory.GenerateEqRareInfoPacket(), - EqList = tmp + WeaponUpgradeRareSubPacket = weapon, + ArmorUpgradeRareSubPacket = armor, + Armor = generateEquipmentSubPacket(EquipmentType.Armor), + WeaponSkin = generateEquipmentSubPacket(EquipmentType.WeaponSkin), + SecondaryWeapon = generateEquipmentSubPacket(EquipmentType.SecondaryWeapon), + Sp = generateEquipmentSubPacket(EquipmentType.Sp), + Amulet = generateEquipmentSubPacket(EquipmentType.Amulet), + Boots = generateEquipmentSubPacket(EquipmentType.Boots), + CostumeHat = generateEquipmentSubPacket(EquipmentType.CostumeHat), + CostumeSuit = generateEquipmentSubPacket(EquipmentType.CostumeSuit), + Fairy = generateEquipmentSubPacket(EquipmentType.Fairy), + Gloves = generateEquipmentSubPacket(EquipmentType.Gloves), + Hat = generateEquipmentSubPacket(EquipmentType.Hat), + MainWeapon = generateEquipmentSubPacket(EquipmentType.MainWeapon), + Mask = generateEquipmentSubPacket(EquipmentType.Mask), + Necklace = generateEquipmentSubPacket(EquipmentType.Necklace), + Ring = generateEquipmentSubPacket(EquipmentType.Ring), + Bracelet = generateEquipmentSubPacket(EquipmentType.Bracelet), }; } } diff --git a/src/ChickenAPI.Game/Inventory/Extensions/MovableEntityExtensions.cs b/src/ChickenAPI.Game/Inventory/Extensions/MovableEntityExtensions.cs index 6833de83..07eaefba 100644 --- a/src/ChickenAPI.Game/Inventory/Extensions/MovableEntityExtensions.cs +++ b/src/ChickenAPI.Game/Inventory/Extensions/MovableEntityExtensions.cs @@ -35,7 +35,7 @@ public static MvPacket GenerateMvPacket(this IEntity entity) case IPlayerEntity player: return new MvPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, VisualId = player.Character.Id, Speed = player.Speed, MapX = player.Position.X, diff --git a/src/ChickenAPI.Game/Inventory/Extensions/VisibleEntityExtensions.cs b/src/ChickenAPI.Game/Inventory/Extensions/VisibleEntityExtensions.cs index 8880377f..16b88785 100644 --- a/src/ChickenAPI.Game/Inventory/Extensions/VisibleEntityExtensions.cs +++ b/src/ChickenAPI.Game/Inventory/Extensions/VisibleEntityExtensions.cs @@ -171,7 +171,7 @@ private static InPacket GenerateInDrop(IDropEntity drop) => private static InPacket GenerateInPlayer(IPlayerEntity player) => new InPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, Name = player.Character.Name, TransportId = "-", VNum = player.Character.Id, diff --git a/src/ChickenAPI.Game/Maps/SimpleMapLayer.cs b/src/ChickenAPI.Game/Maps/SimpleMapLayer.cs index 1b12494d..2753c29e 100644 --- a/src/ChickenAPI.Game/Maps/SimpleMapLayer.cs +++ b/src/ChickenAPI.Game/Maps/SimpleMapLayer.cs @@ -57,7 +57,7 @@ public SimpleMapLayer(IMap map, IEnumerable monsters, public bool IsPvpEnabled => false; public IEnumerable Players => _players; - public IPlayerEntity GetPlayerById(long id) => GetEntity(id, VisualType.Character); + public IPlayerEntity GetPlayerById(long id) => GetEntity(id, VisualType.Player); public IEnumerable GetPlayersInRange(Position pos, int range) => _players.Where(e => PositionHelper.GetDistance(pos, e.Position) < range); diff --git a/src/ChickenAPI.Game/Movements/MovableSystem.cs b/src/ChickenAPI.Game/Movements/MovableSystem.cs index fb33243a..157ff886 100644 --- a/src/ChickenAPI.Game/Movements/MovableSystem.cs +++ b/src/ChickenAPI.Game/Movements/MovableSystem.cs @@ -25,7 +25,7 @@ public MovableSystem(IEntityManager entityManager) : base(entityManager) private static bool MovableFilter(IEntity entity) { - if (entity.Type == VisualType.Character) + if (entity.Type == VisualType.Player) { return false; } diff --git a/src/ChickenAPI.Game/Specialists/SpecialistSystem.cs b/src/ChickenAPI.Game/Specialists/SpecialistSystem.cs index 276543e2..73486ba4 100644 --- a/src/ChickenAPI.Game/Specialists/SpecialistSystem.cs +++ b/src/ChickenAPI.Game/Specialists/SpecialistSystem.cs @@ -16,7 +16,7 @@ public SpecialistSystem(IEntityManager entityManager) : base(entityManager) // all 10 seconds protected override double RefreshRate => 0.1; - protected override Expression> Filter => entity => entity.Type == VisualType.Character; + protected override Expression> Filter => entity => entity.Type == VisualType.Player; protected override void Execute(IEntity entity) { diff --git a/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs b/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs index 1ac3bfe2..15ba37d9 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs @@ -8,12 +8,12 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game._ECS.Entities { public abstract class EntityBase : IEntity { - protected static readonly Logger Log = Logger.GetLogger(); protected static readonly IEventPipeline EventPipelineAsync = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; protected Dictionary Components = new Dictionary(); diff --git a/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs b/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs index c6a39684..6891998b 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs @@ -51,7 +51,7 @@ public void RegisterEntity(T entity) where T : IEntity { lock(LockObj) { - if (entity.Type == VisualType.Character) + if (entity.Type == VisualType.Player) { _players.Add(entity as IPlayerEntity); } @@ -66,7 +66,7 @@ public void RegisterEntity(T entity) where T : IEntity entities.Add(entity.Id, entity); UpdateCache(); // player cache - if (!ShouldUpdate && entity.Type == VisualType.Character) + if (!ShouldUpdate && entity.Type == VisualType.Player) { StartSystemUpdate(); } @@ -77,7 +77,7 @@ public void UnregisterEntity(T entity) where T : IEntity { lock(LockObj) { - if (entity.Type == VisualType.Character) + if (entity.Type == VisualType.Player) { _players.Remove(entity as IPlayerEntity); } diff --git a/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs b/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs index 28856d38..951cd749 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs @@ -3,6 +3,7 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game._ECS.Entities { diff --git a/src/ChickenAPI.Game/_Network/IBroadcastable.cs b/src/ChickenAPI.Game/_Network/IBroadcastable.cs index 87f187b7..e3f4d379 100644 --- a/src/ChickenAPI.Game/_Network/IBroadcastable.cs +++ b/src/ChickenAPI.Game/_Network/IBroadcastable.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace ChickenAPI.Game._Network { diff --git a/src/ChickenAPI.Game/_Network/ISession.cs b/src/ChickenAPI.Game/_Network/ISession.cs index 44b4654b..89209efc 100644 --- a/src/ChickenAPI.Game/_Network/ISession.cs +++ b/src/ChickenAPI.Game/_Network/ISession.cs @@ -5,6 +5,7 @@ using ChickenAPI.Data.Account; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace ChickenAPI.Game._Network { diff --git a/src/Plugins/Essentials/Essentials.csproj b/src/Plugins/Essentials/Essentials.csproj index b96e1b78..5db9c06f 100644 --- a/src/Plugins/Essentials/Essentials.csproj +++ b/src/Plugins/Essentials/Essentials.csproj @@ -5,7 +5,10 @@ - + + + + diff --git a/src/Plugins/NosSharp.BasicAlgorithm/SaltyEmu.BasicAlgorithmPlugin.csproj b/src/Plugins/NosSharp.BasicAlgorithm/SaltyEmu.BasicAlgorithmPlugin.csproj index 1cc278aa..09db8f21 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/SaltyEmu.BasicAlgorithmPlugin.csproj +++ b/src/Plugins/NosSharp.BasicAlgorithm/SaltyEmu.BasicAlgorithmPlugin.csproj @@ -4,6 +4,10 @@ netstandard2.0 + + + + diff --git a/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj b/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj index 95d77e0c..32d46297 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj +++ b/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj @@ -15,6 +15,7 @@ + diff --git a/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj b/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj index 23366f69..151415c3 100644 --- a/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj +++ b/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj @@ -7,10 +7,12 @@ - + + + + - diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs index 761698f2..b7b3a0e9 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs @@ -12,7 +12,7 @@ public class NpcReqPacketHandling : GenericGamePacketHandlerAsync(packet.TargetId, VisualType.Character); + case VisualType.Player: + target = player.CurrentMap.GetEntity(packet.TargetId, VisualType.Player); break; case VisualType.Monster: target = player.CurrentMap.GetEntity(packet.TargetId, VisualType.Monster); diff --git a/src/Plugins/NosSharp.Pathfinder/SaltyEmu.PathfinderPlugin.csproj b/src/Plugins/NosSharp.Pathfinder/SaltyEmu.PathfinderPlugin.csproj index 1cc278aa..09db8f21 100644 --- a/src/Plugins/NosSharp.Pathfinder/SaltyEmu.PathfinderPlugin.csproj +++ b/src/Plugins/NosSharp.Pathfinder/SaltyEmu.PathfinderPlugin.csproj @@ -4,6 +4,10 @@ netstandard2.0 + + + + diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj b/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj index 3cb41101..bc708c8e 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj +++ b/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj @@ -5,6 +5,7 @@ + diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs index 6d643161..8f45c7db 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs @@ -76,7 +76,7 @@ protected override async Task Handle(ProcessHitRequestEvent e, CancellationToken Log.Debug($"[{hitRequest.Sender.Type.ToString()}][{hitRequest.Sender.Id}] ATTACK -> [{hitRequest.Target.Type.ToString()}]({hitRequest.Target.Id}) : {givenDamages} damages"); // sets the new target (for AI) - if (hitRequest.Target.Type != VisualType.Character && !hitRequest.Target.HasTarget) + if (hitRequest.Target.Type != VisualType.Player && !hitRequest.Target.HasTarget) { hitRequest.Target.Target = hitRequest.Sender; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs index fbe9cb08..dbd04bbc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs @@ -45,8 +45,8 @@ protected override async Task Handle(ShopBuyEvent e, CancellationToken cancellat switch (e.Type) { - case VisualType.Character: - IPlayerEntity shop = player.CurrentMap.GetEntitiesByType(VisualType.Character).FirstOrDefault(s => s.Character.Id == e.OwnerId); + case VisualType.Player: + IPlayerEntity shop = player.CurrentMap.GetEntitiesByType(VisualType.Player).FirstOrDefault(s => s.Character.Id == e.OwnerId); if (shop == null) { return; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs index f032595f..558c6a5d 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs @@ -67,7 +67,7 @@ protected override async Task Handle(UseSkillEvent e, CancellationToken cancella return; } - if (entity.Type == VisualType.Character && target.Type == VisualType.Character && !entity.CurrentMap.IsPvpEnabled && skill.HitType != 1) + if (entity.Type == VisualType.Player && target.Type == VisualType.Player && !entity.CurrentMap.IsPvpEnabled && skill.HitType != 1) { if (!(player is null)) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs index 4b475e77..29cce0fb 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs @@ -31,7 +31,7 @@ public async Task Handle(IPlayerEntity player, InventoryUseItemEvent e) await player.SendQuestionAsync(new UiPacket { - VisualType = VisualType.Character, + VisualType = VisualType.Player, CharacterId = player.Id, InventoryType = e.Item.Type, InventorySlot = (byte)e.Item.Slot, diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs index 62a4efbb..fa11ff48 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs @@ -71,7 +71,7 @@ public static void TimeCircle(IPlayerEntity player, NpcDialogEvent args) { player.SendPacketAsync(new SentNpcReqPacket { - VisualType = ChickenAPI.Enums.Game.Entity.VisualType.Character, + VisualType = ChickenAPI.Enums.Game.Entity.VisualType.Player, VisualId = player.Id, Dialog = 17 }); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj b/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj index bf27d29b..2d46b84a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj @@ -4,6 +4,10 @@ netstandard2.0 + + + + diff --git a/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj b/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj index fa6d8cb9..cb44d490 100644 --- a/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj +++ b/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj @@ -5,7 +5,6 @@ - diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/SaltyEmu.FriendsPlugin.csproj b/src/Plugins/SaltyEmu.FriendsPlugin/SaltyEmu.FriendsPlugin.csproj index 33fb54f4..6859861a 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/SaltyEmu.FriendsPlugin.csproj +++ b/src/Plugins/SaltyEmu.FriendsPlugin/SaltyEmu.FriendsPlugin.csproj @@ -11,5 +11,8 @@ + + + \ No newline at end of file diff --git a/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj b/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj index 196eb1cf..41b3d8e5 100644 --- a/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj +++ b/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj @@ -13,7 +13,6 @@ - diff --git a/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj b/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj index 872650ce..622f3034 100644 --- a/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj +++ b/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj @@ -11,7 +11,6 @@ - diff --git a/src/libs/SaltyEmu.Core/Logging/Logger.cs b/src/libs/SaltyEmu.Core/Logging/Logger.cs new file mode 100644 index 00000000..05fa807b --- /dev/null +++ b/src/libs/SaltyEmu.Core/Logging/Logger.cs @@ -0,0 +1,101 @@ +using System; +using NLog; +using NLog.Conditions; +using NLog.Config; +using NLog.Targets; + +namespace SaltyEmu.Core.Logging +{ + public class Logger : ChickenAPI.Core.Logging.ILogger + { + private const string DefaultLayout = "[${date}][${level:uppercase=true}][${logger:shortName=true}] ${message} ${exception:format=tostring}"; + + public Logger(Type type) => Log = LogManager.GetLogger(type.ToString()); + public Logger(string prefix) => Log = LogManager.GetLogger(prefix); + + private ILogger Log { get; } + + /// + /// Initialize logger's configuration. + /// Please refer to https://github.com/nlog/NLog/wiki/Layout-Renderers for custom layouts. + /// + /// + /// + public static void Initialize(string consoleLayout, string fileLayout) + { + var config = new LoggingConfiguration(); + var consoleTarget = new ColoredConsoleTarget(); + var fileTarget = new FileTarget(); + + consoleTarget.Layout = consoleLayout; + + var infoHighlightRule = new ConsoleRowHighlightingRule + { + Condition = ConditionParser.ParseExpression("level == LogLevel.Info"), + ForegroundColor = ConsoleOutputColor.Green + }; + var errorHighlightRule = new ConsoleRowHighlightingRule + { + Condition = ConditionParser.ParseExpression("level == LogLevel.Error"), + ForegroundColor = ConsoleOutputColor.Red + }; + var warnHighlightingRule = new ConsoleRowHighlightingRule + { + Condition = ConditionParser.ParseExpression("level == LogLevel.Warn"), + ForegroundColor = ConsoleOutputColor.DarkYellow + }; + consoleTarget.RowHighlightingRules.Add(infoHighlightRule); + consoleTarget.RowHighlightingRules.Add(errorHighlightRule); + consoleTarget.RowHighlightingRules.Add(warnHighlightingRule); + + fileTarget.Layout = fileLayout; + fileTarget.FileName = "logs/" + DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss") + ".log"; + + config.AddTarget("console", consoleTarget); + config.AddTarget("file", fileTarget); + + var rule1 = new LoggingRule("*", LogLevel.Debug, consoleTarget); + config.LoggingRules.Add(rule1); + + var rule2 = new LoggingRule("*", LogLevel.Debug, fileTarget); + config.LoggingRules.Add(rule2); + + LogManager.Configuration = config; + } + + public static void Initialize() + { + Initialize(DefaultLayout, DefaultLayout); + } + + public void Trace(string msg) + { + Log?.Trace(msg); + } + + public void Debug(string msg) + { + Log?.Debug(msg); + } + + public void Info(string msg) + { + Log?.Info(msg); + } + + public void Warn(string msg) + { + Log?.Warn(msg); + } + + public void Error(string msg, Exception ex) + { + Log?.Error(ex, msg); + } + + public void Fatal(string msg, Exception ex) + { + Log?.Fatal(ex, msg); + } + } +} \ No newline at end of file diff --git a/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs b/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs index 1e6fb983..bf210b48 100644 --- a/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs +++ b/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs @@ -5,6 +5,7 @@ using System.Reflection; using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; +using Logger = SaltyEmu.Core.Logging.Logger; namespace SaltyEmu.Core.Plugins { diff --git a/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj b/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj index db5ae9ec..216e365f 100644 --- a/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj +++ b/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj @@ -1,11 +1,14 @@ - + netcoreapp2.2 - + + + + diff --git a/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj b/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj index 245f141f..c339412e 100644 --- a/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj +++ b/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj @@ -11,7 +11,6 @@ - diff --git a/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj b/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj index 06c80e7c..fd0a1180 100644 --- a/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj +++ b/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj @@ -11,7 +11,6 @@ - From c1d63e9b4f854ed67b935ba0e1e998b7f6c8595a Mon Sep 17 00:00:00 2001 From: Blowa Date: Thu, 18 Apr 2019 18:15:14 +0800 Subject: [PATCH 02/24] continue moving to nuget packages --- SaltyEmu.sln | 7 +++++ .../Helpers/PositionHelper.cs | 18 +++++++++++++ .../_TOCLEAN}/EInfoPacketExtensions.cs | 0 .../_TOCLEAN}/EqPacketExtensions.cs | 0 .../GenerateHeroicShellExtensioncs.cs | 0 .../_TOCLEAN}/GoldPacketExtension.cs | 0 .../_TOCLEAN}/InventoryChecksExtensions.cs | 0 .../_TOCLEAN}/InventoryGetExtensions.cs | 27 ++++++++++++------- .../_TOCLEAN}/InventoryUseExtension.cs | 0 .../InventoryWearPacketExtensions.cs | 0 .../_TOCLEAN}/IvnPacketExtension.cs | 0 .../_TOCLEAN}/MapPacketsExtensions.cs | 0 .../_TOCLEAN}/MovableEntityExtensions.cs | 0 .../_TOCLEAN}/MoveItemExtensions.cs | 0 .../NotifyResultAndSetRarityPointExtension.cs | 0 .../_TOCLEAN}/PortalPacketExtensions.cs | 0 .../_TOCLEAN}/RespawnExtensions.cs | 1 - .../_TOCLEAN/RestEntityExtensions.cs | 5 ++-- .../_TOCLEAN}/SetRarityPointExtension.cs | 0 .../_TOCLEAN}/SlInfoPacketExtensions.cs | 3 +-- .../_TOCLEAN/TpPacketExtension.cs | 1 + .../_TOCLEAN}/VisibleEntityExtensions.cs | 0 .../ChickenAPI.Game.Impl.csproj | 12 +++++++++ .../EffectSystem.cs | 0 .../GroupSystem.cs | 1 - .../IAs => ChickenAPI.Game.Impl}/IASystem.cs | 8 ++---- .../ItemDropEntity.cs | 0 .../MateEntity.cs | 0 .../MonsterEntity.cs | 0 .../MovableComponent.cs | 8 +++--- .../MovableSystem.cs | 15 ++++++----- .../Npc => ChickenAPI.Game.Impl}/NpcEntity.cs | 0 .../PlayerEntity.cs | 0 .../RespawnSystem.cs | 0 .../SimpleMap.cs | 0 .../SimpleMapLayer.cs | 6 ++++- .../SkillComponent.cs | 1 - .../SpecialistSystem.cs | 4 +-- .../BCards/BasicBCardHandler.cs | 1 - .../Effects/EffectComponent.cs | 4 +-- .../Managers/SimplePlayerManager.cs | 1 + .../Movements/DataObjects/MoveEventArgs.cs | 2 +- .../Shops/Events/ShopBuyEvent.cs | 1 + .../Shops/Events/ShowShopEvent.cs | 1 + src/ChickenAPI.Game/Skills/ISkillEntity.cs | 12 ++++++++- src/ChickenAPI.Game/Skills/SkiPacket.cs | 2 +- .../_ECS/Entities/EntityManagerBase.cs | 2 +- .../_ECS/Entities/IEntityManager.cs | 1 + .../_ECS/Systems/SystemBase.cs | 2 -- .../_Network/IPacketPipelineAsync.cs | 1 + .../_Network/IPacketProcessor.cs | 1 + .../Services/Character/CharacterItemDao.cs | 3 ++- .../CharacterSkillServiceClient.cs | 5 ++-- ...{FamilyIpcClient.cs => FamilyRpcClient.cs} | 4 +-- .../Handlers/SendInvitationHandler.cs | 2 +- .../Services/RelationServiceClient.cs | 2 +- ...pcRepository.cs => MappedRPCRepository.cs} | 6 ++--- .../Communicators/MqttIpcClient.cs | 10 +++---- .../Communicators/MqttIpcServer.cs | 14 +++++----- .../Communicators/RabbitMQServer.cs | 11 ++++---- .../Communicators/RabbitMqClient.cs | 12 ++++----- .../SynchronizedIpcRepository.cs | 8 +++--- .../Protocol/BaseBroadcastedPacket.cs | 2 +- .../Protocol/BaseRequest.cs | 6 ++--- .../Protocol/BaseResponse.cs | 2 +- .../Protocol/IPacketContainerFactory.cs | 4 +-- .../Protocol/PacketContainerFactory.cs | 4 +-- .../Routing/RoutingInformationFactory.cs | 10 +++++-- .../Routing/RuntimeSmartIpcRouter.cs | 10 +++---- .../SaltyEmu.Communication.csproj | 2 ++ .../Utils/CommunicationIocInjector.cs | 4 +-- ...er.cs => GenericAsyncRpcRequestHandler.cs} | 11 +++++--- .../Utils/GenericIpcRequestHandler.cs | 10 ++++--- .../Utils/IPendingRequestFactory.cs | 2 +- .../Utils/PacketHandlersContainer.cs | 17 +++++++----- .../Utils/PendingRequest.cs | 4 +-- .../Utils/PendingRequestFactory.cs | 4 +-- .../SaltyEmu.Database/MappedRepositoryBase.cs | 8 +++--- .../SynchronizedRepositoryBase.cs | 5 ++-- .../Handling/RemoveRelationsHandler.cs | 2 +- .../Handling/SendInvitationHandler.cs | 2 +- .../RelationService.cs | 4 +-- 82 files changed, 208 insertions(+), 130 deletions(-) create mode 100644 src/ChickenAPI.Game.Extensions/Helpers/PositionHelper.cs rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/EInfoPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/EqPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GenerateHeroicShellExtensioncs.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/GoldPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/InventoryChecksExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/InventoryGetExtensions.cs (84%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/InventoryUseExtension.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/InventoryWearPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/IvnPacketExtension.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MapPacketsExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MovableEntityExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/MoveItemExtensions.cs (100%) rename src/{ChickenAPI.Game/Inventory/ItemUpgrade/Extension => ChickenAPI.Game.Extensions/_TOCLEAN}/NotifyResultAndSetRarityPointExtension.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/PortalPacketExtensions.cs (100%) rename src/{ChickenAPI.Game/IAs => ChickenAPI.Game.Extensions/_TOCLEAN}/RespawnExtensions.cs (90%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SetRarityPointExtension.cs (100%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/SlInfoPacketExtensions.cs (97%) rename src/{ChickenAPI.Game/Inventory/Extensions => ChickenAPI.Game.Extensions/_TOCLEAN}/VisibleEntityExtensions.cs (100%) create mode 100644 src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj rename src/{ChickenAPI.Game/Effects => ChickenAPI.Game.Impl}/EffectSystem.cs (100%) rename src/{ChickenAPI.Game/Groups => ChickenAPI.Game.Impl}/GroupSystem.cs (94%) rename src/{ChickenAPI.Game/IAs => ChickenAPI.Game.Impl}/IASystem.cs (96%) rename src/{ChickenAPI.Game/Entities/Drop => ChickenAPI.Game.Impl}/ItemDropEntity.cs (100%) rename src/{ChickenAPI.Game/Entities/Mates => ChickenAPI.Game.Impl}/MateEntity.cs (100%) rename src/{ChickenAPI.Game/Entities/Monster => ChickenAPI.Game.Impl}/MonsterEntity.cs (100%) rename src/{ChickenAPI.Game/Movements/DataObjects => ChickenAPI.Game.Impl}/MovableComponent.cs (91%) rename src/{ChickenAPI.Game/Movements => ChickenAPI.Game.Impl}/MovableSystem.cs (85%) rename src/{ChickenAPI.Game/Entities/Npc => ChickenAPI.Game.Impl}/NpcEntity.cs (100%) rename src/{ChickenAPI.Game/Entities/Player => ChickenAPI.Game.Impl}/PlayerEntity.cs (100%) rename src/{ChickenAPI.Game/IAs => ChickenAPI.Game.Impl}/RespawnSystem.cs (100%) rename src/{ChickenAPI.Game/Maps => ChickenAPI.Game.Impl}/SimpleMap.cs (100%) rename src/{ChickenAPI.Game/Maps => ChickenAPI.Game.Impl}/SimpleMapLayer.cs (96%) rename src/{ChickenAPI.Game/Skills => ChickenAPI.Game.Impl}/SkillComponent.cs (98%) rename src/{ChickenAPI.Game/Specialists => ChickenAPI.Game.Impl}/SpecialistSystem.cs (96%) rename src/Plugins/SaltyEmu.FamilyPlugin/{FamilyIpcClient.cs => FamilyRpcClient.cs} (88%) rename src/libs/SaltyEmu.Communication/Communicators/{MappedIpcRepository.cs => MappedRPCRepository.cs} (95%) rename src/libs/SaltyEmu.Communication/Utils/{GenericIpcPacketHandler.cs => GenericAsyncRpcRequestHandler.cs} (60%) diff --git a/SaltyEmu.sln b/SaltyEmu.sln index a9ca83f1..14c5221f 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -73,6 +73,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.CharacterSkillServ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Database.MongoDB", "src\libs\SaltyEmu.Database.MongoDB\SaltyEmu.Database.MongoDB.csproj", "{48886586-562B-4CE6-B105-3F231FE6C97E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChickenAPI.Game.Impl", "src\ChickenAPI.Game.Impl\ChickenAPI.Game.Impl.csproj", "{E5F9DC97-664E-42B5-B68F-F93AC4019051}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -195,6 +197,10 @@ Global {48886586-562B-4CE6-B105-3F231FE6C97E}.Debug|Any CPU.Build.0 = Debug|Any CPU {48886586-562B-4CE6-B105-3F231FE6C97E}.Release|Any CPU.ActiveCfg = Release|Any CPU {48886586-562B-4CE6-B105-3F231FE6C97E}.Release|Any CPU.Build.0 = Release|Any CPU + {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -228,6 +234,7 @@ Global {45C3099C-13FB-47C1-94A8-074445608329} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {48886586-562B-4CE6-B105-3F231FE6C97E} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} + {E5F9DC97-664E-42B5-B68F-F93AC4019051} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {33B1EC1B-965D-4770-B047-390647E82322} diff --git a/src/ChickenAPI.Game.Extensions/Helpers/PositionHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/PositionHelper.cs new file mode 100644 index 00000000..d7199385 --- /dev/null +++ b/src/ChickenAPI.Game.Extensions/Helpers/PositionHelper.cs @@ -0,0 +1,18 @@ +using System; + +namespace ChickenAPI.Core.Utils +{ + public static class PositionHelper + { + public static double Octile(int x, int y) + { + int min = Math.Min(x, y); + int max = Math.Max(x, y); + return min * Math.Sqrt(2) + max - min; + } + + public static int GetDistance(Position src, short x, short y) => (int)Octile(Math.Abs(src.X - x), Math.Abs(src.Y - y)); + + public static int GetDistance(Position src, Position dest) => (int)Octile(Math.Abs(src.X - dest.X), Math.Abs(src.Y - dest.Y)); + } +} \ No newline at end of file diff --git a/src/ChickenAPI.Game/Inventory/Extensions/EInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/EInfoPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/EqPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/EqPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/GenerateHeroicShellExtensioncs.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GenerateHeroicShellExtensioncs.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/GenerateHeroicShellExtensioncs.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GenerateHeroicShellExtensioncs.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/GoldPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GoldPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/GoldPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/GoldPacketExtension.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/InventoryChecksExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryChecksExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/InventoryChecksExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryChecksExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/InventoryGetExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs similarity index 84% rename from src/ChickenAPI.Game/Inventory/Extensions/InventoryGetExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs index fd49978b..39fbfe8f 100644 --- a/src/ChickenAPI.Game/Inventory/Extensions/InventoryGetExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs @@ -7,7 +7,7 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { @@ -16,6 +16,16 @@ public static class InventoryGetExtensions private static readonly IGameConfiguration GameConf = new Lazy(ChickenContainer.Instance.Resolve).Value; public static ItemInstanceDto GetWeared(this InventoryComponent inv, EquipmentType equipmentType) => inv.Wear[(int)equipmentType]; + public static IvnSubPacket GenerateIvnSubPacket(this ItemInstanceDto item) + { + return new IvnSubPacket + { + VNum = (short)item.ItemId, + RareAmount = item.Rarity, + UpgradeDesign = item.Item.IsColored && item.Item.EquipmentSlot == EquipmentType.Sp ? item.Design : item.Upgrade, + SecondUpgrade = item.SpStoneUpgrade, + }; + } public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, InventoryType type) { @@ -23,8 +33,7 @@ public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, Inven var packet = new InvPacket { - InventoryType = type, - Items = new List() + IvnSubPackets = new List() }; if (items.All(s => s == null)) @@ -35,19 +44,19 @@ public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, Inven switch (type) { case InventoryType.Equipment: - packet.Items.AddRange(items.Where(s => s != null).Select(s => - $"{s.Slot}.{s.ItemId}.{s.Rarity}.{(s.Item.IsColored && s.Item.EquipmentSlot == EquipmentType.Sp ? s.Design : s.Upgrade)}.{s.SpStoneUpgrade}")); + packet.IvnSubPackets.AddRange(items.Where(s => s != null).Select(s => s.GenerateIvnSubPacket())); break; case InventoryType.Etc: case InventoryType.Main: - packet.Items.AddRange(items.Where(s => s != null).Select(s => - $"{s.Slot}.{s.ItemId}.{s.Amount}.0")); + + packet.IvnSubPackets.AddRange(items.Where(s => s != null).Select(s => s.GenerateIvnSubPacket())); + // $"{s.Slot}.{s.ItemId}.{s.Amount}.0")); break; case InventoryType.Miniland: - packet.Items.AddRange(items.Where(s => s != null).Select(s => - $"{s.Slot}.{s.ItemId}.{s.Amount}")); + packet.IvnSubPackets.AddRange(items.Where(s => s != null).Select(s => s.GenerateIvnSubPacket())); + // $"{s.Slot}.{s.ItemId}.{s.Amount}")); break; case InventoryType.Wear: break; diff --git a/src/ChickenAPI.Game/Inventory/Extensions/InventoryUseExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/InventoryUseExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/InventoryWearPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/InventoryWearPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/IvnPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/IvnPacketExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/MapPacketsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/MapPacketsExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/MovableEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovableEntityExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/MovableEntityExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MovableEntityExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/MoveItemExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveItemExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/MoveItemExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveItemExtensions.cs diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Extension/NotifyResultAndSetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/ItemUpgrade/Extension/NotifyResultAndSetRarityPointExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/PortalPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/PortalPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs diff --git a/src/ChickenAPI.Game/IAs/RespawnExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs similarity index 90% rename from src/ChickenAPI.Game/IAs/RespawnExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs index 543e0d52..6f8b89ce 100644 --- a/src/ChickenAPI.Game/IAs/RespawnExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Game.Inventory.Extensions; namespace ChickenAPI.Game.IAs { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs index 77506c53..824f02ad 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs @@ -3,7 +3,8 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Entities; namespace ChickenAPI.Game.Movements.Extensions { @@ -32,7 +33,7 @@ public static RestPacket GenerateRestPacket(this IEntity entity) return new RestPacket { VisualType = VisualType.Player, - VisualId = player.Character.Id, + VisualId = player.Id, IsSitting = player.IsSitting }; default: diff --git a/src/ChickenAPI.Game/Inventory/Extensions/SetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SetRarityPointExtension.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/SetRarityPointExtension.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SetRarityPointExtension.cs diff --git a/src/ChickenAPI.Game/Inventory/Extensions/SlInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs similarity index 97% rename from src/ChickenAPI.Game/Inventory/Extensions/SlInfoPacketExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs index 89dd89ee..ef22b4b4 100644 --- a/src/ChickenAPI.Game/Inventory/Extensions/SlInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs @@ -3,8 +3,7 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Item; using ChickenAPI.Data.Skills; -using ChickenAPI.Game.Skills.Extensions; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.ServerPackets.Specialists; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs index 834a1468..4344cb1b 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs @@ -4,6 +4,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Extensions { diff --git a/src/ChickenAPI.Game/Inventory/Extensions/VisibleEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs similarity index 100% rename from src/ChickenAPI.Game/Inventory/Extensions/VisibleEntityExtensions.cs rename to src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs diff --git a/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj b/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj new file mode 100644 index 00000000..0a344e0d --- /dev/null +++ b/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj @@ -0,0 +1,12 @@ + + + + netstandard2.0 + + + + + + + + diff --git a/src/ChickenAPI.Game/Effects/EffectSystem.cs b/src/ChickenAPI.Game.Impl/EffectSystem.cs similarity index 100% rename from src/ChickenAPI.Game/Effects/EffectSystem.cs rename to src/ChickenAPI.Game.Impl/EffectSystem.cs diff --git a/src/ChickenAPI.Game/Groups/GroupSystem.cs b/src/ChickenAPI.Game.Impl/GroupSystem.cs similarity index 94% rename from src/ChickenAPI.Game/Groups/GroupSystem.cs rename to src/ChickenAPI.Game.Impl/GroupSystem.cs index 7e575588..e5c8f759 100644 --- a/src/ChickenAPI.Game/Groups/GroupSystem.cs +++ b/src/ChickenAPI.Game.Impl/GroupSystem.cs @@ -2,7 +2,6 @@ using System.Linq; using System.Linq.Expressions; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; diff --git a/src/ChickenAPI.Game/IAs/IASystem.cs b/src/ChickenAPI.Game.Impl/IASystem.cs similarity index 96% rename from src/ChickenAPI.Game/IAs/IASystem.cs rename to src/ChickenAPI.Game.Impl/IASystem.cs index ec575475..00c72577 100644 --- a/src/ChickenAPI.Game/IAs/IASystem.cs +++ b/src/ChickenAPI.Game.Impl/IASystem.cs @@ -7,18 +7,14 @@ using ChickenAPI.Core.Maths; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Skill; using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Game.Entities; -using ChickenAPI.Game.Entities.Monster; -using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Maps; -using ChickenAPI.Game.Movements; -using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game.Skills.Args; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Game.Movements.Extensions; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.IAs { diff --git a/src/ChickenAPI.Game/Entities/Drop/ItemDropEntity.cs b/src/ChickenAPI.Game.Impl/ItemDropEntity.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Drop/ItemDropEntity.cs rename to src/ChickenAPI.Game.Impl/ItemDropEntity.cs diff --git a/src/ChickenAPI.Game/Entities/Mates/MateEntity.cs b/src/ChickenAPI.Game.Impl/MateEntity.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Mates/MateEntity.cs rename to src/ChickenAPI.Game.Impl/MateEntity.cs diff --git a/src/ChickenAPI.Game/Entities/Monster/MonsterEntity.cs b/src/ChickenAPI.Game.Impl/MonsterEntity.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Monster/MonsterEntity.cs rename to src/ChickenAPI.Game.Impl/MonsterEntity.cs diff --git a/src/ChickenAPI.Game/Movements/DataObjects/MovableComponent.cs b/src/ChickenAPI.Game.Impl/MovableComponent.cs similarity index 91% rename from src/ChickenAPI.Game/Movements/DataObjects/MovableComponent.cs rename to src/ChickenAPI.Game.Impl/MovableComponent.cs index 3ee89cf3..1e63de84 100644 --- a/src/ChickenAPI.Game/Movements/DataObjects/MovableComponent.cs +++ b/src/ChickenAPI.Game.Impl/MovableComponent.cs @@ -1,5 +1,6 @@ using System; using Autofac; +using ChickenAPI.Core.Events; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Character; @@ -16,6 +17,7 @@ namespace ChickenAPI.Game.Movements.DataObjects /// public class MovableComponent : IComponent { + private static IAlgorithmService Algorithm => new Lazy(() => ChickenContainer.Instance.Resolve()).Value; private Position _actual; private bool _isSitting; @@ -37,7 +39,6 @@ public MovableComponent(IPlayerEntity entity) Speed = (byte)Algorithm.GetSpeed(entity.Character.Class, entity.Level); } - private static IAlgorithmService Algorithm => new Lazy(() => ChickenContainer.Instance.Resolve()).Value; /// /// Entity Walking Speed @@ -66,7 +67,7 @@ public Position Actual set { LastMove = DateTime.UtcNow; - OnMove(Entity, new MoveEventArgs { Component = this, New = value, Old = _actual }); + OnMove(Entity, new MoveEventArgs { Component = Entity as IMovableEntity, New = value, Old = _actual }); _actual = value; } } @@ -75,12 +76,9 @@ public Position Actual public IEntity Entity { get; set; } - public static event TypedSenderEventHandler Move; - private static void OnMove(IEntity sender, MoveEventArgs e) { e.Component.LastMove = DateTime.UtcNow; - Move?.Invoke(sender, e); } } } \ No newline at end of file diff --git a/src/ChickenAPI.Game/Movements/MovableSystem.cs b/src/ChickenAPI.Game.Impl/MovableSystem.cs similarity index 85% rename from src/ChickenAPI.Game/Movements/MovableSystem.cs rename to src/ChickenAPI.Game.Impl/MovableSystem.cs index 157ff886..93bb43af 100644 --- a/src/ChickenAPI.Game/Movements/MovableSystem.cs +++ b/src/ChickenAPI.Game.Impl/MovableSystem.cs @@ -1,22 +1,25 @@ using System; using System.Linq; using System.Linq.Expressions; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Utils; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.IAs; -using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Entities; namespace ChickenAPI.Game.Movements { public class MovableSystem : SystemBase { - public MovableSystem(IEntityManager entityManager) : base(entityManager) + private readonly ILogger _log; + + public MovableSystem(IEntityManager entityManager, ILogger log) : base(entityManager) { + _log = log; } protected override double RefreshRate => 3; @@ -47,7 +50,7 @@ private void Move(IEntity entity) { try { - MvPacket packet = entity.GenerateMvPacket(); + MovePacket packet = entity.GenerateMvPacket(); entity.CurrentMap.BroadcastAsync(packet).ConfigureAwait(false).GetAwaiter().GetResult(); if (entity is IPlayerEntity playerEntity) @@ -57,7 +60,7 @@ private void Move(IEntity entity) } catch (Exception e) { - Log.Error("Move()", e); + _log.Error("Move()", e); } } diff --git a/src/ChickenAPI.Game/Entities/Npc/NpcEntity.cs b/src/ChickenAPI.Game.Impl/NpcEntity.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Npc/NpcEntity.cs rename to src/ChickenAPI.Game.Impl/NpcEntity.cs diff --git a/src/ChickenAPI.Game/Entities/Player/PlayerEntity.cs b/src/ChickenAPI.Game.Impl/PlayerEntity.cs similarity index 100% rename from src/ChickenAPI.Game/Entities/Player/PlayerEntity.cs rename to src/ChickenAPI.Game.Impl/PlayerEntity.cs diff --git a/src/ChickenAPI.Game/IAs/RespawnSystem.cs b/src/ChickenAPI.Game.Impl/RespawnSystem.cs similarity index 100% rename from src/ChickenAPI.Game/IAs/RespawnSystem.cs rename to src/ChickenAPI.Game.Impl/RespawnSystem.cs diff --git a/src/ChickenAPI.Game/Maps/SimpleMap.cs b/src/ChickenAPI.Game.Impl/SimpleMap.cs similarity index 100% rename from src/ChickenAPI.Game/Maps/SimpleMap.cs rename to src/ChickenAPI.Game.Impl/SimpleMap.cs diff --git a/src/ChickenAPI.Game/Maps/SimpleMapLayer.cs b/src/ChickenAPI.Game.Impl/SimpleMapLayer.cs similarity index 96% rename from src/ChickenAPI.Game/Maps/SimpleMapLayer.cs rename to src/ChickenAPI.Game.Impl/SimpleMapLayer.cs index 2753c29e..67cd5f90 100644 --- a/src/ChickenAPI.Game/Maps/SimpleMapLayer.cs +++ b/src/ChickenAPI.Game.Impl/SimpleMapLayer.cs @@ -22,6 +22,9 @@ using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Interfaces; +using ChickenAPI.Core.Logging; namespace ChickenAPI.Game.Maps { @@ -115,7 +118,7 @@ private void InitializePortals(IEnumerable portals) private void InitializeSystems() { - AddSystem(new MovableSystem(this)); + AddSystem(new MovableSystem(this, ChickenContainer.Instance.Resolve())); AddSystem(new IASystem(this, Map)); AddSystem(new EffectSystem(this)); AddSystem(new GroupSystem(this)); @@ -138,6 +141,7 @@ private void InitializeNpcs(IEnumerable npcs, IEnumerable sh { npcSkills = new List(); } + new NpcEntity(npc, shop).TransferEntity(this); } } diff --git a/src/ChickenAPI.Game/Skills/SkillComponent.cs b/src/ChickenAPI.Game.Impl/SkillComponent.cs similarity index 98% rename from src/ChickenAPI.Game/Skills/SkillComponent.cs rename to src/ChickenAPI.Game.Impl/SkillComponent.cs index 351bfa04..f978c2f5 100644 --- a/src/ChickenAPI.Game/Skills/SkillComponent.cs +++ b/src/ChickenAPI.Game.Impl/SkillComponent.cs @@ -8,7 +8,6 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game.Skills.Extensions; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; diff --git a/src/ChickenAPI.Game/Specialists/SpecialistSystem.cs b/src/ChickenAPI.Game.Impl/SpecialistSystem.cs similarity index 96% rename from src/ChickenAPI.Game/Specialists/SpecialistSystem.cs rename to src/ChickenAPI.Game.Impl/SpecialistSystem.cs index 73486ba4..631efc93 100644 --- a/src/ChickenAPI.Game/Specialists/SpecialistSystem.cs +++ b/src/ChickenAPI.Game.Impl/SpecialistSystem.cs @@ -1,10 +1,10 @@ using System; using System.Linq.Expressions; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Game.Entities.Player.Extensions; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Specialists { diff --git a/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs b/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs index 4098dc6a..6755aef7 100644 --- a/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs +++ b/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs @@ -31,7 +31,6 @@ public BasicBCardHandler(BCardEffectHandlerAttribute attribute, MethodInfo metho public Task Handle(IBattleEntity target, IBattleEntity sender, BCardDto bcard) { - Log.Info($"Handling : {HandledType}"); _func(target, sender, bcard); return Task.CompletedTask; } diff --git a/src/ChickenAPI.Game/Effects/EffectComponent.cs b/src/ChickenAPI.Game/Effects/EffectComponent.cs index c9a3fef7..8b0abd9a 100644 --- a/src/ChickenAPI.Game/Effects/EffectComponent.cs +++ b/src/ChickenAPI.Game/Effects/EffectComponent.cs @@ -19,14 +19,14 @@ public EffectComponent(IEntity entity) public class Effect { - public Effect(long id, long cooldown) + public Effect(int id, long cooldown) { Id = id; Cooldown = cooldown; LastCast = DateTime.MinValue; } - public long Id { get; } + public int Id { get; } /// /// In milliseconds diff --git a/src/ChickenAPI.Game/Managers/SimplePlayerManager.cs b/src/ChickenAPI.Game/Managers/SimplePlayerManager.cs index 71f08417..a9fe4d45 100644 --- a/src/ChickenAPI.Game/Managers/SimplePlayerManager.cs +++ b/src/ChickenAPI.Game/Managers/SimplePlayerManager.cs @@ -4,6 +4,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace ChickenAPI.Game.Managers { diff --git a/src/ChickenAPI.Game/Movements/DataObjects/MoveEventArgs.cs b/src/ChickenAPI.Game/Movements/DataObjects/MoveEventArgs.cs index f08d9659..00d1af1d 100644 --- a/src/ChickenAPI.Game/Movements/DataObjects/MoveEventArgs.cs +++ b/src/ChickenAPI.Game/Movements/DataObjects/MoveEventArgs.cs @@ -5,7 +5,7 @@ namespace ChickenAPI.Game.Movements.DataObjects { public class MoveEventArgs : EventArgs { - public MovableComponent Component { get; set; } + public IMovableEntity Component { get; set; } public Position Old { get; set; } public Position New { get; set; } } diff --git a/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs b/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs index 05d721b3..284d5e18 100644 --- a/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs +++ b/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs @@ -1,5 +1,6 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Shops.Events { diff --git a/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs b/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs index 6296d1c2..33e79572 100644 --- a/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs +++ b/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs @@ -1,5 +1,6 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Shops.Events { diff --git a/src/ChickenAPI.Game/Skills/ISkillEntity.cs b/src/ChickenAPI.Game/Skills/ISkillEntity.cs index da335399..6a382e74 100644 --- a/src/ChickenAPI.Game/Skills/ISkillEntity.cs +++ b/src/ChickenAPI.Game/Skills/ISkillEntity.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using ChickenAPI.Data.Character; using ChickenAPI.Data.Skills; namespace ChickenAPI.Game.Skills @@ -12,6 +14,14 @@ public interface ISkillEntity SkillComponent SkillComponent { get; } + public Dictionary CharacterSkills { get; } + + public Dictionary Skills { get; } + + public Dictionary SkillsByCastId { get; } + + public List<(DateTime, long)> CooldownsBySkillId { get; } + /// /// Checks if the entity has the given skill /// diff --git a/src/ChickenAPI.Game/Skills/SkiPacket.cs b/src/ChickenAPI.Game/Skills/SkiPacket.cs index db61684d..64dc8e47 100644 --- a/src/ChickenAPI.Game/Skills/SkiPacket.cs +++ b/src/ChickenAPI.Game/Skills/SkiPacket.cs @@ -7,7 +7,7 @@ namespace ChickenAPI.Game.Skills [PacketHeader("ski")] public class SkiPacket : PacketBase { - [PacketIndex(0, SeparatorNestedElements = " ")] + [PacketIndex(0, SpecialSeparator = " ")] public List SkillIds { get; set; } } } \ No newline at end of file diff --git a/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs b/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs index 6891998b..aedb192f 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs @@ -7,13 +7,13 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game._ECS.Entities { public abstract class EntityManagerBase : IEntityManager { protected static IEntityManagerContainer EmContainer = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; - protected static readonly Logger Log = Logger.GetLogger(); // entities protected readonly HashSet _players = new HashSet(); diff --git a/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs b/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs index 7ebadde2..51203ca3 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game._ECS.Entities { diff --git a/src/ChickenAPI.Game/_ECS/Systems/SystemBase.cs b/src/ChickenAPI.Game/_ECS/Systems/SystemBase.cs index 60d1fd80..0a1f959f 100644 --- a/src/ChickenAPI.Game/_ECS/Systems/SystemBase.cs +++ b/src/ChickenAPI.Game/_ECS/Systems/SystemBase.cs @@ -1,14 +1,12 @@ using System; using System.Linq; using System.Linq.Expressions; -using ChickenAPI.Core.Logging; using ChickenAPI.Game._ECS.Entities; namespace ChickenAPI.Game._ECS.Systems { public abstract class SystemBase : ISystem { - protected static readonly Logger Log = Logger.GetLogger(); private Func _filter; private DateTime _lastUpdate; diff --git a/src/ChickenAPI.Game/_Network/IPacketPipelineAsync.cs b/src/ChickenAPI.Game/_Network/IPacketPipelineAsync.cs index 7441483a..99d501f0 100644 --- a/src/ChickenAPI.Game/_Network/IPacketPipelineAsync.cs +++ b/src/ChickenAPI.Game/_Network/IPacketPipelineAsync.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace ChickenAPI.Game._Network { diff --git a/src/ChickenAPI.Game/_Network/IPacketProcessor.cs b/src/ChickenAPI.Game/_Network/IPacketProcessor.cs index b42514d9..82a31a6b 100644 --- a/src/ChickenAPI.Game/_Network/IPacketProcessor.cs +++ b/src/ChickenAPI.Game/_Network/IPacketProcessor.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace ChickenAPI.Game._Network { diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs index 57ffa2b4..46aaa874 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Items; @@ -14,7 +15,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Character { public class CharacterItemDao : SynchronizedRepositoryBase, IItemInstanceService { - public CharacterItemDao(DbContext context, IMapper mapper) : base(context, mapper) + public CharacterItemDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/CharacterSkills/CharacterSkillServiceClient.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/CharacterSkills/CharacterSkillServiceClient.cs index 24b2e03c..9d33251c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/CharacterSkills/CharacterSkillServiceClient.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/CharacterSkills/CharacterSkillServiceClient.cs @@ -3,13 +3,12 @@ using ChickenAPI.Core.IPC; using ChickenAPI.Data.Character; using SaltyEmu.Communication.Communicators; -using SaltyEmu.Communication.Configs; namespace SaltyEmu.BasicPlugin.CharacterSkills { - public class CharacterSkillServiceClient : SynchronizedRepositoryMqtt, ICharacterSkillService + public class CharacterSkillServiceClient : SynchronizedRpcRepository, ICharacterSkillService { - public CharacterSkillServiceClient(MqttClientConfigurationBuilder builder, IIpcClient client) : base(builder, client) + public CharacterSkillServiceClient(IRpcClient client) : base(client) { } diff --git a/src/Plugins/SaltyEmu.FamilyPlugin/FamilyIpcClient.cs b/src/Plugins/SaltyEmu.FamilyPlugin/FamilyRpcClient.cs similarity index 88% rename from src/Plugins/SaltyEmu.FamilyPlugin/FamilyIpcClient.cs rename to src/Plugins/SaltyEmu.FamilyPlugin/FamilyRpcClient.cs index 04ddd808..07e430db 100644 --- a/src/Plugins/SaltyEmu.FamilyPlugin/FamilyIpcClient.cs +++ b/src/Plugins/SaltyEmu.FamilyPlugin/FamilyRpcClient.cs @@ -7,9 +7,9 @@ namespace SaltyEmu.FamilyPlugin { - public class FamilyIpcClient : MappedIpcRepository, IFamilyService + public class FamilyRpcClient : MappedRpcRepository, IFamilyService { - public FamilyIpcClient(IIpcClient builder) : base(builder) + public FamilyRpcClient(IRpcClient builder) : base(builder) { } diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs b/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs index e918a1f5..fc2bde55 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs +++ b/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs @@ -9,7 +9,7 @@ namespace SaltyEmu.FriendsPlugin.Handlers { - internal class SendInvitationHandler : GenericIpcPacketHandler + internal class SendInvitationHandler : GenericAsyncRpcRequestHandler { protected override Task Handle(SendInvitation request) { diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs b/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs index 139b8327..d37e6221 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs +++ b/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs @@ -22,7 +22,7 @@ public RelationServiceClient(IIpcClient client) _client = client; } - private Task RequestAsync(IIpcRequest request) where TResponse : class, IIpcResponse + private Task RequestAsync(IRpcSyncRequest request) where TResponse : class, ISyncRpcResponse { return _client.RequestAsync(request); } diff --git a/src/libs/SaltyEmu.Communication/Communicators/MappedIpcRepository.cs b/src/libs/SaltyEmu.Communication/Communicators/MappedRPCRepository.cs similarity index 95% rename from src/libs/SaltyEmu.Communication/Communicators/MappedIpcRepository.cs rename to src/libs/SaltyEmu.Communication/Communicators/MappedRPCRepository.cs index 4703cea6..6c942e68 100644 --- a/src/libs/SaltyEmu.Communication/Communicators/MappedIpcRepository.cs +++ b/src/libs/SaltyEmu.Communication/Communicators/MappedRPCRepository.cs @@ -7,10 +7,10 @@ namespace SaltyEmu.Communication.Communicators { - public abstract class MappedIpcRepository : IMappedRepository where T : class, IMappedDto + public abstract class MappedRpcRepository : IMappedRepository where T : class, IMappedDto { - protected readonly IIpcClient Client; - protected MappedIpcRepository(IIpcClient client) + protected readonly IRpcClient Client; + protected MappedRpcRepository(IRpcClient client) { Client = client; } diff --git a/src/libs/SaltyEmu.Communication/Communicators/MqttIpcClient.cs b/src/libs/SaltyEmu.Communication/Communicators/MqttIpcClient.cs index 6d8dd4f1..dba39157 100644 --- a/src/libs/SaltyEmu.Communication/Communicators/MqttIpcClient.cs +++ b/src/libs/SaltyEmu.Communication/Communicators/MqttIpcClient.cs @@ -17,9 +17,9 @@ namespace SaltyEmu.Communication.Communicators { - public sealed class MqttIpcClient : IIpcClient + public sealed class MqttIpcClient : IRpcClient { - private readonly Logger _log = Logger.GetLogger(); + private readonly ILogger _log; private readonly IIpcPacketRouter _router; private readonly IIpcSerializer _serializer; @@ -93,7 +93,7 @@ private async Task CheckRouting(Type type) return routingInfos; } - public async Task RequestAsync(IIpcRequest packet) where TResponse : class, IIpcResponse + public async Task RequestAsync(ISyncRpcRequest packet) where TResponse : class, ISyncRpcResponse { // add packet to requests PendingRequest request = _requestFactory.Create(packet); @@ -106,7 +106,7 @@ public async Task RequestAsync(IIpcRequest packet) where T PacketContainer container = _packetFactory.ToPacket(packet.GetType(), packet); await SendAsync(container); - IIpcResponse tmp = await request.Response.Task; + ISyncRpcResponse tmp = await request.Response.Task; return tmp as TResponse; } @@ -121,7 +121,7 @@ await _client.PublishAsync(builder => ); } - public Task BroadcastAsync(T packet) where T : IIpcPacket + public Task BroadcastAsync(T packet) where T : IAsyncRpcRequest { PacketContainer container = _packetFactory.ToPacket(typeof(T), packet); return SendAsync(container); diff --git a/src/libs/SaltyEmu.Communication/Communicators/MqttIpcServer.cs b/src/libs/SaltyEmu.Communication/Communicators/MqttIpcServer.cs index e75923e1..cccee832 100644 --- a/src/libs/SaltyEmu.Communication/Communicators/MqttIpcServer.cs +++ b/src/libs/SaltyEmu.Communication/Communicators/MqttIpcServer.cs @@ -17,9 +17,9 @@ namespace SaltyEmu.Communication.Communicators { - public class MqttIpcServer : IIpcServer + public class MqttIpcServer : IRpcServer { - private readonly Logger _log = Logger.GetLogger(); + private readonly ILogger _log; private readonly HashSet _queues; private readonly IManagedMqttClient _client; private readonly IIpcSerializer _serializer; @@ -29,16 +29,18 @@ public class MqttIpcServer : IIpcServer private readonly IIpcPacketHandlersContainer _packetHandlersContainer; private readonly IIpcPacketRouter _router; - public MqttIpcServer(MqttServerConfigurationBuilder builder, IIpcSerializer serializer, IIpcPacketRouter router, IIpcPacketHandlersContainer packetHandlersContainer) : this(builder.Build(), - serializer, router, packetHandlersContainer) + public MqttIpcServer(MqttServerConfigurationBuilder builder, IIpcSerializer serializer, IIpcPacketRouter router, IIpcPacketHandlersContainer packetHandlersContainer, ILogger log) : this( + builder.Build(), + serializer, router, packetHandlersContainer, log) { } - private MqttIpcServer(MqttIpcServerConfiguration configuration, IIpcSerializer serializer, IIpcPacketRouter router, IIpcPacketHandlersContainer packetHandlersContainer) + private MqttIpcServer(MqttIpcServerConfiguration configuration, IIpcSerializer serializer, IIpcPacketRouter router, IIpcPacketHandlersContainer packetHandlersContainer, ILogger log) { _serializer = serializer; _router = router; _packetHandlersContainer = packetHandlersContainer; + _log = log; string clientName = configuration.ClientName; string endPoint = configuration.EndPoint; @@ -98,7 +100,7 @@ public void OnRequest(BaseRequest request, Type type) _packetHandlersContainer.HandleAsync(request, type).ConfigureAwait(false).GetAwaiter().GetResult(); } - public async Task ResponseAsync(T response, Type packetType) where T : IIpcResponse + public async Task ResponseAsync(T response, Type packetType) where T : ISyncRpcResponse { PacketContainer container = _packetFactory.ToPacket(response); #if DEBUG diff --git a/src/libs/SaltyEmu.Communication/Communicators/RabbitMQServer.cs b/src/libs/SaltyEmu.Communication/Communicators/RabbitMQServer.cs index e3db6354..19ef8c77 100644 --- a/src/libs/SaltyEmu.Communication/Communicators/RabbitMQServer.cs +++ b/src/libs/SaltyEmu.Communication/Communicators/RabbitMQServer.cs @@ -12,14 +12,14 @@ namespace SaltyEmu.Communication.Communicators { - public abstract class RabbitMqServer : IIpcServer + public abstract class RabbitMqServer : IRpcServer { private readonly RabbitMqConfiguration _configuration; private readonly string _requestQueueName; private readonly string _responseQueueName; private readonly string _broadcastQueueName; private const string ExchangeName = ""; // default exchange - private static readonly Logger Log = Logger.GetLogger(); + protected readonly ILogger Log; private readonly IModel _channel; private readonly IConnection _connection; @@ -27,10 +27,11 @@ public abstract class RabbitMqServer : IIpcServer private readonly IIpcPacketHandlersContainer _packetHandlersContainer; - protected RabbitMqServer(RabbitMqConfiguration config, IIpcPacketHandlersContainer packetHandlersContainer) + protected RabbitMqServer(RabbitMqConfiguration config, IIpcPacketHandlersContainer packetHandlersContainer, ILogger log) { _configuration = config; _packetHandlersContainer = packetHandlersContainer; + Log = log; var factory = new ConnectionFactory { HostName = _configuration.Address, Password = _configuration.Password, Port = _configuration.Port }; _requestQueueName = _configuration.RequestQueueName; @@ -53,7 +54,7 @@ protected RabbitMqServer(RabbitMqConfiguration config, IIpcPacketHandlersContain Log.Info("IPC Server launched !"); } - public Task ResponseAsync(T response) where T : IIpcResponse + public Task ResponseAsync(T response) where T : ISyncRpcResponse { return Task.Run(() => { Publish(_packetContainerFactory.ToPacket(response), _responseQueueName); }); } @@ -99,7 +100,7 @@ private void Publish(PacketContainer container, string queueName) _channel.BasicPublish(ExchangeName, queueName, props, messageBytes); } - public Task ResponseAsync(T response, Type requestType) where T : IIpcResponse + public Task ResponseAsync(T response, Type requestType) where T : ISyncRpcResponse { return Task.Run(() => { Publish(_packetContainerFactory.ToPacket(response), _responseQueueName); }); } diff --git a/src/libs/SaltyEmu.Communication/Communicators/RabbitMqClient.cs b/src/libs/SaltyEmu.Communication/Communicators/RabbitMqClient.cs index 2c6c4693..decaf9ec 100644 --- a/src/libs/SaltyEmu.Communication/Communicators/RabbitMqClient.cs +++ b/src/libs/SaltyEmu.Communication/Communicators/RabbitMqClient.cs @@ -14,9 +14,9 @@ namespace SaltyEmu.Communication.Communicators { - public abstract class RabbitMqClient : IDisposable, IIpcClient + public abstract class RabbitMqClient : IDisposable, IRpcClient { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log; private readonly RabbitMqConfiguration _configuration; private readonly string _requestQueueName; private readonly string _responseQueueName; @@ -63,7 +63,7 @@ public void Dispose() _channel?.Dispose(); } - public async Task RequestAsync(IIpcRequest packet) where T : class, IIpcResponse + public async Task RequestAsync(ISyncRpcRequest packet) where T : class, ISyncRpcResponse { // add packet to requests PendingRequest request = _requestFactory.Create(packet); @@ -77,15 +77,15 @@ public async Task RequestAsync(IIpcRequest packet) where T : class, IIpcRe Publish(container, _requestQueueName); - IIpcResponse tmp = await request.Response.Task; + ISyncRpcResponse tmp = await request.Response.Task; return tmp as T; } - public Task BroadcastAsync(T packet) where T : IIpcPacket + public Task BroadcastAsync(T packet) where T : IAsyncRpcRequest { return Task.Run(() => { - PacketContainer tmp = _packetFactory.ToPacket(packet); + PacketContainer tmp = _packetFactory.ToPacket(packet); Publish(tmp, _broadcastQueueName); }); } diff --git a/src/libs/SaltyEmu.Communication/Communicators/SynchronizedIpcRepository.cs b/src/libs/SaltyEmu.Communication/Communicators/SynchronizedIpcRepository.cs index 53e5cbb0..01b1f012 100644 --- a/src/libs/SaltyEmu.Communication/Communicators/SynchronizedIpcRepository.cs +++ b/src/libs/SaltyEmu.Communication/Communicators/SynchronizedIpcRepository.cs @@ -4,16 +4,14 @@ using System.Threading.Tasks; using ChickenAPI.Core.IPC; using ChickenAPI.Data; -using SaltyEmu.Communication.Configs; using SaltyEmu.Communication.Protocol.RepositoryPacket; -using SaltyEmu.Communication.Serializers; namespace SaltyEmu.Communication.Communicators { - public abstract class SynchronizedRepositoryMqtt : ISynchronizedRepository where T : class, ISynchronizedDto + public abstract class SynchronizedRpcRepository : ISynchronizedRepository where T : class, ISynchronizedDto { - private readonly IIpcClient _client; - protected SynchronizedRepositoryMqtt(MqttClientConfigurationBuilder builder, IIpcClient client) + private readonly IRpcClient _client; + protected SynchronizedRpcRepository(IRpcClient client) { _client = client; } diff --git a/src/libs/SaltyEmu.Communication/Protocol/BaseBroadcastedPacket.cs b/src/libs/SaltyEmu.Communication/Protocol/BaseBroadcastedPacket.cs index cb040327..d6405c59 100644 --- a/src/libs/SaltyEmu.Communication/Protocol/BaseBroadcastedPacket.cs +++ b/src/libs/SaltyEmu.Communication/Protocol/BaseBroadcastedPacket.cs @@ -4,7 +4,7 @@ namespace SaltyEmu.Communication.Protocol { - public abstract class BaseBroadcastedPacket : IIpcPacket + public abstract class BaseBroadcastedPacket : IAsyncRpcRequest { public Guid Id { get; set; } diff --git a/src/libs/SaltyEmu.Communication/Protocol/BaseRequest.cs b/src/libs/SaltyEmu.Communication/Protocol/BaseRequest.cs index 66d29441..3ad1856c 100644 --- a/src/libs/SaltyEmu.Communication/Protocol/BaseRequest.cs +++ b/src/libs/SaltyEmu.Communication/Protocol/BaseRequest.cs @@ -5,11 +5,11 @@ namespace SaltyEmu.Communication.Protocol { - public class BaseRequest : IIpcRequest + public class BaseRequest : ISyncRpcRequest { private Guid _id; - public IIpcServer Server { get; set; } + public IRpcServer Server { get; set; } public Guid Id { @@ -17,7 +17,7 @@ public Guid Id set => _id = value; } - public Task ReplyAsync(T response) where T : IIpcResponse + public Task ReplyAsync(T response) where T : ISyncRpcResponse { response.RequestId = Id; return Server.ResponseAsync(response, typeof(TRequest)); diff --git a/src/libs/SaltyEmu.Communication/Protocol/BaseResponse.cs b/src/libs/SaltyEmu.Communication/Protocol/BaseResponse.cs index 2193832f..f78cac06 100644 --- a/src/libs/SaltyEmu.Communication/Protocol/BaseResponse.cs +++ b/src/libs/SaltyEmu.Communication/Protocol/BaseResponse.cs @@ -3,7 +3,7 @@ namespace SaltyEmu.Communication.Protocol { - public class BaseResponse : IIpcResponse + public class BaseResponse : ISyncRpcResponse { private Guid _id; diff --git a/src/libs/SaltyEmu.Communication/Protocol/IPacketContainerFactory.cs b/src/libs/SaltyEmu.Communication/Protocol/IPacketContainerFactory.cs index 22f000e1..1fbce178 100644 --- a/src/libs/SaltyEmu.Communication/Protocol/IPacketContainerFactory.cs +++ b/src/libs/SaltyEmu.Communication/Protocol/IPacketContainerFactory.cs @@ -8,7 +8,7 @@ public interface IPacketContainerFactory PacketContainer Create(string content); PacketContainer Create(Type type, string content); - PacketContainer ToPacket(IIpcPacket packet); - PacketContainer ToPacket(Type type, IIpcPacket packet); + PacketContainer ToPacket(T packet) where T : IAsyncRpcRequest; + PacketContainer ToPacket(Type type, IAsyncRpcRequest packet); } } \ No newline at end of file diff --git a/src/libs/SaltyEmu.Communication/Protocol/PacketContainerFactory.cs b/src/libs/SaltyEmu.Communication/Protocol/PacketContainerFactory.cs index de2de2da..977ee1f6 100644 --- a/src/libs/SaltyEmu.Communication/Protocol/PacketContainerFactory.cs +++ b/src/libs/SaltyEmu.Communication/Protocol/PacketContainerFactory.cs @@ -15,8 +15,8 @@ public PacketContainer Create(Type type, string content) => Content = content }; - public PacketContainer ToPacket(IIpcPacket packet) => ToPacket(typeof(T), packet); + public PacketContainer ToPacket(T packet) where T : IAsyncRpcRequest => ToPacket(typeof(T), packet); - public PacketContainer ToPacket(Type type, IIpcPacket packet) => Create(type, JsonConvert.SerializeObject(packet)); + public PacketContainer ToPacket(Type type, IAsyncRpcRequest packet) => Create(type, JsonConvert.SerializeObject(packet)); } } \ No newline at end of file diff --git a/src/libs/SaltyEmu.Communication/Routing/RoutingInformationFactory.cs b/src/libs/SaltyEmu.Communication/Routing/RoutingInformationFactory.cs index 3a88c3b8..81e00d04 100644 --- a/src/libs/SaltyEmu.Communication/Routing/RoutingInformationFactory.cs +++ b/src/libs/SaltyEmu.Communication/Routing/RoutingInformationFactory.cs @@ -6,10 +6,16 @@ namespace SaltyEmu.Communication { public class RoutingInformationFactory : IRoutingInformationFactory { - private readonly Logger Log = Logger.GetLogger(); + private readonly ILogger _log; + + public RoutingInformationFactory(ILogger log) + { + _log = log; + } + public Task Create(string topic, string responseTopic) { - Log.Info($"[PACKET] Routing to : {topic}"); + _log.Info($"[PACKET] Routing to : {topic}"); return Task.FromResult((IRoutingInformation)new RoutingInformation { IncomingTopic = topic, diff --git a/src/libs/SaltyEmu.Communication/Routing/RuntimeSmartIpcRouter.cs b/src/libs/SaltyEmu.Communication/Routing/RuntimeSmartIpcRouter.cs index 91e7a0a8..f04fbc51 100644 --- a/src/libs/SaltyEmu.Communication/Routing/RuntimeSmartIpcRouter.cs +++ b/src/libs/SaltyEmu.Communication/Routing/RuntimeSmartIpcRouter.cs @@ -38,12 +38,12 @@ private async Task RegisterGenericRequestAsync(Type type) string requestTopic = newTopic.ToString(); string responseTopic = ""; - if (type.GetInterfaces().Any(s => s == typeof(IIpcRequest))) + if (type.GetInterfaces().Any(s => s == typeof(ISyncRpcRequest))) { requestTopic += RequestTopicSuffix; responseTopic = newTopic + ResponseTopicSuffix; } - else if (type.GetInterfaces().Any(s => s == typeof(IIpcPacket))) + else if (type.GetInterfaces().Any(s => s == typeof(IAsyncRpcRequest))) { requestTopic += PacketTopicSuffix; } @@ -62,16 +62,16 @@ public async Task RegisterAsync(Type type) string requestTopic = ""; string responseTopic = ""; - if (type.GetInterfaces().Any(s => s == typeof(IIpcRequest))) + if (type.GetInterfaces().Any(s => s == typeof(ISyncRpcRequest))) { requestTopic = type.FullName.ToLower() + RequestTopicSuffix; responseTopic = type.FullName.ToLower() + ResponseTopicSuffix; } - else if (type.GetInterfaces().Any(s => s == typeof(IIpcPacket))) + else if (type.GetInterfaces().Any(s => s == typeof(IAsyncRpcRequest))) { requestTopic = type.FullName.ToLower() + PacketTopicSuffix; } - else if (type.IsNested && type.GetInterfaces().Any(s => s == typeof(IIpcResponse))) + else if (type.IsNested && type.GetInterfaces().Any(s => s == typeof(ISyncRpcResponse))) { responseTopic = type.FullName.ToLower().Replace('+', '.'); } diff --git a/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj b/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj index 622f3034..7cdac008 100644 --- a/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj +++ b/src/libs/SaltyEmu.Communication/SaltyEmu.Communication.csproj @@ -5,8 +5,10 @@ + + diff --git a/src/libs/SaltyEmu.Communication/Utils/CommunicationIocInjector.cs b/src/libs/SaltyEmu.Communication/Utils/CommunicationIocInjector.cs index ef77966a..434530c7 100644 --- a/src/libs/SaltyEmu.Communication/Utils/CommunicationIocInjector.cs +++ b/src/libs/SaltyEmu.Communication/Utils/CommunicationIocInjector.cs @@ -17,8 +17,8 @@ public static void Inject() ChickenContainer.Builder.RegisterType().As().PropertiesAutowired().SingleInstance(); ChickenContainer.Builder.RegisterType().As().PropertiesAutowired().SingleInstance(); - ChickenContainer.Builder.RegisterType().As().PropertiesAutowired().SingleInstance(); - ChickenContainer.Builder.RegisterType().As().PropertiesAutowired().SingleInstance(); + ChickenContainer.Builder.RegisterType().As().PropertiesAutowired().SingleInstance(); + ChickenContainer.Builder.RegisterType().As().PropertiesAutowired().SingleInstance(); } } } \ No newline at end of file diff --git a/src/libs/SaltyEmu.Communication/Utils/GenericIpcPacketHandler.cs b/src/libs/SaltyEmu.Communication/Utils/GenericAsyncRpcRequestHandler.cs similarity index 60% rename from src/libs/SaltyEmu.Communication/Utils/GenericIpcPacketHandler.cs rename to src/libs/SaltyEmu.Communication/Utils/GenericAsyncRpcRequestHandler.cs index 20d2be60..4f969ab7 100644 --- a/src/libs/SaltyEmu.Communication/Utils/GenericIpcPacketHandler.cs +++ b/src/libs/SaltyEmu.Communication/Utils/GenericAsyncRpcRequestHandler.cs @@ -5,11 +5,16 @@ namespace SaltyEmu.Communication.Utils { - public abstract class GenericIpcPacketHandler : IIpcPacketHandler where T : IIpcPacket + public abstract class GenericAsyncRpcRequestHandler : IIpcPacketHandler where T : IAsyncRpcRequest { - protected readonly Logger Log = Logger.GetLogger>(); + protected readonly ILogger Log; - public Task Handle(IIpcPacket packet) + protected GenericAsyncRpcRequestHandler(ILogger log) + { + Log = log; + } + + public Task Handle(IAsyncRpcRequest packet) { if (packet is T request) { diff --git a/src/libs/SaltyEmu.Communication/Utils/GenericIpcRequestHandler.cs b/src/libs/SaltyEmu.Communication/Utils/GenericIpcRequestHandler.cs index da83496a..1c605fae 100644 --- a/src/libs/SaltyEmu.Communication/Utils/GenericIpcRequestHandler.cs +++ b/src/libs/SaltyEmu.Communication/Utils/GenericIpcRequestHandler.cs @@ -5,12 +5,14 @@ namespace SaltyEmu.Communication.Utils { - public abstract class GenericIpcRequestHandler : IIpcPacketHandler where TRequest : IIpcRequest - where TResponse : IIpcResponse + public abstract class GenericIpcRequestHandler : IIpcPacketHandler where TRequest : ISyncRpcRequest + where TResponse : ISyncRpcResponse { - protected readonly Logger Log = Logger.GetLogger>(); + protected readonly ILogger Log; - public async Task Handle(IIpcPacket packet) + protected GenericIpcRequestHandler(ILogger log) => Log = log; + + public async Task Handle(IAsyncRpcRequest packet) { if (packet is TRequest request) { diff --git a/src/libs/SaltyEmu.Communication/Utils/IPendingRequestFactory.cs b/src/libs/SaltyEmu.Communication/Utils/IPendingRequestFactory.cs index e736f586..ec3894d0 100644 --- a/src/libs/SaltyEmu.Communication/Utils/IPendingRequestFactory.cs +++ b/src/libs/SaltyEmu.Communication/Utils/IPendingRequestFactory.cs @@ -4,6 +4,6 @@ namespace SaltyEmu.Communication.Utils { public interface IPendingRequestFactory { - PendingRequest Create(IIpcRequest request); + PendingRequest Create(ISyncRpcRequest request); } } \ No newline at end of file diff --git a/src/libs/SaltyEmu.Communication/Utils/PacketHandlersContainer.cs b/src/libs/SaltyEmu.Communication/Utils/PacketHandlersContainer.cs index dec770bf..81103dfa 100644 --- a/src/libs/SaltyEmu.Communication/Utils/PacketHandlersContainer.cs +++ b/src/libs/SaltyEmu.Communication/Utils/PacketHandlersContainer.cs @@ -9,9 +9,14 @@ namespace SaltyEmu.Communication.Utils { public sealed class PacketHandlersContainer : IIpcPacketHandlersContainer { - private static readonly Logger Log = Logger.GetLogger(); + private readonly ILogger _log; private readonly Dictionary _packetHandlers = new Dictionary(); + public PacketHandlersContainer(ILogger log) + { + _log = log; + } + public event EventHandler Registered; public event EventHandler Unregistered; @@ -19,25 +24,25 @@ public Task RegisterAsync(IIpcPacketHandler handler, Type type) { if (_packetHandlers.ContainsKey(type)) { - Log.Info($"{type} is already handled"); + _log.Info($"{type} is already handled"); return Task.CompletedTask; } - Log.Warn($"HANDLING -> {type}"); + _log.Warn($"HANDLING -> {type}"); _packetHandlers.Add(type, handler); OnRegistered(type); return Task.CompletedTask; } - public Task HandleAsync(IIpcPacket request, Type type) + public Task HandleAsync(IAsyncRpcRequest request, Type type) { if (!_packetHandlers.TryGetValue(type, out IIpcPacketHandler handler)) { - Log.Warn($"{type} could not be found !"); + _log.Warn($"{type} could not be found !"); return Task.CompletedTask; } - Log.Info($"Handling {type.Name} request"); + _log.Info($"Handling {type.Name} request"); return handler.Handle(request); } diff --git a/src/libs/SaltyEmu.Communication/Utils/PendingRequest.cs b/src/libs/SaltyEmu.Communication/Utils/PendingRequest.cs index baa9e391..a3615a09 100644 --- a/src/libs/SaltyEmu.Communication/Utils/PendingRequest.cs +++ b/src/libs/SaltyEmu.Communication/Utils/PendingRequest.cs @@ -5,7 +5,7 @@ namespace SaltyEmu.Communication.Utils { public class PendingRequest { - public IIpcRequest Request { get; set; } - public TaskCompletionSource Response { get; set; } + public ISyncRpcRequest Request { get; set; } + public TaskCompletionSource Response { get; set; } } } \ No newline at end of file diff --git a/src/libs/SaltyEmu.Communication/Utils/PendingRequestFactory.cs b/src/libs/SaltyEmu.Communication/Utils/PendingRequestFactory.cs index 58c08fc2..7231e10f 100644 --- a/src/libs/SaltyEmu.Communication/Utils/PendingRequestFactory.cs +++ b/src/libs/SaltyEmu.Communication/Utils/PendingRequestFactory.cs @@ -5,10 +5,10 @@ namespace SaltyEmu.Communication.Utils { public class PendingRequestFactory : IPendingRequestFactory { - public PendingRequest Create(IIpcRequest request) => new PendingRequest + public PendingRequest Create(ISyncRpcRequest request) => new PendingRequest { Request = request, - Response = new TaskCompletionSource() + Response = new TaskCompletionSource() }; } } \ No newline at end of file diff --git a/src/libs/SaltyEmu.Database/MappedRepositoryBase.cs b/src/libs/SaltyEmu.Database/MappedRepositoryBase.cs index 85ec4ee0..1964b9a2 100644 --- a/src/libs/SaltyEmu.Database/MappedRepositoryBase.cs +++ b/src/libs/SaltyEmu.Database/MappedRepositoryBase.cs @@ -10,22 +10,22 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Storage; -using Newtonsoft.Json; using Z.EntityFramework.Plus; namespace SaltyEmu.Database { public class MappedRepositoryBase : IMappedRepository where TObject : class, IMappedDto where TModel : class, IMappedModel, new() { - protected static readonly Logger Log = Logger.GetLogger(); + protected readonly ILogger Log; protected readonly DbContext Context; protected readonly DbSet DbSet; protected readonly IMapper Mapper; - public MappedRepositoryBase(DbContext context, IMapper mapper) + public MappedRepositoryBase(DbContext context, IMapper mapper, ILogger log) { Context = context; Mapper = mapper; + Log = log; DbSet = context.Set(); } @@ -78,7 +78,6 @@ public virtual TObject Save(TObject obj) } catch (Exception e) { - Log.Warn($"{JsonConvert.SerializeObject(obj)}"); Log.Error("[SAVE]", e); return null; } @@ -245,7 +244,6 @@ public virtual async Task SaveAsync(TObject obj) } catch (Exception e) { - Log.Warn($"{JsonConvert.SerializeObject(obj)}"); Log.Error("[SAVE]", e); return null; } diff --git a/src/libs/SaltyEmu.Database/SynchronizedRepositoryBase.cs b/src/libs/SaltyEmu.Database/SynchronizedRepositoryBase.cs index f4e05f8d..44bb4573 100644 --- a/src/libs/SaltyEmu.Database/SynchronizedRepositoryBase.cs +++ b/src/libs/SaltyEmu.Database/SynchronizedRepositoryBase.cs @@ -15,15 +15,16 @@ namespace SaltyEmu.Database public class SynchronizedRepositoryBase : ISynchronizedRepository where TObject : class, ISynchronizedDto where TModel : class, ISynchronizedModel, new() { - protected static readonly Logger Log = Logger.GetLogger(); + protected readonly ILogger Log; protected readonly DbContext Context; protected readonly DbSet DbSet; protected readonly IMapper Mapper; - public SynchronizedRepositoryBase(DbContext context, IMapper mapper) + public SynchronizedRepositoryBase(DbContext context, IMapper mapper, ILogger log) { Context = context; Mapper = mapper; + Log = log; DbSet = context.Set(); } diff --git a/src/services/SaltyEmu.RelationService/Handling/RemoveRelationsHandler.cs b/src/services/SaltyEmu.RelationService/Handling/RemoveRelationsHandler.cs index 64df918e..3ca3755c 100644 --- a/src/services/SaltyEmu.RelationService/Handling/RemoveRelationsHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/RemoveRelationsHandler.cs @@ -8,7 +8,7 @@ namespace SaltyEmu.RelationService.Handling { - public class RemoveRelationsHandler : GenericIpcPacketHandler + public class RemoveRelationsHandler : GenericAsyncRpcRequestHandler { private readonly IRelationDao _relations; diff --git a/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs b/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs index ca93b18a..01cd9139 100644 --- a/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs @@ -8,7 +8,7 @@ namespace SaltyEmu.RelationService.Handling { - public class SendInvitationHandler : GenericIpcPacketHandler + public class SendInvitationHandler : GenericAsyncRpcRequestHandler { private readonly IRelationInvitationDao _invitations; diff --git a/src/services/SaltyEmu.RelationService/RelationService.cs b/src/services/SaltyEmu.RelationService/RelationService.cs index a70e6159..55b8674e 100644 --- a/src/services/SaltyEmu.RelationService/RelationService.cs +++ b/src/services/SaltyEmu.RelationService/RelationService.cs @@ -97,7 +97,7 @@ private static void RegisterDependencies() ChickenContainer.Builder.Register(s => new MqttClientConfigurationBuilder().ConnectTo("localhost").WithName("relation-service-client")); ChickenContainer.Builder.Register(s => new MqttServerConfigurationBuilder().ConnectTo("localhost").WithName("relation-service-server")); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(RelationService).Assembly).AsClosedTypesOf(typeof(GenericIpcRequestHandler<,>)).PropertiesAutowired(); - ChickenContainer.Builder.RegisterAssemblyTypes(typeof(RelationService).Assembly).AsClosedTypesOf(typeof(GenericIpcPacketHandler<>)).PropertiesAutowired(); + ChickenContainer.Builder.RegisterAssemblyTypes(typeof(RelationService).Assembly).AsClosedTypesOf(typeof(GenericAsyncRpcRequestHandler<>)).PropertiesAutowired(); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(RelationService).Assembly).AsImplementedInterfaces().PropertiesAutowired(); } @@ -117,7 +117,7 @@ private static void Main() EnablePlugins(PluginEnableTime.PostContainerBuild); var server = ChickenContainer.Instance.Resolve(); var container = ChickenContainer.Instance.Resolve(); - foreach (Type handlerType in typeof(RelationService).Assembly.GetTypesImplementingGenericClass(typeof(GenericIpcRequestHandler<,>), typeof(GenericIpcPacketHandler<>))) + foreach (Type handlerType in typeof(RelationService).Assembly.GetTypesImplementingGenericClass(typeof(GenericIpcRequestHandler<,>), typeof(GenericAsyncRpcRequestHandler<>))) { try { From 020ed300fe0cd0276632c8ef4fae04ffef685355 Mon Sep 17 00:00:00 2001 From: Blowa Date: Thu, 18 Apr 2019 18:25:08 +0800 Subject: [PATCH 03/24] almost finish moving to nuget packages --- .../_TOCLEAN/CModePacketExtension.cs | 14 ++++++------- .../_TOCLEAN/LevPacketExtension.cs | 14 ++++++------- .../_TOCLEAN/SkiPacketExtensions.cs | 4 ++-- .../_TOCLEAN/SkillExtensions.cs | 20 +++++++++---------- src/ChickenAPI.Game.Impl/PlayerEntity.cs | 5 ++++- src/ChickenAPI.Game.Impl/SkillComponent.cs | 19 +++++++++--------- .../Entities/Player/IPlayerEntity.cs | 1 + .../Entities/Portal/PortalEntity.cs | 3 ++- src/ChickenAPI.Game/Skills/ISkillEntity.cs | 16 +++++++-------- .../Specialist_Transform_Handler.cs | 4 ++-- .../SynchronizedMongoRepository.cs | 7 ++++--- .../SaltyEmu.Redis/GenericRedisCacheClient.cs | 7 ++++--- 12 files changed, 61 insertions(+), 53 deletions(-) diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs index 63bd932d..a9f471c6 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CModePacketExtension.cs @@ -1,18 +1,18 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { public static class CModePacketExtension { - public static CModePacketBase GenerateCModePacket(this IPlayerEntity player) => new CModePacketBase + public static CModePacket GenerateCModePacket(this IPlayerEntity player) => new CModePacket { VisualType = VisualType.Player, - CharacterId = player.Id, + VisualId = player.Id, Morph = player.MorphId, - SpUpgrade = player.Sp?.Upgrade ?? 0, - SpDesign = player.Sp?.Design ?? 0, - ArenaWinner = player.Character.ArenaWinner + MorphUpgrade = player.Sp?.Upgrade ?? 0, + MorphDesign = player.Sp?.Design ?? 0, + MorphBonus = (byte)(player.Character.ArenaWinner ? 1 : 0) }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/LevPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/LevPacketExtension.cs index 4fc5946d..685aa863 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/LevPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/LevPacketExtension.cs @@ -2,8 +2,8 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Character; using ChickenAPI.Game.Skills.Extensions; -using ChickenAPI.Packets.Game.Server.Entities; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Entities; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -19,13 +19,13 @@ public static LevPacket GenerateLevPacket(this IPlayerEntity player) => LevelXp = (int)player.LevelXp, JobLevel = player.JobLevel, JobLevelXp = (int)player.JobLevelXp, - LevelXpMax = Algorithm.GetLevelXp(player.Character.Class, player.Level), - JobLevelXpMax = Algorithm.GetLevelXp(player.Character.Class, player.JobLevel), + XpLoad = Algorithm.GetLevelXp(player.Character.Class, player.Level), + JobXpLoad = Algorithm.GetLevelXp(player.Character.Class, player.JobLevel), HeroLevel = player.HeroLevel, Reputation = player.Character.Reput, - Cp = player.GetCp(), - HeroLevelXp = (int)player.HeroLevelXp, - HeroLevelXpMax = Algorithm.GetHeroLevelXp(player.Character.Class, player.HeroLevel) + SkillCp = player.GetCp(), + HeroXp = (int)player.HeroLevelXp, + HeroXpLoad = Algorithm.GetHeroLevelXp(player.Character.Class, player.HeroLevel) }; public static LevelUpPacket GenerateLevelUpPacket(this IPlayerEntity player) => diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkiPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkiPacketExtensions.cs index c541e9f1..06aeea78 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkiPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkiPacketExtensions.cs @@ -11,7 +11,7 @@ public static class SkiPacketExtensions { public static IOrderedEnumerable GetSpSkillsByCastIdAscending(this IPlayerEntity player) { - return player.SkillComponent.Skills.Values.Where(s => s.Class == player.GetSpClassId()).OrderBy(s => s.CastId); + return player.Skills.Values.Where(s => s.Class == player.GetSpClassId()).OrderBy(s => s.CastId); } public static byte GetSpClassId(this IPlayerEntity player) => player.Sp.GetClassId(); @@ -20,7 +20,7 @@ public static IOrderedEnumerable GetSpSkillsByCastIdAscending(this IPl public static IOrderedEnumerable GetSkillsByCastIdAscending(this IPlayerEntity player) { - return player.SkillComponent.Skills.Values.OrderBy(s => s.CastId); + return player.Skills.Values.OrderBy(s => s.CastId); } public static SkiPacket GenerateSkiPacket(this IPlayerEntity player) diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs index 8455aa8c..c78db22f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs @@ -19,12 +19,12 @@ public static class SkillExtensions public static int GetCp(this IPlayerEntity player) { int cpMax = (player.Character.Class > CharacterClassType.Adventurer ? 40 : 0) + player.JobLevel * 2; - if (player.SkillComponent?.Skills?.Count == null) + if (player.Skills?.Count == null) { return cpMax; } - int cpUsed = 0 + (int)player.SkillComponent?.Skills?.Values.Where(s => s != null).Sum(dto => dto.CpCost); + int cpUsed = 0 + (int)player.Skills?.Values.Where(s => s != null).Sum(dto => dto.CpCost); return cpMax - cpUsed; } @@ -44,7 +44,7 @@ public static async Task LearnAdventurerSkillsAsync(this IPlayerEntity player) await player.ActualizeUiSkillList(); } - public static void AddSkill(this SkillComponent component, SkillDto skill) + public static void AddSkill(this ISkillEntity component, SkillDto skill) { if (skill == null) { @@ -64,14 +64,14 @@ public static void AddSkill(this SkillComponent component, SkillDto skill) public static async Task AddCharacterSkillAsync(this IPlayerEntity player, CharacterSkillDto skill) { - if (player.SkillComponent.CharacterSkills.ContainsKey(skill.Id)) + if (player.CharacterSkills.ContainsKey(skill.Id)) { return; } - player.SkillComponent.CharacterSkills.Add(skill.Id, skill); + player.CharacterSkills.Add(skill.Id, skill); SkillDto skillDto = await SkillService.GetByIdAsync(skill.SkillId); - player.SkillComponent.AddSkill(skillDto); + player.AddSkill(skillDto); } public static void AddSkills(this IPlayerEntity player, IEnumerable skills) @@ -84,17 +84,17 @@ public static void AddSkills(this IPlayerEntity player, IEnumerable sk public static void AddSkill(this IPlayerEntity player, SkillDto skill) { - player.SkillComponent.AddSkill(skill); + player.AddSkill(skill); } public static void RemoveSkillsByClassId(this IPlayerEntity player, byte classId) { - IEnumerable> skills = player.SkillComponent.Skills.Where(s => s.Value.Class == classId); + IEnumerable> skills = player.Skills.Where(s => s.Value.Class == classId); foreach (KeyValuePair pair in skills) { - player.SkillComponent.Skills.Remove(pair.Value.Id); - player.SkillComponent.SkillsByCastId.Remove(pair.Value.CastId); + player.Skills.Remove(pair.Value.Id); + player.SkillsByCastId.Remove(pair.Value.CastId); } } } diff --git a/src/ChickenAPI.Game.Impl/PlayerEntity.cs b/src/ChickenAPI.Game.Impl/PlayerEntity.cs index 72081d3f..4b00c8c9 100644 --- a/src/ChickenAPI.Game.Impl/PlayerEntity.cs +++ b/src/ChickenAPI.Game.Impl/PlayerEntity.cs @@ -121,6 +121,7 @@ public long Gold public LocomotionComponent Locomotion { get; } public IRelationList Relations { get; } public CharacterDto Character { get; } + public Dictionary CharacterSkills { get; } public List Mates { get; set; } public IEnumerable ActualMates => Mates.Where(s => s.Mate.IsTeamMember).OrderByDescending(s => s.Mate.MateType); @@ -262,11 +263,13 @@ public void Save() #region Skills + public List<(DateTime, long)> CooldownsBySkillId => SkillComponent.CooldownsBySkillId; public bool HasSkill(long skillId) => SkillComponent.Skills.ContainsKey(skillId); public bool CanCastSkill(long skillId) => SkillComponent.CooldownsBySkillId.Any(s => s.Item2 == skillId); - public IDictionary Skills { get; } + public IDictionary Skills => SkillComponent.Skills; + public IDictionary SkillsByCastId => SkillComponent.SkillsByCastId; public SkillComponent SkillComponent { get; } diff --git a/src/ChickenAPI.Game.Impl/SkillComponent.cs b/src/ChickenAPI.Game.Impl/SkillComponent.cs index f978c2f5..31cfa1c5 100644 --- a/src/ChickenAPI.Game.Impl/SkillComponent.cs +++ b/src/ChickenAPI.Game.Impl/SkillComponent.cs @@ -10,6 +10,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Game.Skills.Extensions; namespace ChickenAPI.Game.Skills { @@ -17,7 +18,7 @@ public class SkillComponent : IComponent { private static readonly ISkillService SkillService = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; - public SkillComponent(IEntity entity) + public SkillComponent(ISkillEntity entity) { Entity = entity; @@ -27,24 +28,24 @@ public SkillComponent(IEntity entity) } int tmp = 200 + 20 * (byte)player.Character.Class; - this.AddSkill(SkillService.GetById(tmp)); - this.AddSkill(SkillService.GetById(tmp + 1)); + entity.AddSkill(SkillService.GetById(tmp)); + entity.AddSkill(SkillService.GetById(tmp + 1)); if (player.Character.Class != CharacterClassType.Adventurer) { return; } - this.AddSkill(SkillService.GetById(tmp + 9)); + entity.AddSkill(SkillService.GetById(tmp + 9)); IEnumerable skills = SkillService.GetByClassIdAsync((byte)player.Character.Class).ConfigureAwait(false).GetAwaiter().GetResult(); foreach (SkillDto skillDto in skills.Where(s => s.LevelMinimum < player.JobLevel && s.Id >= 200 && s.Id != 209 && s.Id <= 210)) { - this.AddSkill(skillDto); + entity.AddSkill(skillDto); } } - public SkillComponent(IEntity entity, IEnumerable skills) : this(entity) + public SkillComponent(ISkillEntity entity, IEnumerable skills) : this(entity) { if (skills == null) { @@ -54,11 +55,11 @@ public SkillComponent(IEntity entity, IEnumerable skills) : // add skills to component foreach (NpcMonsterSkillDto skill in skills) { - this.AddSkill(skill.Skill); + entity.AddSkill(skill.Skill); } } - public SkillComponent(IEntity entity, IEnumerable skills) : this(entity) + public SkillComponent(ISkillEntity entity, IEnumerable skills) : this(entity) { if (skills == null) { @@ -68,7 +69,7 @@ public SkillComponent(IEntity entity, IEnumerable skills) : t foreach (CharacterSkillDto characterSkill in skills) { CharacterSkills.Add(characterSkill.Id, characterSkill); - this.AddSkill(characterSkill.Skill); + entity.AddSkill(characterSkill.Skill); } } diff --git a/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs b/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs index 234fd396..e624247a 100644 --- a/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs +++ b/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs @@ -25,6 +25,7 @@ public interface IPlayerEntity : ILocomotionEntity, IBattleEntity, IInventoriedE CharacterDto Character { get; } + Dictionary CharacterSkills { get; } CharacterNameAppearance NameAppearance { get; } diff --git a/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs b/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs index 450e9f05..e86ca859 100644 --- a/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs +++ b/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs @@ -6,12 +6,13 @@ using ChickenAPI.Game.Visibility; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Portal { public class PortalEntity : EntityBase, IPortalEntity { - public PortalEntity(PortalDto portal) : base(VisualType.Portal, portal.Id) + public PortalEntity(PortalDto portal) : base(VisualType.Object, portal.Id) { Portal = new PortalComponent(this, portal); Components = new Dictionary diff --git a/src/ChickenAPI.Game/Skills/ISkillEntity.cs b/src/ChickenAPI.Game/Skills/ISkillEntity.cs index 6a382e74..ef30356a 100644 --- a/src/ChickenAPI.Game/Skills/ISkillEntity.cs +++ b/src/ChickenAPI.Game/Skills/ISkillEntity.cs @@ -2,25 +2,21 @@ using System.Collections.Generic; using ChickenAPI.Data.Character; using ChickenAPI.Data.Skills; +using ChickenAPI.Game._ECS.Entities; namespace ChickenAPI.Game.Skills { - public interface ISkillEntity + public interface ISkillCapacity { /// /// Skills /// IDictionary Skills { get; } - SkillComponent SkillComponent { get; } - public Dictionary CharacterSkills { get; } + IDictionary SkillsByCastId { get; } - public Dictionary Skills { get; } - - public Dictionary SkillsByCastId { get; } - - public List<(DateTime, long)> CooldownsBySkillId { get; } + List<(DateTime, long)> CooldownsBySkillId { get; } /// /// Checks if the entity has the given skill @@ -36,4 +32,8 @@ public interface ISkillEntity /// bool CanCastSkill(long skillId); } + + public interface ISkillEntity : IEntity, ISkillCapacity + { + } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs index 8c751c5d..e0328da1 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs @@ -31,7 +31,7 @@ public class Specialist_Transform_Handler : GenericEventPostProcessorBase : ISynchronizedRepository where TObject : class, ISynchronizedDto { - protected readonly Logger Log = Logger.GetLogger($"Mongo-{typeof(TObject).Name}"); + protected readonly ILogger Log; protected readonly IMongoDatabase Database; protected readonly IMongoCollection Collection; - protected SynchronizedMongoRepository(MongoConfigurationBuilder builder) : this(builder.Build()) + protected SynchronizedMongoRepository(MongoConfigurationBuilder builder, ILogger log) : this(builder.Build(), log) { } - private SynchronizedMongoRepository(MongoConfiguration conf) + private SynchronizedMongoRepository(MongoConfiguration conf, ILogger log) { + Log = log; MongoClientSettings settings = MongoClientSettings.FromConnectionString($"mongodb://{conf.Endpoint}:{conf.Port}"); var client = new MongoClient(settings); client.Cluster.Initialize(); diff --git a/src/libs/SaltyEmu.Redis/GenericRedisCacheClient.cs b/src/libs/SaltyEmu.Redis/GenericRedisCacheClient.cs index 21e604cb..6124a21f 100644 --- a/src/libs/SaltyEmu.Redis/GenericRedisCacheClient.cs +++ b/src/libs/SaltyEmu.Redis/GenericRedisCacheClient.cs @@ -13,7 +13,7 @@ namespace SaltyEmu.Redis { public abstract class GenericRedisCacheClient : ISynchronizedRepository where TObject : class, ISynchronizedDto { - protected readonly Logger Log = Logger.GetLogger($"RedisCache({typeof(TObject).Name})"); + protected readonly ILogger Log; protected readonly string DataPrefix; protected readonly string KeySetKey; protected readonly RedisHybridCacheClient CacheClient; @@ -31,12 +31,13 @@ public abstract class GenericRedisCacheClient : ISynchronizedRepository protected string ToKey(TObject obj) => ToKey(obj.Id); - protected GenericRedisCacheClient(RedisConfiguration conf) : this(typeof(TObject).Name.ToLower(), conf) + protected GenericRedisCacheClient(RedisConfiguration conf, ILogger log) : this(typeof(TObject).Name.ToLower(), conf, log) { } - private GenericRedisCacheClient(string basePrefix, RedisConfiguration conf) + private GenericRedisCacheClient(string basePrefix, RedisConfiguration conf, ILogger log) { + Log = log; DataPrefix = "data:" + basePrefix + ':'; KeySetKey = "keys:" + basePrefix; var tmp = new RedisCacheClientOptions From 1c9415220d0232a0d9ac898cb568b64d876a2ff6 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 00:18:01 +0800 Subject: [PATCH 04/24] continue move (add chick.packets as submodule to faciliate all packets add) --- .gitmodules | 3 + SaltyEmu.sln | 9 +- src/ChickenAPI.Data/Character/CharacterDto.cs | 5 + .../Character/IAlgorithmService.cs | 1 + src/ChickenAPI.Data/ChickenAPI.Data.csproj | 1 + src/ChickenAPI.Data/Families/FamilyDto.cs | 4 +- .../Game/Character/CharacterClassType.cs | 12 -- .../Game/Character/FactionType.cs | 9 -- .../Game/Character/GenderType.cs | 8 -- .../Game/Character/HairColorType.cs | 134 ------------------ .../Game/Character/HairStyleType.cs | 11 -- .../Packets/CancelPacketType.cs | 8 -- .../Packets/ShopEndPacketType.cs | 9 -- .../ChickenAPI.Game.Extensions.csproj | 5 +- .../Helpers/EmojiHelper.cs | 2 +- .../Helpers/UIHelper.cs | 68 ++++----- .../PacketGeneration/ChatPacketExtensions.cs | 12 +- .../_TOCLEAN/CInfoPacketExtension.cs | 3 +- .../_TOCLEAN/CancelPacketExtension.cs | 6 +- .../_TOCLEAN/CtPacketExtensions.cs | 2 +- .../_TOCLEAN/DropExtensions.cs | 13 +- .../_TOCLEAN/EInfoPacketExtensions.cs | 1 + .../_TOCLEAN/FdPacketExtension.cs | 2 +- .../_TOCLEAN/FsPacketExtension.cs | 3 +- .../_TOCLEAN/GInfoPacketExtensions.cs | 2 +- .../_TOCLEAN/GetPacketExtension.cs | 7 +- .../_TOCLEAN/GidxPacketExtensions.cs | 2 +- .../_TOCLEAN/GoldPacketExtension.cs | 2 +- .../_TOCLEAN/GroupPlayerExtension.cs | 6 +- .../_TOCLEAN/InventoryWearPacketExtensions.cs | 2 +- .../_TOCLEAN/IvnPacketExtension.cs | 2 +- .../MapLayerInformationsExtensions.cs | 9 +- .../_TOCLEAN/MapPacketsExtensions.cs | 2 +- .../_TOCLEAN/MateExtension.cs | 4 +- .../_TOCLEAN/MovableEntityExtensions.cs | 49 ++----- .../_TOCLEAN/MovablePlayerExtensions.cs | 2 +- .../_TOCLEAN/NInvPacketExtensions.cs | 54 +++---- .../_TOCLEAN/NpcExtensions.cs | 2 +- .../_TOCLEAN/PacketExtensions.cs | 2 +- .../_TOCLEAN/PairyPacketExtension.cs | 2 +- .../_TOCLEAN/PlayerExtension.cs | 8 +- .../_TOCLEAN/PlayerInteractionExtensions.cs | 12 +- .../_TOCLEAN/PortalPacketExtensions.cs | 2 +- .../_TOCLEAN/QsetGenerationExtension.cs | 2 +- .../_TOCLEAN/QuicklistPacketExtension.cs | 2 +- .../_TOCLEAN/ShopPacketExtensions.cs | 12 +- .../_TOCLEAN/SpPacketExtension.cs | 2 +- .../_TOCLEAN/SpecialistExtensions.cs | 2 +- .../_TOCLEAN/StPacketExtensions.cs | 2 +- .../_TOCLEAN/StatCharExtensions.cs | 2 +- .../_TOCLEAN/StatPacketExtensions.cs | 2 +- .../_TOCLEAN/SuPacketExtensions.cs | 2 +- .../_TOCLEAN/VisibleEntityExtensions.cs | 6 +- .../Builders/CharacterBuilder.cs | 2 +- src/ChickenAPI.Game/ChickenAPI.Game.csproj | 1 + .../Effects/EntityExtensionEffect.cs | 7 +- .../Attributes/PacketClientAttribute.cs | 2 +- .../Attributes/PacketDescriptionAttribute.cs | 2 +- .../Attributes/PacketHeaderAttribute.cs | 2 +- .../Attributes/PacketIndexAttribute.cs | 2 +- .../PacketPropertyDescriptionAttribute.cs | 2 +- .../Attributes/PacketServerAttribute.cs | 2 +- .../Client/CharNewPacketBase.cs | 4 +- .../Client/CharNewWrestlerPacketBase.cs | 4 +- .../Client/CharacterDeletePacketBase.cs | 4 +- .../Client/EntryPointPacketBase.cs | 4 +- .../Client/GameStartPacketBase.cs | 4 +- .../Client/SelectPacketBase.cs | 4 +- .../Server/CListStartPacket.cs | 4 +- .../Server/ClistEndPacketBase.cs | 4 +- .../Server/ClistPacketBase.cs | 4 +- .../Server/OkPacketBase.cs | 4 +- ...s.csproj => ChickenAPI.Packets.Old.csproj} | 0 .../Client/Battle/MultiTargetListPacket.cs | 4 +- .../Client/Battle/MultiTargetListSubPacket.cs | 4 +- .../Game/Client/Battle/NcifPacket.cs | 5 +- .../Game/Client/Battle/UseAoeSkillPacket.cs | 4 +- .../Game/Client/Battle/UseSkillPacket.cs | 5 +- .../Game/Client/Chat/ClientSayPacket.cs | 4 +- .../Game/Client/Drops/DropPacket.cs | 4 +- .../Game/Client/Drops/GetPacket.cs | 5 +- .../Client/Families/CreateFamilyPacket.cs | 4 +- .../Game/Client/Families/GInfoPacket.cs | 4 +- .../Game/Client/Families/GidxPacket.cs | 5 +- .../Game/Client/Inventory/BiPacket.cs | 4 +- .../Game/Client/Inventory/MviPacket.cs | 4 +- .../Game/Client/Inventory/PdtiPacket.cs | 4 +- .../Game/Client/Inventory/PutPacket.cs | 4 +- .../Game/Client/Inventory/RemovePacket.cs | 4 +- .../Game/Client/Inventory/UiPacket.cs | 7 +- .../Game/Client/Inventory/WearPacket.cs | 4 +- .../Game/Client/Mates/PsOpPacket.cs | 4 +- .../Game/Client/Mates/PslPacket.cs | 4 +- .../Game/Client/Mates/SuCtlPacket.cs | 5 +- .../Game/Client/Mates/UPsPacket.cs | 5 +- .../Game/Client/Mates/UpetPacket.cs | 5 +- .../Game/Client/Miniland/AddobjPacket.cs | 4 +- .../Game/Client/Miniland/MlObjPacket.cs | 4 +- .../Game/Client/Miniland/RmvobjPacket.cs | 4 +- .../Game/Client/Movement/DirectionPacket.cs | 4 +- .../Game/Client/Movement/PreqPacket.cs | 4 +- .../Game/Client/Movement/SitPacket.cs | 4 +- .../Game/Client/Movement/SitSubPacket.cs | 4 +- .../Game/Client/Movement/WalkPacket.cs | 4 +- .../Game/Client/Npcs/NrunPacket.cs | 4 +- .../Game/Client/Npcs/WopenPacket.cs | 4 +- .../Client/Player/CharacterOptionPacket.cs | 4 +- .../Game/Client/Player/ClientGuriPacket.cs | 4 +- .../Game/Client/Player/ComplimentPacket.cs | 4 +- .../Game/Client/Player/EffectPacket.cs | 5 +- .../Game/Client/Player/NpInfoPacket.cs | 4 +- .../Game/Client/Player/QsetPacket.cs | 4 +- .../Game/Client/Player/ScrPacket.cs | 4 +- .../Game/Client/Player/TcInfoPacket.cs | 4 +- .../Game/Client/Shops/BuyPacket.cs | 5 +- .../Game/Client/Shops/MShopPacket.cs | 4 +- .../Game/Client/Shops/NInvPacket.cs | 5 +- .../Game/Client/Shops/ReceivedNpcReqPacket.cs | 5 +- .../Game/Client/Shops/SentNpcReqPacket.cs | 5 +- .../Game/Client/Shops/ShopPacket.cs | 5 +- .../Game/Client/Shops/ShoppingPacket.cs | 4 +- .../Game/Client/Specialists/SlPacket.cs | 4 +- .../Game/Client/Specialists/SpPacket.cs | 4 +- .../Game/Client/UI/EInfoPacket.cs | 9 +- .../Game/Client/UpgradePacket.cs | 4 +- .../Game/Server/Auction/RcbListPacket.cs | 6 +- .../Game/Server/Auction/RcsListPacket.cs | 6 +- .../Game/Server/Battle/BfPacket.cs | 5 +- .../Game/Server/Battle/CancelPacket.cs | 4 +- .../Game/Server/Battle/CtPacket.cs | 5 +- .../Game/Server/Battle/DmPacket.cs | 5 +- .../Game/Server/Battle/MscPacket.cs | 4 +- .../Game/Server/Battle/RcPacket.cs | 5 +- .../Game/Server/Battle/SuPacket.cs | 7 +- .../Game/Server/Chat/SayItemPacket.cs | 7 +- .../Game/Server/Entities/CharScPacket.cs | 5 +- .../Game/Server/Entities/DropPacket.cs | 4 +- .../Game/Server/Entities/MvPacket.cs | 5 +- .../Game/Server/Entities/OutPacket.cs | 5 +- .../Game/Server/Entities/ReqInfoPacket.cs | 4 +- .../Game/Server/Entities/RestPacket.cs | 5 +- .../Game/Server/Entities/StPacket.cs | 5 +- .../Game/Server/Entities/TpPacket.cs | 5 +- .../Game/Server/Group/PInitPacket.cs | 5 +- .../Game/Server/Group/PJoinPacket.cs | 4 +- .../Game/Server/Group/PidxPacket.cs | 4 +- .../Game/Server/Group/PstPacket.cs | 5 +- .../Game/Server/Inventory/EInfoPacket.cs | 4 +- .../Game/Server/Inventory/EqListInfo.cs | 4 +- .../Game/Server/Inventory/EqPacket.cs | 4 +- .../Game/Server/Inventory/EqRareInfo.cs | 4 +- .../Game/Server/Inventory/EquipPacket.cs | 4 +- .../Server/Inventory/EquipmentInfoPacket.cs | 4 +- .../Server/Inventory/EquipmentListItem.cs | 4 +- .../Game/Server/Inventory/GetPacket.cs | 4 +- .../Game/Server/Inventory/GoldPacket.cs | 4 +- .../Game/Server/Inventory/InvPacket.cs | 4 +- .../Inventory/InventoryWearSubPacket.cs | 4 +- .../Game/Server/Inventory/IvnPacket.cs | 4 +- .../Game/Server/Inventory/PairyPacket.cs | 4 +- .../Game/Server/Inventory/SlInfoPacket.cs | 4 +- .../Game/Server/Map/MapoutPacket.cs | 4 +- .../Game/Server/Mates/PSkiPacket.cs | 4 +- .../Game/Server/Mates/SayPetPacket.cs | 4 +- .../Game/Server/Mates/ScnPacket.cs | 4 +- .../Game/Server/Mates/ScpPacket.cs | 4 +- .../Game/Server/MiniMap/AtPacketBase.cs | 4 +- .../Game/Server/MiniMap/CMapPacket.cs | 4 +- .../Game/Server/MiniMap/RsfpPacket.cs | 4 +- .../Game/Server/Player/BnPacket.cs | 4 +- .../Game/Server/Player/CInfoPacket.cs | 4 +- .../Game/Server/Player/CModePacketBase.cs | 5 +- .../Game/Server/Player/CondPacketBase.cs | 5 +- .../Game/Server/Player/FdPacket.cs | 4 +- .../Game/Server/Player/FsPacket.cs | 4 +- .../Game/Server/Player/LevPacket.cs | 4 +- .../Game/Server/Player/LevelUpPacket.cs | 4 +- .../Game/Server/Player/QSlotPacket.cs | 4 +- .../Game/Server/Player/QsetPacketReceive.cs | 4 +- .../Game/Server/Player/RagePacket.cs | 4 +- .../Game/Server/Player/SayPacket.cs | 7 +- .../Game/Server/Player/ScPacket.cs | 4 +- .../Game/Server/Player/StatPacket.cs | 4 +- .../Game/Server/Player/TitPacket.cs | 4 +- .../Game/Server/Portals/GpPacket.cs | 4 +- .../Game/Server/Raids/RlPacket.cs | 4 +- .../Game/Server/Relations/BlInitPacket.cs | 4 +- .../Game/Server/Relations/FInitPacket.cs | 4 +- .../Game/Server/Relations/FInsPacket.cs | 4 +- .../Game/Server/Shop/IShopPacket.cs | 4 +- .../Game/Server/Shop/PFlagPacket.cs | 5 +- .../Game/Server/Shop/SMemoPacket.cs | 4 +- .../Game/Server/Shop/ShopEndPacket.cs | 4 +- .../Game/Server/Specialist/SdPacket.cs | 4 +- .../Game/Server/UserInterface/Act6Packet.cs | 4 +- .../Game/Server/UserInterface/BSInfoPacket.cs | 4 +- .../Game/Server/UserInterface/ChdmPacket.cs | 4 +- .../Game/Server/UserInterface/DelayPacket.cs | 4 +- .../Game/Server/UserInterface/DialogPacket.cs | 4 +- .../Game/Server/UserInterface/GuriPacket.cs | 4 +- .../Game/Server/UserInterface/InfoPacket.cs | 4 +- .../Game/Server/UserInterface/ModalPacket.cs | 4 +- .../Game/Server/UserInterface/MsgPacket.cs | 4 +- .../Game/Server/UserInterface/PClearPacket.cs | 4 +- .../Game/Server/UserInterface/QnaPacket.cs | 4 +- .../Game/Server/UserInterface/ZzimPacket.cs | 4 +- .../Server/Visibility/InAliveSubPacketBase.cs | 4 +- .../Visibility/InCharacterSubPacketBase.cs | 6 +- .../Server/Visibility/InItemSubPacketBase.cs | 4 +- .../Game/Server/Visibility/InMateSubPacket.cs | 4 +- .../Server/Visibility/InMonsterSubPacket.cs | 4 +- .../Visibility/InNonPlayerSubPacketBase.cs | 4 +- .../Game/Server/Visibility/InNpcSubPacket.cs | 4 +- .../Visibility/InOwnableSubPacketBase.cs | 4 +- .../Game/Server/Visibility/InPacket.cs | 4 +- src/ChickenAPI.Packets/IPacket.cs | 2 +- src/ChickenAPI.Packets/IPacketFactory.cs | 2 +- src/ChickenAPI.Packets/PacketBase.cs | 2 +- .../CharacterScreenLoadHandler.cs | 4 +- .../CharacterScreen/CreateCharacterHandler.cs | 4 +- .../CreateCharacterWrestlerHandler.cs | 4 +- .../CharacterScreen/DeleteCharacterHandler.cs | 4 +- .../CharacterScreen/GameStartPacketHandler.cs | 20 +-- .../CharacterScreen/SelectCharacterHandler.cs | 4 +- .../Chat/SayPacketHandling.cs | 2 +- .../Drops/GetPacketHandling.cs | 2 +- .../Entity/NcifPacketHandling.cs | 2 +- .../Entity/ReqInfoPacketHandling.cs | 2 +- .../Groups/PJoinPacketHandling.cs | 2 +- .../Guri/GuriPacketHandling.cs | 1 - .../Inventory/EqInfoPacketHandling.cs | 2 +- .../Inventory/MviPacketHandling.cs | 2 +- .../Inventory/PutPacketHandling.cs | 2 +- .../Inventory/RemovePacketHandling.cs | 2 +- .../Inventory/UpgradeItemPaketHandling.cs | 2 +- .../Inventory/UseItemPaketHandling.cs | 2 +- .../Inventory/WearPacketHandling.cs | 2 +- .../Move/PreqPacketHandling.cs | 2 +- .../Move/SitPacketHandling.cs | 2 +- .../Move/WalkPacketHandling.cs | 2 +- .../NW.Plugins.PacketHandling.csproj | 1 + .../Npc/Dialog/NRunPacketHandling.cs | 2 +- .../Relations/FInsPacketHandling.cs | 2 +- .../Shops/BuyPacketHandler.cs | 2 +- .../Shops/NpcReqPacketHandling.cs | 2 +- .../Shops/PersonalShopCreationHandling.cs | 4 +- .../Shops/ShoppingPacketHandling.cs | 2 +- .../Skill/MultiTargetListPacketHandling.cs | 2 +- .../Skill/QuickListPacketHandling.cs | 1 - .../Skill/UseAoeSkillPacketHandler.cs | 2 +- .../Skill/UseSkillPacketHandling.cs | 4 +- .../Specialists/SlPacketHandling.cs | 2 +- .../Utils/GenericGamePacketHandlerAsync.cs | 1 + .../Utils/GenericSessionPacketHandlerAsync.cs | 1 + .../BCardHandlers/BCardBuffHandler.cs | 2 +- .../Battle_ProcessHitRequest_Handler.cs | 2 +- .../Chat/Chat_GlobalChat_Handler.cs | 3 +- .../Chat/PlayerChatEventHandler.cs | 2 +- .../Groups/Group_InvitationSend_Handler.cs | 3 +- .../Inventory/Inventory_AddItem_Handler.cs | 1 - .../EventHandlers/Maps/Map_Leave_Handler.cs | 2 +- .../Relation_InvitationReceive_Handler.cs | 2 +- .../Specialist_Transform_Handler.cs | 2 +- .../Upgrading/Upgrading_Summing_Handler.cs | 2 +- .../Implems/BasicPacketPipelineAsync.cs | 1 + .../ItemUpgradeHandlers/RarifyItemHandler.cs | 1 - .../BoxItem/PearlPetsReleaseHandler.cs | 3 - .../Handler/LocomotionHandler.cs | 13 +- .../ItemUsageHandlers/Handler/WingsSpCard.cs | 2 +- .../NpcDialogHandlers/WopenHandler.cs | 4 +- src/Toolkit/Commands/DocumentationCommand.cs | 3 +- src/World/Network/ClientSession.cs | 1 + src/World/Packets/PluggablePacketFactory.cs | 4 +- src/World/WorldServer.cs | 2 +- .../ChickenAPI.Game.Test/Mocks/SessionMock.cs | 1 + vendor/ChickenAPI.Packets | 1 + 276 files changed, 577 insertions(+), 802 deletions(-) create mode 100644 .gitmodules delete mode 100644 src/ChickenAPI.Enums/Game/Character/CharacterClassType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Character/FactionType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Character/GenderType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Character/HairColorType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Character/HairStyleType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/CancelPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/ShopEndPacketType.cs rename src/ChickenAPI.Packets/{ChickenAPI.Packets.csproj => ChickenAPI.Packets.Old.csproj} (100%) create mode 160000 vendor/ChickenAPI.Packets diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..2168fc39 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/ChickenAPI.Packets"] + path = vendor/ChickenAPI.Packets + url = git@github.com:ChickenAPI/ChickenAPI.Packets.git diff --git a/SaltyEmu.sln b/SaltyEmu.sln index 14c5221f..1b07deee 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -73,7 +73,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.CharacterSkillServ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Database.MongoDB", "src\libs\SaltyEmu.Database.MongoDB\SaltyEmu.Database.MongoDB.csproj", "{48886586-562B-4CE6-B105-3F231FE6C97E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChickenAPI.Game.Impl", "src\ChickenAPI.Game.Impl\ChickenAPI.Game.Impl.csproj", "{E5F9DC97-664E-42B5-B68F-F93AC4019051}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game.Impl", "src\ChickenAPI.Game.Impl\ChickenAPI.Game.Impl.csproj", "{E5F9DC97-664E-42B5-B68F-F93AC4019051}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Packets", "vendor\ChickenAPI.Packets\src\ChickenAPI.Packets\ChickenAPI.Packets.csproj", "{9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -201,6 +203,10 @@ Global {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Debug|Any CPU.Build.0 = Debug|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.Build.0 = Release|Any CPU + {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -235,6 +241,7 @@ Global {7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {48886586-562B-4CE6-B105-3F231FE6C97E} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} {E5F9DC97-664E-42B5-B68F-F93AC4019051} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} + {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {33B1EC1B-965D-4770-B047-390647E82322} diff --git a/src/ChickenAPI.Data/Character/CharacterDto.cs b/src/ChickenAPI.Data/Character/CharacterDto.cs index 39425d81..50ea89d9 100644 --- a/src/ChickenAPI.Data/Character/CharacterDto.cs +++ b/src/ChickenAPI.Data/Character/CharacterDto.cs @@ -1,4 +1,9 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; +using CharacterClassType = ChickenAPI.Enums.Game.Character.CharacterClassType; +using GenderType = ChickenAPI.Enums.Game.Character.GenderType; +using HairColorType = ChickenAPI.Enums.Game.Character.HairColorType; +using HairStyleType = ChickenAPI.Enums.Game.Character.HairStyleType; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Data/Character/IAlgorithmService.cs b/src/ChickenAPI.Data/Character/IAlgorithmService.cs index 010f5908..dda259f0 100644 --- a/src/ChickenAPI.Data/Character/IAlgorithmService.cs +++ b/src/ChickenAPI.Data/Character/IAlgorithmService.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Data/ChickenAPI.Data.csproj b/src/ChickenAPI.Data/ChickenAPI.Data.csproj index a1e6dba1..86745f7d 100644 --- a/src/ChickenAPI.Data/ChickenAPI.Data.csproj +++ b/src/ChickenAPI.Data/ChickenAPI.Data.csproj @@ -9,6 +9,7 @@ + diff --git a/src/ChickenAPI.Data/Families/FamilyDto.cs b/src/ChickenAPI.Data/Families/FamilyDto.cs index c1e0ee12..faa2bb42 100644 --- a/src/ChickenAPI.Data/Families/FamilyDto.cs +++ b/src/ChickenAPI.Data/Families/FamilyDto.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Families; +using ChickenAPI.Enums.Game.Families; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Families { diff --git a/src/ChickenAPI.Enums/Game/Character/CharacterClassType.cs b/src/ChickenAPI.Enums/Game/Character/CharacterClassType.cs deleted file mode 100644 index c877afb3..00000000 --- a/src/ChickenAPI.Enums/Game/Character/CharacterClassType.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum CharacterClassType : byte - { - Adventurer = 0, - Swordman = 1, - Archer = 2, - Magician = 3, - Wrestler = 4, - Unknown = 5 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Character/FactionType.cs b/src/ChickenAPI.Enums/Game/Character/FactionType.cs deleted file mode 100644 index b8e060b8..00000000 --- a/src/ChickenAPI.Enums/Game/Character/FactionType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum FactionType : byte - { - Neutral = 0, - Angel = 1, - Demon = 2 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Character/GenderType.cs b/src/ChickenAPI.Enums/Game/Character/GenderType.cs deleted file mode 100644 index a47e5fb9..00000000 --- a/src/ChickenAPI.Enums/Game/Character/GenderType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum GenderType : byte - { - Male = 0, - Female = 1 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Character/HairColorType.cs b/src/ChickenAPI.Enums/Game/Character/HairColorType.cs deleted file mode 100644 index 6972b6d1..00000000 --- a/src/ChickenAPI.Enums/Game/Character/HairColorType.cs +++ /dev/null @@ -1,134 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum HairColorType : byte - { - DarkPurple = 0, - Yellow = 1, - Blue = 2, - Purple = 3, - Orange = 4, - Brown = 5, - Green = 6, - DarkGrey = 7, - LightBlue = 8, - PinkRed = 9, - LightYellow = 10, - LightPink = 11, - LightGreen = 12, - LightGrey = 13, - SkyBlue = 14, - Black = 15, - DarkOrange = 16, - DarkOrangeVariant2 = 17, - DarkOrangeVariant3 = 18, - DarkOrangeVariant4 = 19, - DarkOrangeVariant5 = 20, - DarkOrangeVariant6 = 21, - LightOrange = 22, - LightLightOrange = 23, - LightLightLightOrange = 24, - LightLightLightLightOrange = 25, - SuperLightOrange = 26, - DarkYellow = 27, - LightLightYellow = 28, - KakiYellow = 29, - SuperLightYellow = 30, - SuperLightYellow2 = 31, - SuperLightYellow3 = 32, - LittleDarkYellow = 33, - YellowVariant = 34, - YellowVariant1 = 35, - YellowVariant2 = 36, - YellowVariant3 = 37, - YellowVariant4 = 38, - YellowVariant5 = 39, - YellowVariant6 = 40, - YellowVariant7 = 41, - YellowVariant8 = 42, - YellowVariant9 = 43, - GreenVariant = 44, - GreenVariant1 = 45, - DarkGreenVariant = 46, - GreenMoreDarkVariant = 47, - GreenVariant2 = 48, - GreenVariant3 = 49, - GreenVariant4 = 50, - GreenVariant5 = 51, - GreenVariant6 = 52, - GreenVariant7 = 53, - GreenVariant8 = 54, - GreenVariant9 = 55, - GreenVariant10 = 56, - GreenVariant11 = 57, - GreenVariant12 = 58, - GreenVariant13 = 59, - GreenVariant14 = 60, - GreenVariant15 = 61, - GreenVariant16 = 62, - GreenVariant17 = 63, - GreenVariant18 = 64, - GreenVariant19 = 65, - GreenVariant20 = 66, - LightBlueVariant1 = 67, - LightBlueVariant2 = 68, - LightBlueVariant3 = 69, - LightBlueVariant4 = 70, - LightBlueVariant5 = 71, - LightBlueVariant6 = 72, - LightBlueVariant7 = 73, - LightBlueVariant8 = 74, - LightBlueVariant9 = 75, - LightBlueVariant10 = 76, - LightBlueVariant11 = 77, - LightBlueVariant12 = 78, - LightBlueVariant13 = 79, - DarkBlack = 80, - LightBlueVariant14 = 81, - LightBlueVariant15 = 82, - LightBlueVariant16 = 83, - LightBlueVariant17 = 84, - BlueVariant = 85, - BlueVariantDark = 86, - BlueVariantDarkDark = 87, - BlueVariantDarkDark2 = 88, - FlashBlue = 89, - FlashBlueDark = 90, - FlashBlueDark2 = 91, - FlashBlueDark3 = 92, - FlashBlueDark4 = 93, - FlashBlueDark5 = 94, - FlashBlueDark6 = 95, - FlashBlueDark7 = 96, - FlashBlueDark8 = 97, - FlashBlueDark9 = 98, - White = 99, - FlashBlueDark10 = 100, - FlashBlue1 = 101, - FlashBlue2 = 102, - FlashBlue3 = 103, - FlashBlue4 = 104, - FlashBlue5 = 105, - FlashPurple = 106, - FlashLightPurple = 107, - FlashLightPurple2 = 108, - FlashLightPurple3 = 109, - FlashLightPurple4 = 110, - FlashLightPurple5 = 111, - LightPurple = 112, - PurpleVariant1 = 113, - PurpleVariant2 = 114, - PurpleVariant3 = 115, - PurpleVariant4 = 116, - PurpleVariant5 = 117, - PurpleVariant6 = 118, - PurpleVariant7 = 119, - PurpleVariant8 = 120, - PurpleVariant9 = 121, - PurpleVariant10 = 122, - PurpleVariant11 = 123, - PurpleVariant12 = 124, - PurpleVariant13 = 125, - PurpleVariant14 = 126, - PurpleVariant15 = 127 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Character/HairStyleType.cs b/src/ChickenAPI.Enums/Game/Character/HairStyleType.cs deleted file mode 100644 index 009c76fb..00000000 --- a/src/ChickenAPI.Enums/Game/Character/HairStyleType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum HairStyleType : byte - { - HairStyleA = 0, - HairStyleB = 1, - HairStyleC = 2, - HairStyleD = 3, - NoHair = 4 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/CancelPacketType.cs b/src/ChickenAPI.Enums/Packets/CancelPacketType.cs deleted file mode 100644 index ba6d9000..00000000 --- a/src/ChickenAPI.Enums/Packets/CancelPacketType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum CancelPacketType - { - NotInCombatMode = 0, - InCombatMode = 2 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/ShopEndPacketType.cs b/src/ChickenAPI.Enums/Packets/ShopEndPacketType.cs deleted file mode 100644 index 3eafd89f..00000000 --- a/src/ChickenAPI.Enums/Packets/ShopEndPacketType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum ShopEndPacketType - { - PersonalShop = 0, - CloseSubWindow = 1, // todo confirm that enum - CloseWindow = 2 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj b/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj index 9f88a74c..2951e437 100644 --- a/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj +++ b/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -6,10 +6,11 @@ - + + diff --git a/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs index 6dc78514..da4b4555 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Effects; using ChickenAPI.Game.Effects; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Client.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Helpers { diff --git a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs index 6ca70ba0..efd3c6c9 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs @@ -5,8 +5,10 @@ using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._i18n; using ChickenAPI.Packets; -using ChickenAPI.Packets.Game.Client.Player; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Packets.ClientPackets.UI; +using ChickenAPI.Packets.Interfaces; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; +using ChickenAPI.Packets.ServerPackets.UI; namespace ChickenAPI.Game.Helpers { @@ -14,53 +16,53 @@ public static class UIHelper { public static Task SendGuri(this IPlayerEntity player, GuriPacketType type, byte argument, int value = 0) => player.SendPacketAsync(player.GenerateGuriPacket(type, argument, value)); - public static ClientGuriPacket GenerateGuriPacket(this IPlayerEntity player, GuriPacketType type, byte argument, int value = 0) + public static GuriPacket GenerateGuriPacket(this IPlayerEntity player, GuriPacketType type, byte argument, int value = 0) { switch (type) { case GuriPacketType.Unknow: - return new ClientGuriPacket + return new GuriPacket { Type = 2, Argument = argument, - VisualId = player.Id + VisualEntityId = player.Id }; case GuriPacketType.Unknow2: - return new ClientGuriPacket + return new GuriPacket { Type = 6, Argument = 1, - VisualId = player.Id, - Value = 0, + VisualEntityId = player.Id, + Value = "0", Data = 0 }; case GuriPacketType.Unknow3: - return new ClientGuriPacket + return new GuriPacket { Type = 10, Argument = argument, - VisualId = value, - Value = player.Id + VisualEntityId = value, + Value = player.Id.ToString() }; case GuriPacketType.Unknow4: - return new ClientGuriPacket + return new GuriPacket { Type = 15, Argument = argument, - VisualId = 0, + VisualEntityId = 0, Data = 0 }; default: - return new ClientGuriPacket + return new GuriPacket { Type = (int)type, Argument = argument, - VisualId = player.Id, - Value = value + VisualEntityId = player.Id, + Value = value.ToString() }; } } @@ -86,17 +88,17 @@ public static Task SendChatMessageAsync(this IPlayerEntity player, PlayerMessage public static Task GenerateCHDM(this IPlayerEntity player, int maxhp, int angeldmg, int demondmg, int time) => player.SendPacketAsync(player.GenerateCHDMPacket(maxhp, angeldmg, demondmg, time)); - public static Task SendDialog(this IPlayerEntity player, PacketBase acceptpacket, PacketBase refusepacket, string question) => - player.SendPacketAsync(player.GenerateDialogPacket(acceptpacket, refusepacket, question)); + public static Task SendDialog(this IPlayerEntity player, IPacket yesPacket, IPacket noPacket, string question) => + player.SendPacketAsync(player.GenerateDialogPacket(yesPacket, noPacket, question)); - public static Task SendQuestionAsync(this IPlayerEntity player, PacketBase acceptpacket, string question) => player.SendPacketAsync(player.GenerateQnaPacket(acceptpacket, question)); + public static Task SendQuestionAsync(this IPlayerEntity player, IPacket yesPacket, string question) => player.SendPacketAsync(player.GenerateQnaPacket(yesPacket, question)); - public static Task GenerateDelay(this IPlayerEntity player, int delay, DelayPacketType type, string argument) => player.SendPacketAsync(player.GenerateDelayPacket(delay, type, argument)); + public static Task SendDelayAsync(this IPlayerEntity player, short delay, DelayPacketType type, IPacket argument) => player.SendPacketAsync(player.GenerateDelayPacket(delay, type, argument)); - public static QnaPacket GenerateQnaPacket(this IPlayerEntity player, PacketBase acceptpacket, string question) => + public static QnaPacket GenerateQnaPacket(this IPlayerEntity player, IPacket yesPacket, string question) => new QnaPacket { - AcceptPacket = acceptpacket, + YesPacket = yesPacket, Question = question }; @@ -109,29 +111,29 @@ public static BSInfoPacket GenerateBSInfoPacket(this IPlayerEntity player, byte Text = text }; - public static ChDMPacket GenerateCHDMPacket(this IPlayerEntity player, int maxhp, int angeldmg, int demondmg, int time) => + public static ChDMPacket GenerateCHDMPacket(this IPlayerEntity player, int maxHp, int angelDamage, int demonDamage, int time) => new ChDMPacket { - Maxhp = maxhp, - AngelDMG = angeldmg, - DemonDMG = demondmg, + Maxhp = maxHp, + AngelDMG = angelDamage, + DemonDMG = demonDamage, Time = time }; - public static DialogPacket GenerateDialogPacket(this IPlayerEntity player, PacketBase acceptpacket, PacketBase refusepacket, string question) => - new DialogPacket + public static DlgPacket GenerateDialogPacket(this IPlayerEntity player, IPacket yesPacket, IPacket noPacket, string question) => + new DlgPacket { - AcceptPacket = acceptpacket, - RefusePacket = refusepacket, + YesPacket = yesPacket, + NoPacket = noPacket, Question = question }; - public static DelayPacket GenerateDelayPacket(this IPlayerEntity player, int delay, DelayPacketType type, string argument) => + public static DelayPacket GenerateDelayPacket(this IPlayerEntity player, short delay, DelayPacketType type, IPacket packet) => new DelayPacket { Delay = delay, - Type = type, - Argument = argument + Type = (byte)type, + Packet = packet, }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs index fa8e9c52..cc3b7c70 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs @@ -19,11 +19,13 @@ public static SayItemPacket GenerateSayItemPacket(this IPlayerEntity player, str VisualId = player.Id, VisualType = player.Type, Message = message.Replace(' ', '^'), - ItemData = new SayItemPacket.SayItemSubPacket - { - IconId = item.Item.Type == InventoryType.Equipment ? (long?)null : item.ItemId, - EquipmentInfo = item.Item.Type == InventoryType.Equipment ? item.GenerateEInfoPacket() : null - }, + ItemData = item.Item.Type == InventoryType.Equipment + ? null + : new SayItemPacket.SayItemSubPacket + { + IconId = item.Item.Type == InventoryType.Equipment ? (long?)null : item.ItemId, + }, + EquipmentInfo = item.Item.Type == InventoryType.Equipment ? item.GenerateEInfoPacket() : null }; } } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs index ff11550a..89644ccb 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -23,6 +23,7 @@ public static CInfoPacket GenerateCInfoPacket(this IPlayerEntity player) => Morph = player.MorphId, Invisible = player.IsInvisible, FamilyLevel = 0, + SpUpgrade = player.Sp?.Upgrade ?? 0, ArenaWinner = player.Character.ArenaWinner }; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CancelPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CancelPacketExtension.cs index 3085399e..0b1b87cc 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CancelPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CancelPacketExtension.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Packets.Game.Server.Battle; +using ChickenAPI.Game.Battle.Interfaces; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Battle; namespace ChickenAPI.Game.Battle.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CtPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CtPacketExtensions.cs index 44a0ece6..f669d91b 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CtPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CtPacketExtensions.cs @@ -1,7 +1,7 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Server.Battle; +using ChickenAPI.Packets.ServerPackets.Battle; namespace ChickenAPI.Game.Battle.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/DropExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/DropExtensions.cs index 18678fef..72fc7606 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/DropExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/DropExtensions.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Packets.ServerPackets.Entities; namespace ChickenAPI.Game.Entities.Drop.Extensions { @@ -7,14 +7,13 @@ public static class DropExtensions public static DropPacket GenerateDropPacket(this IDropEntity drop) => new DropPacket { - ItemVnum = drop.ItemVnum, - Quantity = drop.Quantity, + VisualId = drop.Id, + Amount = (short)drop.Quantity, + VNum = (short)drop.ItemVnum, PositionX = drop.Position.X, PositionY = drop.Position.Y, - TransportId = drop.Id, - IsQuestDrop = drop.IsQuestDrop, - Unknown = 0, - Unknown2 = -1 + Unknown = (byte)(drop.IsQuestDrop ? 1 : 0), + OwnerId = drop.Id, }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs index 575d236c..c5ddf506 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs @@ -1,5 +1,6 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs index 13a13c6d..1f6db194 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs @@ -1,6 +1,6 @@ using System; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FsPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FsPacketExtension.cs index 9d138df9..d7b995a6 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FsPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FsPacketExtension.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; -using ChickenAPI.Packets.Game.Client.Player; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs index 548544d3..b6f95bce 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Client.Families; +using ChickenAPI.Packets.Old.Game.Client.Families; namespace ChickenAPI.Game.Families.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GetPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GetPacketExtension.cs index 9047d47e..277afd3e 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GetPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GetPacketExtension.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.ClientPackets.Drops; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -6,8 +6,9 @@ public static class GetPacketExtension { public static GetPacket GenerateGetPacket(this IPlayerEntity player, long itemId) => new GetPacket { - CharacterId = player.Id, - ItemId = itemId + PickerId = player.Id, + PickerType = player.Type, + VisualId = itemId }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GidxPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GidxPacketExtensions.cs index 09443db4..6d18f646 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GidxPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GidxPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Client.Families; +using ChickenAPI.Packets.ClientPackets.Families; namespace ChickenAPI.Game.Families.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GoldPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GoldPacketExtension.cs index e60a9557..465892d7 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GoldPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GoldPacketExtension.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs index 85a1e9bb..9dc06ad4 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; using System.Linq; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Mates; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Group; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Groups; +using ChickenAPI.Packets.ServerPackets.Shop; namespace ChickenAPI.Game.Groups.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs index 98a1c3b1..578a8e0d 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs @@ -1,6 +1,6 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Game.Server.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs index 8e5fa265..ec87d4fb 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs @@ -1,7 +1,7 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs index 2aaacc86..75b48ddc 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs @@ -9,10 +9,11 @@ using ChickenAPI.Game.Shops.Extensions; using ChickenAPI.Game.Visibility; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Client.Shops; -using ChickenAPI.Packets.Game.Server.Inventory; -using ChickenAPI.Packets.Game.Server.Portals; -using ChickenAPI.Packets.Game.Server.Visibility; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Inventory; +using ChickenAPI.Packets.ServerPackets.Portals; +using ChickenAPI.Packets.ServerPackets.Shop; +using ChickenAPI.Packets.ServerPackets.Visibility; namespace ChickenAPI.Game.Maps.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs index b68e04da..1729296f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs @@ -1,7 +1,7 @@ using System; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Server.MiniMap; +using ChickenAPI.Packets.Old.Game.Server.MiniMap; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs index df54f20f..e9275607 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs @@ -12,8 +12,8 @@ using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game._i18n; -using ChickenAPI.Packets.Game.Server.Mates; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Packets.Old.Game.Server.Mates; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovableEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovableEntityExtensions.cs index 07eaefba..c1345c42 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovableEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovableEntityExtensions.cs @@ -1,49 +1,20 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game.Entities.Monster; -using ChickenAPI.Game.Entities.Npc; -using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Game.Movements; +using ChickenAPI.Packets.ServerPackets.Entities; namespace ChickenAPI.Game.Inventory.Extensions { public static class MovableEntityExtensions { - public static MvPacket GenerateMvPacket(this IEntity entity) + public static MovePacket GenerateMvPacket(this IMovableEntity entity) { - switch (entity) + return new MovePacket { - case IMonsterEntity monster: - return new MvPacket - { - VisualType = VisualType.Monster, - VisualId = monster.MapMonster.Id, - Speed = monster.Speed, - MapX = monster.Position.X, - MapY = monster.Position.Y - }; - - case INpcEntity npc: - return new MvPacket - { - VisualType = VisualType.Npc, - VisualId = npc.MapNpc.Id, - Speed = npc.Speed, - MapX = npc.Position.X, - MapY = npc.Position.Y - }; - case IPlayerEntity player: - return new MvPacket - { - VisualType = VisualType.Player, - VisualId = player.Character.Id, - Speed = player.Speed, - MapX = player.Position.X, - MapY = player.Position.Y - }; - default: - return null; - } + VisualType = entity.Type, + VisualEntityId = entity.Id, + Speed = entity.Speed, + MapX = entity.Position.X, + MapY = entity.Position.Y + }; } } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs index 7e99c37a..539812a8 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old.Game.Server.Player; namespace ChickenAPI.Game.Movements.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs index a9bc661f..d2f30481 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs @@ -6,51 +6,51 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; -using ChickenAPI.Packets.Game.Client.Shops; +using ChickenAPI.Packets.ServerPackets.Shop; namespace ChickenAPI.Game.Shops.Extensions { public static class NInvPacketExtensions { - private static string GetShopList(IEnumerable items) + private static List GetShopList(IEnumerable items) { - var tmp = new StringBuilder(); + var tmp = new List(); foreach (PersonalShopItem itemInfo in items) { - tmp.Append(' '); + // tmp.Append(' '); long upgradeOrPrice = itemInfo.ItemInstance.Item.Type == InventoryType.Equipment ? itemInfo.ItemInstance.Upgrade : itemInfo.Price; int rareOrQuantity = itemInfo.ItemInstance.Item.Type == InventoryType.Equipment ? itemInfo.ItemInstance.Rarity : itemInfo.Quantity; double priceOrMinus = itemInfo.ItemInstance.Item.Type == InventoryType.Equipment ? itemInfo.Price : -1; - tmp.Append($"{(byte)itemInfo.ItemInstance.Item.Type}.{itemInfo.Slot}.{itemInfo.ItemInstance.ItemId}.{rareOrQuantity}.{upgradeOrPrice}.{priceOrMinus}"); + tmp.Add(new NInvItemSubPacket + { + Price = upgradeOrPrice, + UpgradeDesign = rareOrQuantity, + Slot = (byte)itemInfo.Slot, + VNum = (short)itemInfo.ItemInstance.ItemId, + }); + + // tmp.Append($"{(byte)itemInfo.ItemInstance.Item.Type}.{itemInfo.Slot}.{itemInfo.ItemInstance.ItemId}.{rareOrQuantity}.{upgradeOrPrice}.{priceOrMinus}"); } - return tmp.ToString(); + return tmp; } - private static string GetShopList(IEnumerable items, double percent) + private static List GetShopList(IEnumerable items, double percent) { - var tmp = new StringBuilder(); + var tmp = new List(); foreach (ShopItemDto itemInfo in items) { - tmp.Append(' '); double price = itemInfo.Item.ReputPrice > 0 ? itemInfo.Item.ReputPrice : itemInfo.Item.Price * percent; byte color = itemInfo.Color != 0 ? itemInfo.Item.Color : itemInfo.Item.BasicUpgrade; int rareOrQuantity = itemInfo.Item.Type != InventoryType.Equipment ? -1 : itemInfo.Rare; - tmp.Append($"{(byte)itemInfo.Item.Type}.{itemInfo.Slot}.{itemInfo.ItemId}.{rareOrQuantity}."); - if (itemInfo.Item.Type == InventoryType.Equipment) - { - tmp.Append(color); - tmp.Append('.'); - } - tmp.Append(price); } - return tmp.ToString(); + return tmp; } @@ -59,15 +59,15 @@ public static NInvPacket GenerateNInvPacket(this IPlayerEntity player, PersonalS { VisualType = shop.Owner.Type, VisualId = shop.Owner.Id, - ShopType = 0, + ShopKind = 0, Unknown = 0, - ShopList = GetShopList(shop.ShopItems), - ShopSkills = new List() + Items = GetShopList(shop.ShopItems), + Skills = null, }; public static NInvPacket GenerateNInvPacket(this IPlayerEntity player, Shop shop, byte type) { - int typeshop = 0; + byte typeshop = 0; double percent = 1.0; switch (player.GetDignityIcon()) @@ -93,7 +93,7 @@ public static NInvPacket GenerateNInvPacket(this IPlayerEntity player, Shop shop typeshop = 100; } - List skillIds = new List(); + List skillIds = new List(); foreach (ShopSkillDto skill in shop.Skills.Where(s => s.Type == type)) { @@ -102,12 +102,12 @@ public static NInvPacket GenerateNInvPacket(this IPlayerEntity player, Shop shop typeshop = 1; if (skill.Skill.Class == (byte)player.Character.Class) { - skillIds.Add(skill.SkillId); + skillIds.Add((short)skill.SkillId); } } else { - skillIds.Add(skill.SkillId); + skillIds.Add((short)skill.SkillId); } } @@ -116,10 +116,10 @@ public static NInvPacket GenerateNInvPacket(this IPlayerEntity player, Shop shop { VisualType = shop.Owner.Type, VisualId = shop.Owner.Id, - ShopType = typeshop, + ShopKind = typeshop, Unknown = 0, - ShopList = GetShopList(shop.Items.Where(s => s.Type == type), percent), - ShopSkills = skillIds + Items = GetShopList(shop.Items.Where(s => s.Type == type), percent), + Skills = skillIds }; } } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs index dde39beb..9197841f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Packets.Game.Client.UI; +using ChickenAPI.Packets.Old.Game.Client.UI; namespace ChickenAPI.Game.Entities.Npc.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs index 72db5baf..b1d30ee1 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs @@ -2,7 +2,7 @@ using System.Linq; using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Relations; +using ChickenAPI.Packets.Old.Game.Server.Relations; namespace ChickenAPI.Game.Relations.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs index 987c930b..dd92da95 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs @@ -2,7 +2,7 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Game.Server.Inventory; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs index d613152d..5d127efd 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs @@ -17,9 +17,11 @@ using ChickenAPI.Game.Shops.Extensions; using ChickenAPI.Game.Skills; using ChickenAPI.Game._i18n; -using ChickenAPI.Packets.Game.Client.Player; -using ChickenAPI.Packets.Game.Server.Player; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Game.Extensions.PacketGeneration; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; +using ChickenAPI.Packets.ServerPackets.Player; +using SayColorType = ChickenAPI.Enums.Packets.SayColorType; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs index a26522eb..f5c800b6 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs @@ -2,8 +2,10 @@ using ChickenAPI.Enums.Packets; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._i18n; -using ChickenAPI.Packets.Game.Server.Player; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Chats; +using ChickenAPI.Packets.ServerPackets.UI; +using SayColorType = ChickenAPI.Enums.Packets.SayColorType; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -28,12 +30,12 @@ public static ModalPacket GenerateModalPacket(this IPlayerEntity player, string { return new ModalPacket { - Type = type, + Type = (byte)type, Message = message, }; } - public static MsgPacket GenerateMsgPacket(this IPlayerEntity player, PlayerMessages message, MsgPacketType type) + public static MsgPacket GenerateMsgPacket(this IPlayerEntity player, PlayerMessages message, MessageType type) { return new MsgPacket { @@ -42,7 +44,7 @@ public static MsgPacket GenerateMsgPacket(this IPlayerEntity player, PlayerMessa }; } - public static MsgPacket GenerateMsgPacket(this IPlayerEntity player, string msg, MsgPacketType type) => + public static MsgPacket GenerateMsgPacket(this IPlayerEntity player, string msg, MessageType type) => new MsgPacket { Message = msg, diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs index 666c0b0b..f0621119 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Portals; -using ChickenAPI.Packets.Game.Server.Portals; +using ChickenAPI.Packets.Old.Game.Server.Portals; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs index ea4d7207..cf4e439c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs @@ -1,5 +1,5 @@ using ChickenAPI.Data.Character; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old.Game.Server.Player; namespace ChickenAPI.Game.Quicklist.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs index ec22cc78..b3fe5df4 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs @@ -3,7 +3,7 @@ using System.Text; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old.Game.Server.Player; namespace ChickenAPI.Game.Skills.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs index 2678225c..1f70c359 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs @@ -1,9 +1,9 @@ using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Client.Shops; -using ChickenAPI.Packets.Game.Server.Shop; using System.Threading.Tasks; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Shop; namespace ChickenAPI.Game.Shops.Extensions { @@ -15,10 +15,10 @@ public static ShopEndPacket GenerateShopEndPacket(this IPlayerEntity player, Sho Type = type }; - public static SMemoPacket GenerateShopMemoPacket(this IPlayerEntity player, SMemoPacketType type, string message) => + public static SMemoPacket GenerateShopMemoPacket(this IPlayerEntity player, SMemoType type, string message) => new SMemoPacket { - SMemoPacketType = type, + Type = type, Message = message }; @@ -40,7 +40,7 @@ public static ShopPacket GenerateShopPacket(this IPlayerEntity player) return new ShopPacket { VisualType = player.Type, - EntityId = player.Id, + VisualId = player.Id, ShopId = 1, MenuType = 3, ShopType = 0, @@ -58,7 +58,7 @@ public static ShopPacket GenerateShopPacket(this INpcEntity npc) return new ShopPacket { VisualType = npc.Type, - EntityId = npc.Id, + VisualId = npc.Id, ShopId = npc.Shop.Id, MenuType = npc.Shop.MenuType, ShopType = npc.Shop.ShopType, diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs index f85864a8..a983954a 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs @@ -2,7 +2,7 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Game.Configuration; -using ChickenAPI.Packets.Game.Client.Specialists; +using ChickenAPI.Packets.Old.Game.Client.Specialists; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs index e56d9d4f..e40c20fe 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs @@ -1,7 +1,7 @@ using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Specialist; using System.Threading.Tasks; +using ChickenAPI.Packets.Old.Game.Server.Specialist; namespace ChickenAPI.Game.Specialists.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs index 84f7ab1a..a4362d6f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Packets.Old.Game.Server.Entities; namespace ChickenAPI.Game.Entities.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs index a6dd61c4..d1f4b0d5 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old.Game.Server.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs index ebc77e42..a5e66ca9 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old.Game.Server.Player; namespace ChickenAPI.Game.Entities.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs index 365e4266..61b8310d 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs @@ -1,6 +1,6 @@ using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Packets.Game.Server.Battle; +using ChickenAPI.Packets.Old.Game.Server.Battle; namespace ChickenAPI.Game.Battle.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs index 16b88785..0e5a065c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs @@ -9,9 +9,9 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Server.Entities; -using ChickenAPI.Packets.Game.Server.MiniMap; -using ChickenAPI.Packets.Game.Server.Visibility; +using ChickenAPI.Packets.Old.Game.Server.Entities; +using ChickenAPI.Packets.Old.Game.Server.MiniMap; +using ChickenAPI.Packets.Old.Game.Server.Visibility; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game/Builders/CharacterBuilder.cs b/src/ChickenAPI.Game/Builders/CharacterBuilder.cs index af5c84e0..176c2fc7 100644 --- a/src/ChickenAPI.Game/Builders/CharacterBuilder.cs +++ b/src/ChickenAPI.Game/Builders/CharacterBuilder.cs @@ -1,6 +1,6 @@ using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Builders { diff --git a/src/ChickenAPI.Game/ChickenAPI.Game.csproj b/src/ChickenAPI.Game/ChickenAPI.Game.csproj index d8462855..846208b3 100644 --- a/src/ChickenAPI.Game/ChickenAPI.Game.csproj +++ b/src/ChickenAPI.Game/ChickenAPI.Game.csproj @@ -30,6 +30,7 @@ + diff --git a/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs b/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs index 83353abf..e5e2b466 100644 --- a/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs +++ b/src/ChickenAPI.Game/Effects/EntityExtensionEffect.cs @@ -1,9 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game.Entities.Monster; -using ChickenAPI.Game.Entities.Npc; -using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Effects diff --git a/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs index 67e0e168..ed84083b 100644 --- a/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs +++ b/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets.Attributes +namespace ChickenAPI.Packets.Old.Attributes { [AttributeUsage(AttributeTargets.Class)] public class PacketClientAttribute : Attribute diff --git a/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs index 54899f03..8850aaf9 100644 --- a/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs +++ b/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets.Attributes +namespace ChickenAPI.Packets.Old.Attributes { [AttributeUsage(AttributeTargets.Class)] public class PacketDescriptionAttribute : Attribute diff --git a/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs index 4b0bf4fc..9a74c2f3 100644 --- a/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs +++ b/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs @@ -1,7 +1,7 @@ using System; using ChickenAPI.Enums; -namespace ChickenAPI.Packets.Attributes +namespace ChickenAPI.Packets.Old.Attributes { [AttributeUsage(AttributeTargets.Class)] public class PacketHeaderAttribute : Attribute diff --git a/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs index 8ece7a93..34d4a80a 100644 --- a/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs +++ b/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace ChickenAPI.Packets.Attributes +namespace ChickenAPI.Packets.Old.Attributes { [AttributeUsage(AttributeTargets.Property)] public class PacketIndexAttribute : Attribute diff --git a/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs index 6fe0f330..4df5d06c 100644 --- a/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs +++ b/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets.Attributes +namespace ChickenAPI.Packets.Old.Attributes { [AttributeUsage(AttributeTargets.Property)] public class PacketPropertyDescriptionAttribute : Attribute diff --git a/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs index ecff5203..42eb6292 100644 --- a/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs +++ b/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets.Attributes +namespace ChickenAPI.Packets.Old.Attributes { [AttributeUsage(AttributeTargets.Class)] public class PacketServerAttribute : Attribute diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs index bedd131e..1dcb2849 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Client +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client { [PacketHeader("Char_NEW", false)] public class CharNewPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs index 3aadd153..53051362 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Client +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client { [PacketHeader("Char_NEW_Job", false)] public class CharNewWrestlerPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs index 1ebf189c..3c085f97 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Client +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client { [PacketHeader("Char_DEL", false)] public class CharacterDeletePacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs index 4a5a4eab..9734e1fd 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Client +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client { [PacketHeader("EntryPoint", 3, false)] public class EntryPointPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs index b69ab0eb..71fa83f2 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Client +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client { [PacketHeader("game_start")] public class GameStartPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs index 114bbedf..ec8d46c7 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Client +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client { [PacketHeader("select", NeedCharacter = false)] public class SelectPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs index 33898496..c4cbc670 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Server +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server { [PacketHeader("clist_start")] public class CListStartPacket : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs index 3f1347bf..2808916a 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Server +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server { [PacketHeader("clist_end")] public class ClistEndPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs index 8371bfe5..f5860833 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Server +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server { [PacketHeader("clist")] public class ClistPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs index 2639c135..c0fac7d9 100644 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs +++ b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.CharacterSelectionScreen.Server +namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server { [PacketHeader("OK")] public class OkPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/ChickenAPI.Packets.csproj b/src/ChickenAPI.Packets/ChickenAPI.Packets.Old.csproj similarity index 100% rename from src/ChickenAPI.Packets/ChickenAPI.Packets.csproj rename to src/ChickenAPI.Packets/ChickenAPI.Packets.Old.csproj diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs index 91f81f81..fdb86933 100644 --- a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Battle +namespace ChickenAPI.Packets.Old.Game.Client.Battle { [PacketHeader("mtlist")] public class MultiTargetListPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs index eb1d6a55..639928e5 100644 --- a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Battle +namespace ChickenAPI.Packets.Old.Game.Client.Battle { [PacketHeader("multi_target_list_sub_packet")] public class MultiTargetListSubPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs index 8da912c4..5b33ae55 100644 --- a/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Battle +namespace ChickenAPI.Packets.Old.Game.Client.Battle { [PacketHeader("ncif")] public class NcifPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs index 67c2896e..1d054aff 100644 --- a/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Battle +namespace ChickenAPI.Packets.Old.Game.Client.Battle { [PacketHeader("u_as")] public class UseAoeSkillPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs index a212e2cd..ed24b826 100644 --- a/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Battle +namespace ChickenAPI.Packets.Old.Game.Client.Battle { [PacketHeader("u_s")] public class UseSkillPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs b/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs index a685f152..5411a95d 100644 --- a/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Chat +namespace ChickenAPI.Packets.Old.Game.Client.Chat { [PacketHeader("say")] public class ClientSayPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs b/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs index d254e0b9..f6aa1f05 100644 --- a/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Drops +namespace ChickenAPI.Packets.Old.Game.Client.Drops { [PacketHeader("drop")] internal class DropPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs b/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs index da46e4d3..8f932db2 100644 --- a/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Drops +namespace ChickenAPI.Packets.Old.Game.Client.Drops { [PacketHeader("get")] public class GetPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs b/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs index 00c8c9af..4b7bacaf 100644 --- a/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Families +namespace ChickenAPI.Packets.Old.Game.Client.Families { [PacketHeader("glmk")] public class CreateFamilyPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs index 7cdcf851..a5c383ac 100644 --- a/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs @@ -1,8 +1,8 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Families; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Families +namespace ChickenAPI.Packets.Old.Game.Client.Families { [PacketHeader("ginfo")] public class GInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs b/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs index 9bab0df0..851a6369 100644 --- a/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Families +namespace ChickenAPI.Packets.Old.Game.Client.Families { [PacketHeader("gidx")] public class GidxPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs index a34350f2..b3714109 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("b_i")] public class BiPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs index ec82a369..35af6ede 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("mvi")] public class MviPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs index 21d6882b..033dbd6b 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("pdti")] public class PdtiPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs index 83ddb630..0458f75f 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("put")] public class PutPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs index 99d00d83..38ddfda9 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("remove")] public class RemovePacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs index e99112fa..19473aa7 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs @@ -1,8 +1,7 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("u_i")] public class UiPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs index b5dd3783..b4ba7ee8 100644 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Inventory +namespace ChickenAPI.Packets.Old.Game.Client.Inventory { [PacketHeader("wear")] public class WearPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs index 4bb05537..1ea246a0 100644 --- a/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Mates +namespace ChickenAPI.Packets.Old.Game.Client.Mates { [PacketHeader("ps_op")] public class PsopPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs index 6254c1d2..f3ff66c7 100644 --- a/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Mates +namespace ChickenAPI.Packets.Old.Game.Client.Mates { [PacketHeader("psl")] public class PslPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs index d690fec2..62b9c211 100644 --- a/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Mates +namespace ChickenAPI.Packets.Old.Game.Client.Mates { [PacketHeader("suctl")] public class SuCtlPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs index 8e443dcd..11926c75 100644 --- a/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Mates +namespace ChickenAPI.Packets.Old.Game.Client.Mates { [PacketHeader("u_ps")] public class UpsPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs index ea1b9437..e505e2fc 100644 --- a/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Mates +namespace ChickenAPI.Packets.Old.Game.Client.Mates { [PacketHeader("u_pet")] public class UpetPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs b/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs index f41ac11b..464d7c01 100644 --- a/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Miniland +namespace ChickenAPI.Packets.Old.Game.Client.Miniland { [PacketHeader("addobj")] public class AddobjPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs b/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs index 00a73463..7832fb66 100644 --- a/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Miniland +namespace ChickenAPI.Packets.Old.Game.Client.Miniland { [PacketHeader("mlobj")] public class MlobjPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs b/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs index 3dfb68e8..cdfbce21 100644 --- a/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Miniland +namespace ChickenAPI.Packets.Old.Game.Client.Miniland { [PacketHeader("rmvobj")] public class RmvobjPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs index b1a22f3b..6875ac73 100644 --- a/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Movement +namespace ChickenAPI.Packets.Old.Game.Client.Movement { [PacketHeader("dir")] public class DirectionPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs index 4adf51c4..b222932b 100644 --- a/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Movement +namespace ChickenAPI.Packets.Old.Game.Client.Movement { [PacketHeader("preq")] public class PreqPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs index 12a015a9..e66b6a33 100644 --- a/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Movement +namespace ChickenAPI.Packets.Old.Game.Client.Movement { [PacketHeader("rest")] public class SitPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs index 5a023025..fb35234a 100644 --- a/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Movement +namespace ChickenAPI.Packets.Old.Game.Client.Movement { [PacketHeader("sit_sub_packet")] // header will be ignored for serializing just sub list packets public class SitSubPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs index 0668de60..f5271d38 100644 --- a/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Movement +namespace ChickenAPI.Packets.Old.Game.Client.Movement { [PacketHeader("walk")] public class WalkPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs b/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs index 89ddc018..717f7ee3 100644 --- a/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Npcs +namespace ChickenAPI.Packets.Old.Game.Client.Npcs { [PacketHeader("n_run")] public class NrunPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs b/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs index 193effa7..958ad3f8 100644 --- a/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Npcs +namespace ChickenAPI.Packets.Old.Game.Client.Npcs { [PacketHeader("wopen")] public class WopenPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs index e40389c1..91245f6c 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("gop")] public class CharacterOptionPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs index 2cef7706..f429599e 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("guri")] public class ClientGuriPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs index 3ef97ec3..7dbd7e28 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("compl")] public class ComplimentPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs index d3d49a89..21f677f0 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("eff")] public class EffectPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs index 0d7e2ffa..4d8b1d4c 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("npinfo")] public class NpInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs index aae44b7b..68625d4b 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("qset")] public class QsetPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs index 4ac36a72..8a240c23 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("scr")] public class ScrPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs index cdcda72b..e1ef5615 100644 --- a/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs @@ -1,8 +1,8 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Player +namespace ChickenAPI.Packets.Old.Game.Client.Player { [PacketHeader("tc_info")] public class TcInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs index 009a8343..38b25df8 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("buy")] public class BuyPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs index 98a3768d..a8ff5290 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("m_shop")] public class MShopPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs index 1d806ba7..544e4a95 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("n_inv")] public class NInvPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs index c7cb7c9a..6d730c18 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("npc_req")] public class ReceivedNpcReqPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs index 0dc935a3..a6d552cf 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("npc_req")] public class SentNpcReqPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs index 54882b48..cd79612e 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("shop")] public class ShopPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs index 949dd11a..cc541fc3 100644 --- a/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Shops +namespace ChickenAPI.Packets.Old.Game.Client.Shops { [PacketHeader("shopping")] public class ShoppingPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs b/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs index 3df3403f..d72d874f 100644 --- a/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Specialists +namespace ChickenAPI.Packets.Old.Game.Client.Specialists { [PacketHeader("sl")] public class SlPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs b/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs index 23811606..5bcebffd 100644 --- a/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.Specialists +namespace ChickenAPI.Packets.Old.Game.Client.Specialists { [PacketHeader("sp")] public class SpPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs index cfa3d14d..a8a5a23c 100644 --- a/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client.UI +namespace ChickenAPI.Packets.Old.Game.Client.UI { [PacketHeader("e_info")] public class EInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs b/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs index 5e700521..470434de 100644 --- a/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs +++ b/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs @@ -1,8 +1,8 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Client +namespace ChickenAPI.Packets.Old.Game.Client { [PacketHeader("up_gr")] public class UpgradePacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs b/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs index 99be83b2..4977767f 100644 --- a/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Attributes; +using ChickenAPI.Packets.Old.Game.Server.Inventory; -namespace ChickenAPI.Packets.Game.Server.Auction +namespace ChickenAPI.Packets.Old.Game.Server.Auction { [PacketHeader("rc_blist")] public class RcbListPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs b/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs index 8e4651fb..357b199d 100644 --- a/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Attributes; +using ChickenAPI.Packets.Old.Game.Server.Inventory; -namespace ChickenAPI.Packets.Game.Server.Auction +namespace ChickenAPI.Packets.Old.Game.Server.Auction { [PacketHeader("rc_slist")] public class RcsListPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs index facc01bd..178709d0 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("bf")] public class BfPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs index 91b70394..17210499 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("cancel")] public class CancelPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs index b3275506..0e27c66e 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("ct")] public class CtPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs index 4174b234..02fb2621 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("dm")] public class DmPacket diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs index ec019413..53993c06 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("ms_c")] public class MscPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs index 4aeafd31..afa840c8 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("rc")] public class RcPacket diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs index d217b88e..1c1a1c72 100644 --- a/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs @@ -1,8 +1,7 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Enums.Packets; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Battle +namespace ChickenAPI.Packets.Old.Game.Server.Battle { [PacketHeader("su")] public class SuPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs b/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs index 6be20292..3d6b25d2 100644 --- a/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs @@ -1,8 +1,7 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Attributes; +using ChickenAPI.Packets.Old.Game.Server.Inventory; -namespace ChickenAPI.Packets.Game.Server.Chat +namespace ChickenAPI.Packets.Old.Game.Server.Chat { [PacketHeader("sayitem")] public class SayItemPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs index 10790df9..c345d066 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("char_sc")] public class CharScPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs index d7c50364..39645738 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("drop")] public class DropPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs index b2bfb8d7..0d60a4be 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("mv")] public class MvPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs index 6c89d09c..b4b4a584 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("out")] public class OutPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs index 76adce6d..6f3a372c 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("req_info")] public class ReqInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs index 8dd9542d..77aeef15 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("rest")] public class RestPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs index 0e104d2e..ad6a217b 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("st")] public class StPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs index 70fe9509..f53a72f8 100644 --- a/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Entities +namespace ChickenAPI.Packets.Old.Game.Server.Entities { [PacketHeader("tp")] public class TpPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs index b02fd87a..687ffc81 100644 --- a/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Group +namespace ChickenAPI.Packets.Old.Game.Server.Group { [PacketHeader("pinit")] public class PInitPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs index 108c291d..b6e8d3fa 100644 --- a/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Group +namespace ChickenAPI.Packets.Old.Game.Server.Group { [PacketHeader("pjoin")] public class PJoinPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs index cd0408fe..7d93db61 100644 --- a/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Group +namespace ChickenAPI.Packets.Old.Game.Server.Group { [PacketHeader("pidx")] public class PidxPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs index 29800fbc..05666a96 100644 --- a/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Group +namespace ChickenAPI.Packets.Old.Game.Server.Group { [PacketHeader("pst")] public class PstPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs index 029711b8..af10ad6f 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("e_info")] public class EInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs index 919de3bc..107ffaa8 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("subpacket_eq_list_info")] public class EqListInfo : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs index 1a2d0b38..91aa63ab 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("eq")] public class EqPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs index 8013ffec..339ed79e 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("subpacket_eq_rare_info")] public class EqRareInfo : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs index b98d4187..2be3e4ff 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("equip")] public class EquipPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs index 3a6ca342..c319da6f 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("eqinfo")] public class EquipmentInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs index e09571b7..d073e450 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("subpacket_eq_list")] public class EquipmentListItem diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs index d67a14a1..7bca8705 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("get")] public class GetPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs index 2e6842e4..a4742a99 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("gold")] public class GoldPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs index 2f9b9921..72203f81 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("inv")] public class InvPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs index c8a54978..39193398 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("eq_subpacket")] public class InventoryWearSubPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs index 6854cc2d..90680736 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("ivn")] public class IvnPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs index 14a3462d..cf55777c 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("pairy")] public class PairyPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs index 251c3728..db591802 100644 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Inventory +namespace ChickenAPI.Packets.Old.Game.Server.Inventory { [PacketHeader("slinfo")] public class SlInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs b/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs index 90fee3fa..ec6119b2 100644 --- a/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Map +namespace ChickenAPI.Packets.Old.Game.Server.Map { [PacketHeader("mapout")] public class MapoutPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs index a1ba1256..f760cd93 100644 --- a/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Mates +namespace ChickenAPI.Packets.Old.Game.Server.Mates { [PacketHeader("pski")] public class PSkiPacket diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs index f0208f56..c86e4fee 100644 --- a/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Mates +namespace ChickenAPI.Packets.Old.Game.Server.Mates { [PacketHeader("say_p")] public class SayPetPacket diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs index 7fa94176..a356d280 100644 --- a/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Mates; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Mates +namespace ChickenAPI.Packets.Old.Game.Server.Mates { /// /// Packets for partners diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs index 1abf8726..ad36ede1 100644 --- a/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Mates +namespace ChickenAPI.Packets.Old.Game.Server.Mates { /// /// Packets for pets diff --git a/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs index 32922512..630ea19c 100644 --- a/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.MiniMap +namespace ChickenAPI.Packets.Old.Game.Server.MiniMap { [PacketHeader("at")] public class AtPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs b/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs index b4c6aa3f..38e4c6b9 100644 --- a/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.MiniMap +namespace ChickenAPI.Packets.Old.Game.Server.MiniMap { [PacketHeader("c_map")] public class CMapPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs b/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs index 5c228344..0a2b995a 100644 --- a/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.MiniMap +namespace ChickenAPI.Packets.Old.Game.Server.MiniMap { [PacketHeader("rsfp")] public class RsfpPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs index 730501bc..e5e502da 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("bn")] public class BnPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs index 271bf0db..c5e51dca 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("c_info")] public class CInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs index 7b1bb106..5059aa70 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("c_mode")] public class CModePacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs index 38a02edd..b46902cb 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("cond")] public class CondPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs index e616262d..b744ecde 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("fd")] public class FdPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs index 4c376ad4..5cf5a56b 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("fs")] public class FsPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs index 2acab96e..9b2aaeb2 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { /// /// $"lev {Level} {LevelXp} {(UseSp? SpInstance.SpLevel : JobLevel)} {(UseSp ? SpInstance.XP : JobLevelXp)} {XpLoad()} diff --git a/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs index 155d9b50..42d91007 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("levelup")] public class LevelUpPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs index 3f5f2fc6..36812bca 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("qslot")] public class QSlotPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs b/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs index 0d403d57..92fc45f6 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("qset")] public class QsetPacketReceive : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs index 12a459e7..4582c807 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("rage")] public class RagePacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs index 813d7070..c2942fda 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs @@ -1,8 +1,7 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Enums.Packets; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("say")] public class SayPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs index 29dd0933..99575747 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("sc")] public class ScPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs index 94666aa5..a4edea4a 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("stat")] public class StatPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs index 1d70b181..829d3caf 100644 --- a/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Player +namespace ChickenAPI.Packets.Old.Game.Server.Player { [PacketHeader("tit")] public class TitPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs index fba292ec..87e2bcdf 100644 --- a/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Portals; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Portals +namespace ChickenAPI.Packets.Old.Game.Server.Portals { /// /// gp {SourceX} {SourceY} {MapId} {Type} {PortalId} {IsDisabled} diff --git a/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs b/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs index 99435b50..78fc1606 100644 --- a/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Raids +namespace ChickenAPI.Packets.Old.Game.Server.Raids { [PacketHeader("rl")] public class RlPacket diff --git a/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs index ea8ad37d..01ad086c 100644 --- a/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Relations +namespace ChickenAPI.Packets.Old.Game.Server.Relations { [PacketHeader("blinit")] public class BlInitPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs index 4ec89c41..f46681bf 100644 --- a/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using ChickenAPI.Enums.Game.Relations; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Relations +namespace ChickenAPI.Packets.Old.Game.Server.Relations { [PacketHeader("finit")] public class FInitPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs b/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs index 947f593e..46e62d78 100644 --- a/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Relations +namespace ChickenAPI.Packets.Old.Game.Server.Relations { [PacketHeader("fins")] public class FInsPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs index d784204d..ce19743a 100644 --- a/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Shop +namespace ChickenAPI.Packets.Old.Game.Server.Shop { [PacketHeader("ishop")] public class IShopPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs index 84992ceb..ed0f9c5a 100644 --- a/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs @@ -1,7 +1,6 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Shop +namespace ChickenAPI.Packets.Old.Game.Server.Shop { [PacketHeader("pflag")] public class PFlagPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs index 77ebfe76..2e93c652 100644 --- a/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Shop +namespace ChickenAPI.Packets.Old.Game.Server.Shop { [PacketHeader("s_memo")] public class SMemoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs index 65e4fdb6..e3815382 100644 --- a/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Shop +namespace ChickenAPI.Packets.Old.Game.Server.Shop { [PacketHeader("shop_end")] public class ShopEndPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs b/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs index 68c74adf..a40c6abb 100644 --- a/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Specialist +namespace ChickenAPI.Packets.Old.Game.Server.Specialist { [PacketHeader("sd")] public class SdPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs index 0b71b480..e149da91 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("act6")] public class Act6Packet : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs index ef7f4ef6..670b42a3 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("bsinfo")] public class BSInfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs index 84141ea8..d272ea7d 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("ch_dm")] public class ChDMPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs index a484b7cc..f29c2cc6 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("delay")] public class DelayPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs index 281e0c2d..5dddb42a 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("dlg")] public class DialogPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs index 0b264612..149c4966 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("guri")] public class GuriPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs index 2be5e66d..858b21fd 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("info")] public class InfoPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs index b846735f..bf183850 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("modal")] public class ModalPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs index ffb29d5b..a4783cb7 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("msg")] public class MsgPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs index 77d41a4f..1ad85637 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("p_clear")] public class PClearPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs index 3f3e68b8..2e34329c 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("qna")] public class QnaPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs index 5bbbf08c..d9823634 100644 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.UserInterface +namespace ChickenAPI.Packets.Old.Game.Server.UserInterface { [PacketHeader("zzim")] public class ZzimPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs index 0da0d1ee..ffb8d6b0 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_alive_subpacket")] public class InAliveSubPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs index d6df5df2..6ad3ae31 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs @@ -1,8 +1,8 @@ using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Attributes; +using ChickenAPI.Packets.Old.Game.Server.Inventory; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_character_subpacket")] public class InCharacterSubPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs index 729b151f..98cbd41f 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_item_subpacket")] public class InItemSubPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs index 0fbfa7be..0bb8a7e9 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_mate_subpacket")] public class InMateSubPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs index a01cd5a9..c6294b81 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_monster_subpacket")] public class InMonsterSubPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs index 9f9509ef..7f6949af 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_non_player_subpacket")] public class InNonPlayerSubPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs index f8fbcec6..90bb908b 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_npc_subpacket")] public class InNpcSubPacket : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs index aed87337..0fe96344 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in_ownable_subpacket")] public class InOwnableSubPacketBase : PacketBase diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs index 57b3a53a..a958e1f0 100644 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs +++ b/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs @@ -1,7 +1,7 @@ using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old.Attributes; -namespace ChickenAPI.Packets.Game.Server.Visibility +namespace ChickenAPI.Packets.Old.Game.Server.Visibility { [PacketHeader("in")] public class InPacket : PacketBase diff --git a/src/ChickenAPI.Packets/IPacket.cs b/src/ChickenAPI.Packets/IPacket.cs index ea10b095..c84c4d95 100644 --- a/src/ChickenAPI.Packets/IPacket.cs +++ b/src/ChickenAPI.Packets/IPacket.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets +namespace ChickenAPI.Packets.Old { public interface IPacket { diff --git a/src/ChickenAPI.Packets/IPacketFactory.cs b/src/ChickenAPI.Packets/IPacketFactory.cs index dab147c8..df80d445 100644 --- a/src/ChickenAPI.Packets/IPacketFactory.cs +++ b/src/ChickenAPI.Packets/IPacketFactory.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets +namespace ChickenAPI.Packets.Old { public interface IPacketFactory { diff --git a/src/ChickenAPI.Packets/PacketBase.cs b/src/ChickenAPI.Packets/PacketBase.cs index 0d796ecd..8c0cf995 100644 --- a/src/ChickenAPI.Packets/PacketBase.cs +++ b/src/ChickenAPI.Packets/PacketBase.cs @@ -1,6 +1,6 @@ using System; -namespace ChickenAPI.Packets +namespace ChickenAPI.Packets.Old { public abstract class PacketBase : IPacket { diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs index ef42cf4a..d84eab03 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs @@ -9,8 +9,8 @@ using ChickenAPI.Enums.Game; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.CharacterSelectionScreen.Server; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Server; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs index 8613bd0f..f9d93273 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs @@ -5,8 +5,8 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._i18n; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs index 9136dff2..cea71e9b 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs @@ -4,8 +4,8 @@ using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs index f934877d..d6e68927 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs @@ -5,8 +5,8 @@ using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs index 25921a34..b048e4d2 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs @@ -3,8 +3,6 @@ using ChickenAPI.Data.Character; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Enums.Packets; -using ChickenAPI.Game.Entities.Mates; -using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Families.Extensions; using ChickenAPI.Game.Helpers; @@ -12,15 +10,17 @@ using ChickenAPI.Game.Managers; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Game.Server.Map; -using ChickenAPI.Packets.Game.Server.Player; -using ChickenAPI.Packets.Game.Server.UserInterface; +using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; +using ChickenAPI.Packets.Old.Game.Server.UserInterface; +using ChickenAPI.Packets.ServerPackets.Map; +using ChickenAPI.Packets.ServerPackets.Player; +using ChickenAPI.Packets.ServerPackets.UI; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen { - public class GameStartPacketHandler : GenericSessionPacketHandlerAsync + public class GameStartPacketHandler : GenericSessionPacketHandlerAsync { private readonly IAlgorithmService _algorithmService; private readonly ICharacterMateService _characterMateService; @@ -45,7 +45,7 @@ public GameStartPacketHandler(IPlayerManager playerManager, IMapManager mapManag } - protected override async Task Handle(GameStartPacketBase packet, ISession session) + protected override async Task Handle(GameStartPacket packet, ISession session) { if (session.Player != null) { @@ -72,7 +72,7 @@ protected override async Task Handle(GameStartPacketBase packet, ISession sessio await session.Player.SendChatMessageAsync($"HEROXP : {dto.HeroXp}/{_algorithmService.GetHeroLevelXp(dto.Class, dto.Level)}", SayColorType.Yellow); await session.Player.SendChatMessageAsync("└----------------------------------------------┘", SayColorType.Yellow); await session.SendPacketAsync(new TitPacket { ClassType = "Adventurer", Name = dto.Name }); - await session.SendPacketAsync(new MapoutPacket()); + await session.SendPacketAsync(new MapOutPacket()); session.Player.Character.SpPoint = 10000; session.Player.Character.SpAdditionPoint = 500000; @@ -95,7 +95,7 @@ protected override async Task Handle(GameStartPacketBase packet, ISession sessio // exts // MlInfo - await session.SendPacketAsync(new PClearPacket()); + await session.SendPacketAsync(new PclearPacket()); await session.Player.ActualizeGroupList(); await session.Player.ActualizeUiGroupIcons(); await session.SendPacketAsync(new ZzimPacket()); diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs index d885bdfe..dcb3a94b 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using ChickenAPI.Data.Character; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.CharacterSelectionScreen.Server; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; +using ChickenAPI.Packets.Old.CharacterSelectionScreen.Server; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen diff --git a/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs index b51db23b..96ca7431 100644 --- a/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Chat.Events; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Client.Chat; +using ChickenAPI.Packets.Old.Game.Client.Chat; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Chat diff --git a/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs index fe8f992d..b049e489 100644 --- a/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs @@ -5,7 +5,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Game.Client.Drops; +using ChickenAPI.Packets.Old.Game.Client.Drops; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Drops diff --git a/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs index c106eeed..9d2c68fc 100644 --- a/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs @@ -4,7 +4,7 @@ using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Extensions.UserInterface; -using ChickenAPI.Packets.Game.Client.Battle; +using ChickenAPI.Packets.Old.Game.Client.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Entity diff --git a/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs index bf01f0ad..b2abdeb5 100644 --- a/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Events; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Packets.Old.Game.Server.Entities; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Entity diff --git a/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs index cf6af153..cbb8648b 100644 --- a/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs @@ -5,7 +5,7 @@ using ChickenAPI.Game.Groups; using ChickenAPI.Game.Groups.Events; using ChickenAPI.Game.Managers; -using ChickenAPI.Packets.Game.Server.Group; +using ChickenAPI.Packets.Old.Game.Server.Group; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Groups diff --git a/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs index 382b8865..ec949cec 100644 --- a/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.GuriHandling.Events; -using ChickenAPI.Packets.Game.Client.Player; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Guri diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/EqInfoPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/EqInfoPacketHandling.cs index fa173915..6990d79d 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/EqInfoPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/EqInfoPacketHandling.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Game.Server.Inventory; +using ChickenAPI.Packets.Old.Game.Server.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs index 79d86bca..83174ad7 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Game.Client.Inventory; +using ChickenAPI.Packets.Old.Game.Client.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs index 5efc5b25..08b3b29f 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs @@ -2,7 +2,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Packets.Game.Client.Inventory; +using ChickenAPI.Packets.Old.Game.Client.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs index a263b07e..52091a07 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Game.Client.Inventory; +using ChickenAPI.Packets.Old.Game.Client.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs index 8be97a7f..0771f4d6 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs @@ -3,7 +3,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; -using ChickenAPI.Packets.Game.Client; +using ChickenAPI.Packets.Old.Game.Client; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs index 08db6779..3e7cf912 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs @@ -4,7 +4,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Packets.Game.Client.Inventory; +using ChickenAPI.Packets.Old.Game.Client.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs index ec842e3f..bd01fc96 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs @@ -2,7 +2,7 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Game.Client.Inventory; +using ChickenAPI.Packets.Old.Game.Client.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory diff --git a/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs index 76fc5efd..9b84f2ad 100644 --- a/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs @@ -2,7 +2,7 @@ using ChickenAPI.Data.Map; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Portals.Events; -using ChickenAPI.Packets.Game.Client.Movement; +using ChickenAPI.Packets.Old.Game.Client.Movement; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Move diff --git a/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs index 4126d050..fb819238 100644 --- a/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements.Events; -using ChickenAPI.Packets.Game.Client.Movement; +using ChickenAPI.Packets.Old.Game.Client.Movement; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Move diff --git a/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs index f9e7cd4c..619c0149 100644 --- a/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs @@ -3,7 +3,7 @@ using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Game.Client.Movement; +using ChickenAPI.Packets.Old.Game.Client.Movement; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Move diff --git a/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj b/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj index 151415c3..362beb8f 100644 --- a/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj +++ b/src/Plugins/NosSharp.PacketHandler/NW.Plugins.PacketHandling.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs index 0ffec52f..8ff4b689 100644 --- a/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog.Events; -using ChickenAPI.Packets.Game.Client.Npcs; +using ChickenAPI.Packets.Old.Game.Client.Npcs; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Npc.Dialog diff --git a/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs index 314426bd..7cedf062 100644 --- a/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs @@ -3,7 +3,7 @@ using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Relations.Events; -using ChickenAPI.Packets.Game.Server.Relations; +using ChickenAPI.Packets.Old.Game.Server.Relations; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Relations diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs index dd993405..a98e4c25 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; -using ChickenAPI.Packets.Game.Client.Shops; +using ChickenAPI.Packets.Old.Game.Client.Shops; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs index b7b3a0e9..6722914a 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs @@ -3,7 +3,7 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; -using ChickenAPI.Packets.Game.Client.Shops; +using ChickenAPI.Packets.Old.Game.Client.Shops; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs index 7236dfdc..4aecb09d 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs @@ -12,8 +12,8 @@ using ChickenAPI.Game.Shops; using ChickenAPI.Game.Shops.Events; using ChickenAPI.Game.Shops.Extensions; -using ChickenAPI.Packets.Game.Client.Shops; -using ChickenAPI.Packets.Game.Server.Shop; +using ChickenAPI.Packets.Old.Game.Client.Shops; +using ChickenAPI.Packets.Old.Game.Server.Shop; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs index 51dd0e02..96800ef5 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs @@ -3,7 +3,7 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; -using ChickenAPI.Packets.Game.Client.Shops; +using ChickenAPI.Packets.Old.Game.Client.Shops; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs index 9233389d..1867a0a3 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Client.Battle; +using ChickenAPI.Packets.Old.Game.Client.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs index e2201095..3a2e13c0 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Quicklist.Events; -using ChickenAPI.Packets.Game.Client.Player; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs index b11eabd2..035602c5 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Client.Battle; +using ChickenAPI.Packets.Old.Game.Client.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs index 210a924f..654d4628 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs @@ -8,8 +8,8 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Skills.Args; -using ChickenAPI.Packets.Game.Client.Battle; -using ChickenAPI.Packets.Game.Server.Battle; +using ChickenAPI.Packets.Old.Game.Client.Battle; +using ChickenAPI.Packets.Old.Game.Server.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill diff --git a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs index 98f6c71b..4205e714 100644 --- a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs @@ -4,7 +4,7 @@ using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Specialists.Args; -using ChickenAPI.Packets.Game.Client.Specialists; +using ChickenAPI.Packets.Old.Game.Client.Specialists; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Specialists diff --git a/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs b/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs index d0d192e9..b8c0a298 100644 --- a/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs +++ b/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs @@ -3,6 +3,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Old; namespace NW.Plugins.PacketHandling.Utils { diff --git a/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs b/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs index d8b4539b..330396d8 100644 --- a/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs +++ b/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs @@ -2,6 +2,7 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Old; namespace NW.Plugins.PacketHandling.Utils { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs index f73d86d6..56e423ce 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs @@ -10,7 +10,7 @@ using ChickenAPI.Game.BCards; using ChickenAPI.Game.Buffs; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Game.Server.Battle; +using ChickenAPI.Packets.Old.Game.Server.Battle; namespace SaltyEmu.BasicPlugin.BCardHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs index 8f45c7db..cfc516fc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs @@ -17,7 +17,7 @@ using ChickenAPI.Game.Entities.Npc.Events; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Events; -using ChickenAPI.Packets.Game.Server.Battle; +using ChickenAPI.Packets.Old.Game.Server.Battle; namespace SaltyEmu.BasicPlugin.EventHandlers.Battle { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/Chat_GlobalChat_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/Chat_GlobalChat_Handler.cs index 051d8c05..e3292d2e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/Chat_GlobalChat_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/Chat_GlobalChat_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Chat.Events; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -15,7 +16,7 @@ public class Chat_GlobalChat_Handler : GenericEventPostProcessorBase(); - public ItemType Type => ItemType.Box; public long EffectId => 1; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs index e27865d7..a573dc92 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs @@ -12,7 +12,12 @@ namespace SaltyEmu.BasicPlugin.ItemUsageHandlers.Handler { public class LocomotionHandler : IUseItemRequestHandlerAsync { - private readonly Logger _log = Logger.GetLogger(); + private readonly ILogger _log; + + public LocomotionHandler(ILogger log) + { + _log = log; + } public ItemType Type => ItemType.Special; @@ -24,15 +29,15 @@ public async Task Handle(IPlayerEntity player, InventoryUseItemEvent e) { if (e.Option == 0) { - await player.GenerateDelay(3000, DelayPacketType.Locomotion, $"#u_i^1^{player.Character.Id}^{(byte)e.Item.Type}^{e.Item.Slot}^2"); + // await player.SendDelayAsync(3000, DelayPacketType.Locomotion, $"#u_i^1^{player.Character.Id}^{(byte)e.Item.Type}^{e.Item.Slot}^2"); return; } - player.EmitEvent(new LocomotionTransformEvent { Item = e.Item }); + await player.EmitEventAsync(new LocomotionTransformEvent { Item = e.Item }); return; } - player.EmitEvent(new LocomotionUntransformEvent { }); + await player.EmitEventAsync(new LocomotionUntransformEvent { }); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs index 29cce0fb..acc8774c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs @@ -6,7 +6,7 @@ using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.ItemUsage; -using ChickenAPI.Packets.Game.Client.Inventory; +using ChickenAPI.Packets.Old.Game.Client.Inventory; namespace SaltyEmu.BasicPlugin.ItemUsageHandlers.Handler { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs index fa11ff48..26446fc8 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs @@ -2,8 +2,8 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; -using ChickenAPI.Packets.Game.Client.Npcs; -using ChickenAPI.Packets.Game.Client.Shops; +using ChickenAPI.Packets.Old.Game.Client.Npcs; +using ChickenAPI.Packets.Old.Game.Client.Shops; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers { diff --git a/src/Toolkit/Commands/DocumentationCommand.cs b/src/Toolkit/Commands/DocumentationCommand.cs index 7dc90e9a..afae590e 100644 --- a/src/Toolkit/Commands/DocumentationCommand.cs +++ b/src/Toolkit/Commands/DocumentationCommand.cs @@ -3,7 +3,8 @@ using System.Linq; using System.Reflection; using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old.Attributes; +using ChickenAPI.Packets.Old.Game.Server.Player; namespace Toolkit.Commands { diff --git a/src/World/Network/ClientSession.cs b/src/World/Network/ClientSession.cs index d5f0ab38..ca3c113d 100644 --- a/src/World/Network/ClientSession.cs +++ b/src/World/Network/ClientSession.cs @@ -18,6 +18,7 @@ using SaltyEmu.Commands.Interfaces; using ChickenAPI.Game._Network; using ChickenAPI.Packets.Attributes; +using ChickenAPI.Packets.Old; namespace World.Network { diff --git a/src/World/Packets/PluggablePacketFactory.cs b/src/World/Packets/PluggablePacketFactory.cs index 2cb6ecaa..fda59f42 100644 --- a/src/World/Packets/PluggablePacketFactory.cs +++ b/src/World/Packets/PluggablePacketFactory.cs @@ -7,10 +7,10 @@ using System.Text; using System.Text.RegularExpressions; using ChickenAPI.Core.Logging; -using ChickenAPI.Packets; using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Entities; +using ChickenAPI.Packets.Old; using World.Extensions; +using PacketBase = ChickenAPI.Packets.PacketBase; namespace World.Packets { diff --git a/src/World/WorldServer.cs b/src/World/WorldServer.cs index c3955774..a8b07423 100644 --- a/src/World/WorldServer.cs +++ b/src/World/WorldServer.cs @@ -10,7 +10,7 @@ using ChickenAPI.Core.Plugins.Exceptions; using ChickenAPI.Packets; using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Game.Server.Player; +using ChickenAPI.Packets.Old; using Essentials; using NLog; using NW.Plugins.PacketHandling; diff --git a/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs b/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs index 6a498ce5..d501a876 100644 --- a/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs +++ b/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs @@ -9,6 +9,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Old; using Moq; namespace ChickenAPI.Game.Test.Mocks diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets new file mode 160000 index 00000000..c4a5a496 --- /dev/null +++ b/vendor/ChickenAPI.Packets @@ -0,0 +1 @@ +Subproject commit c4a5a496da460f5c5fc701679f2cbea5c6510acc From 08831c9424ea197f81815c693fab8934d903e793 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 00:36:15 +0800 Subject: [PATCH 05/24] continue moving to nuget packages --- src/ChickenAPI.Data/Character/CharacterDto.cs | 4 ---- src/ChickenAPI.Enums/ChickenAPI.Enums.csproj | 6 +++++- .../Game/Entity/ElementType.cs | 11 ---------- .../Game/Portals/PortalType.cs | 21 ------------------- .../PacketGeneration/TcInfoPacketExtension.cs | 3 ++- .../_TOCLEAN/MapPacketsExtensions.cs | 4 ++-- .../_TOCLEAN/PairyPacketExtension.cs | 19 ++++++++++------- .../_TOCLEAN/PortalPacketExtensions.cs | 12 +++++------ .../Portals/PortalComponent.cs | 1 + .../Skill/QuickListPacketHandling.cs | 1 + src/Toolkit/Converter/ItemDatConverter.cs | 2 +- src/libs/SaltyEmu.Commands/CommandHandler.cs | 2 +- vendor/ChickenAPI.Packets | 2 +- 13 files changed, 31 insertions(+), 57 deletions(-) delete mode 100644 src/ChickenAPI.Enums/Game/Entity/ElementType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Portals/PortalType.cs diff --git a/src/ChickenAPI.Data/Character/CharacterDto.cs b/src/ChickenAPI.Data/Character/CharacterDto.cs index 50ea89d9..68939f40 100644 --- a/src/ChickenAPI.Data/Character/CharacterDto.cs +++ b/src/ChickenAPI.Data/Character/CharacterDto.cs @@ -1,9 +1,5 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; -using CharacterClassType = ChickenAPI.Enums.Game.Character.CharacterClassType; -using GenderType = ChickenAPI.Enums.Game.Character.GenderType; -using HairColorType = ChickenAPI.Enums.Game.Character.HairColorType; -using HairStyleType = ChickenAPI.Enums.Game.Character.HairStyleType; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj b/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj index 9f5c4f4a..d8e0b0b4 100644 --- a/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj +++ b/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj @@ -1,7 +1,11 @@ - + netstandard2.0 + + + + diff --git a/src/ChickenAPI.Enums/Game/Entity/ElementType.cs b/src/ChickenAPI.Enums/Game/Entity/ElementType.cs deleted file mode 100644 index 8af2bb11..00000000 --- a/src/ChickenAPI.Enums/Game/Entity/ElementType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace ChickenAPI.Enums.Game.Entity -{ - public enum ElementType - { - Neutral, - Fire, - Water, - Light, - Dark - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Portals/PortalType.cs b/src/ChickenAPI.Enums/Game/Portals/PortalType.cs deleted file mode 100644 index 5c0448bc..00000000 --- a/src/ChickenAPI.Enums/Game/Portals/PortalType.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace ChickenAPI.Enums.Game.Portals -{ - public enum PortalType : sbyte - { - MapPortal = -1, - TsNormal = 0, // same over >127 - sbyte - Closed = 1, - Open = 2, - Miniland = 3, - TsEnd = 4, - TsEndClosed = 5, - Exit = 6, - ExitClosed = 7, - Raid = 8, - Effect = 9, // same as 13 - 19 and 20 - 126 - BlueRaid = 10, - DarkRaid = 11, - TimeSpace = 12, - ShopTeleport = 20 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs index 8279531a..9bf45a69 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs @@ -1,11 +1,12 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Player; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Extensions.PacketGeneration { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs index 1729296f..81da675c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs @@ -1,7 +1,7 @@ using System; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Old.Game.Server.MiniMap; +using ChickenAPI.Packets.ServerPackets.Minimap; namespace ChickenAPI.Game.Inventory.Extensions { @@ -13,7 +13,7 @@ public static class MapPacketsExtensions { Type = 0, Id = Convert.ToInt16(map.Id), - MapType = 1 + MapType = true }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs index dd92da95..fa6c8a0e 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs @@ -1,8 +1,9 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Packets.Old.Game.Server.Inventory; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Inventory; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -16,10 +17,11 @@ public static PairyPacket GeneratePairyPacket(this IPlayerEntity player) return new PairyPacket { VisualType = VisualType.Player, - CharacterId = player.Character.Id, + VisualId = player.Character.Id, FairyMoveType = 0, - ElementType = 0, - FairyLevel = 0 + Element = ElementType.Neutral, + ElementRate = 0, + Morph = -1, }; } @@ -28,9 +30,10 @@ public static PairyPacket GeneratePairyPacket(this IPlayerEntity player) return new PairyPacket { VisualType = VisualType.Player, - CharacterId = player.Character.Id, - ElementType = fairy.ElementType, - FairyLevel = fairy.Upgrade, + VisualId = player.Character.Id, + Morph = (int)fairy.ItemId, + Element = fairy.ElementType, + ElementRate = fairy.Upgrade, FairyMoveType = 4 // todo enum }; } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs index f0621119..cee55ef3 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PortalPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Portals; -using ChickenAPI.Packets.Old.Game.Server.Portals; +using ChickenAPI.Packets.ServerPackets.Portals; namespace ChickenAPI.Game.Inventory.Extensions { @@ -7,12 +7,12 @@ public static class PortalPacketExtensions { public static GpPacket GenerateGpPacket(this PortalComponent portal) => new GpPacket { - PositionX = portal.SourceX, - PositionY = portal.SourceY, - DestinationMapId = portal.DestinationMapId, + PortalId = (int)portal.PortalId, + IsDisabled = portal.IsDisabled, + SourceX = portal.SourceX, + SourceY = portal.SourceY, + MapId = portal.DestinationMapId, PortalType = portal.Type, - PortalId = portal.PortalId, - IsDisabled = portal.IsDisabled }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game/Portals/PortalComponent.cs b/src/ChickenAPI.Game/Portals/PortalComponent.cs index 1a2163d6..f9534f2d 100644 --- a/src/ChickenAPI.Game/Portals/PortalComponent.cs +++ b/src/ChickenAPI.Game/Portals/PortalComponent.cs @@ -2,6 +2,7 @@ using ChickenAPI.Enums.Game.Portals; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Portals { diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs index 3a2e13c0..13e683ac 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Quicklist.Events; +using ChickenAPI.Packets.ClientPackets.Quicklist; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill diff --git a/src/Toolkit/Converter/ItemDatConverter.cs b/src/Toolkit/Converter/ItemDatConverter.cs index 343562d1..cde356f5 100644 --- a/src/Toolkit/Converter/ItemDatConverter.cs +++ b/src/Toolkit/Converter/ItemDatConverter.cs @@ -1026,7 +1026,7 @@ private void DoWork(string inputDirectory) case ItemType.Specialist: - // item.isSpecialist = Convert.ToByte(currentLine[2]); item.Unknown = Convert.ToInt16(currentLine[3]); + // item.isSpecialist = Convert.ToByte(currentLine[2]); item.FairyMoveType = Convert.ToInt16(currentLine[3]); item.ElementRate = Convert.ToInt16(currentLine[4]); item.Speed = Convert.ToByte(currentLine[5]); item.SpType = Convert.ToByte(currentLine[13]); diff --git a/src/libs/SaltyEmu.Commands/CommandHandler.cs b/src/libs/SaltyEmu.Commands/CommandHandler.cs index 2f5634e8..d8e7d3bf 100644 --- a/src/libs/SaltyEmu.Commands/CommandHandler.cs +++ b/src/libs/SaltyEmu.Commands/CommandHandler.cs @@ -190,7 +190,7 @@ private Task _commands_CommandExecuted(Command command, CommandResult result, IC var ctx = context as SaltyCommandContext; if (ctx is null) { - _logger.Debug($"Unknown context: {context.GetType()}. This is bad. Please report this."); + _logger.Debug($"FairyMoveType context: {context.GetType()}. This is bad. Please report this."); } _logger.Debug($"The command {command.Name} (from player {ctx.Player.Character.Name} [{ctx.Player.Character.Id}]) has successfully been executed."); diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index c4a5a496..50339231 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit c4a5a496da460f5c5fc701679f2cbea5c6510acc +Subproject commit 503392310cd006dad183dd57de3d1504e2f35ed3 From 168f555963b991a629bd172d6a7f2ff619aafb49 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 01:31:00 +0800 Subject: [PATCH 06/24] continue moving to nuget packages and cleanup --- src/ChickenAPI.Data/Item/ItemDto.cs | 4 +- src/ChickenAPI.Data/Item/ItemInstanceDto.cs | 3 +- src/ChickenAPI.Data/Map/PortalDto.cs | 2 +- .../Relations/IRelationService.cs | 1 + src/ChickenAPI.Data/Relations/RelationDto.cs | 1 + .../Relations/RelationInvitationDto.cs | 1 + .../Game/Items/EInfoPacketType.cs | 15 ---- .../Game/Items/InventoryType.cs | 18 ---- .../Game/Relations/CharacterRelationType.cs | 10 --- .../Packets/DelayPacketType.cs | 17 ---- src/ChickenAPI.Enums/Packets/EffectType.cs | 9 -- .../Packets/FInsPacketType.cs | 8 -- .../Packets/GuriPacketType.cs | 11 --- .../Packets/MShopPacketType.cs | 9 -- src/ChickenAPI.Enums/Packets/MsgPacketType.cs | 16 ---- src/ChickenAPI.Enums/Packets/OutPacketType.cs | 9 -- .../Packets/PJoinPacketType.cs | 13 --- src/ChickenAPI.Enums/Packets/PslPacketType.cs | 8 -- src/ChickenAPI.Enums/Packets/RlPacketType.cs | 10 --- .../Packets/SMemoPacketType.cs | 10 --- src/ChickenAPI.Enums/Packets/SayColorType.cs | 17 ---- src/ChickenAPI.Enums/Packets/SlPacketType.cs | 8 -- .../Packets/SuPacketHitMode.cs | 9 -- .../Packets/UpgradePacketType.cs | 36 -------- .../Helpers/UIHelper.cs | 2 +- .../PacketGeneration/ChatPacketExtensions.cs | 6 +- .../_TOCLEAN/EInfoPacketExtensions.cs | 2 + .../_TOCLEAN/GroupPlayerExtension.cs | 80 ++++++++--------- .../_TOCLEAN/InventoryGetExtensions.cs | 33 +++---- .../_TOCLEAN/InventoryUseExtension.cs | 2 +- .../_TOCLEAN/IvnPacketExtension.cs | 90 ++++++++++++------- .../MapLayerInformationsExtensions.cs | 2 +- .../_TOCLEAN/MateExtension.cs | 8 +- .../_TOCLEAN/MovablePlayerExtensions.cs | 4 +- .../_TOCLEAN/MoveItemExtensions.cs | 2 +- .../_TOCLEAN/NInvPacketExtensions.cs | 9 +- .../NotifyResultAndSetRarityPointExtension.cs | 2 +- .../_TOCLEAN/NpcExtensions.cs | 22 +++-- .../_TOCLEAN/PacketExtensions.cs | 28 +++--- .../_TOCLEAN/PlayerExtension.cs | 13 ++- .../_TOCLEAN/PlayerInteractionExtensions.cs | 3 +- .../_TOCLEAN/PlayerUiExtension.cs | 3 +- .../_TOCLEAN/QuicklistPacketExtension.cs | 2 +- .../_TOCLEAN/SpPacketExtension.cs | 11 +-- .../_TOCLEAN/SpecialistExtensions.cs | 8 +- .../_TOCLEAN/StPacketExtensions.cs | 12 +-- .../_TOCLEAN/StatCharExtensions.cs | 2 +- .../_TOCLEAN/StatPacketExtensions.cs | 8 +- .../_TOCLEAN/SuPacketExtensions.cs | 2 +- .../_TOCLEAN/TpPacketExtension.cs | 1 + .../_TOCLEAN/VisibleEntityExtensions.cs | 35 ++++---- .../Battle/Hitting/HitRequest.cs | 1 + .../Inventory/Events/InventoryMoveEvent.cs | 3 +- .../Portals/PortalComponent.cs | 1 - .../Events/RelationInvitationSendEvent.cs | 1 + .../Essentials/MapManagement/ButcherModule.cs | 2 - .../AlgorithmService.cs | 1 + .../Close/CloseDefenceAlgorithm.cs | 1 + .../Close/CloseDodgeAlgorithm.cs | 6 +- .../Damage/CriticalDistAlgorithm.cs | 5 +- .../Damage/CriticalDistRateAlgorithm.cs | 5 +- .../Damage/CriticalHitAlgortihmcs.cs | 5 +- .../Damage/CriticalHitRateAlgorithm.cs | 5 +- .../Damage/HitRateAlgorithm.cs | 7 +- .../Damage/MaxDistanceAlgorithm.cs | 5 +- .../Damage/MaxHitAlgorithm.cs | 5 +- .../Distance/RangedDefenceAlgorithm.cs | 5 +- .../Distance/RangedDodgeAlgorithm.cs | 5 +- .../ICharacterStatAlgorithm.cs | 1 + .../NosSharp.DatabasePlugin/DatabasePlugin.cs | 5 +- .../Models/Character/CharacterItemModel.cs | 3 +- .../Models/Character/CharacterModel.cs | 1 + .../Models/Families/FamilyModel.cs | 1 + .../Models/Item/ItemModel.cs | 4 +- .../Models/Map/MapPortalModel.cs | 3 +- .../Services/Character/CharacterItemDao.cs | 2 +- .../CharacterScreen/GameStartPacketHandler.cs | 6 +- .../Inventory/MviPacketHandling.cs | 2 +- .../Shops/PersonalShopCreationHandling.cs | 2 +- .../Utils/GenericSessionPacketHandlerAsync.cs | 10 ++- .../BasicPluginIoCInjector.cs | 24 +++-- .../Inventory/Inventory_ItemInfo_Handler.cs | 9 +- .../Inventory_LoadInventory_Handler.cs | 8 +- .../Inventory/Inventory_MoveItem_Handler.cs | 6 +- .../Inventory_SendDetails_Handler.cs | 6 +- .../Inventory/Inventory_WearItem_Handler.cs | 6 +- .../Specialists/Specialist_Remove_Handler.cs | 6 +- .../GuriHandlers/ReleasePetsHandler.cs | 2 +- .../ItemUpgradeHandlers/RarifyItemHandler.cs | 2 +- .../JsonGameConfiguration.cs | 5 +- .../NpcDialogHandlers/DialogHandler.cs | 12 +-- src/Toolkit/Converter/ItemDatConverter.cs | 12 +-- src/libs/SaltyEmu.Commands/CommandHandler.cs | 10 +-- vendor/ChickenAPI.Packets | 2 +- 94 files changed, 348 insertions(+), 502 deletions(-) delete mode 100644 src/ChickenAPI.Enums/Game/Items/EInfoPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Items/InventoryType.cs delete mode 100644 src/ChickenAPI.Enums/Game/Relations/CharacterRelationType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/DelayPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/EffectType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/FInsPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/GuriPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/MShopPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/MsgPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/OutPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/PJoinPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/PslPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/RlPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/SMemoPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/SayColorType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/SlPacketType.cs delete mode 100644 src/ChickenAPI.Enums/Packets/SuPacketHitMode.cs delete mode 100644 src/ChickenAPI.Enums/Packets/UpgradePacketType.cs diff --git a/src/ChickenAPI.Data/Item/ItemDto.cs b/src/ChickenAPI.Data/Item/ItemDto.cs index 9d38e681..14f2e14a 100644 --- a/src/ChickenAPI.Data/Item/ItemDto.cs +++ b/src/ChickenAPI.Data/Item/ItemDto.cs @@ -1,4 +1,6 @@ using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Data.Item { @@ -161,7 +163,7 @@ public class ItemDto : IMappedDto public byte SpType { get; set; } - public InventoryType Type { get; set; } + public PocketType Type { get; set; } public short WaitDelay { get; set; } diff --git a/src/ChickenAPI.Data/Item/ItemInstanceDto.cs b/src/ChickenAPI.Data/Item/ItemInstanceDto.cs index bc08cf62..92ebc3d0 100644 --- a/src/ChickenAPI.Data/Item/ItemInstanceDto.cs +++ b/src/ChickenAPI.Data/Item/ItemInstanceDto.cs @@ -1,6 +1,7 @@ using System; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Item { @@ -42,7 +43,7 @@ public class ItemInstanceDto : ISynchronizedDto public sbyte Rarity { get; set; } - public InventoryType Type { get; set; } + public PocketType Type { get; set; } public byte Upgrade { get; set; } diff --git a/src/ChickenAPI.Data/Map/PortalDto.cs b/src/ChickenAPI.Data/Map/PortalDto.cs index ae14b915..40178455 100644 --- a/src/ChickenAPI.Data/Map/PortalDto.cs +++ b/src/ChickenAPI.Data/Map/PortalDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Portals; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Map { diff --git a/src/ChickenAPI.Data/Relations/IRelationService.cs b/src/ChickenAPI.Data/Relations/IRelationService.cs index 5d390e1e..6c18604c 100644 --- a/src/ChickenAPI.Data/Relations/IRelationService.cs +++ b/src/ChickenAPI.Data/Relations/IRelationService.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Relations { diff --git a/src/ChickenAPI.Data/Relations/RelationDto.cs b/src/ChickenAPI.Data/Relations/RelationDto.cs index af0127d2..1769219f 100644 --- a/src/ChickenAPI.Data/Relations/RelationDto.cs +++ b/src/ChickenAPI.Data/Relations/RelationDto.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Relations { diff --git a/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs b/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs index 064305df..5d58f299 100644 --- a/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs +++ b/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Relations { diff --git a/src/ChickenAPI.Enums/Game/Items/EInfoPacketType.cs b/src/ChickenAPI.Enums/Game/Items/EInfoPacketType.cs deleted file mode 100644 index 86c8c6ac..00000000 --- a/src/ChickenAPI.Enums/Game/Items/EInfoPacketType.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace ChickenAPI.Enums.Game.Items -{ - public enum EInfoPacketType - { - WeaponDefault = 0, - MainWeaponArcher = 1, - Armor = 2, - Hat = 3, - Jewelery = 4, - MainWeaponMagician = 5, - - Specialist = 8 - // Box 7 - 11 - 12 - 13 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Items/InventoryType.cs b/src/ChickenAPI.Enums/Game/Items/InventoryType.cs deleted file mode 100644 index 5a5ddf09..00000000 --- a/src/ChickenAPI.Enums/Game/Items/InventoryType.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace ChickenAPI.Enums.Game.Items -{ - public enum InventoryType : byte - { - Equipment = 0, - Main = 1, - Etc = 2, - Miniland = 3, - Specialist = 6, - Costume = 7, - Wear = 8, - Bazaar = 9, - Warehouse = 10, - FamilyWareHouse = 11, - PetWarehouse = 12, - PartnerInventory = 13 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Relations/CharacterRelationType.cs b/src/ChickenAPI.Enums/Game/Relations/CharacterRelationType.cs deleted file mode 100644 index 66fa7837..00000000 --- a/src/ChickenAPI.Enums/Game/Relations/CharacterRelationType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace ChickenAPI.Enums.Game.Relations -{ - public enum CharacterRelationType : short - { - Blocked = -1, - Friend = 0, - HiddenSpouse = 2, - Spouse = 5 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/DelayPacketType.cs b/src/ChickenAPI.Enums/Packets/DelayPacketType.cs deleted file mode 100644 index a6ce5228..00000000 --- a/src/ChickenAPI.Enums/Packets/DelayPacketType.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum DelayPacketType - { - Button = 1, - Exploration = 2, - Locomotion = 3, - InUse = 4, - UnFreeze = 5, - Cooking = 6, - ItemInUse = 7, - Identify = 8, - OpenChest = 9, - BackToMiniland = 10, - Invocation = 11 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/EffectType.cs b/src/ChickenAPI.Enums/Packets/EffectType.cs deleted file mode 100644 index c5cb63ea..00000000 --- a/src/ChickenAPI.Enums/Packets/EffectType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum EffectType - { - Character = 1, - MateOrNpc = 2, - Monster = 3 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/FInsPacketType.cs b/src/ChickenAPI.Enums/Packets/FInsPacketType.cs deleted file mode 100644 index b9ecd67b..00000000 --- a/src/ChickenAPI.Enums/Packets/FInsPacketType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum FInsPacketType - { - Accept, - Refuse - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/GuriPacketType.cs b/src/ChickenAPI.Enums/Packets/GuriPacketType.cs deleted file mode 100644 index 871ad8cc..00000000 --- a/src/ChickenAPI.Enums/Packets/GuriPacketType.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum GuriPacketType - { - Unknow = 2, - Unknow2 = 6, - Unknow3 = 10, - Unknow4 = 15, - AfterSumming = 19 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/MShopPacketType.cs b/src/ChickenAPI.Enums/Packets/MShopPacketType.cs deleted file mode 100644 index d143ee8b..00000000 --- a/src/ChickenAPI.Enums/Packets/MShopPacketType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum MShopPacketType - { - OpenShop = 0, - CloseShop = 1, - OpenDialog = 2 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/MsgPacketType.cs b/src/ChickenAPI.Enums/Packets/MsgPacketType.cs deleted file mode 100644 index 28fbb042..00000000 --- a/src/ChickenAPI.Enums/Packets/MsgPacketType.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum ModalPacketType - { - Default = 1, - } - - public enum MsgPacketType - { - Whisper = 0, - PrivateChat = 1, - Shout = 2, - White = 3, - FamilyChat = 4 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/OutPacketType.cs b/src/ChickenAPI.Enums/Packets/OutPacketType.cs deleted file mode 100644 index c2b05648..00000000 --- a/src/ChickenAPI.Enums/Packets/OutPacketType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum OutPacketType - { - Character = 1, - MateOrNpc = 2, - Monster = 3 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/PJoinPacketType.cs b/src/ChickenAPI.Enums/Packets/PJoinPacketType.cs deleted file mode 100644 index f59b77e7..00000000 --- a/src/ChickenAPI.Enums/Packets/PJoinPacketType.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum PJoinPacketType - { - Requested = 0, - Invited = 1, - Accepted = 3, - Declined = 4, - Sharing = 5, - AcceptedShare = 6, - DeclinedShare = 7 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/PslPacketType.cs b/src/ChickenAPI.Enums/Packets/PslPacketType.cs deleted file mode 100644 index 14a10dc2..00000000 --- a/src/ChickenAPI.Enums/Packets/PslPacketType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum PslPacketType - { - Unwear, - Wear - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/RlPacketType.cs b/src/ChickenAPI.Enums/Packets/RlPacketType.cs deleted file mode 100644 index e2d64f0b..00000000 --- a/src/ChickenAPI.Enums/Packets/RlPacketType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum RlPacketType - { - Normal, - WantToRegister = 1, - WantToUnregister = 2, - MemberAndAlreadyInList = 3 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/SMemoPacketType.cs b/src/ChickenAPI.Enums/Packets/SMemoPacketType.cs deleted file mode 100644 index fe6496be..00000000 --- a/src/ChickenAPI.Enums/Packets/SMemoPacketType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum SMemoPacketType - { - SuccessPlayer = 0, - SuccessNpc = 1, - FailNpc = 2, - FailPlayer = 3 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/SayColorType.cs b/src/ChickenAPI.Enums/Packets/SayColorType.cs deleted file mode 100644 index b72239c7..00000000 --- a/src/ChickenAPI.Enums/Packets/SayColorType.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum SayColorType - { - White = 0, - PlayerSay = 1, - LightGreen = 3, - DarkGrey = 4, - RedWhisper = 5, - Blue = 6, - LightYellow = 7, - RedW = 8, - Yellow = 10, - Purple = 11, - Green = 12 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/SlPacketType.cs b/src/ChickenAPI.Enums/Packets/SlPacketType.cs deleted file mode 100644 index 7e3a03b2..00000000 --- a/src/ChickenAPI.Enums/Packets/SlPacketType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum SlPacketType - { - WearSp = 0, - ChangePoints = 10 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/SuPacketHitMode.cs b/src/ChickenAPI.Enums/Packets/SuPacketHitMode.cs deleted file mode 100644 index 602eab03..00000000 --- a/src/ChickenAPI.Enums/Packets/SuPacketHitMode.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum SuPacketHitMode : byte - { - SuccessAttack = 0, - Miss = 1, - CriticalAttack = 3 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Packets/UpgradePacketType.cs b/src/ChickenAPI.Enums/Packets/UpgradePacketType.cs deleted file mode 100644 index 579c71a7..00000000 --- a/src/ChickenAPI.Enums/Packets/UpgradePacketType.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace ChickenAPI.Enums.Packets -{ - public enum UpgradePacketType - { - #region Item - - ItemToPart = 0, - UpgradeItem = 1, // UpgradeMode.Normal, UpgradeProtection.None, hasAmulet: HasAmulet - CellonItem = 3, - RarifyItem = 7, // mode, protection - UpgradeItemProtected = 20, // UpgradeMode.Normal, UpgradeProtection.Protected, hasAmulet: HasAmulet - RarifyItemProtected = 21, // RarifyMode.Normal, RarifyProtection.Scroll - UpgradeItemGoldScroll = 43, // UpgradeMode.Reduced, UpgradeProtection.Protected, hasAmulet: hasAmulet ( Gold scroll) - FusionItem = 53, - - #endregion Item - - SumResistance = 8, - - #region Specialist - - UpgradeSpNoProtection = 9, // UpgradeProtection.None - UpgradeSpProtected = 25, // Scroll Blue or red - Need to verify - UpgradeSpProtected2 = 26, // Scroll Blue or red - Need to verify - PerfectSp = 41, - UpgradeSpChiken = 35, // Scroll Chiken - event - UpgradeSpPyjama = 38, // Scroll Pyjama - Event - UpgradeSpPirate = 42, // Scroll Pirate - Event - - #endregion Specialist - - CreateFairyFernon = 52, - CreateFairyErenia = 51, - CreateFairyZenas = 50 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs index efd3c6c9..881148c0 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs @@ -1,11 +1,11 @@ using System.Threading.Tasks; -using ChickenAPI.Core.i18n; using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._i18n; using ChickenAPI.Packets; using ChickenAPI.Packets.ClientPackets.UI; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Interfaces; using ChickenAPI.Packets.Old.Game.Server.UserInterface; using ChickenAPI.Packets.ServerPackets.UI; diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs index cc3b7c70..0fc3fd73 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs @@ -19,13 +19,13 @@ public static SayItemPacket GenerateSayItemPacket(this IPlayerEntity player, str VisualId = player.Id, VisualType = player.Type, Message = message.Replace(' ', '^'), - ItemData = item.Item.Type == InventoryType.Equipment + ItemData = item.Item.Type == PocketType.Equipment ? null : new SayItemPacket.SayItemSubPacket { - IconId = item.Item.Type == InventoryType.Equipment ? (long?)null : item.ItemId, + IconId = item.Item.Type == PocketType.Equipment ? (long?)null : item.ItemId, }, - EquipmentInfo = item.Item.Type == InventoryType.Equipment ? item.GenerateEInfoPacket() : null + EquipmentInfo = item.Item.Type == PocketType.Equipment ? item.GenerateEInfoPacket() : null }; } } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs index c5ddf506..a924d89f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs @@ -1,6 +1,8 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs index 9dc06ad4..16462fe0 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GroupPlayerExtension.cs @@ -19,17 +19,17 @@ public static PstPacket GeneratePstPacket(this IPlayerEntity entity, ref int ico return new PstPacket { - VisualType = VisualType.Player, - GroupIndex = ++iconIndex, + Type = VisualType.Player, + GroupOrder = ++iconIndex, VisualId = entity.Id, - HpPercentage = entity.HpPercentage, - HpMax = entity.HpMax, - MpPercentage = entity.MpPercentage, - MpMax = entity.MpMax, - Gender = entity.Character.Gender, - Class = entity.Character.Class, + HpLeft = entity.HpPercentage, + HpLoad = entity.HpMax, + MpLeft = entity.MpPercentage, + MpLoad = entity.MpMax, + Gender = entity.Character.Gender, // 0 + Race = (short)entity.Character.Class, // 0 Morph = entity.MorphId, - Buffs = new List(entity.Buffs.Select(s => s.Id)) + BuffIds = new List(entity.Buffs.Select(s => (int)s.Id)) }; } @@ -42,65 +42,67 @@ public static PstPacket GeneratePstPacket(this IMateEntity entity, ref int iconI return new PstPacket { - VisualType = VisualType.Player, - GroupIndex = iconIndex++, + Type = VisualType.Player, + GroupOrder = iconIndex++, VisualId = entity.Id, - HpPercentage = entity.HpPercentage, - HpMax = entity.HpMax, - MpPercentage = entity.MpPercentage, - MpMax = entity.MpMax, + HpLeft = entity.HpPercentage, + HpLoad = entity.HpMax, + MpLeft = entity.MpPercentage, + MpLoad = entity.MpMax, Gender = GenderType.Male, // 0 - Class = CharacterClassType.Adventurer, // 0 + Race = (short)CharacterClassType.Adventurer, // 0 Morph = entity.MorphId, - Buffs = new List(entity.Buffs.Select(s => s.Id)) + BuffIds = new List(entity.Buffs.Select(s => (int)s.Id)) }; } - public static PInitPacket.PInitMateSubPacket GeneratePInitSubPacket(this IMateEntity mate, ref byte groupIndex) + public static PinitSubPacket GeneratePInitSubPacket(this IMateEntity mate, ref byte groupIndex) { if (mate == null) { return null; } - return new PInitPacket.PInitMateSubPacket + return new PinitSubPacket { VisualType = mate.Type, VisualId = mate.Id, - GroupIndex = ++groupIndex, + GroupPosition = ++groupIndex, Name = mate.Mate.Name.Replace(' ', '^'), Level = mate.Level, - MorphOrNpcMonsterId = mate.MorphId == 0 ? mate.NpcMonster.Id : mate.MorphId, + Morph = (short)(mate.MorphId == 0 ? mate.NpcMonster.Id : mate.MorphId), Unknown = -1, - Unknown2 = 0 + Gender = 0, + Race = 0, + HeroLevel = 0 }; } - public static PInitPacket.PInitPlayerSubPacket GeneratePinitSubPacket(this IPlayerEntity player, ref byte groupIndex) + public static PinitSubPacket GeneratePinitSubPacket(this IPlayerEntity player, ref byte groupIndex) { if (player == null) { return null; } - return new PInitPacket.PInitPlayerSubPacket + return new PinitSubPacket() { VisualType = player.Type, VisualId = player.Id, - MorphId = player.MorphId, - GroupIndex = ++groupIndex, + Morph = player.MorphId, + GroupPosition = ++groupIndex, Name = player.Character.Name, Unknown = 0, Gender = player.Character.Gender, Level = player.Level, - Class = player.Character.Class, + Race = (short)player.Character.Class, HeroLevel = player.HeroLevel }; } public static PidxPacket GeneratePidxPacket(this IPlayerEntity player) { - List packets = new List { new PidxPacket.PidxSubPacket { CharacterId = player.Id, IsMemberOfGroup = player.HasGroup } }; + List packets = new List { new PidxSubPacket { VisualId = player.Id, IsGrouped = player.HasGroup } }; if (!player.HasGroup) { @@ -118,10 +120,10 @@ public static PidxPacket GeneratePidxPacket(this IPlayerEntity player) continue; } - packets.Add(new PidxPacket.PidxSubPacket + packets.Add(new PidxSubPacket { - CharacterId = member.Id, - IsMemberOfGroup = member.Group == player.Group // stupid as fuck ?? + VisualId = member.Id, + IsGrouped = member.Group == player.Group // stupid as fuck ?? }); } @@ -132,24 +134,22 @@ public static PidxPacket GeneratePidxPacket(this IPlayerEntity player) }; } - public static PInitPacket GeneratePInitPacket(this IPlayerEntity player) + public static PinitPacket GeneratePInitPacket(this IPlayerEntity player) { byte tmp = 0; - List mates = new List(); - List players = new List(); - mates.AddRange(player.ActualMates.Where(s => s != null)?.Select(s => s.GeneratePInitSubPacket(ref tmp)).Where(s => s != null)); + List subPackets = new List(); + subPackets.AddRange(player.ActualMates.Where(s => s != null)?.Select(s => s.GeneratePInitSubPacket(ref tmp)).Where(s => s != null)); if (player.HasGroup) { - players.AddRange(player.Group.Players.Where(s => s != null).Select(s => s.GeneratePinitSubPacket(ref tmp)).Where(s => s != null)); + subPackets.AddRange(player.Group.Players.Where(s => s != null).Select(s => s.GeneratePinitSubPacket(ref tmp)).Where(s => s != null)); } - return new PInitPacket + return new PinitPacket { - PartySize = player.Mates.Count(s => s.Mate.IsTeamMember) + player.GroupMembersCount, - MateSubPackets = mates, - PlayerSubPackets = players + GroupSize = player.Mates.Count(s => s.Mate.IsTeamMember) + player.GroupMembersCount, + PinitSubPackets = subPackets }; } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs index 39fbfe8f..36b08a3c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs @@ -4,10 +4,11 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.Extensions { @@ -27,7 +28,7 @@ public static IvnSubPacket GenerateIvnSubPacket(this ItemInstanceDto item) }; } - public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, InventoryType type) + public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, PocketType type) { ItemInstanceDto[] items = player.Inventory.GetSubInvFromInventoryType(type); @@ -43,22 +44,22 @@ public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, Inven switch (type) { - case InventoryType.Equipment: + case PocketType.Equipment: packet.IvnSubPackets.AddRange(items.Where(s => s != null).Select(s => s.GenerateIvnSubPacket())); break; - case InventoryType.Etc: - case InventoryType.Main: + case PocketType.Etc: + case PocketType.Main: packet.IvnSubPackets.AddRange(items.Where(s => s != null).Select(s => s.GenerateIvnSubPacket())); // $"{s.Slot}.{s.ItemId}.{s.Amount}.0")); break; - case InventoryType.Miniland: + case PocketType.Miniland: packet.IvnSubPackets.AddRange(items.Where(s => s != null).Select(s => s.GenerateIvnSubPacket())); // $"{s.Slot}.{s.ItemId}.{s.Amount}")); break; - case InventoryType.Wear: + case PocketType.Wear: break; } @@ -68,7 +69,7 @@ public static InvPacket GenerateInventoryPacket(this IPlayerEntity player, Inven public static short GetFirstFreeSlot(this InventoryComponent inv, IReadOnlyCollection subInventory, ItemDto source, short amount) { ItemInstanceDto item = subInventory.FirstOrDefault(x => x != null && - x.Amount + amount < GameConf.Inventory.MaxItemPerSlot && x.ItemId == source.Id && x.Item.Type != InventoryType.Equipment); + x.Amount + amount < GameConf.Inventory.MaxItemPerSlot && x.ItemId == source.Id && x.Item.Type != PocketType.Equipment); return item?.Slot ?? GetFirstFreeSlot(inv, subInventory); } @@ -124,21 +125,21 @@ public static IEnumerable GetItems(this InventoryComponent inve /// Gets the first available slot by it's inventory type /// /// - /// + /// /// Returns -1 in case it could not find any available slot - public static short GetFirstFreeSlot(this InventoryComponent inv, InventoryType inventoryType) => GetFirstFreeSlot(inv, GetSubInvFromInventoryType(inv, inventoryType)); + public static short GetFirstFreeSlot(this InventoryComponent inv, PocketType pocketType) => GetFirstFreeSlot(inv, GetSubInvFromInventoryType(inv, pocketType)); - public static ItemInstanceDto[] GetSubInvFromInventoryType(this InventoryComponent inv, InventoryType type) + public static ItemInstanceDto[] GetSubInvFromInventoryType(this InventoryComponent inv, PocketType type) { switch (type) { - case InventoryType.Wear: + case PocketType.Wear: return inv.Wear; - case InventoryType.Equipment: + case PocketType.Equipment: return inv.Equipment; - case InventoryType.Main: + case PocketType.Main: return inv.Main; - case InventoryType.Etc: + case PocketType.Etc: return inv.Etc; default: return null; @@ -150,7 +151,7 @@ public static ItemInstanceDto[] GetSubInvFromInventoryType(this InventoryCompone public static ItemInstanceDto[] GetSubInvFromItemInstance(this InventoryComponent inv, ItemInstanceDto item) => GetSubInvFromInventoryType(inv, item.Type); - public static ItemInstanceDto GetItemFromSlotAndType(this InventoryComponent inventory, short itemSlot, InventoryType equipment) + public static ItemInstanceDto GetItemFromSlotAndType(this InventoryComponent inventory, short itemSlot, PocketType equipment) { ItemInstanceDto[] subInv = inventory.GetSubInvFromInventoryType(equipment); return itemSlot >= subInv.Length ? null : subInv[itemSlot]; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs index ded5b843..0de63393 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs @@ -10,7 +10,7 @@ public static void UseItem(this InventoryComponent inventory, ItemInstanceDto it { switch (itemInstance.Item.Type) { - case InventoryType.Wear: + case PocketType.Wear: inventory.UseWear(itemInstance); break; } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs index ec87d4fb..d587eae8 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs @@ -1,50 +1,69 @@ -using ChickenAPI.Data.Item; +using System.Collections.Generic; +using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Inventory.Extensions { public static class IvnPacketExtension { - public static IvnPacket GenerateEmptyIvnPacket(this IPlayerEntity player, InventoryType type, short slot) => + public static IvnPacket GenerateEmptyIvnPacket(this IPlayerEntity player, PocketType type, short slot) => new IvnPacket { - InventoryType = type, - Slot = slot, - ItemId = -1, - Upgrade = 0, - Rare = 0, - SpStoneUpgrade = 0 + Type = type, + IvnSubPackets = new List + { + new IvnSubPacket() + { + VNum = -1, + Slot = slot, + UpgradeDesign = 0, + RareAmount = 0, + SecondUpgrade = 0, + } + } }; public static IvnPacket GenerateIvnPacket(this ItemInstanceDto itemInstance) { switch (itemInstance.Type) { - case InventoryType.Specialist: + case PocketType.Specialist: return new IvnPacket { - InventoryType = itemInstance.Type, - ItemId = itemInstance.Item.Id, - Slot = itemInstance.Slot, - Upgrade = itemInstance.Upgrade, - Rare = itemInstance.Rarity, - SpStoneUpgrade = itemInstance.SpecialistUpgrade + Type = itemInstance.Type, + IvnSubPackets = new List + { + new IvnSubPacket + { + VNum = (short)itemInstance.ItemId, + UpgradeDesign = itemInstance.Upgrade, + Slot = itemInstance.Slot, + RareAmount = itemInstance.Rarity, + SecondUpgrade = itemInstance.SpecialistUpgrade, + } + } }; - case InventoryType.Equipment: + case PocketType.Equipment: return new IvnPacket { - InventoryType = itemInstance.Type, - ItemId = itemInstance.ItemId, - Slot = itemInstance.Slot, - Rare = itemInstance.Rarity, - Upgrade = itemInstance.Upgrade + Type = itemInstance.Type, + IvnSubPackets = new List + { + new IvnSubPacket + { + VNum = (short)itemInstance.ItemId, + UpgradeDesign = itemInstance.Upgrade, + Slot = itemInstance.Slot, + RareAmount = itemInstance.Rarity, + } + } }; - - case InventoryType.Main: - case InventoryType.Etc: + case PocketType.Main: + case PocketType.Etc: return itemInstance.GenerateMainIvnPacket(); default: @@ -53,13 +72,22 @@ public static IvnPacket GenerateIvnPacket(this ItemInstanceDto itemInstance) } } - private static IvnPacket GenerateMainIvnPacket(this ItemInstanceDto itemInstance) => new IvnPacket + private static IvnPacket GenerateMainIvnPacket(this ItemInstanceDto itemInstance) { - InventoryType = itemInstance.Type, - Slot = itemInstance.Slot, - ItemId = itemInstance.ItemId, - Rare = itemInstance.Amount, - Upgrade = 0 - }; + return new IvnPacket + { + Type = itemInstance.Type, + IvnSubPackets = new List + { + new IvnSubPacket + { + VNum = (short)itemInstance.ItemId, + UpgradeDesign = 0, + Slot = itemInstance.Slot, + RareAmount = itemInstance.Amount, + } + } + }; + } } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs index 75b48ddc..12adb9ad 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs @@ -38,7 +38,7 @@ public static IEnumerable GetEntitiesPackets(this IMapLayer layer) public static IEnumerable GetPortalsPackets(this IMapLayer map) { - return map.GetEntitiesByType(VisualType.Portal)?.Select(s => s.Portal.GenerateGpPacket()); + return map.GetEntitiesByType(VisualType.Object)?.Where(s => s != null).Select(s => s.Portal.GenerateGpPacket()); } } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs index e9275607..67fdc76a 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Threading.Tasks; using Autofac; -using ChickenAPI.Core.i18n; using ChickenAPI.Core.IoC; using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Entity; @@ -12,8 +11,9 @@ using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game._i18n; -using ChickenAPI.Packets.Old.Game.Server.Mates; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Mates; +using ChickenAPI.Packets.ServerPackets.UI; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -32,7 +32,7 @@ public static async Task AddPet(this IPlayerEntity player, IMateEntity mat CharacterMateService.Save(mate.Mate); await player.BroadcastAsync(mate.GenerateInPacket()); - await player.SendPacketAsync(new PClearPacket()); + await player.SendPacketAsync(new PclearPacket()); player.Mates.Add(mate); await player.SendPacketsAsync(player.GenerateScP()); await player.SendPacketsAsync(player.GenerateScN()); diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs index 539812a8..5bfba45b 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MovablePlayerExtensions.cs @@ -1,11 +1,11 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Movements.Extensions { public static class MovablePlayerExtensions { - public static CondPacketBase GenerateCondPacket(this IPlayerEntity entity) => new CondPacketBase + public static CondPacket GenerateCondPacket(this IPlayerEntity entity) => new CondPacket { NoAttack = !entity.CanAttack, NoMove = !entity.CanMove, diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveItemExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveItemExtensions.cs index 076b55a4..385dec22 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveItemExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MoveItemExtensions.cs @@ -19,7 +19,7 @@ public static async Task MoveItem(this InventoryComponent inv, ItemInstanceDto s return; } - await player.SendPacketAsync(player.GenerateEmptyIvnPacket(args.InventoryType, args.SourceSlot)); + await player.SendPacketAsync(player.GenerateEmptyIvnPacket(args.PocketType, args.SourceSlot)); await player.SendPacketAsync(source.GenerateIvnPacket()); } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs index d2f30481..3c6132f3 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs @@ -6,6 +6,7 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Shop; namespace ChickenAPI.Game.Shops.Extensions @@ -19,9 +20,9 @@ private static List GetShopList(IEnumerable foreach (PersonalShopItem itemInfo in items) { // tmp.Append(' '); - long upgradeOrPrice = itemInfo.ItemInstance.Item.Type == InventoryType.Equipment ? itemInfo.ItemInstance.Upgrade : itemInfo.Price; - int rareOrQuantity = itemInfo.ItemInstance.Item.Type == InventoryType.Equipment ? itemInfo.ItemInstance.Rarity : itemInfo.Quantity; - double priceOrMinus = itemInfo.ItemInstance.Item.Type == InventoryType.Equipment ? itemInfo.Price : -1; + long upgradeOrPrice = itemInfo.ItemInstance.Item.Type == PocketType.Equipment ? itemInfo.ItemInstance.Upgrade : itemInfo.Price; + int rareOrQuantity = itemInfo.ItemInstance.Item.Type == PocketType.Equipment ? itemInfo.ItemInstance.Rarity : itemInfo.Quantity; + double priceOrMinus = itemInfo.ItemInstance.Item.Type == PocketType.Equipment ? itemInfo.Price : -1; tmp.Add(new NInvItemSubPacket { @@ -45,7 +46,7 @@ private static List GetShopList(IEnumerable item { double price = itemInfo.Item.ReputPrice > 0 ? itemInfo.Item.ReputPrice : itemInfo.Item.Price * percent; byte color = itemInfo.Color != 0 ? itemInfo.Item.Color : itemInfo.Item.BasicUpgrade; - int rareOrQuantity = itemInfo.Item.Type != InventoryType.Equipment ? -1 : itemInfo.Rare; + int rareOrQuantity = itemInfo.Item.Type != PocketType.Equipment ? -1 : itemInfo.Rare; } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs index 22a4d5fc..dfce6e4b 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs @@ -35,7 +35,7 @@ public static async Task FailAsync(this RarifyEvent e, IPlayerEntity player) case RarifyProtection.RedAmulet: case RarifyProtection.HeroicAmulet: case RarifyProtection.RandomHeroicAmulet: - ItemInstanceDto amulets = player.Inventory.GetItemFromSlotAndType((short)EquipmentType.Amulet, InventoryType.Wear); + ItemInstanceDto amulets = player.Inventory.GetItemFromSlotAndType((short)EquipmentType.Amulet, PocketType.Wear); if (amulets == null) { return; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs index 9197841f..aa8e3338 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs @@ -1,5 +1,6 @@ using ChickenAPI.Data.NpcMonster; using ChickenAPI.Packets.Old.Game.Client.UI; +using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Entities.Npc.Extensions { @@ -8,25 +9,27 @@ public static class NpcExtensions public static EInfoPacket GenerateEInfoPacket(this NpcMonsterDto monster) { return new EInfoPacket - { + {/* Unknown1 = 10, - MonsterVnum = monster.Id, - Level = monster.Level, - Element = monster.Element, + ItemVNum = monster.Id, + LevelMinimum = monster.Level, + Element = (byte?)monster.Element, AttackClass = monster.AttackClass, ElementRate = monster.ElementRate, - AttackUpgrade = monster.AttackUpgrade, + Upgrade = monster.AttackUpgrade, + DamageMinimum = monster.DamageMinimum, DamageMaximum = monster.DamageMaximum, Concentrate = monster.Concentrate, CriticalChance = monster.CriticalChance, CriticalRate = monster.CriticalRate, DefenceUpgrade = monster.DefenceUpgrade, - CloseDefence = monster.CloseDefence, - DefenceDodge = monster.DefenceDodge, - DistanceDefence = monster.DistanceDefence, + CloseDefense = monster.CloseDefence, + DefenseDodge = monster.DefenceDodge, + RangeDefense = monster.DistanceDefence, DistanceDefenceDodge = monster.DistanceDefenceDodge, - MagicDefence = monster.MagicDefence, + MagicDefense = monster.MagicDefence, + FireResistance = monster.FireResistance, WaterResistance = monster.WaterResistance, LightResistance = monster.LightResistance, @@ -35,6 +38,7 @@ public static EInfoPacket GenerateEInfoPacket(this NpcMonsterDto monster) MaxMp = monster.MaxMp, Unknown2 = -1, Name = monster.Name.Replace(" ", "^") + */ }; } } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs index b1d30ee1..fc9dd96a 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PacketExtensions.cs @@ -1,43 +1,43 @@ using System.Collections.Generic; using System.Linq; -using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Relations; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Relations; namespace ChickenAPI.Game.Relations.Extensions { public static class PacketExtensions { - public static FInitPacket GenerateFInitPacket(this IPlayerEntity player) + public static FinitPacket GenerateFInitPacket(this IPlayerEntity player) { - List subpackets = new List(); + List subpackets = new List(); subpackets.AddRange( player.Relations.Relation.Where(s => s != null && (s.Type == CharacterRelationType.Friend || s.Type == CharacterRelationType.Spouse))?.Select(relation => - new FInitPacket.FInitSubPacket + new FinitSubPacket { - RelationId = relation.TargetId, - RelationType = relation.Type, + CharacterId = relation.TargetId, CharacterName = relation.Name, + RelationType = relation.Type, IsOnline = true })); - return new FInitPacket + return new FinitPacket() { - Packets = subpackets + SubPackets = subpackets }; } - public static BlInitPacket GenerateBlIinitPacket(this IPlayerEntity player) + public static BlinitPacket GenerateBlIinitPacket(this IPlayerEntity player) { - List subPackets = new List(); + List subPackets = new List(); - subPackets.AddRange(player.Relations.Relation.Where(s => s?.Type == CharacterRelationType.Blocked).Select(relation => new BlInitPacket.BlInitSubPacket + subPackets.AddRange(player.Relations.Relation.Where(s => s?.Type == CharacterRelationType.Blocked).Select(relation => new BlinitSubPacket { - CharacterId = relation.TargetId, + RelatedCharacterId = relation.TargetId, CharacterName = relation.Name })); - return new BlInitPacket + return new BlinitPacket() { SubPackets = subPackets }; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs index 5d127efd..541ee194 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs @@ -21,7 +21,7 @@ using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Server.UserInterface; using ChickenAPI.Packets.ServerPackets.Player; -using SayColorType = ChickenAPI.Enums.Packets.SayColorType; +using ChickenAPI.Packets.ServerPackets.UI; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -35,8 +35,8 @@ public static async Task ChangeClass(this IPlayerEntity player, CharacterClassTy { player.JobLevel = 1; player.JobLevelXp = 0; - await player.SendPacketAsync(new NpInfoPacket { UnKnow = 0 }); - await player.SendPacketAsync(new PClearPacket()); + await player.SendPacketAsync(new NpInfoPacket { Page = 0 }); + await player.SendPacketAsync(new PclearPacket()); if (type == CharacterClassType.Adventurer) { @@ -71,12 +71,11 @@ public static async Task ChangeClass(this IPlayerEntity player, CharacterClassTy await player.BroadcastAsync(player.GenerateEffectPacket(6)); await player.BroadcastAsync(player.GenerateEffectPacket(196)); - SkillComponent component = player.SkillComponent; - foreach (SkillDto skill in component.Skills.Values) + foreach (SkillDto skill in player.Skills.Values) { if (skill.Id >= 200) { - component.Skills.Remove(skill.Id); + player.Skills.Remove(skill.Id); } } @@ -122,7 +121,7 @@ public static async Task ChangeGender(this IPlayerEntity player, GenderType type public static async Task NotifyRarifyResult(this IPlayerEntity player, sbyte rare) { - await player.SendMessageAsync(PlayerMessages.UPGRADE_RARIFY_SUCCESS, MsgPacketType.Whisper); + await player.SendMessageAsync(PlayerMessages.UPGRADE_RARIFY_SUCCESS, MessageType.White); await player.SendPacketAsync(player.GenerateSayPacket("RARIFY_SUCCESS " + rare, SayColorType.Green)); await player.BroadcastAsync(player.GenerateEffectPacket(3005)); await player.SendPacketAsync(player.GenerateShopEndPacket(ShopEndPacketType.CloseSubWindow)); diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs index f5c800b6..38e16eea 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs @@ -5,13 +5,12 @@ using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Chats; using ChickenAPI.Packets.ServerPackets.UI; -using SayColorType = ChickenAPI.Enums.Packets.SayColorType; namespace ChickenAPI.Game.Entities.Player.Extensions { public static class PlayerInteractionExtensions { - public static Task SendMessageAsync(this IPlayerEntity player, PlayerMessages message, MsgPacketType type) + public static Task SendMessageAsync(this IPlayerEntity player, PlayerMessages message, MessageType type) { return player.SendPacketAsync(player.GenerateMsgPacket(message, type)); } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs index 2cb7ab15..35409b64 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs @@ -8,6 +8,7 @@ using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game.Relations.Extensions; using ChickenAPI.Game.Skills.Extensions; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -49,7 +50,7 @@ public static Task ActualizeUiReputation(this IPlayerEntity player) => /// /// /// - public static Task ActualizeUiInventorySlot(this IPlayerEntity player, InventoryType type, short slot) + public static Task ActualizeUiInventorySlot(this IPlayerEntity player, PocketType type, short slot) { ItemInstanceDto tmp = player.Inventory.GetItemFromSlotAndType(slot, type); diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs index b3fe5df4..4f565dba 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QuicklistPacketExtension.cs @@ -3,7 +3,7 @@ using System.Text; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Skills.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs index a983954a..74ed1539 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpPacketExtension.cs @@ -2,7 +2,7 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Game.Configuration; -using ChickenAPI.Packets.Old.Game.Client.Specialists; +using ChickenAPI.Packets.ServerPackets.Specialists; namespace ChickenAPI.Game.Entities.Player.Extensions { @@ -16,12 +16,13 @@ public static SpPacket GenerateSpPacket(this IPlayerEntity player) { return null; } + return new SpPacket { - AdditionalPoints = player.Character.SpAdditionPoint, - MaxAdditionalPoints = Configuration.SpMaxAdditionalPoints, - Points = player.Character.SpPoint, - MaxDailyPoints = Configuration.SpMaxDailyPoints + AdditionalPoint = player.Character.SpAdditionPoint, + MaxAdditionalPoint = (int)Configuration.SpMaxAdditionalPoints, + SpPoint = player.Character.SpPoint, + MaxSpPoint = (int)Configuration.SpMaxDailyPoints }; } } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs index e40c20fe..cededb79 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SpecialistExtensions.cs @@ -1,7 +1,7 @@ using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game.Entities.Player; using System.Threading.Tasks; -using ChickenAPI.Packets.Old.Game.Server.Specialist; +using ChickenAPI.Packets.ServerPackets.Specialists; namespace ChickenAPI.Game.Specialists.Extensions { @@ -16,16 +16,16 @@ public static void SetMorph(this IMorphableEntity entity, short id) entity.MorphId = id; } - public static Task SendSdAsync(this IPlayerEntity player, int cooldown) + public static Task SendSdAsync(this IPlayerEntity player, short cooldown) { return player.SendPacketAsync(player.GenerateSdPacket(cooldown)); } - public static SdPacket GenerateSdPacket(this IPlayerEntity player, int cooldown) + public static SdPacket GenerateSdPacket(this IPlayerEntity player, short cooldown) { return new SdPacket { - CoolDown = cooldown + Cooldown = cooldown }; } } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs index a4362d6f..3c4efad3 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StPacketExtensions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Packets.Old.Game.Server.Entities; +using ChickenAPI.Packets.ServerPackets.Entities; namespace ChickenAPI.Game.Entities.Extensions { @@ -10,15 +10,15 @@ public static class StPacketExtensions public static StPacket GenerateStPacket(this IBattleEntity battle) => new StPacket { - VisualType = battle.Type, + Type = battle.Type, VisualId = battle.Id, Level = battle.Level, - HeroLevel = battle.HeroLevel, + HeroLvl = battle.HeroLevel, HpPercentage = battle.HpPercentage, MpPercentage = battle.MpPercentage, - Hp = battle.Hp, - Mp = battle.Mp, - CardIds = new List(battle.Buffs.Select(s => s.Id)) + CurrentHp = battle.Hp, + CurrentMp = battle.Mp, + BuffIds = new List(battle.Buffs.Select(s => (short)s.Id)) }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs index d1f4b0d5..163a963a 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Server.Player; namespace ChickenAPI.Game.Entities.Player.Extensions diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs index a5e66ca9..e5e69034 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Extensions { @@ -9,11 +9,11 @@ public static StatPacket GenerateStatPacket(this IPlayerEntity player) => new StatPacket { Hp = player.Hp, - HpMax = player.HpMax, + HpMaximum = player.HpMax, Mp = player.Mp, - MpMax = player.MpMax, + MpMaximum = player.MpMax, Unknown = 0, - CharacterOption = 0 + Option = 0, }; } } \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs index 61b8310d..3d29798c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SuPacketExtensions.cs @@ -1,6 +1,6 @@ using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; -using ChickenAPI.Packets.Old.Game.Server.Battle; +using ChickenAPI.Packets.ServerPackets.Battle; namespace ChickenAPI.Game.Battle.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs index 4344cb1b..b504900e 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs @@ -5,6 +5,7 @@ using ChickenAPI.Game.Movements; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Entities; namespace ChickenAPI.Game.Entities.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs index 0e5a065c..3583f4b4 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs @@ -1,7 +1,5 @@ using System; using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Drop; using ChickenAPI.Game.Entities.Mates; using ChickenAPI.Game.Entities.Monster; @@ -9,9 +7,10 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Old.Game.Server.Entities; -using ChickenAPI.Packets.Old.Game.Server.MiniMap; -using ChickenAPI.Packets.Old.Game.Server.Visibility; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Entities; +using ChickenAPI.Packets.ServerPackets.Minimap; +using ChickenAPI.Packets.ServerPackets.Visibility; namespace ChickenAPI.Game.Inventory.Extensions { @@ -24,10 +23,10 @@ private static InPacket GenerateInMonster(IMonsterEntity monster) { VisualType = VisualType.Monster, Name = npcMonster.Id.ToString(), - TransportId = monster.MapMonster.Id.ToString(), + VisualId = monster.MapMonster.Id, PositionX = monster.Position.X, PositionY = monster.Position.Y, - DirectionType = monster.DirectionType, + Direction = (byte?)monster.DirectionType, InMonsterSubPacket = new InMonsterSubPacket { HpPercentage = monster.HpPercentage, @@ -70,7 +69,7 @@ public static InPacket GenerateInPacket(this IEntity entity) case IMateEntity mate: return GenerateInMate(mate); - case ItemDropEntity drop: + case IDropEntity drop: return GenerateInDrop(drop); default: @@ -80,8 +79,8 @@ public static InPacket GenerateInPacket(this IEntity entity) public static OutPacket GenerateOutPacket(this IEntity entity) => new OutPacket { - Type = entity.Type, - EntityId = entity.Id + VisualType = entity.Type, + VisualId = entity.Id }; private static InPacket GenerateInMate(IMateEntity mate) => @@ -89,10 +88,10 @@ private static InPacket GenerateInMate(IMateEntity mate) => { VisualType = VisualType.Npc, Name = mate.Mate.NpcMonsterId.ToString(), - TransportId = mate.Id.ToString(), + VisualId = mate.Id, PositionX = mate.Position.X, PositionY = mate.Position.Y, - DirectionType = mate.DirectionType, + Direction = (byte?)mate.DirectionType, InMateSubPacket = new InMateSubPacket { HpPercentage = mate.HpPercentage, @@ -156,7 +155,7 @@ private static InPacket GenerateInDrop(IDropEntity drop) => { VisualType = drop.Type, Name = drop.ItemVnum.ToString(), - TransportId = drop.Id.ToString(), + VisualId = drop.Id, PositionX = drop.Position.X, PositionY = drop.Position.Y, Amount = drop.Quantity, @@ -173,11 +172,11 @@ private static InPacket GenerateInPlayer(IPlayerEntity player) => { VisualType = VisualType.Player, Name = player.Character.Name, - TransportId = "-", - VNum = player.Character.Id, + VNum = "-", + VisualId = player.Id, PositionX = player.Position.X, PositionY = player.Position.Y, - DirectionType = player.DirectionType, + Direction = (byte?)player.DirectionType, InCharacterSubPacket = new InCharacterSubPacketBase { NameAppearance = player.NameAppearance, @@ -214,8 +213,8 @@ private static InPacket GenerateInPlayer(IPlayerEntity player) => } }; - public static AtPacketBase GenerateAtPacket(this IPlayerEntity player) => - new AtPacketBase + public static AtPacket GenerateAtPacket(this IPlayerEntity player) => + new AtPacket { CharacterId = player.Character.Id, MapId = Convert.ToInt16(player.CurrentMap.Map.Id), diff --git a/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs b/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs index e8181b04..14a0490a 100644 --- a/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs +++ b/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs @@ -3,6 +3,7 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Battle.Interfaces; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Battle.Hitting { diff --git a/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs b/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs index 03e773d0..a2c75e21 100644 --- a/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs +++ b/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs @@ -1,11 +1,12 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Inventory.Events { public class InventoryMoveEvent : GameEntityEvent { - public InventoryType InventoryType { get; set; } + public PocketType PocketType { get; set; } public short SourceSlot { get; set; } diff --git a/src/ChickenAPI.Game/Portals/PortalComponent.cs b/src/ChickenAPI.Game/Portals/PortalComponent.cs index f9534f2d..3438470e 100644 --- a/src/ChickenAPI.Game/Portals/PortalComponent.cs +++ b/src/ChickenAPI.Game/Portals/PortalComponent.cs @@ -1,5 +1,4 @@ using ChickenAPI.Data.Map; -using ChickenAPI.Enums.Game.Portals; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs b/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs index f2c1d02d..5a2fb2cb 100644 --- a/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs +++ b/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs @@ -1,5 +1,6 @@ using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Relations.Events { diff --git a/src/Plugins/Essentials/MapManagement/ButcherModule.cs b/src/Plugins/Essentials/MapManagement/ButcherModule.cs index d490e2a5..ef59f8c7 100644 --- a/src/Plugins/Essentials/MapManagement/ButcherModule.cs +++ b/src/Plugins/Essentials/MapManagement/ButcherModule.cs @@ -4,8 +4,6 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Packets; -using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Monster; diff --git a/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs b/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs index 04cb56d2..1e41baff 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs @@ -1,5 +1,6 @@ using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms; using SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Close; using SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage; diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs index cdb669ed..30f4113f 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Close { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDodgeAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDodgeAlgorithm.cs index 72c7bc94..c5872260 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDodgeAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDodgeAlgorithm.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Close { @@ -9,7 +9,7 @@ public class CloseDodgeAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) @@ -18,7 +18,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = i + 12; // approx _stats[(int)CharacterClassType.Magician, i] = i + 24; // approx _stats[(int)CharacterClassType.Archer, i] = i + 41; // approx - _stats[(int)CharacterClassType.Wrestler, i] = i + 12; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = i + 12; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs index 949cf2fb..d4bd5562 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class CriticalDistAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _criticalDist = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _criticalDist = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _criticalDist[(int)CharacterClassType.Swordman, i] = 0; // approx _criticalDist[(int)CharacterClassType.Magician, i] = 0; // sure _criticalDist[(int)CharacterClassType.Archer, i] = 0; // sure - _criticalDist[(int)CharacterClassType.Wrestler, i] = 0; // sure + _criticalDist[(int)CharacterClassType.MartialArtist, i] = 0; // sure } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs index 3ab2c6cd..f16f8e99 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class CriticalDistRateAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _criticalDistRate = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _criticalDistRate = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _criticalDistRate[(int)CharacterClassType.Swordman, i] = 0; // approx _criticalDistRate[(int)CharacterClassType.Magician, i] = 0; // sure _criticalDistRate[(int)CharacterClassType.Archer, i] = 0; // sure - _criticalDistRate[(int)CharacterClassType.Wrestler, i] = 0; // sure + _criticalDistRate[(int)CharacterClassType.MartialArtist, i] = 0; // sure } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs index 4ef4486e..6e369a19 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class CriticalHitAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _criticalHit = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _criticalHit = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _criticalHit[(int)CharacterClassType.Swordman, i] = 0; // approx _criticalHit[(int)CharacterClassType.Magician, i] = 0; // sure _criticalHit[(int)CharacterClassType.Archer, i] = 0; // sure - _criticalHit[(int)CharacterClassType.Wrestler, i] = 0; // sure + _criticalHit[(int)CharacterClassType.MartialArtist, i] = 0; // sure } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs index fa543d40..2c748d56 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class CriticalHitRateAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _criticalHitRate = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _criticalHitRate = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _criticalHitRate[(int)CharacterClassType.Swordman, i] = 0; // approx _criticalHitRate[(int)CharacterClassType.Magician, i] = 0; // sure _criticalHitRate[(int)CharacterClassType.Archer, i] = 0; // sure - _criticalHitRate[(int)CharacterClassType.Wrestler, i] = 0; // sure + _criticalHitRate[(int)CharacterClassType.MartialArtist, i] = 0; // sure } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs index 6096be33..bb761af1 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class HitRateAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _hitRate = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _hitRate = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -19,8 +20,8 @@ public void Initialize() _hitRate[(int)CharacterClassType.Magician, i] = 0; // sure _hitRate[(int)CharacterClassType.Archer, 1] = 41; _hitRate[(int)CharacterClassType.Archer, i] += add; // approx - _hitRate[(int)CharacterClassType.Wrestler, 1] = 41; - _hitRate[(int)CharacterClassType.Wrestler, i] += add; // approx + _hitRate[(int)CharacterClassType.MartialArtist, 1] = 41; + _hitRate[(int)CharacterClassType.MartialArtist, i] += add; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs index f4a1763c..66b98430 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class MaxDistanceAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _maxDist = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _maxDist = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _maxDist[(int)CharacterClassType.Swordman, i] = i + 12; // approx _maxDist[(int)CharacterClassType.Magician, i] = 14 + i; // approx _maxDist[(int)CharacterClassType.Archer, i] = 2 * i; // approx - _maxDist[(int)CharacterClassType.Wrestler, i] = 2 * i; // approx + _maxDist[(int)CharacterClassType.MartialArtist, i] = 2 * i; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs index d893c0c7..652e6c82 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class MaxHitAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _maxHit = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _maxHit = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _maxHit[(int)CharacterClassType.Swordman, i] = (2 * i) + 5; // approx Numbers n such that 10n+9 is prime. _maxHit[(int)CharacterClassType.Magician, i] = (2 * i) + 9; // approx Numbers n such that n^2 is of form x^2+40y^2 with positive x,y. _maxHit[(int)CharacterClassType.Archer, i] = 9 + (i * 3); // approx - _maxHit[(int)CharacterClassType.Wrestler, i] = 9 + (i * 3); // nop + _maxHit[(int)CharacterClassType.MartialArtist, i] = 9 + (i * 3); // nop } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs index 42d3e100..dadcf34b 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Distance { @@ -9,7 +10,7 @@ public class RangedDefenceAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) @@ -18,7 +19,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = i; // approx _stats[(int)CharacterClassType.Magician, i] = i + 20; // approx _stats[(int)CharacterClassType.Archer, i] = i; // approx - _stats[(int)CharacterClassType.Wrestler, i] = i; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = i; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs index 00a07a95..6e76ca5e 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Distance { @@ -9,7 +10,7 @@ public class RangedDodgeAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist +1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) @@ -18,7 +19,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = i + 12; // approx _stats[(int)CharacterClassType.Magician, i] = i + 14; // approx _stats[(int)CharacterClassType.Archer, i] = i + 2; // approx - _stats[(int)CharacterClassType.Wrestler, i] = i + 12; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = i + 12; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs index ebc330b8..7722afa6 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms { diff --git a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs index 7889d96e..bbedb33d 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs @@ -1,19 +1,22 @@ using System; using System.Data.SqlClient; +using ChickenAPI.Core.Configurations; using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; using ChickenAPI.Core.Plugins.Exceptions; using ChickenAPI.Core.Utils; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; using SaltyEmu.DatabasePlugin.Configuration; using SaltyEmu.DatabasePlugin.Context; using SaltyEmu.DatabasePlugin.Utils; +using ILogger = ChickenAPI.Core.Logging.ILogger; namespace SaltyEmu.DatabasePlugin { public class DatabasePlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); + private readonly ILogger Log; private readonly string _configurationFilePath = $"plugins/config/{nameof(DatabasePlugin)}/conf.json"; private DatabaseConfiguration _configuration; public PluginEnableTime EnableTime => PluginEnableTime.PreContainerBuild; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs index 81f612a4..fb75d7f6 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs @@ -5,6 +5,7 @@ using ChickenAPI.Data; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Item; @@ -32,7 +33,7 @@ public class CharacterItemModel : ISynchronizedModel public short Slot { get; set; } - public InventoryType Type { get; set; } + public PocketType Type { get; set; } public byte Design { get; set; } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs index 438f24d3..a669b763 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; namespace SaltyEmu.DatabasePlugin.Models.Character diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs index 0c44c372..55df694e 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Families; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Character; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs index c79b7070..273fd74f 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs @@ -3,10 +3,12 @@ using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.BCard; using SaltyEmu.DatabasePlugin.Models.Character; using SaltyEmu.DatabasePlugin.Models.Shop; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.DatabasePlugin.Models.Item { @@ -159,7 +161,7 @@ public class ItemModel : IMappedModel public byte SpType { get; set; } - public InventoryType Type { get; set; } + public PocketType Type { get; set; } public short WaitDelay { get; set; } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapPortalModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapPortalModel.cs index 26fdc055..80e5fc16 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapPortalModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapPortalModel.cs @@ -1,6 +1,5 @@ using System.ComponentModel.DataAnnotations.Schema; -using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Portals; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; namespace SaltyEmu.DatabasePlugin.Models.Map diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs index 46aaa874..bd1f65d6 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs @@ -38,7 +38,7 @@ public async Task> GetWearByCharacterIdAsync(long c { try { - return (await DbSet.Where(s => s.CharacterId == characterId && s.Item.Type == InventoryType.Wear).ToArrayAsync()).Select(Mapper.Map).ToArray(); + return (await DbSet.Where(s => s.CharacterId == characterId && s.Item.Type == PocketType.Wear).ToArrayAsync()).Select(Mapper.Map).ToArray(); } catch (Exception e) { diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs index b048e4d2..c9659544 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Enums.Packets; @@ -10,8 +11,10 @@ using ChickenAPI.Game.Managers; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._Network; +using ChickenAPI.Game.Entities.Mates; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Server.UserInterface; using ChickenAPI.Packets.ServerPackets.Map; using ChickenAPI.Packets.ServerPackets.Player; @@ -32,7 +35,8 @@ public class GameStartPacketHandler : GenericSessionPacketHandlerAsync protected override Task Handle(MviPacket packet, IPlayerEntity player) => player.EmitEventAsync(new InventoryMoveEvent { - InventoryType = packet.InventoryType, + PocketType = packet.InventoryType, Amount = packet.Amount, SourceSlot = packet.InventorySlot, DestinationSlot = packet.DestinationSlot diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs index 4aecb09d..5411afcc 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs @@ -65,7 +65,7 @@ private static ShopPlayerShopCreateEvent ParseMShopPacket(string data, IPlayerEn }; string[] packetsplit = data.Split(' '); - InventoryType[] type = new InventoryType[20]; + PocketType[] type = new PocketType[20]; long[] gold = new long[20]; short[] slot = new short[20]; byte[] qty = new byte[20]; diff --git a/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs b/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs index 330396d8..bd169373 100644 --- a/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs +++ b/src/Plugins/NosSharp.PacketHandler/Utils/GenericSessionPacketHandlerAsync.cs @@ -1,14 +1,18 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; using ChickenAPI.Game._Network; -using ChickenAPI.Packets; -using ChickenAPI.Packets.Old; +using ChickenAPI.Packets.Interfaces; namespace NW.Plugins.PacketHandling.Utils { public abstract class GenericSessionPacketHandlerAsync : IPacketProcessor where T : class, IPacket { - protected readonly Logger Log = Logger.GetLogger(); + protected readonly ILogger Log; + + protected GenericSessionPacketHandlerAsync(ILogger log) + { + Log = log; + } public Task Handle(IPacket packet, ISession session) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs index 8d9ed5b7..e688e1b4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Autofac; +using ChickenAPI.Core.Configurations; using ChickenAPI.Core.Events; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; @@ -23,6 +24,7 @@ using ChickenAPI.Game.NpcDialog; using ChickenAPI.Game._ECS; using ChickenAPI.Game._Network; +using Newtonsoft.Json; using SaltyEmu.BasicPlugin.BCardHandlers; using SaltyEmu.BasicPlugin.EventHandlers.Battle; using SaltyEmu.BasicPlugin.EventHandlers.Guri; @@ -37,8 +39,6 @@ namespace SaltyEmu.BasicPlugin { public class BasicPluginIoCInjector { - private static readonly Logger Log = Logger.GetLogger(); - public static void InitializeEventHandlers() { // first version hardcoded, next one through Plugin + Assembly Reflection @@ -60,7 +60,7 @@ public static void InitializeEventHandlers() } catch (Exception e) { - Log.Error("[EVENT_HANDLER]", e); + // Log.Error("[EVENT_HANDLER]", e); // ignored } } @@ -84,7 +84,7 @@ public static void InitializeNpcDialogHandlers() } catch (Exception e) { - Log.Error("[ITEM_USAGE_HANDLER_REGISTRATION]", e); + // Log.Error("[ITEM_USAGE_HANDLER_REGISTRATION]", e); } } } @@ -107,22 +107,30 @@ public static void InitializeItemUsageHandlers() } catch (Exception e) { - Log.Error("[ITEM_USAGE_HANDLER_REGISTRATION]", e); + // Log.Error("[ITEM_USAGE_HANDLER_REGISTRATION]", e); } } } + public class ConfigurationSerializer : IConfigurationSerializer + { + public string Serialize(T conf) where T : IConfiguration => JsonConvert.SerializeObject(conf); + + public T Deserialize(string buffer) where T : IConfiguration => JsonConvert.DeserializeObject(buffer); + } + public static void InjectDependencies() { + var config = new ConfigurationHelper(new ConfigurationSerializer()); ChickenContainer.Builder.Register(_ => - ConfigurationHelper.Load($"plugins/config/{nameof(BasicPlugin)}/rates.json", true)) + config.Load($"plugins/config/{nameof(BasicPlugin)}/rates.json", true)) .As().SingleInstance(); // packet handlers ChickenContainer.Builder.Register(_ => new BasicPacketPipelineAsync()).As().SingleInstance(); // event handlers - ChickenContainer.Builder.Register(_ => new BasicEventPipelineAsync()).As().SingleInstance(); + ChickenContainer.Builder.Register(_ => new BasicEventPipelineAsync(_.Resolve())).As().SingleInstance(); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(BasicPlugin).Assembly).AsClosedTypesOf(typeof(GenericEventPostProcessorBase<>)).PropertiesAutowired(); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(BasicPlugin).Assembly).Where(s => s.ImplementsInterface()).PropertiesAutowired().AsSelf(); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(BasicPlugin).Assembly).Where(s => s.ImplementsInterface()).PropertiesAutowired().AsSelf(); @@ -151,7 +159,7 @@ public static void InjectDependencies() ChickenContainer.Builder.Register(_ => new SimpleEntityManagerContainer()).As().SingleInstance(); // player manager ChickenContainer.Builder.Register(_ => new SimplePlayerManager()).As().SingleInstance(); - ChickenContainer.Builder.Register(_ => new CommandHandler()).As().SingleInstance(); + ChickenContainer.Builder.Register(context => new CommandHandler(context.Resolve())).As().SingleInstance(); ChickenContainer.Builder.Register(_ => new BasicUpgradeHandler()).As().SingleInstance(); } } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs index 323f328d..c4a076ea 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs @@ -7,6 +7,7 @@ using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { @@ -27,7 +28,7 @@ protected override async Task Handle(InventoryEqInfoEvent eqInfo, CancellationTo switch (eqInfo.Type) { case 0: - subInv = inventory.GetSubInvFromInventoryType(InventoryType.Wear); + subInv = inventory.GetSubInvFromInventoryType(PocketType.Wear); if (eqInfo.Slot > subInv.Length) { return; @@ -37,7 +38,7 @@ protected override async Task Handle(InventoryEqInfoEvent eqInfo, CancellationTo break; case 1: - subInv = inventory.GetSubInvFromInventoryType(InventoryType.Equipment); + subInv = inventory.GetSubInvFromInventoryType(PocketType.Equipment); if (eqInfo.Slot > subInv.Length) { return; @@ -48,7 +49,7 @@ protected override async Task Handle(InventoryEqInfoEvent eqInfo, CancellationTo case 7: case 10: - subInv = inventory.GetSubInvFromInventoryType(InventoryType.Specialist); + subInv = inventory.GetSubInvFromInventoryType(PocketType.Specialist); if (eqInfo.Slot > subInv.Length) { return; @@ -58,7 +59,7 @@ protected override async Task Handle(InventoryEqInfoEvent eqInfo, CancellationTo break; case 11: - subInv = inventory.GetSubInvFromInventoryType(InventoryType.Costume); + subInv = inventory.GetSubInvFromInventoryType(PocketType.Costume); if (eqInfo.Slot > subInv.Length) { return; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs index 2688235e..d63c8f4a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs @@ -39,19 +39,19 @@ protected override async Task Handle(InventoryLoadEvent e, CancellationToken can { switch (item.Type) { - case InventoryType.Equipment: + case PocketType.Equipment: inventory.Equipment[item.Slot] = item; break; - case InventoryType.Etc: + case PocketType.Etc: inventory.Etc[item.Slot] = item; break; - case InventoryType.Wear: + case PocketType.Wear: inventory.Wear[item.Slot] = item; break; - case InventoryType.Main: + case PocketType.Main: inventory.Main[item.Slot] = item; break; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs index 94f7540f..8822a2dc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs @@ -29,15 +29,15 @@ protected override async Task Handle(InventoryMoveEvent args, CancellationToken } InventoryComponent inv = player.Inventory; - ItemInstanceDto source = inv.GetSubInvFromInventoryType(args.InventoryType)[args.SourceSlot]; - ItemInstanceDto dest = inv.GetSubInvFromInventoryType(args.InventoryType)[args.DestinationSlot]; + ItemInstanceDto source = inv.GetSubInvFromInventoryType(args.PocketType)[args.SourceSlot]; + ItemInstanceDto dest = inv.GetSubInvFromInventoryType(args.PocketType)[args.DestinationSlot]; if (source == null) { return; } - if (dest != null && (args.InventoryType == InventoryType.Main || args.InventoryType == InventoryType.Etc) && dest.ItemId == source.ItemId && + if (dest != null && (args.PocketType == PocketType.Main || args.PocketType == PocketType.Etc) && dest.ItemId == source.ItemId && dest.Amount + source.Amount > _gameConfiguration.Inventory.MaxItemPerSlot) { // if both source & dest are stackable && slots combined are > max slots diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs index 138f5812..386ef609 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs @@ -18,9 +18,9 @@ protected override async Task Handle(InventoryRequestDetailsEvent e, Cancellatio } - await player.SendPacketAsync(player.GenerateInventoryPacket(InventoryType.Equipment)); - await player.SendPacketAsync(player.GenerateInventoryPacket(InventoryType.Main)); - await player.SendPacketAsync(player.GenerateInventoryPacket(InventoryType.Etc)); + await player.SendPacketAsync(player.GenerateInventoryPacket(PocketType.Equipment)); + await player.SendPacketAsync(player.GenerateInventoryPacket(PocketType.Main)); + await player.SendPacketAsync(player.GenerateInventoryPacket(PocketType.Etc)); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs index 7c3db13d..a6c7f121 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs @@ -24,7 +24,7 @@ protected override async Task Handle(InventoryWearEvent e, CancellationToken can var inventory = player.Inventory; - ItemInstanceDto item = inventory.GetItemFromSlotAndType(e.InventorySlot, InventoryType.Equipment); + ItemInstanceDto item = inventory.GetItemFromSlotAndType(e.InventorySlot, PocketType.Equipment); if (item == null) { return; @@ -69,7 +69,7 @@ private async Task EquipItem(InventoryComponent inventory, IInventoriedEntity en // todo refacto to "MoveSlot" method inventory.Equipment[itemToEquip.Slot] = alreadyEquipped; alreadyEquipped.Slot = itemToEquip.Slot; - alreadyEquipped.Type = InventoryType.Equipment; + alreadyEquipped.Type = PocketType.Equipment; } else { @@ -83,7 +83,7 @@ private async Task EquipItem(InventoryComponent inventory, IInventoriedEntity en inventory.Wear[(int)itemToEquip.Item.EquipmentSlot] = itemToEquip; itemToEquip.Slot = (short)itemToEquip.Item.EquipmentSlot; - itemToEquip.Type = InventoryType.Wear; + itemToEquip.Type = PocketType.Wear; if (alreadyEquipped == null) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs index 74ca8312..2c35bfc4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Packets; @@ -14,6 +15,7 @@ using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game.Specialists.Args; using ChickenAPI.Game.Specialists.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Specialists { @@ -21,7 +23,7 @@ public class Specialist_Remove_Handler : GenericEventPostProcessorBase i.Type == InventoryType.Wear)) + /* if (Session.Character.Inventory.All(i => i.Type == PocketType.Wear)) { await session.SendPacketAsync(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("EQ_NOT_EMPTY"), 0)); return; } - Session.Character.Inventory.AddNewToInventory((short)(4 + (packet.Type * 14)), type: InventoryType.Wear); - Session.Character.Inventory.AddNewToInventory((short)(81 + (packet.Type * 13)), type: InventoryType.Wear); + Session.Character.Inventory.AddNewToInventory((short)(4 + (packet.Type * 14)), type: PocketType.Wear); + Session.Character.Inventory.AddNewToInventory((short)(81 + (packet.Type * 13)), type: PocketType.Wear); switch (packet.Type) { case 1: - Session.Character.Inventory.AddNewToInventory(68, type: InventoryType.Wear); + Session.Character.Inventory.AddNewToInventory(68, type: PocketType.Wear); Session.Character.Inventory.AddNewToInventory(2082, 10); break; case 2: - Session.Character.Inventory.AddNewToInventory(78, type: InventoryType.Wear); + Session.Character.Inventory.AddNewToInventory(78, type: PocketType.Wear); Session.Character.Inventory.AddNewToInventory(2083, 10); break; case 3: - Session.Character.Inventory.AddNewToInventory(86, type: InventoryType.Wear); + Session.Character.Inventory.AddNewToInventory(86, type: PocketType.Wear); break; default: diff --git a/src/Toolkit/Converter/ItemDatConverter.cs b/src/Toolkit/Converter/ItemDatConverter.cs index cde356f5..0fefbaff 100644 --- a/src/Toolkit/Converter/ItemDatConverter.cs +++ b/src/Toolkit/Converter/ItemDatConverter.cs @@ -62,23 +62,23 @@ private void DoWork(string inputDirectory) switch (Convert.ToByte(currentLine[2])) { case 4: - item.Type = InventoryType.Equipment; + item.Type = PocketType.Equipment; break; case 8: - item.Type = InventoryType.Equipment; + item.Type = PocketType.Equipment; break; case 9: - item.Type = InventoryType.Main; + item.Type = PocketType.Main; break; case 10: - item.Type = InventoryType.Etc; + item.Type = PocketType.Etc; break; default: - item.Type = (InventoryType)Enum.Parse(typeof(InventoryType), currentLine[2]); + item.Type = (PocketType)Enum.Parse(typeof(PocketType), currentLine[2]); break; } @@ -1195,7 +1195,7 @@ private void DoWork(string inputDirectory) break; } - if (item.Type == InventoryType.Miniland) + if (item.Type == PocketType.Miniland) { item.MinilandObjectPoint = int.Parse(currentLine[2]); item.EffectValue = short.Parse(currentLine[8]); diff --git a/src/libs/SaltyEmu.Commands/CommandHandler.cs b/src/libs/SaltyEmu.Commands/CommandHandler.cs index d8e7d3bf..28fbd8bd 100644 --- a/src/libs/SaltyEmu.Commands/CommandHandler.cs +++ b/src/libs/SaltyEmu.Commands/CommandHandler.cs @@ -1,9 +1,7 @@ using Autofac.Extensions.DependencyInjection; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game.Helpers; using Qmmands; using SaltyEmu.Commands.Entities; using SaltyEmu.Commands.Interfaces; @@ -12,6 +10,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.Commands { @@ -21,17 +20,16 @@ namespace SaltyEmu.Commands public class CommandHandler : ICommandContainer { private readonly CommandService _commands; - private readonly Logger _logger; + private readonly ILogger _logger; public IServiceProvider Services { get; } /// /// This class should be instanciated with our Container. /// - public CommandHandler() + public CommandHandler(ILogger logger) { - _logger = Logger.GetLogger(); - + _logger = logger; _commands = new CommandService(new CommandServiceConfiguration { CaseSensitive = false, diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index 50339231..c78e4871 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit 503392310cd006dad183dd57de3d1504e2f35ed3 +Subproject commit c78e487195bd087bc824b1ac2a87aa0ea52ccda4 From 91950f3f7a9eadfb70262b836e5ee12c80aa10bc Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 01:36:22 +0800 Subject: [PATCH 07/24] continue... --- .../CharacterAlgorithms/HpMp/MpMax.cs | 5 +++-- .../CharacterAlgorithms/HpMp/MpRegen.cs | 6 ++---- .../Services/Account/AccountDao.cs | 4 ++-- .../Services/Character/CharacterDao.cs | 3 ++- .../Utils/PluginDependencyInjector.cs | 4 +++- .../Redis/ServerApiService.cs | 5 +++-- .../Services/RelationServiceClient.cs | 12 +++++++----- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs index f178add0..a07849d2 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { @@ -9,7 +10,7 @@ public class MpMax : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; // todo improve that shit int actual = 60; @@ -32,7 +33,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = actual; _stats[(int)CharacterClassType.Magician, i] = 3 * actual; // approx _stats[(int)CharacterClassType.Archer, i] = actual + baseAdventurer; // approx - _stats[(int)CharacterClassType.Wrestler, i] = actual; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = actual; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegen.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegen.cs index 62afed18..8f0c56fe 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegen.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegen.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { @@ -21,9 +21,7 @@ public int GetStat(CharacterClassType type, byte level) return 28; case CharacterClassType.Magician: return 40; - case CharacterClassType.Wrestler: - return 50; - case CharacterClassType.Unknown: + case CharacterClassType.MartialArtist: return 50; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Account/AccountDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Account/AccountDao.cs index f9815426..1076dcf5 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Account/AccountDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Account/AccountDao.cs @@ -2,8 +2,8 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Account; -using ChickenAPI.Data.Character; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Context; @@ -13,7 +13,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Account { public class AccountDao : MappedRepositoryBase, IAccountService { - public AccountDao(DbContext dbFactory, IMapper mapper) : base(dbFactory, mapper) + public AccountDao(SaltyDbContext dbFactory, IMapper mapper, ILogger log) : base(dbFactory, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs index 6160d39c..5f03d887 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; using Microsoft.EntityFrameworkCore; @@ -16,7 +17,7 @@ public class CharacterDao : MappedRepositoryBase, { private readonly CharacterDto _baseConf; - public CharacterDao(DbContext context, IMapper mapper, CharacterDto baseConf) : base(context, mapper) => _baseConf = baseConf; + public CharacterDao(DbContext context, IMapper mapper, CharacterDto baseConf, ILogger log) : base(context, mapper, log) => _baseConf = baseConf; public IEnumerable GetActiveByAccountId(long accountId) { diff --git a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs index 65f56c58..d7159fe7 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs @@ -1,6 +1,7 @@ using Autofac; using AutoMapper; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Account; using ChickenAPI.Data.BCard; using ChickenAPI.Data.Character; @@ -12,6 +13,7 @@ using ChickenAPI.Data.Shop; using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; using Microsoft.EntityFrameworkCore; using SaltyEmu.DatabasePlugin.Context; using SaltyEmu.DatabasePlugin.Services.Account; @@ -82,7 +84,7 @@ public static void RegisterDaos() // character ChickenContainer.Builder.Register(s => new AccountDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterDao(s.Resolve(), s.Resolve(), characterConf)).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterDao(s.Resolve(), s.Resolve(), characterConf, s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new CharacterMateDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new CharacterItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new CharacterSkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/Redis/ServerApiService.cs b/src/Plugins/NosSharp.RedisSessionPlugin/Redis/ServerApiService.cs index 2791412b..e78ad736 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/Redis/ServerApiService.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/Redis/ServerApiService.cs @@ -16,11 +16,12 @@ namespace SaltyEmu.RedisWrappers.Redis public class ServerApiService : IServerApiService { private static readonly string Prefix = nameof(WorldServerDto).ToLower(); - private readonly Logger _log = Logger.GetLogger(); + private readonly ILogger _log; private readonly ICacheClient _cache; - public ServerApiService(RedisConfiguration config) + public ServerApiService(RedisConfiguration config, ILogger log) { + _log = log; var options = new RedisCacheClientOptions { ConnectionMultiplexer = ConnectionMultiplexer.Connect(config.Host), diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs b/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs index d37e6221..9fdca73e 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs +++ b/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs @@ -6,6 +6,7 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Communication.Communicators; using SaltyEmu.Communication.Configs; using SaltyEmu.FriendsPlugin.Protocol; @@ -14,20 +15,21 @@ namespace SaltyEmu.FriendsPlugin.Services { public class RelationServiceClient : IRelationService { - private readonly IIpcClient _client; - private readonly Logger _log = Logger.GetLogger(); + private readonly IRpcClient _client; + private readonly ILogger _log; - public RelationServiceClient(IIpcClient client) + public RelationServiceClient(IRpcClient client, ILogger log) { _client = client; + _log = log; } - private Task RequestAsync(IRpcSyncRequest request) where TResponse : class, ISyncRpcResponse + private Task RequestAsync(ISyncRpcRequest request) where TResponse : class, ISyncRpcResponse { return _client.RequestAsync(request); } - private Task BroadcastAsync(TPacket request) where TPacket : class, IIpcPacket + private Task BroadcastAsync(TPacket request) where TPacket : class, IAsyncRpcRequest { return _client.BroadcastAsync(request); } From 97da77cd03437f5e003580d161e7c4a6c39c0c26 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 01:39:01 +0800 Subject: [PATCH 08/24] move to Qmmands 2.3 --- src/libs/SaltyEmu.Commands/CommandHandler.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/SaltyEmu.Commands/CommandHandler.cs b/src/libs/SaltyEmu.Commands/CommandHandler.cs index 28fbd8bd..0719d798 100644 --- a/src/libs/SaltyEmu.Commands/CommandHandler.cs +++ b/src/libs/SaltyEmu.Commands/CommandHandler.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using ChickenAPI.Game.Helpers; using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.Commands @@ -43,7 +44,7 @@ public CommandHandler(ILogger logger) public async Task AddModuleAsync() where T : SaltyModuleBase { - await _commands.AddModuleAsync(); + _commands.AddModule(); IReadOnlyList readOnlyList = _commands.GetAllModules().FirstOrDefault(s => s.Type == typeof(T))?.Commands; if (readOnlyList != null) @@ -64,7 +65,7 @@ public async Task RemoveModuleAsync() where T : SaltyModuleBase throw new ArgumentException("The given module is not registered in the command container."); } - await _commands.RemoveModuleAsync(module); + _commands.RemoveModule(module); } public Module[] GetModulesByName(string name, bool caseSensitive = true) @@ -146,8 +147,8 @@ public async Task RemoveCommandAsync(Command command) builder.AddCommand(cmdBuilder); } - await _commands.RemoveModuleAsync(oldModule); - await _commands.AddModuleAsync(builder); + _commands.RemoveModule(oldModule); + _commands.AddModule(builder); } public void AddTypeParser(TypeParser typeParser) From 5fab5ec8d7d6fd911b8bb2b326b6dffa361e3e00 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 01:41:04 +0800 Subject: [PATCH 09/24] update qmmands & add dependency to Game.Extensions (SendChatMessage) --- src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj b/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj index 41b3d8e5..9662d683 100644 --- a/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj +++ b/src/libs/SaltyEmu.Commands/SaltyEmu.Commands.csproj @@ -9,10 +9,11 @@ - + + From 0416f34556fd43a28cfef76c92e9031145168cc9 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 09:01:53 +0800 Subject: [PATCH 10/24] continue migration --- .../Helpers/TeleportationHelper.cs | 1 + .../Helpers/UIHelper.cs | 14 ++- .../PacketGeneration/ChatPacketExtensions.cs | 1 + .../_TOCLEAN/CInfoPacketExtension.cs | 7 +- .../_TOCLEAN/EqPacketExtensions.cs | 38 +++--- .../_TOCLEAN/InventoryUseExtension.cs | 3 +- .../_TOCLEAN/InventoryWearPacketExtensions.cs | 26 ---- .../_TOCLEAN/NInvPacketExtensions.cs | 4 +- .../NotifyResultAndSetRarityPointExtension.cs | 8 +- .../_TOCLEAN/NpcExtensions.cs | 3 +- .../_TOCLEAN/RespawnExtensions.cs | 1 + .../_TOCLEAN/ShopPacketExtensions.cs | 3 +- .../_TOCLEAN/SkillExtensions.cs | 1 + .../_TOCLEAN/SlInfoPacketExtensions.cs | 1 + .../_TOCLEAN/VisibleEntityExtensions.cs | 115 +++++++----------- src/ChickenAPI.Game.Impl/MateEntity.cs | 3 + src/ChickenAPI.Game.Impl/MonsterEntity.cs | 4 + src/ChickenAPI.Game.Impl/NpcEntity.cs | 4 + src/ChickenAPI.Game.Impl/SkillComponent.cs | 11 +- .../Damage/MinDistanceAlgorithm.cs | 8 +- .../Damage/MinHitAlgorithm.cs | 5 +- .../Services/BCard/BCardDao.cs | 4 +- .../Services/Character/CharacterItemDao.cs | 1 + .../BasicPluginIoCInjector.cs | 7 -- .../Upgrading/Upgrading_Celloning_Handler.cs | 4 +- .../Upgrading/Upgrading_PerfectSp_Handler.cs | 4 +- .../Upgrading/Upgrading_Rarify_Handler.cs | 6 +- .../Upgrading/Upgrading_Summing_Handler.cs | 4 +- .../Upgrading_UpgradeEquipment_Handler.cs | 16 +-- .../Upgrading/Upgrading_UpgradeSp_Handler.cs | 8 +- .../ItemUpgradeHandlers/CellonItem.cs | 6 +- .../TypeParsers/ItemDtoTypeParser.cs | 4 +- .../TypeParsers/MapLayerTypeParser.cs | 4 +- .../TypeParsers/PlayerEntityTypeParser.cs | 4 +- src/libs/SaltyEmu.Core/EncodingExtensions.cs | 9 ++ src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj | 1 + 36 files changed, 163 insertions(+), 180 deletions(-) delete mode 100644 src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs diff --git a/src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs index f0197ccb..b9b81d07 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/TeleportationHelper.cs @@ -5,6 +5,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Managers; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Game.Entities.Extensions; namespace ChickenAPI.Game.Helpers { diff --git a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs index 881148c0..acf23ed4 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs @@ -3,8 +3,6 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._i18n; -using ChickenAPI.Packets; -using ChickenAPI.Packets.ClientPackets.UI; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Interfaces; using ChickenAPI.Packets.Old.Game.Server.UserInterface; @@ -18,14 +16,17 @@ public static class UIHelper public static GuriPacket GenerateGuriPacket(this IPlayerEntity player, GuriPacketType type, byte argument, int value = 0) { + return null; + /* switch (type) { case GuriPacketType.Unknow: return new GuriPacket { - Type = 2, - Argument = argument, - VisualEntityId = player.Id + Type = (GuriPacketType)2, + EntityId = player.Id, + Unknown = argument, + Value = (uint)value, }; case GuriPacketType.Unknow2: @@ -65,6 +66,7 @@ public static GuriPacket GenerateGuriPacket(this IPlayerEntity player, GuriPacke Value = value.ToString() }; } + */ } public static Task SendChatMessageFormat(this IPlayerEntity player, PlayerMessages key, SayColorType color, params object[] objs) @@ -81,7 +83,7 @@ public static Task SendChatMessageAsync(this IPlayerEntity player, PlayerMessage public static Task SendChatMessageAsync(this IPlayerEntity player, string msg, SayColorType color) => player.SendPacketAsync(player.GenerateSayPacket(msg, color)); - public static Task SendTopscreenMessage(this IPlayerEntity player, string msg, MsgPacketType type) => player.SendPacketAsync(player.GenerateMsgPacket(msg, type)); + public static Task SendTopscreenMessage(this IPlayerEntity player, string msg, MessageType type) => player.SendPacketAsync(player.GenerateMsgPacket(msg, type)); public static Task GenerateBSInfo(this IPlayerEntity player, byte mode, short title, short time, short text) => player.SendPacketAsync(player.GenerateBSInfoPacket(mode, title, time, text)); diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs index 0fc3fd73..08c39145 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs @@ -2,6 +2,7 @@ using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Game.Server.Chat; namespace ChickenAPI.Game.Extensions.PacketGeneration diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs index 89644ccb..5eb4c988 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/CInfoPacketExtension.cs @@ -10,10 +10,10 @@ public static CInfoPacket GenerateCInfoPacket(this IPlayerEntity player) => Name = player.Character.Name, Unknown1 = "-", //TODO: Find signification GroupId = -1, - FamilyId = player.Family?.Id ?? -1, // todo : family system + FamilyId = (int)(player.Family?.Id ?? -1), FamilyName = player.Family?.Name ?? "-", CharacterId = player.Character.Id, - NameAppearance = player.NameAppearance, + Authority = (byte)player.NameAppearance, Gender = player.Character.Gender, HairStyle = player.Character.HairStyle, HairColor = player.Character.HairColor, @@ -23,8 +23,7 @@ public static CInfoPacket GenerateCInfoPacket(this IPlayerEntity player) => Morph = player.MorphId, Invisible = player.IsInvisible, FamilyLevel = 0, - - SpUpgrade = player.Sp?.Upgrade ?? 0, + MorphUpgrade = player.Sp?.Upgrade ?? 0, ArenaWinner = player.Character.ArenaWinner }; } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs index 61c5e8b2..9ca23885 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs @@ -3,42 +3,42 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; +using ChickenAPI.Packets.ServerPackets.Visibility; namespace ChickenAPI.Game.Inventory.Extensions { public static class EqPacketExtensions { - public static EqListInfo GenerateEqListInfoPacket(this InventoryComponent inventory) => new EqListInfo + public static InEquipmentSubPacket GenerateEqListInfoPacket(this InventoryComponent inventory) => new InEquipmentSubPacket { - Hat = inventory.Wear[(int)EquipmentType.Hat]?.ItemId ?? -1, - Armor = inventory.Wear[(int)EquipmentType.Armor]?.ItemId ?? -1, - MainWeapon = inventory.Wear[(int)EquipmentType.MainWeapon]?.ItemId ?? -1, - SecondaryWeapon = inventory.Wear[(int)EquipmentType.SecondaryWeapon]?.ItemId ?? -1, - Mask = inventory.Wear[(int)EquipmentType.Mask]?.ItemId ?? -1, - Fairy = inventory.Wear[(int)EquipmentType.Fairy]?.ItemId ?? -1, - CostumeSuit = inventory.Wear[(int)EquipmentType.CostumeSuit]?.ItemId ?? -1, - CostumeHat = inventory.Wear[(int)EquipmentType.CostumeHat]?.ItemId ?? -1, - WeaponSkin = inventory.Wear[(int)EquipmentType.WeaponSkin]?.ItemId ?? -1 + Hat = (short?)inventory.Wear[(int)EquipmentType.Hat]?.ItemId ?? -1, + Armor = (short?)inventory.Wear[(int)EquipmentType.Armor]?.ItemId ?? -1, + MainWeapon = (short?)inventory.Wear[(int)EquipmentType.MainWeapon]?.ItemId ?? -1, + SecondaryWeapon = (short?)inventory.Wear[(int)EquipmentType.SecondaryWeapon]?.ItemId ?? -1, + Mask = (short?)inventory.Wear[(int)EquipmentType.Mask]?.ItemId ?? -1, + Fairy = (short?)inventory.Wear[(int)EquipmentType.Fairy]?.ItemId ?? -1, + CostumeSuit = (short?)inventory.Wear[(int)EquipmentType.CostumeSuit]?.ItemId ?? -1, + CostumeHat = (short?)inventory.Wear[(int)EquipmentType.CostumeHat]?.ItemId ?? -1, + WeaponSkin = (short?)inventory.Wear[(int)EquipmentType.WeaponSkin]?.ItemId ?? -1 }; - public static EqRareInfo GenerateEqRareInfoPacket(this InventoryComponent inventory) => new EqRareInfo + public static UpgradeRareSubPacket GenerateEqRareInfoPacket(this InventoryComponent inventory, EquipmentType type) => new UpgradeRareSubPacket { - WeaponUpgrade = inventory.Wear[(int)EquipmentType.MainWeapon]?.Upgrade ?? 0, - WeaponRarity = inventory.Wear[(int)EquipmentType.MainWeapon]?.Rarity ?? 0, - ArmorUpgrade = inventory.Wear[(int)EquipmentType.Armor]?.Upgrade ?? 0, - ArmorRarity = inventory.Wear[(int)EquipmentType.MainWeapon]?.Rarity ?? 0 + Upgrade = inventory.Wear[(int)type]?.Upgrade ?? 0, + Rare = (byte)(inventory.Wear[(int)type]?.Rarity ?? 0) }; public static EqPacket GenerateEqPacket(this IPlayerEntity player) => new EqPacket { VisualId = player.Id, - NameAppearance = player.NameAppearance, + Visibility = (byte)player.NameAppearance, Gender = player.Character.Gender, HairStyle = player.Character.HairStyle, Haircolor = player.Character.HairColor, - CharacterClassType = player.Character.Class, - EqList = player.Inventory.GenerateEqListInfoPacket(), - EqInfo = player.Inventory.GenerateEqRareInfoPacket() + ClassType = player.Character.Class, + ArmorUpgradeRarePacket = player.Inventory.GenerateEqRareInfoPacket(EquipmentType.Armor), + WeaponUpgradeRarePacket = player.Inventory.GenerateEqRareInfoPacket(EquipmentType.MainWeapon), + EqSubPacket = player.Inventory.GenerateEqListInfoPacket(), }; /// diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs index 0de63393..e9807d44 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs @@ -1,6 +1,7 @@ using System; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs deleted file mode 100644 index 578a8e0d..00000000 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryWearPacketExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Inventory; - -namespace ChickenAPI.Game.Inventory.Extensions -{ - public static class InventoryWearPacketExtensions - { - public static InventoryWearSubPacket GenerateInventoryWearPacket(this IPlayerEntity player) - { - InventoryComponent inventory = player.Inventory; - return new InventoryWearSubPacket - { - Hat = inventory.Wear[(int)EquipmentType.Hat]?.ItemId ?? -1, - Armor = inventory.Wear[(int)EquipmentType.Armor]?.ItemId ?? -1, - MainWeapon = inventory.Wear[(int)EquipmentType.MainWeapon]?.ItemId ?? -1, - SecondaryWeapon = inventory.Wear[(int)EquipmentType.SecondaryWeapon]?.ItemId ?? -1, - Mask = inventory.Wear[(int)EquipmentType.Mask]?.ItemId ?? -1, - Fairy = inventory.Wear[(int)EquipmentType.Fairy]?.ItemId ?? -1, - CostumeSuit = inventory.Wear[(int)EquipmentType.CostumeSuit]?.ItemId ?? -1, - CostumeHat = inventory.Wear[(int)EquipmentType.CostumeHat]?.ItemId ?? -1, - WeaponSkin = inventory.Wear[(int)EquipmentType.WeaponSkin]?.ItemId ?? -1 - }; - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs index 3c6132f3..8792f230 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs @@ -26,8 +26,8 @@ private static List GetShopList(IEnumerable tmp.Add(new NInvItemSubPacket { - Price = upgradeOrPrice, - UpgradeDesign = rareOrQuantity, + Price = (int)upgradeOrPrice, + UpgradeDesign = (short)rareOrQuantity, Slot = (byte)itemInfo.Slot, VNum = (short)itemInfo.ItemInstance.ItemId, }); diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs index dfce6e4b..94248608 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs @@ -8,6 +8,8 @@ using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Extension { @@ -48,20 +50,20 @@ public static async Task FailAsync(this RarifyEvent e, IPlayerEntity player) await session.SendPacketAsync($"info {Language.Instance.GetMessageFromKey("AMULET_DESTROYED")}"); await session.SendPacketAsync(session.Character.GenerateEquipment()); }*/ - await player.SendTopscreenMessage("AMULET_FAIL_SAVED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("AMULET_FAIL_SAVED", MessageType.Whisper); await player.SendChatMessageAsync("AMULET_FAIL_SAVED", SayColorType.Purple); return; case RarifyProtection.None: /* session.Character.DeleteItemByItemInstanceId(Id);*/ //player.EmitEvent(new InventoryDestroyItemEvent { ItemInstance = e.Item }); - await player.SendTopscreenMessage("RARIFY_FAILED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("RARIFY_FAILED", MessageType.Whisper); await player.SendChatMessageAsync("RARIFY_FAILED", SayColorType.Purple); return; } - await player.SendTopscreenMessage("RARIFY_FAILED_ITEM_SAVED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("RARIFY_FAILED_ITEM_SAVED", MessageType.Whisper); await player.SendChatMessageAsync("RARIFY_FAILED_ITEM_SAVED", SayColorType.Purple); await player.BroadcastAsync(player.GenerateEffectPacket(3004)); } diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs index aa8e3338..760f6049 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NpcExtensions.cs @@ -1,5 +1,4 @@ using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Packets.Old.Game.Client.UI; using ChickenAPI.Packets.ServerPackets.Inventory; namespace ChickenAPI.Game.Entities.Npc.Extensions @@ -36,7 +35,7 @@ public static EInfoPacket GenerateEInfoPacket(this NpcMonsterDto monster) DarkResistance = monster.DarkResistance, MaxHp = monster.MaxHp, MaxMp = monster.MaxMp, - Unknown2 = -1, + GroupId = -1, Name = monster.Name.Replace(" ", "^") */ }; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs index 6f8b89ce..543e0d52 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RespawnExtensions.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Game.Battle.Interfaces; +using ChickenAPI.Game.Inventory.Extensions; namespace ChickenAPI.Game.IAs { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs index 1f70c359..46f85f98 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs @@ -3,6 +3,7 @@ using ChickenAPI.Game.Entities.Player; using System.Threading.Tasks; using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Old.Game.Server.Shop; using ChickenAPI.Packets.ServerPackets.Shop; namespace ChickenAPI.Game.Shops.Extensions @@ -70,7 +71,7 @@ public static ShopPacket GenerateEmptyShopPacket(this IPlayerEntity player) return new ShopPacket { VisualType = player.Type, - EntityId = player.Id, + VisualId = player.Id, ShopId = 0, MenuType = 0, ShopType = 0, diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs index c78db22f..b4c64caa 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs @@ -9,6 +9,7 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Skills.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs index ef22b4b4..61bee4e6 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SlInfoPacketExtensions.cs @@ -3,6 +3,7 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Item; using ChickenAPI.Data.Skills; +using ChickenAPI.Game.Skills.Extensions; using ChickenAPI.Packets.ServerPackets.Specialists; namespace ChickenAPI.Game.Inventory.Extensions diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs index 3583f4b4..206d23d0 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Game.Entities.Drop; using ChickenAPI.Game.Entities.Mates; @@ -27,28 +28,29 @@ private static InPacket GenerateInMonster(IMonsterEntity monster) PositionX = monster.Position.X, PositionY = monster.Position.Y, Direction = (byte?)monster.DirectionType, - InMonsterSubPacket = new InMonsterSubPacket + InNonPlayerSubPacket = new InNonPlayerSubPacket { - HpPercentage = monster.HpPercentage, - MpPercentage = monster.MpPercentage, - Unknown1 = 0, - Unknown2 = 0, - Unknown3 = 0, - Unknown4 = -1, - NoAggressiveIcon = npcMonster.NoAggresiveIcon, - Unknown5 = 0, - Unknown6 = -1, - Unknown7 = "-", - Unknown8 = 0, - Unknown9 = -1, - Unknown10 = 0, - Unknown11 = 0, - Unknown12 = 0, - Unknown13 = 0, - Unknown14 = 0, - Unknown15 = 0, - Unknown16 = 0, - Unknown17 = 0 + Dialog = 0, + Faction = 0, + GroupEffect = 0, + InAliveSubPacket = new InAliveSubPacket + { + Hp = monster.HpPercentage, + Mp = monster.MpPercentage, + }, + Morph = 0, + Skill1 = 0, + Skill2 = 0, + Skill3 = 0, + SkillRank1 = 0, + SkillRank2 = 0, + SkillRank3 = 0, + Unknow1 = 0, + Unknow3 = 0, + Unknow4 = 0, + Name = npcMonster.Id.ToString(), + IsSitting = false, + SpawnEffect = SpawnEffectType.Summon, } }; } @@ -92,6 +94,7 @@ private static InPacket GenerateInMate(IMateEntity mate) => PositionX = mate.Position.X, PositionY = mate.Position.Y, Direction = (byte?)mate.DirectionType, + /* InMateSubPacket = new InMateSubPacket { HpPercentage = mate.HpPercentage, @@ -114,6 +117,7 @@ private static InPacket GenerateInMate(IMateEntity mate) => SPRank2 = 0, // if rank = 7 (SpInstance.SkillRank1 == 7 ? "4238" : "0") SPRank3 = 0 // xxx (SpInstance.SkillRank1 == 7 ? "4239" : "0") } + */ }; private static InPacket GenerateInNpc(INpcEntity npcEntity) => @@ -121,33 +125,11 @@ private static InPacket GenerateInNpc(INpcEntity npcEntity) => { VisualType = VisualType.Npc, Name = npcEntity.NpcMonster.Id.ToString(), - TransportId = npcEntity.Id.ToString(), + VisualId = npcEntity.Id, PositionX = npcEntity.Position.X, PositionY = npcEntity.Position.Y, - DirectionType = npcEntity.DirectionType, - InNpcSubPacket = new InNpcSubPacket - { - HpPercentage = npcEntity.HpPercentage, - MpPercentage = npcEntity.MpPercentage, - Dialog = npcEntity.MapNpc.Dialog, - Unknown1 = 0, - Unknown2 = 0, - Unknown3 = -1, - Unknown4 = 1, - IsSitting = false, - Unknown5 = -1, - Unknown6 = "-", - Unknown7 = 0, - Unknown8 = -1, - Unknown9 = 0, - Unknown10 = 0, - Unknown11 = 0, - Unknown12 = 0, - Unknown13 = 0, - Unknown14 = 0, - Unknown15 = 0, - Unknown16 = 0 - } + VNum = npcEntity.NpcMonster.Id.ToString(), + Direction = (byte?)npcEntity.DirectionType, }; private static InPacket GenerateInDrop(IDropEntity drop) => @@ -158,13 +140,6 @@ private static InPacket GenerateInDrop(IDropEntity drop) => VisualId = drop.Id, PositionX = drop.Position.X, PositionY = drop.Position.Y, - Amount = drop.Quantity, - InDropSubPacket = new InItemSubPacketBase - { - Unknown = 0, - Unknown1 = 0, - Unknown2 = 0 - } }; private static InPacket GenerateInPlayer(IPlayerEntity player) => @@ -177,39 +152,39 @@ private static InPacket GenerateInPlayer(IPlayerEntity player) => PositionX = player.Position.X, PositionY = player.Position.Y, Direction = (byte?)player.DirectionType, - InCharacterSubPacket = new InCharacterSubPacketBase + InCharacterSubPacket = new InCharacterSubPacket() { - NameAppearance = player.NameAppearance, + Authority = (byte)player.NameAppearance, Gender = player.Character.Gender, HairStyle = player.Character.HairStyle, HairColor = player.Character.HairColor, Class = player.Character.Class, - Equipment = player.GenerateInventoryWearPacket(), - HpPercentage = player.HpPercentage, - MpPercentage = player.MpPercentage, + Equipment = player.Inventory.GenerateEqListInfoPacket(), + InAliveSubPacket = new InAliveSubPacket { Hp = player.HpPercentage, Mp = player.MpPercentage }, IsSitting = false, GroupId = -1, - FairyId = (byte)(player.Fairy != null ? 4 : 0), + Fairy = (byte)(player.Fairy != null ? 4 : 0), FairyElement = (byte)(player.Fairy?.ElementType ?? 0), - IsBoostedFairy = 0, - FairyMorph = player.Fairy?.Item.Morph ?? 0, - EntryType = 0, - Morph = player.MorphId, - WeaponRareAndUpgradeInfo = $"{player.Weapon?.Rarity ?? 0}{player.Weapon?.Upgrade ?? 0}", - ArmorRareAndUpgradeInfo = $"{player.Armor?.Rarity ?? 0}{player.Armor?.Upgrade ?? 0}", + Unknown = 0, + Morph = (byte)player.MorphId, + Unknown2 = 0, + WeaponUpgradeRareSubPacket = player.Inventory.GenerateEqRareInfoPacket(EquipmentType.MainWeapon), + ArmorUpgradeRareSubPacket = player.Inventory.GenerateEqRareInfoPacket(EquipmentType.Armor), FamilyId = player.HasFamily ? player.Family.Id : -1, FamilyName = player.HasFamily ? player.Family.Name : "-", // if not put -1 - ReputationIcon = player.GetReputIcon(), - Invisible = player.IsInvisible, - SpUpgrade = player.Sp?.Upgrade ?? 0, Faction = FactionType.Neutral, // todo faction system - SpDesign = player.Sp?.Design ?? 0, + ReputIco = (short)player.GetReputIcon(), + Invisible = player.IsInvisible, Level = player.Level, FamilyLevel = player.Family?.FamilyLevel ?? 0, ArenaWinner = player.Character.ArenaWinner, Compliment = player.Character.Compliment, Size = 10, - HeroLevel = player.HeroLevel + HeroLevel = player.HeroLevel, + FamilyIcons = new List { false, false, false }, + MorphUpgrade = player.Sp?.Upgrade ?? 0, + MorphUpgrade2 = player.Sp?.Design ?? 0, + Unknown3 = 0 } }; diff --git a/src/ChickenAPI.Game.Impl/MateEntity.cs b/src/ChickenAPI.Game.Impl/MateEntity.cs index 58a440eb..a1cd1ccf 100644 --- a/src/ChickenAPI.Game.Impl/MateEntity.cs +++ b/src/ChickenAPI.Game.Impl/MateEntity.cs @@ -15,6 +15,7 @@ using ChickenAPI.Game.Visibility; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Mates { @@ -206,11 +207,13 @@ public IBattleEntity Target #region Skills + public List<(DateTime, long)> CooldownsBySkillId => SkillComponent.CooldownsBySkillId; public bool HasSkill(long skillId) => SkillComponent.Skills.ContainsKey(skillId); public bool CanCastSkill(long skillId) => SkillComponent.CooldownsBySkillId.Any(s => s.Item2 == skillId); public IDictionary Skills => SkillComponent.Skills; + public IDictionary SkillsByCastId => SkillComponent.SkillsByCastId; public SkillComponent SkillComponent { get; } diff --git a/src/ChickenAPI.Game.Impl/MonsterEntity.cs b/src/ChickenAPI.Game.Impl/MonsterEntity.cs index 4afe7567..214d0532 100644 --- a/src/ChickenAPI.Game.Impl/MonsterEntity.cs +++ b/src/ChickenAPI.Game.Impl/MonsterEntity.cs @@ -14,6 +14,7 @@ using ChickenAPI.Game.Visibility; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Monster { @@ -129,11 +130,14 @@ public VisibilityType Visibility #region Skills + public List<(DateTime, long)> CooldownsBySkillId => SkillComponent.CooldownsBySkillId; + public bool HasSkill(long skillId) => SkillComponent.Skills.ContainsKey(skillId); public bool CanCastSkill(long skillId) => SkillComponent.CooldownsBySkillId.Any(s => s.Item2 == skillId); public IDictionary Skills => SkillComponent.Skills; + public IDictionary SkillsByCastId => SkillComponent.SkillsByCastId; public SkillComponent SkillComponent { get; } diff --git a/src/ChickenAPI.Game.Impl/NpcEntity.cs b/src/ChickenAPI.Game.Impl/NpcEntity.cs index 585a8262..5874a7b5 100644 --- a/src/ChickenAPI.Game.Impl/NpcEntity.cs +++ b/src/ChickenAPI.Game.Impl/NpcEntity.cs @@ -17,6 +17,7 @@ using ChickenAPI.Game.Visibility; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Npc { @@ -133,11 +134,14 @@ public VisibilityType Visibility #region Skills + public List<(DateTime, long)> CooldownsBySkillId => SkillComponent.CooldownsBySkillId; + public bool HasSkill(long skillId) => SkillComponent.Skills.ContainsKey(skillId); public bool CanCastSkill(long skillId) => SkillComponent.CooldownsBySkillId.Any(s => s.Item2 == skillId); public IDictionary Skills => SkillComponent.Skills; + public IDictionary SkillsByCastId => SkillComponent.SkillsByCastId; public SkillComponent SkillComponent { get; } diff --git a/src/ChickenAPI.Game.Impl/SkillComponent.cs b/src/ChickenAPI.Game.Impl/SkillComponent.cs index 31cfa1c5..ef18a319 100644 --- a/src/ChickenAPI.Game.Impl/SkillComponent.cs +++ b/src/ChickenAPI.Game.Impl/SkillComponent.cs @@ -6,15 +6,15 @@ using ChickenAPI.Data.Character; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game.Skills.Extensions; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Skills { - public class SkillComponent : IComponent + public class SkillComponent : IComponent, ISkillCapacity { private static readonly ISkillService SkillService = new Lazy(() => ChickenContainer.Instance.Resolve()).Value; @@ -75,11 +75,14 @@ public SkillComponent(ISkillEntity entity, IEnumerable skills public Dictionary CharacterSkills { get; } = new Dictionary(); - public Dictionary Skills { get; } = new Dictionary(); + public IDictionary Skills { get; } = new Dictionary(); - public Dictionary SkillsByCastId { get; } = new Dictionary(); + public IDictionary SkillsByCastId { get; } = new Dictionary(); public List<(DateTime, long)> CooldownsBySkillId { get; } = new List<(DateTime, long)>(); + public bool HasSkill(long skillId) => Skills.ContainsKey(skillId); + + public bool CanCastSkill(long skillId) => CooldownsBySkillId.Any(s => s.Item2 == skillId); public IEntity Entity { get; } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs index 013c465e..35324e54 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs @@ -1,4 +1,6 @@ -using ChickenAPI.Enums.Game.Character; +using System; +using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +11,7 @@ public class MinDistanceAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _minDist = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _minDist = new int[Enum.GetValues(typeof(CharacterClassType)).Length + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +19,7 @@ public void Initialize() _minDist[(int)CharacterClassType.Swordman, i] = i + 12; // approx _minDist[(int)CharacterClassType.Magician, i] = 14 + i; // approx _minDist[(int)CharacterClassType.Archer, i] = 2 * i; // approx - _minDist[(int)CharacterClassType.Wrestler, i] = 2 * i; // approx + _minDist[(int)CharacterClassType.MartialArtist, i] = 2 * i; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs index 64ea5a78..4ad0558f 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { @@ -9,7 +10,7 @@ public class MinHitAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) { @@ -17,7 +18,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = (2 * i) + 5; // approx Numbers n such that 10n+9 is prime. _stats[(int)CharacterClassType.Magician, i] = (2 * i) + 9; // approx Numbers n such that n^2 is of form x^ 2 + 40y ^ 2 with positive x,y. _stats[(int)CharacterClassType.Archer, i] = 9 + (i * 3); // approx - _stats[(int)CharacterClassType.Wrestler, i] = 9 + (i * 3); // approx + _stats[(int)CharacterClassType.MartialArtist, i] = 9 + (i * 3); // approx } } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs index e3d0ecd7..4e27c5b0 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs @@ -3,17 +3,19 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; using ChickenAPI.Enums.Game.BCard; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; +using SaltyEmu.DatabasePlugin.Context; using SaltyEmu.DatabasePlugin.Models.BCard; namespace SaltyEmu.DatabasePlugin.Services.BCard { public class BCardDao : MappedRepositoryBase, IBCardService { - public BCardDao(DbContext context, IMapper mapper) : base(context, mapper) + public BCardDao(SaltyDbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs index bd1f65d6..f84a66bb 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs @@ -7,6 +7,7 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Character; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs index e688e1b4..5e673b94 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs @@ -112,13 +112,6 @@ public static void InitializeItemUsageHandlers() } } - public class ConfigurationSerializer : IConfigurationSerializer - { - public string Serialize(T conf) where T : IConfiguration => JsonConvert.SerializeObject(conf); - - public T Deserialize(string buffer) where T : IConfiguration => JsonConvert.DeserializeObject(buffer); - } - public static void InjectDependencies() { var config = new ConfigurationHelper(new ConfigurationSerializer()); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs index 19bf502d..3f1cebd9 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs @@ -31,7 +31,7 @@ protected override async Task Handle(CellonItemEvent e, CancellationToken cancel /* if (option == null || e.Jewelry.EquipmentOptions.Any(s => s.Type == option.Type)) { - player.SendTopscreenMessage("CELLONING_FAILED", MsgPacketType.White); + player.SendTopscreenMessage("CELLONING_FAILED", MessageType.White); player.GenerateShopEndPacket(ShopEndPacketType.CloseSubWindow); return; } @@ -39,7 +39,7 @@ protected override async Task Handle(CellonItemEvent e, CancellationToken cancel // SUCCESS e.Jewelry.EquipmentOptions.Add(option); */ - await player.SendTopscreenMessage("CELLONING_SUCCESS", MsgPacketType.White); + await player.SendTopscreenMessage("CELLONING_SUCCESS", MessageType.White); await player.SendPacketAsync(player.GenerateShopEndPacket(ShopEndPacketType.CloseSubWindow)); } } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs index 6b59e2bd..eb3902af 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs @@ -57,14 +57,14 @@ protected override async Task Handle(PerfectSPCardEvent e, CancellationToken can type == 14 ? e.SpCard.SpLight : e.SpCard.SpDark); stoneup += count; - await player.SendTopscreenMessage("PERFECTSP_SUCCESS", MsgPacketType.White); + await player.SendTopscreenMessage("PERFECTSP_SUCCESS", MessageType.White); await player.SendChatMessageAsync("PERFECTSP_SUCCESS", SayColorType.Green); e.SpCard.SpStoneUpgrade++; } else { - await player.SendTopscreenMessage("PERFECTSP_FAILURE", MsgPacketType.White); + await player.SendTopscreenMessage("PERFECTSP_FAILURE", MessageType.White); await player.SendChatMessageAsync("PERFECTSP_FAILURE", SayColorType.Purple); } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs index c5839fb5..f2af7445 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs @@ -146,20 +146,20 @@ protected override async Task Handle(RarifyEvent e, CancellationToken cancellati if ((e.Protection == RarifyProtection.Scroll || e.Protection == RarifyProtection.BlueAmulet || e.Protection == RarifyProtection.RedAmulet) && !e.IsCommand && e.Item.Item.IsHeroic) { - await player.SendTopscreenMessage("ITEM_IS_HEROIC", MsgPacketType.Whisper); + await player.SendTopscreenMessage("ITEM_IS_HEROIC", MessageType.Whisper); return; } if ((e.Protection == RarifyProtection.HeroicAmulet || e.Protection == RarifyProtection.RandomHeroicAmulet) && !e.Item.Item.IsHeroic) { - await player.SendTopscreenMessage("ITEM_NOT_HEROIC", MsgPacketType.Whisper); + await player.SendTopscreenMessage("ITEM_NOT_HEROIC", MessageType.Whisper); return; } if (e.Item.Item.IsHeroic && e.Item.Rarity == 8) { - await player.SendTopscreenMessage("ALREADY_MAX_RARE", MsgPacketType.Whisper); + await player.SendTopscreenMessage("ALREADY_MAX_RARE", MessageType.Whisper); return; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs index 11e019a3..be00b8f6 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs @@ -47,14 +47,14 @@ protected override async Task Handle(SummingEvent e, CancellationToken cancellat //session.Character.DeleteItemByItemInstanceId(itemToSum.Id); await player.SendPacketAsync(new PdtiPacket { Unknow = 10, Unknow2 = 1, Unknow3 = 27, Unknow4 = 0, ItemVnum = e.Item.Item.Id, ItemUpgrade = e.Item.Sum }); await player.SendChatMessageAsync("SUM_SUCCESS", SayColorType.Green); - await player.SendTopscreenMessage("SUM_SUCCESS", MsgPacketType.Whisper); + await player.SendTopscreenMessage("SUM_SUCCESS", MessageType.Whisper); await player.SendGuri(GuriPacketType.AfterSumming, 1, 1324); await player.SendPacketAsync(e.Item?.GenerateIvnPacket()); } else { await player.SendChatMessageAsync("SUM_FAILED", SayColorType.Purple); - await player.SendTopscreenMessage("SUM_FAILED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("SUM_FAILED", MessageType.Whisper); await player.SendGuri(GuriPacketType.AfterSumming, 1, 1332); //session.Character.DeleteItemByItemInstanceId(itemToSum.Id); //session.Character.DeleteItemByItemInstanceId(Id); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs index f6af34fc..58ec1a69 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs @@ -189,14 +189,14 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt if (e.Protection == UpgradeProtection.None) { await player.SendChatMessageAsync("UPGRADE_FAILED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADE_FAILED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_FAILED", MessageType.Whisper); //session.Character.DeleteItemByItemInstanceId(Id); } else { await player.BroadcastAsync(player.GenerateEffectPacket(3004)); await player.SendChatMessageAsync("SCROLL_PROTECT_USED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADE_FAILED_ITEM_SAVED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_FAILED_ITEM_SAVED", MessageType.Whisper); } } else if (rnd < upfix[e.Item.Upgrade]) @@ -204,13 +204,13 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt await player.BroadcastAsync(player.GenerateEffectPacket(3004)); wearable.IsFixed = true; await player.SendChatMessageAsync("UPGRADE_FIXED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADE_FIXED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_FIXED", MessageType.Whisper); } else { await player.BroadcastAsync(player.GenerateEffectPacket(3005)); await player.SendChatMessageAsync("UPGRADE_SUCCESS", SayColorType.Green); - await player.SendTopscreenMessage("UPGRADE_SUCCESS", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_SUCCESS", MessageType.Whisper); wearable.Upgrade++; if (wearable.Upgrade > 4) { @@ -228,28 +228,28 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt await player.BroadcastAsync(player.GenerateEffectPacket(3004)); wearable.IsFixed = true; await player.SendChatMessageAsync("UPGRADE_FIXED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADE_FIXED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_FIXED", MessageType.Whisper); } else if (rnd < upfail[e.Item.Upgrade] + upfix[e.Item.Upgrade]) { if (e.Protection == UpgradeProtection.None) { await player.SendChatMessageAsync("UPGRADE_FAILED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADE_FAILED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_FAILED", MessageType.Whisper); //session.Character.DeleteItemByItemInstanceId(Id); } else { await player.BroadcastAsync(player.GenerateEffectPacket(3004)); await player.SendChatMessageAsync("SCROLL_PROTECT_USED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADE_FAILED_ITEM_SAVED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_FAILED_ITEM_SAVED", MessageType.Whisper); } } else { await player.BroadcastAsync(player.GenerateEffectPacket(3005)); await player.SendChatMessageAsync("UPGRADE_SUCCESS", SayColorType.Green); - await player.SendTopscreenMessage("UPGRADE_SUCCESS", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADE_SUCCESS", MessageType.Whisper); wearable.Upgrade++; if (wearable.Upgrade > 4) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs index b47e2ccd..3a9417c4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs @@ -98,13 +98,13 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt { await player.SendPacketAsync(player.GenerateEffectPacket(3004)); await player.SendChatMessageAsync("UPGRADESP_FAILED_SAVED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADESP_FAILED_SAVED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADESP_FAILED_SAVED", MessageType.Whisper); } else { wearable.Rarity = -2; await player.SendChatMessageAsync("UPGRADESP_DESTROYED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADESP_DESTROYED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADESP_DESTROYED", MessageType.Whisper); await player.SendPacketAsync(wearable.GenerateIvnPacket()); } } @@ -116,7 +116,7 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt } await player.SendChatMessageAsync("UPGRADESP_FAILED", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADESP_FAILED", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADESP_FAILED", MessageType.Whisper); } else { @@ -127,7 +127,7 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt await player.SendPacketAsync(player.GenerateEffectPacket(3005)); await player.SendChatMessageAsync("UPGRADESP_SUCCESS", SayColorType.Purple); - await player.SendTopscreenMessage("UPGRADESP_SUCCESS", MsgPacketType.Whisper); + await player.SendTopscreenMessage("UPGRADESP_SUCCESS", MessageType.Whisper); /* if (Upgrade < 5) { CharacterSession.Character.Inventory.RemoveItemAmount( diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs index e70d0eb3..af9348f0 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs @@ -24,7 +24,7 @@ public static void CellonItemNpc(IPlayerEntity player, ItemUpgradeEvent e) if (e.CellonItem.Item.EffectValue > e.SecondItem.Item.MaxCellonLvl) { - player.SendTopscreenMessage("CELLON_LEVEL_TOO_HIGH", MsgPacketType.White); + player.SendTopscreenMessage("CELLON_LEVEL_TOO_HIGH", MessageType.White); player.GenerateShopEndPacket(ShopEndPacketType.CloseSubWindow); return; } @@ -34,7 +34,7 @@ public static void CellonItemNpc(IPlayerEntity player, ItemUpgradeEvent e) if (e.SecondItem.Item.MaxCellon <= equipmentOptionsCount) { - player.SendTopscreenMessage("CELLON_FULL", MsgPacketType.White); + player.SendTopscreenMessage("CELLON_FULL", MessageType.White); player.GenerateShopEndPacket(ShopEndPacketType.CloseSubWindow); return; } @@ -75,7 +75,7 @@ public static void CellonItemNpc(IPlayerEntity player, ItemUpgradeEvent e) if (player.Character.Gold < gold) { - player.SendTopscreenMessage("NOT_ENOUGH_GOLD", MsgPacketType.White); + player.SendTopscreenMessage("NOT_ENOUGH_GOLD", MessageType.White); player.GenerateShopEndPacket(ShopEndPacketType.CloseSubWindow); return; } diff --git a/src/libs/SaltyEmu.Commands/TypeParsers/ItemDtoTypeParser.cs b/src/libs/SaltyEmu.Commands/TypeParsers/ItemDtoTypeParser.cs index dd8bc5e6..42d61f1a 100644 --- a/src/libs/SaltyEmu.Commands/TypeParsers/ItemDtoTypeParser.cs +++ b/src/libs/SaltyEmu.Commands/TypeParsers/ItemDtoTypeParser.cs @@ -10,8 +10,10 @@ namespace SaltyEmu.Commands.TypeParsers { public sealed class ItemDtoTypeParser : TypeParser { - public override async Task> ParseAsync(string value, ICommandContext context, IServiceProvider provider) + + public override async Task> ParseAsync(Parameter parameter, string value, ICommandContext context, IServiceProvider provider) { + if (!long.TryParse(value, out long result)) { return await Task.FromResult(new TypeParserResult($"The given Item ID was invalid. ({value})")); diff --git a/src/libs/SaltyEmu.Commands/TypeParsers/MapLayerTypeParser.cs b/src/libs/SaltyEmu.Commands/TypeParsers/MapLayerTypeParser.cs index 62b19ffb..e744f8d3 100644 --- a/src/libs/SaltyEmu.Commands/TypeParsers/MapLayerTypeParser.cs +++ b/src/libs/SaltyEmu.Commands/TypeParsers/MapLayerTypeParser.cs @@ -10,7 +10,7 @@ namespace SaltyEmu.Commands.TypeParsers { public sealed class MapLayerTypeParser : TypeParser { - public override Task> ParseAsync(string value, ICommandContext context, IServiceProvider provider) + public override Task> ParseAsync(Parameter param, string value, ICommandContext context, IServiceProvider provider) { if (!long.TryParse(value, out var result)) { @@ -25,4 +25,4 @@ public override Task> ParseAsync(string value, IComm : Task.FromResult(new TypeParserResult(map)); } } -} +} \ No newline at end of file diff --git a/src/libs/SaltyEmu.Commands/TypeParsers/PlayerEntityTypeParser.cs b/src/libs/SaltyEmu.Commands/TypeParsers/PlayerEntityTypeParser.cs index 84bd0264..f0c0619a 100644 --- a/src/libs/SaltyEmu.Commands/TypeParsers/PlayerEntityTypeParser.cs +++ b/src/libs/SaltyEmu.Commands/TypeParsers/PlayerEntityTypeParser.cs @@ -10,7 +10,7 @@ namespace SaltyEmu.Commands.TypeParsers { public sealed class PlayerEntityTypeParser : TypeParser { - public override Task> ParseAsync(string value, ICommandContext context, IServiceProvider provider) + public override Task> ParseAsync(Parameter param, string value, ICommandContext context, IServiceProvider provider) { var manager = ChickenContainer.Instance.Resolve(); IPlayerEntity player = manager.GetPlayerByCharacterName(value); @@ -20,4 +20,4 @@ public override Task> ParseAsync(string value, I : Task.FromResult(new TypeParserResult(player)); } } -} +} \ No newline at end of file diff --git a/src/libs/SaltyEmu.Core/EncodingExtensions.cs b/src/libs/SaltyEmu.Core/EncodingExtensions.cs index 71f53463..13554e3a 100644 --- a/src/libs/SaltyEmu.Core/EncodingExtensions.cs +++ b/src/libs/SaltyEmu.Core/EncodingExtensions.cs @@ -1,9 +1,18 @@ using System; using System.Text; +using ChickenAPI.Core.Configurations; using ChickenAPI.Core.i18n; +using Newtonsoft.Json; namespace SaltyEmu.Core { + public class JsonConfigurationSerializer : IConfigurationSerializer + { + public string Serialize(T conf) where T : IConfiguration => JsonConvert.SerializeObject(conf); + + public T Deserialize(string buffer) where T : IConfiguration => JsonConvert.DeserializeObject(buffer); + } + public static class EncodingExtensions { public static string GetKeyForLangFiles(this LanguageKey key) diff --git a/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj b/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj index 216e365f..2bd445bf 100644 --- a/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj +++ b/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj @@ -6,6 +6,7 @@ + From cd53d74b36e0ec03fe5fe1c4cf4adf81d6bba810 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 11:29:33 +0800 Subject: [PATCH 11/24] continue cleanup --- .../NpcMonster/NpcMonsterDto.cs | 1 + .../Helpers/UIHelper.cs | 2 -- .../PacketGeneration/ChatPacketExtensions.cs | 2 +- .../_TOCLEAN/GInfoPacketExtensions.cs | 2 +- .../_TOCLEAN/MapPacketsExtensions.cs | 2 +- .../_TOCLEAN/MateExtension.cs | 1 - .../NotifyResultAndSetRarityPointExtension.cs | 1 - .../_TOCLEAN/PlayerExtension.cs | 2 -- .../_TOCLEAN/PlayerInteractionExtensions.cs | 1 - .../_TOCLEAN/QsetGenerationExtension.cs | 2 +- .../_TOCLEAN/ShopPacketExtensions.cs | 5 ++-- .../_TOCLEAN/StatCharExtensions.cs | 2 +- .../_TOCLEAN/VisibleEntityExtensions.cs | 2 +- src/ChickenAPI.Game.Impl/GroupSystem.cs | 1 + src/ChickenAPI.Game.Impl/ItemDropEntity.cs | 3 +- src/ChickenAPI.Game.Impl/MovableSystem.cs | 4 ++- src/ChickenAPI.Game.Impl/RespawnSystem.cs | 1 + src/ChickenAPI.Game.Impl/SimpleMap.cs | 5 +++- .../Battle/Hitting/HitRequest.cs | 1 - .../ItemUpgrade/Events/ItemUpgradeEvent.cs | 2 +- .../Handlers/Handling/IItemUpgradeHandler.cs | 4 +-- .../Handlers/Handling/ItemUpgradeHandler.cs | 2 +- .../Handling/ItemUpgradeHandlerAttribute.cs | 2 +- .../Essentials/Character/CharacterModule.cs | 4 +-- src/Plugins/Essentials/EssentialsPlugin.cs | 5 ++-- src/Plugins/Essentials/Help/HelpModule.cs | 3 +- .../Close/CloseDefenceAlgorithm.cs | 2 +- .../CharacterAlgorithms/HpMp/HpMax.cs | 5 ++-- .../CharacterAlgorithms/HpMp/HpRegen.cs | 5 ++-- .../HpMp/HpRegenSitting.cs | 5 ++-- .../HpMp/MpRegenSitting.cs | 5 ++-- .../Magical/MagicDefenceAlgorithm.cs | 5 ++-- .../Magical/MagicDodgeAlgorithm.cs | 1 + .../CharacterAlgorithms/SpeedAlgorithm.cs | 5 ++-- .../Models/NpcMonster/NpcMonsterModel.cs | 1 + .../Services/Character/CharacterFamilyDao.cs | 4 ++- .../Services/Character/CharacterMateDao.cs | 3 +- .../Character/CharacterQuickListDao.cs | 3 +- .../Services/Character/CharacterSkillDao.cs | 4 ++- .../CharacterScreenLoadHandler.cs | 29 +++++++++++-------- .../CharacterScreen/CreateCharacterHandler.cs | 13 +++++---- .../CreateCharacterWrestlerHandler.cs | 3 +- .../CharacterScreen/DeleteCharacterHandler.cs | 11 +++---- .../CharacterScreen/GameStartPacketHandler.cs | 2 -- .../Chat/SayPacketHandling.cs | 2 +- .../Drops/GetPacketHandling.cs | 11 +++++-- .../Groups/PJoinPacketHandling.cs | 2 +- .../Guri/GuriPacketHandling.cs | 9 ++++-- .../Inventory/EqInfoPacketHandling.cs | 13 +++++++-- .../Relations/FInsPacketHandling.cs | 19 +++++++----- .../Shops/BuyPacketHandler.cs | 17 +++++++---- .../Shops/PersonalShopCreationHandling.cs | 3 +- .../Skill/UseSkillPacketHandling.cs | 1 - .../Specialists/SlPacketHandling.cs | 2 +- .../Utils/GenericGamePacketHandlerAsync.cs | 10 +++++-- .../BCardHandlers/BCardBuffHandler.cs | 15 ++++++---- .../Chat/PlayerChatEventHandler.cs | 2 -- .../Groups/Group_InvitationAccept_Handler.cs | 1 - .../Groups/Group_InvitationSend_Handler.cs | 2 +- .../Inventory_DestroyItem_Handler.cs | 1 - .../Relation_InvitationReceive_Handler.cs | 1 - .../EventHandlers/Shops/Shop_Buy_Event.cs | 4 +-- .../Skills/Skill_AddSkill_Handler.cs | 2 +- .../Skills/Skill_UseSkill_Handler.cs | 1 - .../Specialists/Specialist_Remove_Handler.cs | 1 - .../Specialist_Transform_Handler.cs | 4 +-- .../Upgrading/Upgrading_Celloning_Handler.cs | 2 +- .../Upgrading/Upgrading_PerfectSp_Handler.cs | 2 +- .../Upgrading/Upgrading_Rarify_Handler.cs | 3 +- .../Upgrading/Upgrading_Summing_Handler.cs | 2 +- .../Upgrading_UpgradeEquipment_Handler.cs | 3 +- .../Upgrading/Upgrading_UpgradeSp_Handler.cs | 2 +- .../Implems/BasicPacketPipelineAsync.cs | 5 ++-- .../BasicUpgradeHandler.cs | 10 ++++--- .../ItemUpgradeHandlers/CellonItem.cs | 4 +-- .../ItemUpgradeHandlers/PerfectSpCard.cs | 4 +-- .../ItemUpgradeHandlers/RarifyItemHandler.cs | 3 +- .../ItemUpgradeHandlers/SumItem.cs | 4 +-- .../ItemUpgradeHandlers/UpgradeItemHandler.cs | 3 +- .../ItemUpgradeHandlers/UpgradeSpCard.cs | 3 +- .../Handler/LocomotionHandler.cs | 1 - .../ItemUsageHandlers/UseItemHandlerAsync.cs | 8 +++-- .../NpcDialog_UpgradeFamily_Handler.cs | 2 +- .../Handlers/SendInvitationHandler.cs | 5 ++++ src/Toolkit/Commands/DocumentationCommand.cs | 1 - src/Toolkit/Converter/MonsterDatConverter.cs | 1 + .../SaltyEmu.FamilyService/Program.cs | 1 - .../RelationInvitationProcessing.cs | 1 + vendor/ChickenAPI.Packets | 2 +- 89 files changed, 207 insertions(+), 156 deletions(-) diff --git a/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs b/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs index 0506c15f..1bb04c57 100644 --- a/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs +++ b/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.NpcMonster { diff --git a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs index acf23ed4..37d563f3 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/UIHelper.cs @@ -1,11 +1,9 @@ using System.Threading.Tasks; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game._i18n; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Interfaces; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; using ChickenAPI.Packets.ServerPackets.UI; namespace ChickenAPI.Game.Helpers diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs index 08c39145..700f5d42 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs @@ -3,7 +3,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Game.Server.Chat; +using ChickenAPI.Packets.ServerPackets.Chats; namespace ChickenAPI.Game.Extensions.PacketGeneration { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs index b6f95bce..8323afd7 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GInfoPacketExtensions.cs @@ -1,5 +1,5 @@ using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Client.Families; +using ChickenAPI.Packets.ServerPackets.Families; namespace ChickenAPI.Game.Families.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs index 81da675c..7b2ec389 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapPacketsExtensions.cs @@ -1,7 +1,7 @@ using System; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.ServerPackets.Minimap; +using ChickenAPI.Packets.ServerPackets.MiniMap; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs index 67fdc76a..7c7d9ecb 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs @@ -6,7 +6,6 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Mates; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Extensions; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs index 94248608..52e3babb 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs index 541ee194..35efed10 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs @@ -9,7 +9,6 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Families.Extensions; using ChickenAPI.Game.Helpers; @@ -19,7 +18,6 @@ using ChickenAPI.Game._i18n; using ChickenAPI.Game.Extensions.PacketGeneration; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; using ChickenAPI.Packets.ServerPackets.Player; using ChickenAPI.Packets.ServerPackets.UI; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs index 38e16eea..ffdf1dcb 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerInteractionExtensions.cs @@ -1,5 +1,4 @@ using System.Threading.Tasks; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._i18n; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs index cf4e439c..77f1339c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/QsetGenerationExtension.cs @@ -1,5 +1,5 @@ using ChickenAPI.Data.Character; -using ChickenAPI.Packets.Old.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Quicklist.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs index 46f85f98..7a7d52c3 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/ShopPacketExtensions.cs @@ -1,9 +1,8 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Game.Entities.Npc; +using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using System.Threading.Tasks; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Server.Shop; +using ChickenAPI.Packets.ServerPackets.Player; using ChickenAPI.Packets.ServerPackets.Shop; namespace ChickenAPI.Game.Shops.Extensions diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs index 163a963a..d1283f73 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/StatCharExtensions.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Server.Player; +using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs index 206d23d0..ea84f8cd 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/VisibleEntityExtensions.cs @@ -10,7 +10,7 @@ using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Entities; -using ChickenAPI.Packets.ServerPackets.Minimap; +using ChickenAPI.Packets.ServerPackets.MiniMap; using ChickenAPI.Packets.ServerPackets.Visibility; namespace ChickenAPI.Game.Inventory.Extensions diff --git a/src/ChickenAPI.Game.Impl/GroupSystem.cs b/src/ChickenAPI.Game.Impl/GroupSystem.cs index e5c8f759..e5e164b8 100644 --- a/src/ChickenAPI.Game.Impl/GroupSystem.cs +++ b/src/ChickenAPI.Game.Impl/GroupSystem.cs @@ -4,6 +4,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Game.Entities.Player.Extensions; namespace ChickenAPI.Game.Groups { diff --git a/src/ChickenAPI.Game.Impl/ItemDropEntity.cs b/src/ChickenAPI.Game.Impl/ItemDropEntity.cs index a14e56af..d54f2ccd 100644 --- a/src/ChickenAPI.Game.Impl/ItemDropEntity.cs +++ b/src/ChickenAPI.Game.Impl/ItemDropEntity.cs @@ -5,12 +5,13 @@ using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Drop { public class ItemDropEntity : EntityBase, IDropEntity { - public ItemDropEntity(long id) : base(VisualType.MapObject, id) => Components = new Dictionary(); + public ItemDropEntity(long id) : base(VisualType.Object, id) => Components = new Dictionary(); public ItemDto Item { get; set; } public ItemInstanceDto ItemInstance { get; set; } diff --git a/src/ChickenAPI.Game.Impl/MovableSystem.cs b/src/ChickenAPI.Game.Impl/MovableSystem.cs index 93bb43af..0ef9f60e 100644 --- a/src/ChickenAPI.Game.Impl/MovableSystem.cs +++ b/src/ChickenAPI.Game.Impl/MovableSystem.cs @@ -8,6 +8,8 @@ using ChickenAPI.Game.IAs; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Entities; @@ -46,7 +48,7 @@ protected override void Execute(IEntity entity) ProcessMovement((IMovableEntity)entity); } - private void Move(IEntity entity) + private void Move(IMovableEntity entity) { try { diff --git a/src/ChickenAPI.Game.Impl/RespawnSystem.cs b/src/ChickenAPI.Game.Impl/RespawnSystem.cs index 65fcd178..a0dc5afb 100644 --- a/src/ChickenAPI.Game.Impl/RespawnSystem.cs +++ b/src/ChickenAPI.Game.Impl/RespawnSystem.cs @@ -6,6 +6,7 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Game._ECS.Systems; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.IAs { diff --git a/src/ChickenAPI.Game.Impl/SimpleMap.cs b/src/ChickenAPI.Game.Impl/SimpleMap.cs index 241efa02..244b2caa 100644 --- a/src/ChickenAPI.Game.Impl/SimpleMap.cs +++ b/src/ChickenAPI.Game.Impl/SimpleMap.cs @@ -4,6 +4,7 @@ using System.Threading; using Autofac; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Map; @@ -16,6 +17,7 @@ namespace ChickenAPI.Game.Maps public class SimpleMap : EntityManagerBase, IMap { private readonly bool _initSystems; + private readonly ILogger _log; private readonly MapDto _map; private readonly IEnumerable _monsters; private readonly IEnumerable _shops; @@ -41,6 +43,7 @@ public SimpleMap(MapDto map, IEnumerable monsters, IEnumerable(); _random = ChickenContainer.Instance.Resolve(); + _log = ChickenContainer.Instance.Resolve(); _walkableGrid = new Lazy[]>(() => @@ -76,7 +79,7 @@ public bool IsWalkable(short x, short y) } catch (Exception) { - Log.Warn($"[IS_WALKABLE] {Id}: ({x},{y})"); + _log.Warn($"[IS_WALKABLE] {Id}: ({x},{y})"); return false; } } diff --git a/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs b/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs index 14a0490a..7793055c 100644 --- a/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs +++ b/src/ChickenAPI.Game/Battle/Hitting/HitRequest.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using ChickenAPI.Data.BCard; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/ItemUpgradeEvent.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/ItemUpgradeEvent.cs index 5ea94ba5..21a2985a 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/ItemUpgradeEvent.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/ItemUpgradeEvent.cs @@ -1,6 +1,6 @@ using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Events { diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/IItemUpgradeHandler.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/IItemUpgradeHandler.cs index 03a9e0b8..ea659911 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/IItemUpgradeHandler.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/IItemUpgradeHandler.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling { diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandler.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandler.cs index 361a42e7..f1059181 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandler.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandler.cs @@ -1,8 +1,8 @@ using System; using System.Reflection; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling { diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandlerAttribute.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandlerAttribute.cs index fe700873..d7b896ba 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandlerAttribute.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Handlers/Handling/ItemUpgradeHandlerAttribute.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Packets; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling { diff --git a/src/Plugins/Essentials/Character/CharacterModule.cs b/src/Plugins/Essentials/Character/CharacterModule.cs index adfb92f6..e4644657 100644 --- a/src/Plugins/Essentials/Character/CharacterModule.cs +++ b/src/Plugins/Essentials/Character/CharacterModule.cs @@ -6,15 +6,15 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; using Qmmands; using SaltyEmu.Commands.Checks; using SaltyEmu.Commands.Entities; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace Essentials.Character { diff --git a/src/Plugins/Essentials/EssentialsPlugin.cs b/src/Plugins/Essentials/EssentialsPlugin.cs index 9e7e2f60..316f06fb 100644 --- a/src/Plugins/Essentials/EssentialsPlugin.cs +++ b/src/Plugins/Essentials/EssentialsPlugin.cs @@ -16,7 +16,6 @@ namespace Essentials { public class EssentialsPlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); public PluginEnableTime EnableTime => PluginEnableTime.PostContainerBuild; public string Name => "Essentials"; @@ -58,7 +57,7 @@ private static Task RegisterCommands(ICommandContainer container) } catch (Exception e) { - Log.Debug(e.StackTrace); + // Log.Debug(e.StackTrace); } return Task.CompletedTask; @@ -73,7 +72,7 @@ private static async Task UnregisterCommands() } catch (Exception e) { - Log.Debug(e.StackTrace); + // Log.Debug(e.StackTrace); } } diff --git a/src/Plugins/Essentials/Help/HelpModule.cs b/src/Plugins/Essentials/Help/HelpModule.cs index 06aa32c4..106e2936 100644 --- a/src/Plugins/Essentials/Help/HelpModule.cs +++ b/src/Plugins/Essentials/Help/HelpModule.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Packets; -using Qmmands; +using Qmmands; using SaltyEmu.Commands.Entities; using System.Collections.Generic; using System.Linq; diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs index 30f4113f..1ff74ed8 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs @@ -19,7 +19,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = i + 2; // approx _stats[(int)CharacterClassType.Magician, i] = (i + 11) / 2; // approx _stats[(int)CharacterClassType.Archer, i] = i; // approx - _stats[(int)CharacterClassType.Wrestler, i] = i + 2; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = i + 2; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs index 67b06eb0..bf64d87a 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { @@ -9,7 +10,7 @@ public class HpMax : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; // todo improve that shit for (int i = 0; i < MAX_LEVEL; i++) @@ -53,7 +54,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = hpSwordman; _stats[(int)CharacterClassType.Magician, i] = (int)((i + 15) * (i + 15) + i + 15.0 - 465 + 550); // approx _stats[(int)CharacterClassType.Archer, i] = hpArcher; // approx - _stats[(int)CharacterClassType.Wrestler, i] = hpSwordman; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = hpSwordman; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs index f001f68c..05ce3aad 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { @@ -21,10 +22,8 @@ public int GetStat(CharacterClassType type, byte level) return 32; case CharacterClassType.Magician: return 20; - case CharacterClassType.Wrestler: + case CharacterClassType.MartialArtist: return 20; - case CharacterClassType.Unknown: - return 10; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs index c67befd2..47d3daf0 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { @@ -21,10 +22,8 @@ public int GetStat(CharacterClassType type, byte level) return 60; case CharacterClassType.Magician: return 30; - case CharacterClassType.Wrestler: + case CharacterClassType.MartialArtist: return 80; - case CharacterClassType.Unknown: - return 50; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs index edb9b559..7e0b8394 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { @@ -21,10 +22,8 @@ public int GetStat(CharacterClassType type, byte level) return 50; case CharacterClassType.Magician: return 80; - case CharacterClassType.Wrestler: + case CharacterClassType.MartialArtist: return 80; - case CharacterClassType.Unknown: - return 50; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs index ab778ae5..65fc0ab3 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Magical { @@ -9,7 +10,7 @@ public class MagicDefenceAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) @@ -18,7 +19,7 @@ public void Initialize() _stats[(int)CharacterClassType.Swordman, i] = (i + 9) / 2; // approx _stats[(int)CharacterClassType.Magician, i] = i + 4; // approx _stats[(int)CharacterClassType.Archer, i] = i + 41; // approx - _stats[(int)CharacterClassType.Wrestler, i] = i + 12; // approx + _stats[(int)CharacterClassType.MartialArtist, i] = i + 12; // approx } } diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs index 93131652..4d1bfbd8 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs @@ -1,4 +1,5 @@ using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Magical { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs index d0fc61e0..977474b2 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms { @@ -21,9 +22,7 @@ public int GetStat(CharacterClassType type, byte level) return 12; case CharacterClassType.Magician: return 10; - case CharacterClassType.Wrestler: - return 11; - case CharacterClassType.Unknown: + case CharacterClassType.MartialArtist: return 11; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs index 9d7e1c8f..1a2e033c 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs @@ -2,6 +2,7 @@ using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.BCard; using SaltyEmu.DatabasePlugin.Models.Character; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterFamilyDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterFamilyDao.cs index 803b98df..707bb696 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterFamilyDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterFamilyDao.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -12,7 +13,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Character { public class CharacterFamilyDao : MappedRepositoryBase, ICharacterFamilyService { - public CharacterFamilyDao(DbContext context, IMapper mapper) : base(context, mapper) + public CharacterFamilyDao(SaltyDbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } @@ -35,5 +36,6 @@ public async Task> GetCharacterFamilyDtosByFamil { return (await DbSet.Where(s => s.FamilyId == familyId).ToArrayAsync()).Select(Mapper.Map); } + } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterMateDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterMateDao.cs index 7347c40a..2dec4d87 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterMateDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterMateDao.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -12,7 +13,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Character { public class CharacterMateDao : MappedRepositoryBase, ICharacterMateService { - public CharacterMateDao(DbContext context, IMapper mapper) : base(context, mapper) + public CharacterMateDao(SaltyDbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterQuickListDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterQuickListDao.cs index a89638a9..4dedb722 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterQuickListDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterQuickListDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -15,7 +16,7 @@ public class CharacterQuickListDao : SynchronizedRepositoryBase, ICharacterSkillService { - public CharacterSkillDao(DbContext context, IMapper mapper) : base(context, mapper) + public CharacterSkillDao(SaltyDbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs index d84eab03..95ecc99d 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; @@ -9,13 +10,14 @@ using ChickenAPI.Enums.Game; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Server; +using ChickenAPI.Packets.ClientPackets.Login; +using ChickenAPI.Packets.Interfaces; +using ChickenAPI.Packets.ServerPackets.CharacterSelectionScreen; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen { - public class CharacterScreenLoadHandler : GenericSessionPacketHandlerAsync + public class CharacterScreenLoadHandler : GenericSessionPacketHandlerAsync { private readonly IAccountService _accountService; private readonly ICharacterMateService _characterMateService; @@ -23,17 +25,18 @@ public class CharacterScreenLoadHandler : GenericSessionPacketHandlerAsync AccountChecks(EntryPointPacketBase packetBase, ISession session) + private async Task AccountChecks(EntryPointPacket packetBase, ISession session) { string name = packetBase.Name; AccountDto accountDto = await _accountService.GetByNameAsync(name); @@ -89,18 +92,19 @@ private async Task AccountChecks(EntryPointPacketBase packetBase, ISession public Task Handle(ISession session) => Handle(null, session); - protected override async Task Handle(EntryPointPacketBase packet, ISession session) + protected override async Task Handle(EntryPointPacket packet, ISession session) { if (session.Account == null && !await AccountChecks(packet, session)) { return; } + List packets = new List(); Log.Info($"[LOAD_CHARACTERS] {session.Account.Name}"); IEnumerable characters = await _characterService.GetActiveByAccountIdAsync(session.Account.Id); // load characterlist packetBase for each characterEntity in Player - await session.SendPacketAsync(new CListStartPacket { Type = 0 }); + packets.Add(new ClistStartPacket { Type = 0 }); foreach (CharacterDto character in characters) { ItemInstanceDto[] equipment = new ItemInstanceDto[16]; @@ -125,7 +129,7 @@ protected override async Task Handle(EntryPointPacketBase packet, ISession sessi } } - await session.SendPacketAsync(new ClistPacketBase + packets.Add(new ClistPacket() { Slot = character.Slot, Name = character.Name, @@ -157,7 +161,8 @@ await session.SendPacketAsync(new ClistPacketBase }); } - await session.SendPacketAsync(new ClistEndPacketBase()); + packets.Add(new ClistEndPacket()); + await session.SendPacketsAsync(packets); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs index f9d93273..44cfb992 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs @@ -1,30 +1,33 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using ChickenAPI.Core.i18n; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._i18n; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; +using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.UI; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen { - public class CreateCharacterHandler : GenericSessionPacketHandlerAsync + public class CreateCharacterHandler : GenericSessionPacketHandlerAsync { private readonly ICharacterService _characterService; private readonly IGameLanguageService _gameLanguageService; private readonly CharacterScreenLoadHandler _screenLoader; - public CreateCharacterHandler(ICharacterService characterService, IGameLanguageService gameLanguageService, CharacterScreenLoadHandler screenLoader) + + public CreateCharacterHandler(ILogger log, ICharacterService characterService, IGameLanguageService gameLanguageService, CharacterScreenLoadHandler screenLoader) : base(log) { _characterService = characterService; _gameLanguageService = gameLanguageService; _screenLoader = screenLoader; } - protected override async Task Handle(CharNewPacketBase packet, ISession session) + protected override async Task Handle(CharNewPacket packet, ISession session) { long accountId = session.Account.Id; byte slot = packet.Slot; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs index cea71e9b..7996a5aa 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs @@ -5,7 +5,6 @@ using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._Network; using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen @@ -82,7 +81,7 @@ await session.SendPacketAsync(new InfoPacket CharacterDto newCharacter = _characterService.GetCreationCharacter(); - newCharacter.Class = CharacterClassType.Wrestler; + newCharacter.Class = CharacterClassType.MartialArtist; newCharacter.Gender = packet.Gender; newCharacter.HairColor = packet.HairColor; newCharacter.HairStyle = packet.HairStyle; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs index d6e68927..d8ba7f28 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs @@ -1,30 +1,31 @@ using System; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; +using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; +using ChickenAPI.Packets.ServerPackets.UI; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen { - public class DeleteCharacterHandler : GenericSessionPacketHandlerAsync + public class DeleteCharacterHandler : GenericSessionPacketHandlerAsync { private readonly IAccountService _accountService; private readonly ICharacterService _characterService; private readonly CharacterScreenLoadHandler _screenLoader; - public DeleteCharacterHandler(IAccountService accountService, ICharacterService characterService, CharacterScreenLoadHandler screenLoader) + public DeleteCharacterHandler(ILogger log, IAccountService accountService, ICharacterService characterService, CharacterScreenLoadHandler screenLoader) : base(log) { _accountService = accountService; _characterService = characterService; _screenLoader = screenLoader; } - protected override async Task Handle(CharacterDeletePacketBase packet, ISession session) + protected override async Task Handle(CharacterDeletePacket packet, ISession session) { AccountDto account = await _accountService.GetByIdAsync(session.Account.Id); if (account == null) diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs index c9659544..4dc4f97f 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/GameStartPacketHandler.cs @@ -3,7 +3,6 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Families.Extensions; using ChickenAPI.Game.Helpers; @@ -15,7 +14,6 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Server.UserInterface; using ChickenAPI.Packets.ServerPackets.Map; using ChickenAPI.Packets.ServerPackets.Player; using ChickenAPI.Packets.ServerPackets.UI; diff --git a/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs index 96ca7431..cfb816bf 100644 --- a/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Chat.Events; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Client.Chat; +using ChickenAPI.Packets.ClientPackets.Chat; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Chat diff --git a/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs index b049e489..85067b7b 100644 --- a/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Drops/GetPacketHandling.cs @@ -1,20 +1,25 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Utils; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Drop; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Old.Game.Client.Drops; +using ChickenAPI.Packets.ClientPackets.Drops; +using ChickenAPI.Packets.Enumerations; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Drops { public class GetPacketHandling : GenericGamePacketHandlerAsync { + public GetPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(GetPacket packet, IPlayerEntity player) { - var mapItem = player.CurrentMap.GetEntity(packet.DropId, VisualType.MapObject); + var mapItem = player.CurrentMap.GetEntity(packet.VisualId, VisualType.Object); if (mapItem == null || PositionHelper.GetDistance(mapItem.Position, player.Position) > 8) { diff --git a/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs index cbb8648b..2277fefb 100644 --- a/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs @@ -1,10 +1,10 @@ using System.Linq; using System.Threading.Tasks; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Groups; using ChickenAPI.Game.Groups.Events; using ChickenAPI.Game.Managers; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Server.Group; using NW.Plugins.PacketHandling.Utils; diff --git a/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs index ec949cec..86fd0f98 100644 --- a/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.GuriHandling.Events; +using ChickenAPI.Packets.ClientPackets.Player; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Guri @@ -10,10 +11,14 @@ public class GuriPacketHandling : GenericGamePacketHandlerAsync { - protected override Task Handle(EquipmentInfoPacket packet, IPlayerEntity player) => - player.EmitEventAsync(new InventoryEqInfoEvent + public EqInfoPacketHandling(ILogger log) : base(log) + { + } + + protected override async Task Handle(EquipmentInfoPacket packet, IPlayerEntity player) + { + await player.EmitEventAsync(new InventoryEqInfoEvent { Type = packet.Type, Slot = packet.Slot, ShopOwnerId = packet.ShopOwnerId }); + } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs index 7cedf062..eea116c3 100644 --- a/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs @@ -1,24 +1,29 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Enums.Game.Relations; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Relations.Events; -using ChickenAPI.Packets.Old.Game.Server.Relations; +using ChickenAPI.Packets.ClientPackets.Relations; +using ChickenAPI.Packets.Enumerations; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Relations { - public class FInsPacketHandling : GenericGamePacketHandlerAsync + public class FInsPacketHandling : GenericGamePacketHandlerAsync { - protected override async Task Handle(FInsPacket packet, IPlayerEntity player) + public FInsPacketHandling(ILogger log) : base(log) + { + } + + protected override async Task Handle(FinsPacket packet, IPlayerEntity player) { switch (packet.Type) { - case FInsPacketType.Accept: - case FInsPacketType.Refuse: + case FinsPacketType.Accepted: + case FinsPacketType.Rejected: await player.EmitEventAsync(new RelationInvitationProcessEvent { - Type = packet.Type == FInsPacketType.Accept ? RelationInvitationProcessType.Accept : RelationInvitationProcessType.Refuse, + Type = packet.Type == FinsPacketType.Accepted ? RelationInvitationProcessType.Accept : RelationInvitationProcessType.Refuse, TargetCharacterId = packet.CharacterId }); break; diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs index a98e4c25..f2e816b2 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/BuyPacketHandler.cs @@ -1,20 +1,27 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; -using ChickenAPI.Packets.Old.Game.Client.Shops; +using ChickenAPI.Packets.ClientPackets.Shops; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops { public class BuyPacketHandler : GenericGamePacketHandlerAsync { - protected override Task Handle(BuyPacket packet, IPlayerEntity player) => - player.EmitEventAsync(new ShopBuyEvent + public BuyPacketHandler(ILogger log) : base(log) + { + } + + protected override async Task Handle(BuyPacket packet, IPlayerEntity player) + { + await player.EmitEventAsync(new ShopBuyEvent { Amount = packet.Amount, - OwnerId = packet.OwnerId, + OwnerId = packet.VisualId, Slot = packet.Slot, - Type = packet.Type + Type = packet.VisualType }); + } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs index 5411afcc..30f90eaf 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs @@ -5,15 +5,14 @@ using ChickenAPI.Core.Utils; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Shops; using ChickenAPI.Game.Shops.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Client.Shops; -using ChickenAPI.Packets.Old.Game.Server.Shop; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs index 654d4628..02d9e542 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Monster; diff --git a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs index 4205e714..abedd859 100644 --- a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs @@ -1,9 +1,9 @@ using System.Linq; using System.Threading.Tasks; using ChickenAPI.Enums; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Specialists.Args; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Client.Specialists; using NW.Plugins.PacketHandling.Utils; diff --git a/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs b/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs index b8c0a298..e0db10f2 100644 --- a/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs +++ b/src/Plugins/NosSharp.PacketHandler/Utils/GenericGamePacketHandlerAsync.cs @@ -2,14 +2,18 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._Network; -using ChickenAPI.Packets; -using ChickenAPI.Packets.Old; +using ChickenAPI.Packets.Interfaces; namespace NW.Plugins.PacketHandling.Utils { public abstract class GenericGamePacketHandlerAsync : IPacketProcessor where T : class, IPacket { - protected readonly Logger Log = Logger.GetLogger(); + protected readonly ILogger Log; + + protected GenericGamePacketHandlerAsync(ILogger log) + { + Log = log; + } public Task Handle(IPacket packet, ISession session) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs index 56e423ce..a3240ac0 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs @@ -10,24 +10,27 @@ using ChickenAPI.Game.BCards; using ChickenAPI.Game.Buffs; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Battle; +using ChickenAPI.Packets.ServerPackets.Battle; namespace SaltyEmu.BasicPlugin.BCardHandlers { public static class BCardBuffHandler { - static readonly Logger Log = Logger.GetLogger(); - public static BfPacket GenerateBfPacket(this IPlayerEntity player, BuffContainer buff) { return new BfPacket { VisualType = player.Type, VisualId = player.Id, - BuffId = buff.Id, + Buff = new BfPacket.BuffElementSubPacket + { + BuffId = buff.Id, + ChargeValue = 0, + Duration = buff.Duration, + + }, BuffLevel = buff.Level, - ChargeValue = 0, - Duration = buff.Duration, + }; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs index 9173cd78..47516368 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs @@ -1,10 +1,8 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Chat.Events; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Player; namespace SaltyEmu.BasicPlugin.EventHandlers.Chat { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs index 39ffa04c..fd6cf9ab 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs @@ -1,7 +1,6 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Groups; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs index e70e8f13..9d4b072a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.i18n; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Groups; @@ -11,6 +10,7 @@ using ChickenAPI.Game.Managers; using ChickenAPI.Game._i18n; using ChickenAPI.Packets; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Server.Group; namespace SaltyEmu.BasicPlugin.EventHandlers diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs index 19ae2412..d470885b 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Helpers; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs index 14b1c873..b41d190f 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs @@ -3,7 +3,6 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.i18n; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Helpers; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs index dbd04bbc..b8b2aa9c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs @@ -12,7 +12,6 @@ using ChickenAPI.Data.Shop; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -24,6 +23,7 @@ using ChickenAPI.Game.Shops.Extensions; using ChickenAPI.Game.Skills.Extensions; using ChickenAPI.Game._i18n; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Shops { @@ -146,7 +146,7 @@ private static async Task HandleNpcSkillBuyRequest(IPlayerEntity player, ShopBuy minimumLevel = skillShop.Skill.MinimumMagicianLevel; break; - case CharacterClassType.Wrestler: + case CharacterClassType.MartialArtist: minimumLevel = skillShop.Skill.MinimumWrestlerLevel; break; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs index f6c7a83d..53acddaf 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs @@ -72,7 +72,7 @@ protected override async Task Handle(PlayerAddSkillEvent e, CancellationToken ca classLevel = e.Skill.MinimumMagicianLevel; break; - case CharacterClassType.Wrestler: + case CharacterClassType.MartialArtist: classLevel = e.Skill.MinimumWrestlerLevel; break; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs index 558c6a5d..b600ba13 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs @@ -6,7 +6,6 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Skill; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Battle.Events; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Hitting; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs index 2c35bfc4..5e85843e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Remove_Handler.cs @@ -5,7 +5,6 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Entities.Player; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs index dd1294d3..fbf62cc2 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs @@ -12,8 +12,6 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Entities.Player; @@ -24,6 +22,8 @@ using ChickenAPI.Game.Skills.Extensions; using ChickenAPI.Game.Specialists.Args; using ChickenAPI.Game.Specialists.Extensions; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers.Specialists { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs index 3f1cebd9..9f9771b6 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs @@ -2,12 +2,12 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs index eb3902af..e167542c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Maths; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Effects; @@ -11,6 +10,7 @@ using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs index f2af7445..d52b177b 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs @@ -9,7 +9,6 @@ using ChickenAPI.Core.Maths; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -19,6 +18,8 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Extension; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs index be00b8f6..b5eb0e8e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Maths; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -11,6 +10,7 @@ using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Client.Inventory; namespace SaltyEmu.BasicPlugin.EventHandlers diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs index 58ec1a69..7c04c215 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs @@ -4,7 +4,6 @@ using ChickenAPI.Core.Maths; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Effects; @@ -14,6 +13,8 @@ using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers.Upgrading { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs index 3a9417c4..b18b3af7 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs @@ -4,7 +4,6 @@ using ChickenAPI.Core.Maths; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Effects; @@ -14,6 +13,7 @@ using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/Implems/BasicPacketPipelineAsync.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/Implems/BasicPacketPipelineAsync.cs index 8864ced0..9f577e0c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/Implems/BasicPacketPipelineAsync.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/Implems/BasicPacketPipelineAsync.cs @@ -3,9 +3,8 @@ using System.Reflection; using System.Threading.Tasks; using ChickenAPI.Game._Network; -using ChickenAPI.Packets; using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Old; +using ChickenAPI.Packets.Interfaces; namespace SaltyEmu.BasicPlugin.Implems { @@ -35,7 +34,7 @@ public Task UnregisterAsync(IPacketProcessor processor, Type packetType) public Task Handle(IPacket packet, ISession session) { - if (!_packetProcessors.TryGetValue(packet.PacketType, out IPacketProcessor processor)) + if (!_packetProcessors.TryGetValue(packet.GetType(), out IPacketProcessor processor)) { return Task.CompletedTask; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/BasicUpgradeHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/BasicUpgradeHandler.cs index b385ccb1..361af11a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/BasicUpgradeHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/BasicUpgradeHandler.cs @@ -2,23 +2,25 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.ItemUpgrade; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { public class BasicUpgradeHandler : IItemUpgradeHandler { - private static readonly Logger Log = Logger.GetLogger(); + private readonly ILogger _log; protected readonly Dictionary HandlersByUpgradeType; - public BasicUpgradeHandler() + public BasicUpgradeHandler(ILogger log) { + _log = log; HandlersByUpgradeType = new Dictionary(); Assembly currentAsm = Assembly.GetAssembly(typeof(BasicUpgradeHandler)); // get types @@ -42,7 +44,7 @@ public void Register(ItemUpgradeHandler handlerAttribute) return; } - Log.Info($"[REGISTER_HANDLER] UPGRADE_TYPE : {handlerAttribute.Type} REGISTERED !"); + _log.Info($"[REGISTER_HANDLER] UPGRADE_TYPE : {handlerAttribute.Type} REGISTERED !"); HandlersByUpgradeType.Add(handlerAttribute.Type, handlerAttribute); } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs index af9348f0..ee009162 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/CellonItem.cs @@ -1,10 +1,10 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs index e4f164d8..8fec8c80 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs @@ -1,8 +1,6 @@ using System; using Autofac; using ChickenAPI.Core.IoC; -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -11,6 +9,8 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs index d02c5c97..c13a1f06 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs @@ -1,12 +1,13 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs index 77fd0cc7..f10e0117 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs @@ -1,8 +1,6 @@ using System; using Autofac; using ChickenAPI.Core.IoC; -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -10,6 +8,8 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs index 7fe941a8..e4172295 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs @@ -3,7 +3,6 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -11,6 +10,8 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs index 402e8742..a2cbf230 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs @@ -1,10 +1,11 @@ using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs index a573dc92..642cf12f 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Events; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs index 7b320760..d85445dd 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs @@ -10,10 +10,14 @@ namespace SaltyEmu.BasicPlugin.ItemUsageHandlers { public class UseItemHandlerContainer : IItemUsageContainerAsync { - private readonly Logger _log = Logger.GetLogger(); - + private readonly ILogger _log; private readonly Dictionary<(long, ItemType), IUseItemRequestHandlerAsync> _handlers = new Dictionary<(long, ItemType), IUseItemRequestHandlerAsync>(); + public UseItemHandlerContainer(ILogger log) + { + _log = log; + } + public Task RegisterItemUsageCallback(IUseItemRequestHandlerAsync handler) { _handlers.Add((handler.EffectId, handler.Type), handler); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs index 33d3592d..41d8b489 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using ChickenAPI.Enums.Packets; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.NpcDialog; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game._i18n; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers.Handlers.Families { diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs b/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs index fc2bde55..cd7da5e2 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs +++ b/src/Plugins/SaltyEmu.FriendsPlugin/Handlers/SendInvitationHandler.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using Autofac; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Managers; using ChickenAPI.Game.Relations.Events; @@ -11,6 +12,10 @@ namespace SaltyEmu.FriendsPlugin.Handlers { internal class SendInvitationHandler : GenericAsyncRpcRequestHandler { + public SendInvitationHandler(ILogger log) : base(log) + { + } + protected override Task Handle(SendInvitation request) { if (!(request is SendInvitation sendInvitation)) diff --git a/src/Toolkit/Commands/DocumentationCommand.cs b/src/Toolkit/Commands/DocumentationCommand.cs index afae590e..5ac587a2 100644 --- a/src/Toolkit/Commands/DocumentationCommand.cs +++ b/src/Toolkit/Commands/DocumentationCommand.cs @@ -4,7 +4,6 @@ using System.Reflection; using ChickenAPI.Packets.Attributes; using ChickenAPI.Packets.Old.Attributes; -using ChickenAPI.Packets.Old.Game.Server.Player; namespace Toolkit.Commands { diff --git a/src/Toolkit/Converter/MonsterDatConverter.cs b/src/Toolkit/Converter/MonsterDatConverter.cs index 96467cdc..3dc99264 100644 --- a/src/Toolkit/Converter/MonsterDatConverter.cs +++ b/src/Toolkit/Converter/MonsterDatConverter.cs @@ -14,6 +14,7 @@ using ChickenAPI.Enums.Game.BCard; using ChickenAPI.Enums.Game.Drop; using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Packets.Enumerations; namespace Toolkit.Converter { diff --git a/src/services/SaltyEmu.FamilyService/Program.cs b/src/services/SaltyEmu.FamilyService/Program.cs index 7ea5f81b..f9766d65 100644 --- a/src/services/SaltyEmu.FamilyService/Program.cs +++ b/src/services/SaltyEmu.FamilyService/Program.cs @@ -28,7 +28,6 @@ private static void PrintHeader() private static void InitializeLogger() { - Logger.Initialize(); } private static void Main() diff --git a/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs b/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs index a74f536e..b5a7ffad 100644 --- a/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs +++ b/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs @@ -6,6 +6,7 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Relations; using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Packets.Enumerations; using NUnit.Framework; using SaltyEmu.Communication.Configs; using SaltyEmu.Communication.Utils; diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index c78e4871..a2b4851c 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit c78e487195bd087bc824b1ac2a87aa0ea52ccda4 +Subproject commit a2b4851c94c60869925e8c649445e7ae6105bcac From 034032abc2da6bbca1d82faf063f24adb1f927f6 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 11:48:12 +0800 Subject: [PATCH 12/24] again and again --- .../Game/Entity/ReqInfoType.cs | 12 +------- .../Entities/Events/ReqInfoEvent.cs | 4 +-- src/Plugins/Essentials/Help/HelpModule.cs | 1 + .../CreateCharacterWrestlerHandler.cs | 11 ++++--- .../CharacterScreen/SelectCharacterHandler.cs | 13 +++++---- .../Entity/NcifPacketHandling.cs | 7 ++++- .../Entity/ReqInfoPacketHandling.cs | 2 +- .../Groups/PJoinPacketHandling.cs | 24 ++++++++------- .../Guri/GuriPacketHandling.cs | 5 ++++ .../Inventory/MviPacketHandling.cs | 10 ++++--- .../Inventory/PutPacketHandling.cs | 10 ++++--- .../Move/SitPacketHandling.cs | 19 ++++++++---- .../Npc/Dialog/NRunPacketHandling.cs | 13 ++++++--- .../Shops/PersonalShopCreationHandling.cs | 29 ++++++++++++++----- .../Skill/MultiTargetListPacketHandling.cs | 8 +++-- .../EventHandlers/ReqInfoEventHandler.cs | 1 - vendor/ChickenAPI.Packets | 2 +- 17 files changed, 106 insertions(+), 65 deletions(-) diff --git a/src/ChickenAPI.Enums/Game/Entity/ReqInfoType.cs b/src/ChickenAPI.Enums/Game/Entity/ReqInfoType.cs index e81bc0b0..5f282702 100644 --- a/src/ChickenAPI.Enums/Game/Entity/ReqInfoType.cs +++ b/src/ChickenAPI.Enums/Game/Entity/ReqInfoType.cs @@ -1,11 +1 @@ -namespace ChickenAPI.Enums.Game.Entity -{ - public enum ReqInfoType - { - ItemInfo = 12, - MateInfo = 6, - - NpcInfo = 5 - // Default => Player - } -} \ No newline at end of file + \ No newline at end of file diff --git a/src/ChickenAPI.Game/Entities/Events/ReqInfoEvent.cs b/src/ChickenAPI.Game/Entities/Events/ReqInfoEvent.cs index 3211fc14..16c7242f 100644 --- a/src/ChickenAPI.Game/Entities/Events/ReqInfoEvent.cs +++ b/src/ChickenAPI.Game/Entities/Events/ReqInfoEvent.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game._Events; +using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Entities.Events { diff --git a/src/Plugins/Essentials/Help/HelpModule.cs b/src/Plugins/Essentials/Help/HelpModule.cs index 106e2936..e3fbe467 100644 --- a/src/Plugins/Essentials/Help/HelpModule.cs +++ b/src/Plugins/Essentials/Help/HelpModule.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using ChickenAPI.Game.Helpers; +using ChickenAPI.Packets.Enumerations; namespace Essentials.Help { diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs index 7996a5aa..fcf3763a 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs @@ -1,26 +1,29 @@ using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; +using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.UI; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen { - public class CreateCharacterWrestlerHandler : GenericSessionPacketHandlerAsync + public class CreateCharacterWrestlerHandler : GenericSessionPacketHandlerAsync { private readonly ICharacterService _characterService; private readonly CharacterScreenLoadHandler _screenLoader; - public CreateCharacterWrestlerHandler(ICharacterService characterService, CharacterScreenLoadHandler screenLoader) + public CreateCharacterWrestlerHandler(ILogger log, ICharacterService characterService, CharacterScreenLoadHandler screenLoader) : base(log) { _characterService = characterService; _screenLoader = screenLoader; } - protected override async Task Handle(CharNewWrestlerPacketBase packet, ISession session) + protected override async Task Handle(CharNewJobPacket packet, ISession session) { long accountId = session.Account.Id; byte slot = packet.Slot; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs index dcb3a94b..101983dd 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/SelectCharacterHandler.cs @@ -1,20 +1,21 @@ using System; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Game._Network; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Client; -using ChickenAPI.Packets.Old.CharacterSelectionScreen.Server; +using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; +using ChickenAPI.Packets.ServerPackets.CharacterSelectionScreen; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.CharacterScreen { - public class SelectCharacterHandler : GenericSessionPacketHandlerAsync + public class SelectCharacterHandler : GenericSessionPacketHandlerAsync { private readonly ICharacterService _characterService; - public SelectCharacterHandler(ICharacterService characterService) => _characterService = characterService; + public SelectCharacterHandler(ILogger log, ICharacterService characterService) : base(log) => _characterService = characterService; - protected override async Task Handle(SelectPacketBase packet, ISession session) + protected override async Task Handle(SelectPacket packet, ISession session) { try { @@ -30,7 +31,7 @@ protected override async Task Handle(SelectPacketBase packet, ISession session) } session.InitializeCharacterId(characterDto.Id); - await session.SendPacketAsync(new OkPacketBase()); + await session.SendPacketAsync(new OkPacket()); } catch (Exception ex) { diff --git a/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs index 9d2c68fc..4f1b0fc9 100644 --- a/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Entity/NcifPacketHandling.cs @@ -1,16 +1,21 @@ using System; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Extensions.UserInterface; -using ChickenAPI.Packets.Old.Game.Client.Battle; +using ChickenAPI.Packets.ClientPackets.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Entity { public class NcifPacketHandling : GenericGamePacketHandlerAsync { + public NcifPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(NcifPacket packet, IPlayerEntity player) { try diff --git a/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs index b2abdeb5..70ed52a6 100644 --- a/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Events; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Server.Entities; +using ChickenAPI.Packets.ServerPackets.Entities; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Entity diff --git a/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs index 2277fefb..81c94fd8 100644 --- a/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Groups/PJoinPacketHandling.cs @@ -1,38 +1,40 @@ using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Groups; using ChickenAPI.Game.Groups.Events; using ChickenAPI.Game.Managers; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Server.Group; +using ChickenAPI.Packets.ServerPackets.Groups; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Groups { - public class PJoinPacketHandling : GenericGamePacketHandlerAsync + public class PJoinPacketHandling : GenericGamePacketHandlerAsync { private readonly IPlayerManager _manager; private readonly IGroupManager _groupManager; - public PJoinPacketHandling(IPlayerManager manager, IGroupManager groupManager) + + public PJoinPacketHandling(ILogger log, IPlayerManager manager, IGroupManager groupManager) : base(log) { _manager = manager; _groupManager = groupManager; } - protected override async Task Handle(PJoinPacket packet, IPlayerEntity player) + protected override async Task Handle(PjoinPacket packet, IPlayerEntity player) { switch (packet.RequestType) { - case PJoinPacketType.Requested: - case PJoinPacketType.Invited: + case GroupRequestType.Requested: + case GroupRequestType.Invited: await player.EmitEventAsync(new GroupInvitationSendEvent { Target = _manager.GetPlayerByCharacterId(packet.CharacterId) }); break; - case PJoinPacketType.Accepted: + case GroupRequestType.Accepted: GroupInvitDto group = _groupManager.GetPendingInvitationsByCharacterId(player.Id)?.FirstOrDefault(s => s.Target == player); if (group == null) @@ -45,7 +47,7 @@ await player.EmitEventAsync(new GroupInvitationAcceptEvent Invitation = group }); break; - case PJoinPacketType.Declined: + case GroupRequestType.Declined: GroupInvitDto invitation = _groupManager.GetPendingInvitationsByCharacterId(player.Id)?.FirstOrDefault(s => s.Target == player); if (invitation == null) @@ -58,11 +60,11 @@ await player.EmitEventAsync(new GroupInvitationRefuseEvent() Invitation = invitation }); break; - case PJoinPacketType.Sharing: + case GroupRequestType.Sharing: break; - case PJoinPacketType.AcceptedShare: + case GroupRequestType.AcceptedShare: break; - case PJoinPacketType.DeclinedShare: + case GroupRequestType.DeclinedShare: break; } } diff --git a/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs index 86fd0f98..db0bc866 100644 --- a/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Guri/GuriPacketHandling.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.GuriHandling.Events; using ChickenAPI.Packets.ClientPackets.Player; @@ -9,6 +10,10 @@ namespace NW.Plugins.PacketHandling.Guri { public class GuriPacketHandling : GenericGamePacketHandlerAsync { + public GuriPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(ClientGuriPacket packet, IPlayerEntity player) { string[] packetsplit = new[] { "", "" }; // todo; diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs index 077bc503..85eec52a 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs @@ -1,20 +1,22 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Old.Game.Client.Inventory; +using ChickenAPI.Packets.ClientPackets.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory { public class MviPacketHandling : GenericGamePacketHandlerAsync { - protected override Task Handle(MviPacket packet, IPlayerEntity player) => - player.EmitEventAsync(new InventoryMoveEvent + protected override async Task Handle(MviPacket packet, IPlayerEntity player) + { + await player.EmitEventAsync(new InventoryMoveEvent { PocketType = packet.InventoryType, Amount = packet.Amount, - SourceSlot = packet.InventorySlot, + SourceSlot = packet.Slot, DestinationSlot = packet.DestinationSlot }); + } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs index 08b3b29f..261c83d9 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs @@ -2,18 +2,20 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Packets.Old.Game.Client.Inventory; +using ChickenAPI.Packets.ClientPackets.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory { public class PutPacketHandling : GenericGamePacketHandlerAsync { - protected override Task Handle(PutPacket packet, IPlayerEntity player) => - player.EmitEventAsync(new InventoryRemoveItemEvent + protected override async Task Handle(PutPacket packet, IPlayerEntity player) + { + await player.EmitEventAsync(new InventoryRemoveItemEvent { - ItemInstance = player.Inventory.GetItemFromSlotAndType(packet.InventorySlot, packet.InventoryType), + ItemInstance = player.Inventory.GetItemFromSlotAndType(packet.Slot, packet.PocketType), Amount = packet.Amount }); + } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs index fb819238..cb1f103a 100644 --- a/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Move/SitPacketHandling.cs @@ -1,29 +1,36 @@ using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements.Events; -using ChickenAPI.Packets.Old.Game.Client.Movement; +using ChickenAPI.Packets.ClientPackets.Movement; +using ChickenAPI.Packets.Enumerations; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Move { public class SitPacketHandling : GenericGamePacketHandlerAsync { - protected override Task Handle(SitPacket packet, IPlayerEntity player) + public SitPacketHandling(ILogger log) : base(log) + { + } + + protected override async Task Handle(SitPacket packet, IPlayerEntity player) { foreach (SitSubPacket u in packet.Users) { - if (u.UserType == 1 && u.UserId != player.Character.Id) + if (u.VisualType == VisualType.Player && u.VisualId != player.Character.Id) { - return Task.CompletedTask; + // return; + return; } //TODO: rest on mate } - return player.EmitEventAsync(new TriggerSitEvent + await player.EmitEventAsync(new TriggerSitEvent { - ChildsId = packet.Users.Select(s => s.UserId) + ChildsId = packet.Users.Select(s => s.VisualId) }); } } diff --git a/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs index 8ff4b689..27632225 100644 --- a/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs @@ -1,20 +1,25 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog.Events; -using ChickenAPI.Packets.Old.Game.Client.Npcs; +using ChickenAPI.Packets.ClientPackets.Npcs; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Npc.Dialog { public class NRunPacketHandling : GenericGamePacketHandlerAsync { + public NRunPacketHandling(ILogger log) : base(log) + { + } + protected override Task Handle(NrunPacket packet, IPlayerEntity player) => player.EmitEventAsync(new NpcDialogEvent { - DialogId = packet.Runner, + DialogId = (long)packet.Runner, Type = packet.Type, - Value = packet.Value, - NpcId = packet.NpcId + Value = (int)packet.VisualType, + NpcId = packet.VisualId }); } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs index 30f90eaf..093dfb82 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/PersonalShopCreationHandling.cs @@ -2,31 +2,46 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Shops; using ChickenAPI.Game.Shops.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.ClientPackets.Shops; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Client.Shops; +using ChickenAPI.Packets.ServerPackets.Shop; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops { public class PersonalShopCreationHandling : GenericGamePacketHandlerAsync { + public PersonalShopCreationHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(MShopPacket packet, IPlayerEntity player) { switch (packet.Type) { - case MShopPacketType.OpenShop: + case CreateShopPacketType.Create: try { - ShopPlayerShopCreateEvent e = ParseMShopPacket(packet.PacketData, player); + //ShopPlayerShopCreateEvent e = ParseMShopPacket(packet.ItemList, player); + var e = new ShopPlayerShopCreateEvent + { + ShopItems = packet.ItemList.Select(s => new PersonalShopItem + { + Slot = s.Slot, + Price = s.Price, + ItemInstance = player.Inventory.GetItemFromSlotAndType(s.Slot, s.Type), + Quantity = s.Amount + }).ToList() + }; if (e?.ShopItems.Any() == true) { await player.EmitEventAsync(e); @@ -43,13 +58,13 @@ protected override async Task Handle(MShopPacket packet, IPlayerEntity player) } break; - case MShopPacketType.CloseShop: + case CreateShopPacketType.Close: await player.ClosePersonalShopAsync(); player.IsSitting = false; await player.ActualizePlayerCondition(); return; - case MShopPacketType.OpenDialog: - await player.SendPacketAsync(new IShopPacket()); + case CreateShopPacketType.Open: + await player.SendPacketAsync(new IshopPacket()); return; default: return; diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs index 1867a0a3..5cc6881d 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/MultiTargetListPacketHandling.cs @@ -1,15 +1,19 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Client.Battle; +using ChickenAPI.Packets.ClientPackets.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill { public class MultiTargetListPacketHandling : GenericGamePacketHandlerAsync { + public MultiTargetListPacketHandling(ILogger log) : base(log) + { + } + protected override Task Handle(MultiTargetListPacket packet, IPlayerEntity player) { - Log.Debug(packet.OriginalContent); return Task.CompletedTask; } } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs index 4db969a9..637ff469 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Events; using ChickenAPI.Game.Entities.Npc.Extensions; using ChickenAPI.Game.Entities.Player; diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index a2b4851c..417ac060 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit a2b4851c94c60869925e8c649445e7ae6105bcac +Subproject commit 417ac0602f39c467075733bd7b7d6821b814c7b3 From 281145cfc7e2fbf235e2e749657aee1bcb40522a Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 17:03:40 +0800 Subject: [PATCH 13/24] continue fixing things --- .../Essentials/MapManagement/ButcherModule.cs | 2 ++ .../Configuration/DatabaseConfiguration.cs | 3 ++- .../NosSharp.DatabasePlugin/DatabasePlugin.cs | 12 +++++++---- .../Inventory/PutPacketHandling.cs | 5 +++++ .../Inventory/RemovePacketHandling.cs | 15 +++++++++---- .../Inventory/UpgradeItemPaketHandling.cs | 7 ++++++- .../Inventory/UseItemPaketHandling.cs | 20 +++++++++++------- .../Inventory/WearPacketHandling.cs | 11 +++++++--- .../Move/PreqPacketHandling.cs | 7 ++++++- .../Move/WalkPacketHandling.cs | 10 ++++++--- .../Shops/NpcReqPacketHandling.cs | 20 +++++++++++++----- .../Shops/ShoppingPacketHandling.cs | 12 ++++++++--- .../Skill/UseAoeSkillPacketHandler.cs | 7 ++++++- .../Skill/UseSkillPacketHandling.cs | 5 ++++- .../Specialists/SlPacketHandling.cs | 21 +++++++++++-------- .../Test/PathfinderTest.cs | 9 +++++++- .../BasicPluginIoCInjector.cs | 2 +- .../Battle_ProcessHitRequest_Handler.cs | 11 +++++----- .../Groups/Group_InvitationSend_Handler.cs | 11 +++++----- .../NpcDialogHandlers/WopenHandler.cs | 8 +++---- vendor/ChickenAPI.Packets | 2 +- 21 files changed, 137 insertions(+), 63 deletions(-) diff --git a/src/Plugins/Essentials/MapManagement/ButcherModule.cs b/src/Plugins/Essentials/MapManagement/ButcherModule.cs index ef59f8c7..ed059fd6 100644 --- a/src/Plugins/Essentials/MapManagement/ButcherModule.cs +++ b/src/Plugins/Essentials/MapManagement/ButcherModule.cs @@ -4,9 +4,11 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums; using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Monster; +using ChickenAPI.Packets.Enumerations; using Qmmands; using SaltyEmu.Commands.Checks; using SaltyEmu.Commands.Entities; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Configuration/DatabaseConfiguration.cs b/src/Plugins/NosSharp.DatabasePlugin/Configuration/DatabaseConfiguration.cs index 9444cd78..1a7c6993 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Configuration/DatabaseConfiguration.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Configuration/DatabaseConfiguration.cs @@ -1,8 +1,9 @@ using System; +using ChickenAPI.Core.Configurations; namespace SaltyEmu.DatabasePlugin.Configuration { - public class DatabaseConfiguration + public class DatabaseConfiguration : IConfiguration { public DatabaseConfiguration() { diff --git a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs index bbedb33d..76a43c72 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs @@ -1,12 +1,9 @@ using System; using System.Data.SqlClient; using ChickenAPI.Core.Configurations; -using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; using ChickenAPI.Core.Plugins.Exceptions; -using ChickenAPI.Core.Utils; using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; using SaltyEmu.DatabasePlugin.Configuration; using SaltyEmu.DatabasePlugin.Context; using SaltyEmu.DatabasePlugin.Utils; @@ -14,6 +11,12 @@ namespace SaltyEmu.DatabasePlugin { + internal class JsonConfigurationSerializer : IConfigurationSerializer + { + public string Serialize(T conf) where T : IConfiguration => JsonConvert.SerializeObject(conf); + + public T Deserialize(string buffer) where T : IConfiguration => throw new NotImplementedException(); + } public class DatabasePlugin : IPlugin { private readonly ILogger Log; @@ -25,7 +28,8 @@ public class DatabasePlugin : IPlugin public void OnLoad() { Log.Info("Loading..."); - _configuration = ConfigurationHelper.Load(_configurationFilePath, true); // database configuration + var loader = new ConfigurationHelper(new JsonConfigurationSerializer()); + _configuration = loader.Load(_configurationFilePath, true); // database configuration if (!Initialize()) { throw new CriticalPluginException(this, "Verify your configuration in : " + _configurationFilePath); diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs index 261c83d9..b3764b81 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/PutPacketHandling.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; @@ -9,6 +10,10 @@ namespace NW.Plugins.PacketHandling.Inventory { public class PutPacketHandling : GenericGamePacketHandlerAsync { + public PutPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(PutPacket packet, IPlayerEntity player) { await player.EmitEventAsync(new InventoryRemoveItemEvent diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs index 52091a07..973050a7 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/RemovePacketHandling.cs @@ -1,17 +1,24 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Old.Game.Client.Inventory; +using ChickenAPI.Packets.ClientPackets.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory { public class RemovePacketHandling : GenericGamePacketHandlerAsync { - protected override Task Handle(RemovePacket packet, IPlayerEntity player) => - player.EmitEventAsync(new InventoryUnequipEvent + public RemovePacketHandling(ILogger log) : base(log) + { + } + + protected override async Task Handle(RemovePacket packet, IPlayerEntity player) + { + await player.EmitEventAsync(new InventoryUnequipEvent { - ItemToUnwear = player.Inventory.Wear[packet.InventorySlot] + ItemToUnwear = player.Inventory.Wear[(int)packet.InventorySlot] }); + } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs index 0771f4d6..39130a40 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/UpgradeItemPaketHandling.cs @@ -1,15 +1,20 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; -using ChickenAPI.Packets.Old.Game.Client; +using ChickenAPI.Packets.ClientPackets.Player; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory { public class UpgradeItemPaketHandling : GenericGamePacketHandlerAsync { + public UpgradeItemPaketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(UpgradePacket packet, IPlayerEntity player) { ItemInstanceDto item = player.Inventory.GetItemFromSlotAndType(packet.Slot, packet.InventoryType); diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs index 3e7cf912..32d9653f 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/UseItemPaketHandling.cs @@ -1,31 +1,35 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; -using ChickenAPI.Packets.Old.Game.Client.Inventory; +using ChickenAPI.Packets.ClientPackets.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory { - public class UseItemPaketHandling : GenericGamePacketHandlerAsync + public class UseItemPaketHandling : GenericGamePacketHandlerAsync { - protected override async Task Handle(UiPacket packet, IPlayerEntity player) + public UseItemPaketHandling(ILogger log) : base(log) { - ItemInstanceDto item = player.Inventory.GetItemFromSlotAndType(packet.InventorySlot, packet.InventoryType); + } + + protected override async Task Handle(UseItemPacket packet, IPlayerEntity player) + { + ItemInstanceDto item = player.Inventory.GetItemFromSlotAndType(packet.Slot, packet.Type); if (item == null) { return; } - string[] packetsplit = packet.OriginalContent.Split(' ', '^'); + // string[] packetsplit = packet.OriginalContent.Split(' ', '^'); await player.EmitEventAsync(new InventoryUseItemEvent { Item = item, - Option = packetsplit[1].ElementAt(0) == '#' ? (byte)50 : (byte)0 + Option = packet.Header.StartsWith("#") ? (byte)50 : (byte)0 // packetsplit[1].ElementAt(0) == '#' ? (byte)50 : (byte)0 }); } } diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs index bd01fc96..a132a831 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs @@ -1,19 +1,24 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; -using ChickenAPI.Packets.Old.Game.Client.Inventory; +using ChickenAPI.Packets.ClientPackets.Inventory; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Inventory { public class WearPacketHandling : GenericGamePacketHandlerAsync { + public WearPacketHandling(ILogger log) : base(log) + { + } + protected override Task Handle(WearPacket packet, IPlayerEntity player) => player.EmitEventAsync(new InventoryWearEvent { - ItemWearType = packet.WearPacketType == 0 ? ItemWearType.Player : ItemWearType.Partner, - InventorySlot = packet.ItemSlot + ItemWearType = packet.Type == 0 ? ItemWearType.Player : ItemWearType.Partner, + InventorySlot = packet.InventorySlot }); } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs index 9b84f2ad..a19fa98b 100644 --- a/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Move/PreqPacketHandling.cs @@ -1,14 +1,19 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Portals.Events; -using ChickenAPI.Packets.Old.Game.Client.Movement; +using ChickenAPI.Packets.ClientPackets.Movement; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Move { public class PreqPacketHandling : GenericGamePacketHandlerAsync { + public PreqPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(PreqPacket packet, IPlayerEntity player) { PortalDto currentPortal = player.CurrentMap.Map.GetPortalFromPosition(player.Position.X, player.Position.Y); diff --git a/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs index 619c0149..8ee4a35b 100644 --- a/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Move/WalkPacketHandling.cs @@ -1,15 +1,19 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Movements.Extensions; -using ChickenAPI.Game._ECS.Entities; -using ChickenAPI.Packets.Old.Game.Client.Movement; +using ChickenAPI.Packets.ClientPackets.Movement; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Move { public class WalkPacketHandling : GenericGamePacketHandlerAsync { + public WalkPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(WalkPacket packet, IPlayerEntity player) { if (player.Position.X == packet.XCoordinate && player.Position.Y == packet.YCoordinate) @@ -24,7 +28,7 @@ protected override async Task Handle(WalkPacket packet, IPlayerEntity player) player.Position.X = packet.XCoordinate; player.Position.Y = packet.YCoordinate; - player.Speed = packet.Speed; + player.Speed = (byte)packet.Speed; await player.SendPacketAsync(player.GenerateCondPacket()); await player.BroadcastAsync(player.GenerateMvPacket()); diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs index 6722914a..6b4cfa04 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs @@ -1,16 +1,21 @@ using System.Threading.Tasks; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; -using ChickenAPI.Packets.Old.Game.Client.Shops; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Shop; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops { - public class NpcReqPacketHandling : GenericGamePacketHandlerAsync + public class NpcReqPacketHandling : GenericGamePacketHandlerAsync { - protected override async Task Handle(ReceivedNpcReqPacket packet, IPlayerEntity player) + public NpcReqPacketHandling(ILogger log) : base(log) + { + } + + protected override async Task Handle(NpcReqPacket packet, IPlayerEntity player) { if (packet.VisualType == VisualType.Player) { @@ -26,7 +31,12 @@ protected override async Task Handle(ReceivedNpcReqPacket packet, IPlayerEntity var npc = player.CurrentMap.GetEntity(packet.VisualId, VisualType.Npc); - await player.SendPacketAsync(new SentNpcReqPacket + if (npc == null) + { + return; + } + + await player.SendPacketAsync(new NpcReqPacket() { VisualType = VisualType.Npc, VisualId = npc.MapNpc.Id, diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs index 96800ef5..3c020a47 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs @@ -1,18 +1,24 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; -using ChickenAPI.Packets.Old.Game.Client.Shops; +using ChickenAPI.Packets.ClientPackets.Shops; +using ChickenAPI.Packets.Enumerations; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops { public class ShoppingPacketHandling : GenericGamePacketHandlerAsync { + public ShoppingPacketHandling(ILogger log) : base(log) + { + } + protected override Task Handle(ShoppingPacket packet, IPlayerEntity player) { - var npc = player.CurrentMap.GetEntity(packet.NpcId, VisualType.Npc); + var npc = player.CurrentMap.GetEntity(packet.VisualId, VisualType.Npc); if (npc == null) { Log.Info("npc null"); @@ -22,7 +28,7 @@ protected override Task Handle(ShoppingPacket packet, IPlayerEntity player) return player.EmitEventAsync(new ShopGetInformationEvent { Shop = npc, - Type = packet.Type + Type = (byte)packet.VisualType }); } } diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs index 035602c5..b3fb774a 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseAoeSkillPacketHandler.cs @@ -1,12 +1,17 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Packets.Old.Game.Client.Battle; +using ChickenAPI.Packets.ClientPackets.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill { public class UseAoeSkillPacketHandler : GenericGamePacketHandlerAsync { + public UseAoeSkillPacketHandler(ILogger log) : base(log) + { + } + protected override Task Handle(UseAoeSkillPacket packet, IPlayerEntity player) => Task.CompletedTask; } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs index 02d9e542..399addea 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs @@ -7,8 +7,11 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Skills.Args; +using ChickenAPI.Packets.ClientPackets.Battle; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Old.Game.Client.Battle; using ChickenAPI.Packets.Old.Game.Server.Battle; +using ChickenAPI.Packets.ServerPackets.Battle; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Skill @@ -27,7 +30,7 @@ protected override async Task Handle(UseSkillPacket packet, IPlayerEntity player player.IsSitting = false; } - if (!player.SkillComponent.SkillsByCastId.TryGetValue(packet.CastId, out SkillDto skill)) + if (!player.SkillsByCastId.TryGetValue(packet.CastId, out SkillDto skill)) { // skill does not exist await player.SendPacketAsync(player.GenerateEmptyCancelPacket(CancelPacketType.NotInCombatMode)); diff --git a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs index abedd859..ae81dc79 100644 --- a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs @@ -1,35 +1,38 @@ using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Enums; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Specialists.Args; +using ChickenAPI.Packets.ClientPackets.Specialists; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Client.Specialists; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Specialists { - public class SlPacketHandling : GenericGamePacketHandlerAsync + public class SlPacketHandling : GenericGamePacketHandlerAsync { - protected override Task Handle(SlPacket packet, IPlayerEntity player) + public SlPacketHandling(ILogger log) : base(log) { - string[] packetsplit = packet.OriginalContent.Split(' ', '^'); + } + protected override Task Handle(SpTransformPacket packet, IPlayerEntity player) + { switch (packet.Type) { case SlPacketType.WearSp: return player.EmitEventAsync(new SpTransformEvent { - Wait = packetsplit[1].ElementAt(0) == '#' ? false : player.Session.Account.Authority >= AuthorityType.GameMaster ? false : true + Wait = packet.Header.StartsWith("#") && player.Session.Account.Authority < AuthorityType.GameMaster }); case SlPacketType.ChangePoints: return player.EmitEventAsync(new SpChangePointsEvent { - Attack = packet.SpecialistDamage, - Defense = packet.SpecialistDefense, - Element = packet.SpecialistElement, - HpMp = packet.SpecialistHp + Attack = packet.SpecialistDamage.GetValueOrDefault(), + Defense = packet.SpecialistDefense.GetValueOrDefault(), + Element = packet.SpecialistElement.GetValueOrDefault(), + HpMp = packet.SpecialistHP.GetValueOrDefault() }); } diff --git a/src/Plugins/NosSharp.Pathfinder/Test/PathfinderTest.cs b/src/Plugins/NosSharp.Pathfinder/Test/PathfinderTest.cs index f40f5b4b..308b5536 100644 --- a/src/Plugins/NosSharp.Pathfinder/Test/PathfinderTest.cs +++ b/src/Plugins/NosSharp.Pathfinder/Test/PathfinderTest.cs @@ -10,10 +10,16 @@ namespace SaltyEmu.PathfinderPlugin.Test { public class PathfinderTest { - private static readonly Logger Log = Logger.GetLogger(); + private readonly ILogger Log; + + public PathfinderTest(ILogger log) + { + Log = log; + } public void RunTest(int repetition) { + /* var pathfinder = ChickenContainer.Instance.Resolve(); var map = new SimpleMap(new MapDto { @@ -43,6 +49,7 @@ public void RunTest(int repetition) { Log.Info($"x : {pos.X}, y : {pos.Y}"); } + */ } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs index 5e673b94..8088954a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs @@ -114,7 +114,7 @@ public static void InitializeItemUsageHandlers() public static void InjectDependencies() { - var config = new ConfigurationHelper(new ConfigurationSerializer()); + var config = new ConfigurationHelper(new JsonConfigurationSerializer()); ChickenContainer.Builder.Register(_ => config.Load($"plugins/config/{nameof(BasicPlugin)}/rates.json", true)) .As().SingleInstance(); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs index cfc516fc..5fa27dba 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_ProcessHitRequest_Handler.cs @@ -3,8 +3,8 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Battle.Events; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Hitting; @@ -17,7 +17,8 @@ using ChickenAPI.Game.Entities.Npc.Events; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Events; -using ChickenAPI.Packets.Old.Game.Server.Battle; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Battle; namespace SaltyEmu.BasicPlugin.EventHandlers.Battle { @@ -25,10 +26,8 @@ public class Battle_ProcessHitRequest_Handler : GenericEventPostProcessorBase _bCardHandlerContainer = bCardHandlerContainer; protected override async Task Handle(ProcessHitRequestEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs index 9d4b072a..19dd8249 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationSend_Handler.cs @@ -1,7 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; -using ChickenAPI.Core.i18n; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Groups; @@ -11,7 +11,7 @@ using ChickenAPI.Game._i18n; using ChickenAPI.Packets; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Server.Group; +using ChickenAPI.Packets.ServerPackets.Groups; namespace SaltyEmu.BasicPlugin.EventHandlers { @@ -20,7 +20,8 @@ public class Group_InvitationSend_Handler : GenericEventPostProcessorBase(); - [NpcDialogHandler(2)] public static void UpgradeFromNpc(IPlayerEntity player, NpcDialogEvent args) { @@ -69,9 +67,9 @@ public static void Recipe(IPlayerEntity player, NpcDialogEvent args) [NpcDialogHandler(18)] public static void TimeCircle(IPlayerEntity player, NpcDialogEvent args) { - player.SendPacketAsync(new SentNpcReqPacket + player.SendPacketAsync(new NpcReqPacket { - VisualType = ChickenAPI.Enums.Game.Entity.VisualType.Player, + VisualType = player.Type, VisualId = player.Id, Dialog = 17 }); diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index 417ac060..7526fcd9 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit 417ac0602f39c467075733bd7b7d6821b814c7b3 +Subproject commit 7526fcd9c96b45ef84db1a107f06e12ef593ec21 From 70ef9706a158a2cc8a7d1c4d3e8ae7a7432ed640 Mon Sep 17 00:00:00 2001 From: Blowa Date: Wed, 24 Apr 2019 17:09:31 +0800 Subject: [PATCH 14/24] continue fixing some things --- .../BasicAlgorithmPlugin.cs | 6 +++--- .../Utils/PluginDependencyInjector.cs | 21 ++++++++++++------- .../PacketHandlerPlugin.cs | 10 ++++----- .../Skill/UseSkillPacketHandling.cs | 7 +++++-- .../BCardHandlers/BCardBuffHandler.cs | 2 +- .../NpcDialogHandlers/WopenHandler.cs | 2 +- vendor/ChickenAPI.Packets | 2 +- 7 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/Plugins/NosSharp.BasicAlgorithm/BasicAlgorithmPlugin.cs b/src/Plugins/NosSharp.BasicAlgorithm/BasicAlgorithmPlugin.cs index c28da9f4..0a430eb4 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/BasicAlgorithmPlugin.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/BasicAlgorithmPlugin.cs @@ -7,7 +7,7 @@ namespace SaltyEmu.BasicAlgorithmPlugin { public class BasicAlgorithmPlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); public PluginEnableTime EnableTime => PluginEnableTime.PreContainerBuild; public string Name => nameof(BasicAlgorithmPlugin); @@ -21,9 +21,9 @@ public void OnEnable() public void OnLoad() { - Log.Info("Loading..."); + // Log.Info("Loading..."); AlgorithmDependenciesInjector.InjectDependencies(); - Log.Info("Algorithms initialized"); + // Log.Info("Algorithms initialized"); } public void ReloadConfig() diff --git a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs index d7159fe7..72d05d93 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs @@ -75,7 +75,7 @@ public static void RegisterDaos() // data ChickenContainer.Builder.Register(s => new MapDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new SkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new BCardDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new BCardDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new CardDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new ItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new NpcMonsterDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); @@ -83,13 +83,18 @@ public static void RegisterDaos() ChickenContainer.Builder.Register(s => new DropDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); // character - ChickenContainer.Builder.Register(s => new AccountDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterDao(s.Resolve(), s.Resolve(), characterConf, s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterMateDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterSkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterQuickListDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CharacterFamilyDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new AccountDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterDao(s.Resolve(), s.Resolve(), characterConf, s.Resolve())).As() + .InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterMateDao(s.Resolve(), s.Resolve(), s.Resolve())).As() + .InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterItemDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterSkillDao(s.Resolve(), s.Resolve(), s.Resolve())).As() + .InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterQuickListDao(s.Resolve(), s.Resolve(), s.Resolve())).As() + .InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CharacterFamilyDao(s.Resolve(), s.Resolve(), s.Resolve())).As() + .InstancePerLifetimeScope(); // family ChickenContainer.Builder.Register(s => new FamilyDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); diff --git a/src/Plugins/NosSharp.PacketHandler/PacketHandlerPlugin.cs b/src/Plugins/NosSharp.PacketHandler/PacketHandlerPlugin.cs index a7e6fa8b..61fe5afb 100644 --- a/src/Plugins/NosSharp.PacketHandler/PacketHandlerPlugin.cs +++ b/src/Plugins/NosSharp.PacketHandler/PacketHandlerPlugin.cs @@ -11,7 +11,7 @@ namespace NW.Plugins.PacketHandling { public class PacketHandlerPlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); public PluginEnableTime EnableTime => PluginEnableTime.PostContainerBuild; public string Name => "SaltyEmu"; @@ -37,7 +37,7 @@ public void OnEnable() Type type = handlerType.BaseType.GenericTypeArguments[0]; - Log.Info($"[CHARACTER_SCREEN][HANDLING] {handlerType}"); + // Log.Info($"[CHARACTER_SCREEN][HANDLING] {handlerType}"); packetPipeline.RegisterAsync(handler, type).ConfigureAwait(false).GetAwaiter().GetResult(); } catch (Exception) @@ -58,7 +58,7 @@ public void OnEnable() Type type = handlerType.BaseType.GenericTypeArguments[0]; - Log.Info($"[GAME][HANDLING] {handlerType}"); + // Log.Info($"[GAME][HANDLING] {handlerType}"); packetPipeline.RegisterAsync(handler, type).ConfigureAwait(false).GetAwaiter().GetResult(); } catch (Exception) @@ -69,13 +69,13 @@ public void OnEnable() } catch (Exception e) { - Log.Error("OnEnable", e); + // Log.Error("OnEnable", e); } } public void OnLoad() { - Log.Info("Loading..."); + // Log.Info("Loading..."); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(PacketHandlerPlugin).Assembly).AsClosedTypesOf(typeof(GenericSessionPacketHandlerAsync<>)).PropertiesAutowired(); ChickenContainer.Builder.RegisterAssemblyTypes(typeof(PacketHandlerPlugin).Assembly).AsClosedTypesOf(typeof(GenericGamePacketHandlerAsync<>)).PropertiesAutowired(); } diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs index 399addea..ad4aede1 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Battle.Extensions; @@ -9,8 +10,6 @@ using ChickenAPI.Game.Skills.Args; using ChickenAPI.Packets.ClientPackets.Battle; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Client.Battle; -using ChickenAPI.Packets.Old.Game.Server.Battle; using ChickenAPI.Packets.ServerPackets.Battle; using NW.Plugins.PacketHandling.Utils; @@ -18,6 +17,10 @@ namespace NW.Plugins.PacketHandling.Skill { public class UseSkillPacketHandling : GenericGamePacketHandlerAsync { + public UseSkillPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(UseSkillPacket packet, IPlayerEntity player) { if (packet.CastId != 0) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs index a3240ac0..87720d4c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs @@ -47,7 +47,7 @@ public static void Handle(IBattleEntity target, IBattleEntity sender, BCardDto b if (card == null) { - Log.Debug($"Couldn't find any buff with card Id : {bcard.SecondData}"); + //Log.Debug($"Couldn't find any buff with card Id : {bcard.SecondData}"); return; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs index 3ae4a268..90f50320 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs @@ -2,7 +2,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; -using ChickenAPI.Packets.Old.Game.Client.Npcs; +using ChickenAPI.Packets.ServerPackets.Player; using ChickenAPI.Packets.ServerPackets.Shop; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index 7526fcd9..3ac0e414 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit 7526fcd9c96b45ef84db1a107f06e12ef593ec21 +Subproject commit 3ac0e41404e4a0fc9cac59024578bebaefeddf84 From eef6fd556980c97eea5cad2fd5079a809aa53aa7 Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 26 Apr 2019 16:09:18 +0800 Subject: [PATCH 15/24] continue migration --- .../Character/CharacterFamilyDto.cs | 1 + .../Game/Families/FamilyAuthority.cs | 10 ------- .../JsonConfigurationSerializer.cs | 11 +++++++ src/ChickenAPI.Game.Impl/PlayerEntity.cs | 1 - .../Families/Events/FamilyJoinEvent.cs | 2 +- .../Close/CloseDefenceAlgorithm.cs | 2 +- .../NosSharp.DatabasePlugin/DatabasePlugin.cs | 7 +---- .../Models/Character/CharacterFamilyModel.cs | 1 + .../SaltyEmu.DatabasePlugin.csproj | 1 + .../NosSharp.Pathfinder/PathfinderPlugin.cs | 5 ++-- .../RedisPlugin.cs | 10 +++---- .../RedisSessionService.cs | 5 ++-- .../SaltyEmu.RedisWrappers.csproj | 1 + .../BasicBCardHandlerContainer.cs | 19 ++++++------ .../BasicPlugin.cs | 5 ++-- .../BasicPluginIoCInjector.cs | 16 ++++------ .../EventHandlers/Battle/BuffEventHandler.cs | 9 ++++++ .../Chat/PlayerChatEventHandler.cs | 8 ++++- .../EventHandlers/Effects/AddEffectHandler.cs | 7 ++++- .../Family/Family_Creation_Handler.cs | 8 +++-- .../Family/Family_Join_Handler.cs | 7 ++--- .../Groups/Group_InvitationAccept_Handler.cs | 1 + .../EventHandlers/Guri/BaseGuriHandler.cs | 7 +++-- .../Inventory_DestroyItem_Handler.cs | 6 ++++ .../Inventory_LoadInventory_Handler.cs | 1 + .../Inventory/Inventory_MoveItem_Handler.cs | 1 + .../Inventory_SendDetails_Handler.cs | 1 + .../Inventory/Inventory_WearItem_Handler.cs | 2 ++ .../EventHandlers/Maps/Map_Leave_Handler.cs | 9 ++++-- .../EventHandlers/Mates/PetEventHandler.cs | 4 +-- .../Players/Player_ExperienceGain_Handler.cs | 5 ++++ .../Players/Player_LevelUp_Handler.cs | 1 + .../Relation_InvitationReceive_Handler.cs | 12 ++++---- .../EventHandlers/ReqInfoEventHandler.cs | 2 ++ .../EventHandlers/Shops/Shop_Buy_Event.cs | 28 ++++++++--------- .../Skills/Skill_AddSkill_Handler.cs | 21 ++++++------- .../Skills/Skill_UseSkill_Handler.cs | 8 ++--- .../Specialist_Transform_Handler.cs | 3 +- .../Upgrading/Upgrading_Celloning_Handler.cs | 5 ++++ .../Upgrading/Upgrading_Summing_Handler.cs | 10 ++++--- .../GuriHandlers/EmoticonGuriHandler.cs | 4 +-- .../GuriHandlers/ReleasePetsHandler.cs | 5 ++-- .../ShellIdentifyingGuriHandler.cs | 4 +-- .../ItemUpgradeHandlers/RarifyItemHandler.cs | 2 +- .../BoxItem/PearlPetsReleaseHandler.cs | 1 + .../ItemUsageHandlers/Handler/WingsSpCard.cs | 17 ++++++----- .../NpcDialogHandlers/DialogHandler.cs | 5 ++-- .../NpcDialogHandlers/FamilyHandler.cs | 6 ++-- .../NpcDialog_UpgradeFamily_Handler.cs | 2 +- .../NpcDialogHandlers/TeleporterHandler.cs | 30 +++++++++---------- .../SaltyEmu.BasicPlugin.csproj | 1 + src/libs/SaltyEmu.Core/Logging/Logger.cs | 2 +- .../GenericGamePacketHandlerAsync.cs | 1 + .../GenericSessionPacketHandlerAsync.cs | 1 + src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj | 3 +- src/libs/SaltyEmu.Redis/RedisConfiguration.cs | 6 ++-- 56 files changed, 201 insertions(+), 152 deletions(-) delete mode 100644 src/ChickenAPI.Enums/Game/Families/FamilyAuthority.cs create mode 100644 src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs diff --git a/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs b/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs index 4bc28989..3b4e22e2 100644 --- a/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs +++ b/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Families; +using FamilyAuthority = ChickenAPI.Packets.Enumerations.FamilyAuthority; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Enums/Game/Families/FamilyAuthority.cs b/src/ChickenAPI.Enums/Game/Families/FamilyAuthority.cs deleted file mode 100644 index 1c4ce7ca..00000000 --- a/src/ChickenAPI.Enums/Game/Families/FamilyAuthority.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace ChickenAPI.Enums.Game.Families -{ - public enum FamilyAuthority - { - Head = 0, - Assistant = 1, - Manager = 2, - Member = 3 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs b/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs new file mode 100644 index 00000000..7415974b --- /dev/null +++ b/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs @@ -0,0 +1,11 @@ +using ChickenAPI.Core.Configurations; + +namespace ChickenAPI.Game.Impl +{ + public class JsonConfigurationSerializer : IConfigurationSerializer + { + public string Serialize(T conf) where T : IConfiguration => throw new System.NotImplementedException(); + + public T Deserialize(string buffer) where T : IConfiguration => throw new System.NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Impl/PlayerEntity.cs b/src/ChickenAPI.Game.Impl/PlayerEntity.cs index 4b00c8c9..2c57d191 100644 --- a/src/ChickenAPI.Game.Impl/PlayerEntity.cs +++ b/src/ChickenAPI.Game.Impl/PlayerEntity.cs @@ -36,7 +36,6 @@ using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Interfaces; using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; -using FamilyAuthority = ChickenAPI.Enums.Game.Families.FamilyAuthority; namespace ChickenAPI.Game.Entities.Player { diff --git a/src/ChickenAPI.Game/Families/Events/FamilyJoinEvent.cs b/src/ChickenAPI.Game/Families/Events/FamilyJoinEvent.cs index 1870db87..7008007e 100644 --- a/src/ChickenAPI.Game/Families/Events/FamilyJoinEvent.cs +++ b/src/ChickenAPI.Game/Families/Events/FamilyJoinEvent.cs @@ -1,7 +1,7 @@ using ChickenAPI.Data.Families; -using ChickenAPI.Enums.Game.Families; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._Events; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Families.Events { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs index 1ff74ed8..0d9da070 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs @@ -10,7 +10,7 @@ public class CloseDefenceAlgorithm : ICharacterStatAlgorithm public void Initialize() { - _stats = new int[(int)CharacterClassType.Unknown, MAX_LEVEL]; + _stats = new int[(int)CharacterClassType.MartialArtist + 1, MAX_LEVEL]; for (int i = 0; i < MAX_LEVEL; i++) diff --git a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs index 76a43c72..b53f02e2 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs @@ -3,6 +3,7 @@ using ChickenAPI.Core.Configurations; using ChickenAPI.Core.Plugins; using ChickenAPI.Core.Plugins.Exceptions; +using ChickenAPI.Game.Impl; using Microsoft.EntityFrameworkCore; using SaltyEmu.DatabasePlugin.Configuration; using SaltyEmu.DatabasePlugin.Context; @@ -11,12 +12,6 @@ namespace SaltyEmu.DatabasePlugin { - internal class JsonConfigurationSerializer : IConfigurationSerializer - { - public string Serialize(T conf) where T : IConfiguration => JsonConvert.SerializeObject(conf); - - public T Deserialize(string buffer) where T : IConfiguration => throw new NotImplementedException(); - } public class DatabasePlugin : IPlugin { private readonly ILogger Log; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs index 4e331ba4..36ce524a 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; using ChickenAPI.Enums.Game.Families; +using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Families; diff --git a/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj b/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj index 32d46297..d985d15b 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj +++ b/src/Plugins/NosSharp.DatabasePlugin/SaltyEmu.DatabasePlugin.csproj @@ -28,6 +28,7 @@ + diff --git a/src/Plugins/NosSharp.Pathfinder/PathfinderPlugin.cs b/src/Plugins/NosSharp.Pathfinder/PathfinderPlugin.cs index ce1a9325..d2169b66 100644 --- a/src/Plugins/NosSharp.Pathfinder/PathfinderPlugin.cs +++ b/src/Plugins/NosSharp.Pathfinder/PathfinderPlugin.cs @@ -10,15 +10,14 @@ namespace SaltyEmu.PathfinderPlugin { public class PathfinderPlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); public PluginEnableTime EnableTime => PluginEnableTime.PostContainerBuild; public string Name => nameof(PathfinderPlugin); public void OnLoad() { - Log.Info("Loading..."); + //Log.Info("Loading..."); ChickenContainer.Builder.Register(s => new Pathfinder()).As(); - Log.Info("Loaded !"); + // Log.Info("Loaded !"); } public void ReloadConfig() diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs b/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs index 38c2b33b..6b3a4061 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs @@ -1,5 +1,6 @@ using System; using Autofac; +using ChickenAPI.Core.Configurations; using ChickenAPI.Core.i18n; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; @@ -7,6 +8,7 @@ using ChickenAPI.Core.Utils; using ChickenAPI.Data.Server; using ChickenAPI.Game._i18n; +using ChickenAPI.Game.Impl; using SaltyEmu.Redis; using SaltyEmu.RedisWrappers.Redis; @@ -14,7 +16,6 @@ namespace SaltyEmu.RedisWrappers { public class RedisPlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); private readonly string _configurationPath = $"plugins/config/{nameof(RedisPlugin)}/conf.json"; private RedisConfiguration _configuration; public PluginEnableTime EnableTime => PluginEnableTime.PreContainerBuild; @@ -32,14 +33,11 @@ public void OnEnable() public void OnLoad() { - Log.Info("Loading..."); - _configuration = ConfigurationHelper.Load(_configurationPath, true); + IConfigurationManager conf = new ConfigurationHelper(new JsonConfigurationSerializer()); + _configuration = conf.Load(_configurationPath, true); ChickenContainer.Builder.Register(s => new RedisSessionService(_configuration)).As(); - Log.Info("ISessionService registered !"); ChickenContainer.Builder.Register(s => new RedisServerApi(_configuration)).As(); - Log.Info("IServerApiService registered !"); ChickenContainer.Builder.Register(s => new RedisGameLanguageService(_configuration)).As(); - Log.Info("IGameLanguageService registered !"); } public void ReloadConfig() diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs b/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs index 0a993449..2c961d0b 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs @@ -11,11 +11,12 @@ namespace SaltyEmu.RedisWrappers { public class RedisSessionService : ISessionService { - private readonly Logger _log = Logger.GetLogger(); + private readonly ILogger _log; private readonly IRedisTypedClient _client; - public RedisSessionService(RedisConfiguration configuration) + public RedisSessionService(RedisConfiguration configuration, ILogger log) { + _log = log; _client = new RedisClient(new RedisEndpoint { Host = configuration.Host, diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj b/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj index bc708c8e..47e7dc60 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj +++ b/src/Plugins/NosSharp.RedisSessionPlugin/SaltyEmu.RedisWrappers.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs index 905d8f1b..72b1175e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs @@ -13,12 +13,12 @@ namespace SaltyEmu.BasicPlugin.BCardHandlers { public class BasicBCardHandlerContainer : IBCardHandlerContainer { - private static readonly Logger Log = Logger.GetLogger(); - + private readonly ILogger _log; protected readonly Dictionary Useitem = new Dictionary(); - public BasicBCardHandlerContainer() + public BasicBCardHandlerContainer(ILogger log) { + _log = log; Assembly currentAsm = Assembly.GetAssembly(typeof(BasicPlugin)); // get types foreach (Type type in currentAsm.GetTypes().Where(s => s.GetMethods().Any(m => m.GetCustomAttribute() != null))) @@ -39,23 +39,24 @@ public void Register(IBCardEffectHandler handler) } Useitem.Add(handler.HandledType, handler); - Log.Info($"[REGISTER_HANDLER] BCARD_TYPE : {handler.HandledType} REGISTERED !"); + _log.Info($"[REGISTER_HANDLER] BCARD_TYPE : {handler.HandledType} REGISTERED !"); } - public Task Handle(IBattleEntity target, IBattleEntity sender, BCardDto bcard) + public async Task Handle(IBattleEntity target, IBattleEntity sender, BCardDto bcard) { if (target == null) { - return Task.CompletedTask; + return; } - Log.Info($"Trying to cast Bcard id : {bcard.Id} : {bcard.Type}"); + + _log.Info($"Trying to cast Bcard id : {bcard.Id} : {bcard.Type}"); if (!Useitem.TryGetValue(bcard.Type, out IBCardEffectHandler handler)) { - return Task.CompletedTask; + return; } - return handler.Handle(target, sender, bcard); + await handler.Handle(target, sender, bcard); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPlugin.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPlugin.cs index bc1c6c88..36ff4cfc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPlugin.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPlugin.cs @@ -5,7 +5,6 @@ namespace SaltyEmu.BasicPlugin { public class BasicPlugin : IPlugin { - private static readonly Logger Log = Logger.GetLogger(); public PluginEnableTime EnableTime => PluginEnableTime.PostContainerBuild; public string Name => nameof(BasicPlugin); @@ -23,9 +22,9 @@ public void OnEnable() public void OnLoad() { - Log.Info("Loading..."); + // Log.Info("Loading..."); BasicPluginIoCInjector.InjectDependencies(); - Log.Info("Loaded !"); + // Log.Info("Loaded !"); } public void ReloadConfig() diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs index 8088954a..0a860104 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BasicPluginIoCInjector.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Autofac; using ChickenAPI.Core.Configurations; using ChickenAPI.Core.Events; @@ -9,29 +8,24 @@ using ChickenAPI.Core.Utils; using ChickenAPI.Data.BCard; using ChickenAPI.Data.Item; -using ChickenAPI.Game; using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.BCards; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities; -using ChickenAPI.Game.Groups; using ChickenAPI.Game.GuriHandling.Handling; -using ChickenAPI.Game.Inventory.ItemUpgrade; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Game.Inventory.ItemUsage; using ChickenAPI.Game.Managers; using ChickenAPI.Game.NpcDialog; using ChickenAPI.Game._ECS; using ChickenAPI.Game._Network; -using Newtonsoft.Json; +using ChickenAPI.Game.Impl; using SaltyEmu.BasicPlugin.BCardHandlers; -using SaltyEmu.BasicPlugin.EventHandlers.Battle; using SaltyEmu.BasicPlugin.EventHandlers.Guri; using SaltyEmu.BasicPlugin.Implems; using SaltyEmu.BasicPlugin.ItemUpgradeHandlers; using SaltyEmu.BasicPlugin.ItemUsageHandlers; -using SaltyEmu.BasicPlugin.NpcDialogHandlers; using SaltyEmu.Commands; using SaltyEmu.Commands.Interfaces; @@ -138,14 +132,14 @@ public static void InjectDependencies() ChickenContainer.Builder.RegisterType().AsImplementedInterfaces().PropertiesAutowired().SingleInstance(); // bcard - ChickenContainer.Builder.Register(_ => new BasicBCardHandlerContainer()).As().SingleInstance(); + ChickenContainer.Builder.Register(_ => new BasicBCardHandlerContainer(_.Resolve())).As().SingleInstance(); ChickenContainer.Builder.Register(c => new SimpleItemInstanceDtoFactory(c.Resolve())).As().InstancePerDependency(); ChickenContainer.Builder.Register(_ => new RandomGenerator()).As().InstancePerDependency(); - ChickenContainer.Builder.Register(_ => new BaseGuriHandler()).As().SingleInstance(); + ChickenContainer.Builder.Register(_ => new BaseGuriHandler(_.Resolve())).As().SingleInstance(); // item usage - ChickenContainer.Builder.Register(_ => new UseItemHandlerContainer()).As().SingleInstance(); + ChickenContainer.Builder.Register(s => new UseItemHandlerContainer(s.Resolve())).As().SingleInstance(); // npc dialog ChickenContainer.Builder.Register(_ => new NpcDialogHandlerContainer()).As().SingleInstance(); // entityManagerContainer @@ -153,7 +147,7 @@ public static void InjectDependencies() // player manager ChickenContainer.Builder.Register(_ => new SimplePlayerManager()).As().SingleInstance(); ChickenContainer.Builder.Register(context => new CommandHandler(context.Resolve())).As().SingleInstance(); - ChickenContainer.Builder.Register(_ => new BasicUpgradeHandler()).As().SingleInstance(); + ChickenContainer.Builder.Register(s => new BasicUpgradeHandler(s.Resolve())).As().SingleInstance(); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/BuffEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/BuffEventHandler.cs index 89be7eda..06f9ead6 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/BuffEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/BuffEventHandler.cs @@ -3,12 +3,17 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Battle.Events; namespace SaltyEmu.BasicPlugin.EventHandlers.Battle { public class BattleEntity_AddBuff_Handler : GenericEventPostProcessorBase { + public BattleEntity_AddBuff_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(BattleEntityAddBuffEvent e, CancellationToken cancellation) { return Task.CompletedTask; @@ -17,6 +22,10 @@ protected override Task Handle(BattleEntityAddBuffEvent e, CancellationToken can public class BattleEntity_RemoveBuff_Handler : GenericEventPostProcessorBase { + public BattleEntity_RemoveBuff_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(BattleEntityRemoveBuffEvent e, CancellationToken cancellation) { return Task.CompletedTask; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs index 47516368..e9364fdc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Chat/PlayerChatEventHandler.cs @@ -1,14 +1,20 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Chat.Events; using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.ServerPackets.Chats; namespace SaltyEmu.BasicPlugin.EventHandlers.Chat { - public class PlayerChatEventHandler : GenericEventPostProcessorBase { + public PlayerChatEventHandler(ILogger log) : base(log) + { + } + protected override async Task Handle(ChatGeneralEvent e, CancellationToken cancellation) { var sayPacket = new SayPacket diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Effects/AddEffectHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Effects/AddEffectHandler.cs index 6c5f3d52..d6ce3fa8 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Effects/AddEffectHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Effects/AddEffectHandler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Effects.Events; @@ -8,6 +9,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Effects { public class AddEffectHandler : GenericEventPostProcessorBase { + public AddEffectHandler(ILogger log) : base(log) + { + } + protected override Task Handle(AddEffectEvent e, CancellationToken cancellation) { var effects = e.Sender.GetComponent(); @@ -18,7 +23,7 @@ protected override Task Handle(AddEffectEvent e, CancellationToken cancellation) e.Sender.AddComponent(effects); } - effects.Effects.Add(new EffectComponent.Effect(e.EffectId, e.Cooldown)); + effects.Effects.Add(new EffectComponent.Effect((int)e.EffectId, e.Cooldown)); return Task.CompletedTask; } } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs index 921e5c36..3b094307 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs @@ -1,13 +1,14 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.Families; using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Families; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Families.Events; using ChickenAPI.Game.Families.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Family { @@ -16,10 +17,11 @@ public class Family_Creation_Handler : GenericEventPostProcessorBase _characterFamilyService = characterFamilyService; protected override async Task Handle(FamilyJoinEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs index fd6cf9ab..d04cdca5 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs @@ -7,6 +7,7 @@ using ChickenAPI.Game.Groups.Events; using ChickenAPI.Game.Helpers; using ChickenAPI.Game._i18n; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/BaseGuriHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/BaseGuriHandler.cs index 39056ce4..4afa18c7 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/BaseGuriHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/BaseGuriHandler.cs @@ -11,11 +11,12 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Guri { public class BaseGuriHandler : IGuriHandler { - private static readonly Logger Log = Logger.GetLogger(); + private readonly ILogger _log; protected readonly Dictionary HandlersByDialogId; - public BaseGuriHandler() + public BaseGuriHandler(ILogger log) { + _log = log; HandlersByDialogId = new Dictionary(); Assembly currentAsm = Assembly.GetAssembly(typeof(BasicPlugin)); // get types @@ -36,7 +37,7 @@ public void Register(GuriRequestHandler handler) return; } - Log.Info($"[REGISTER_HANDLER] GURI_EFFECT : {handler.GuriEffectId} REGISTERED !"); + _log.Info($"[REGISTER_HANDLER] GURI_EFFECT : {handler.GuriEffectId} REGISTERED !"); HandlersByDialogId.Add(handler.GuriEffectId, handler); } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs index d470885b..6ea41fb2 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_DestroyItem_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -8,11 +9,16 @@ using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { public class Inventory_DestroyItem_Handler : GenericEventPostProcessorBase { + public Inventory_DestroyItem_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(InventoryDestroyItemEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs index d63c8f4a..767176b9 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs @@ -8,6 +8,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs index 8822a2dc..ce8dcbef 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs @@ -9,6 +9,7 @@ using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs index 386ef609..601f911b 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs @@ -5,6 +5,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs index a6c7f121..5048fa69 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs @@ -10,6 +10,8 @@ using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Leave_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Leave_Handler.cs index 7fbbf310..7e890f24 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Leave_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Leave_Handler.cs @@ -1,21 +1,26 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Maps.Events; using ChickenAPI.Game._BroadcastRules; -using ChickenAPI.Packets.Old.Game.Server.Map; +using ChickenAPI.Packets.ServerPackets.Map; namespace SaltyEmu.BasicPlugin.EventHandlers.Maps { public class Map_Leave_Handler : GenericEventPostProcessorBase { + public Map_Leave_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(MapLeaveEvent e, CancellationToken cancellation) { if (e.Sender is IPlayerEntity session) { - await session.SendPacketAsync(new MapoutPacket()); + await session.SendPacketAsync(new MapOutPacket()); await e.Map.BroadcastAsync(e.Sender.GenerateOutPacket(), new AllExpectOne(session)); return; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Mates/PetEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Mates/PetEventHandler.cs index 68b0fa2a..454a9b88 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Mates/PetEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Mates/PetEventHandler.cs @@ -22,10 +22,10 @@ public class PetEventHandler : GenericEventPostProcessorBase private readonly IGameEntityFactory _entityFactory; private readonly INpcMonsterService _npcMonsterService; - public PetEventHandler(INpcMonsterService npcMonsterService, IGameEntityFactory entityFactory) + public PetEventHandler(ILogger log, IGameEntityFactory entityFactory, INpcMonsterService npcMonsterService) : base(log) { - _npcMonsterService = npcMonsterService; _entityFactory = entityFactory; + _npcMonsterService = npcMonsterService; } public static void AddPet(IPlayerEntity player, AddPetEvent e) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_ExperienceGain_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_ExperienceGain_Handler.cs index 8e73288e..23674244 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_ExperienceGain_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_ExperienceGain_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Events; using ChickenAPI.Game.Entities.Player.Extensions; @@ -9,6 +10,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers { public class Player_ExperienceGain_Handler : GenericEventPostProcessorBase { + public Player_ExperienceGain_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(ExperienceGainEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs index adabd96f..b3b87060 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs @@ -9,6 +9,7 @@ using ChickenAPI.Game.Entities.Player.Events; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Skills.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs index b41d190f..ad574a6e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationReceive_Handler.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.i18n; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -10,7 +11,8 @@ using ChickenAPI.Game.Relations.Events; using ChickenAPI.Game._i18n; using ChickenAPI.Packets; -using ChickenAPI.Packets.Old.Game.Server.Relations; +using ChickenAPI.Packets.ClientPackets.Relations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Relations { @@ -19,10 +21,10 @@ public class Relation_InvitationReceive_Handler : GenericEventPostProcessorBase< private readonly IPlayerManager _playerManager; private readonly ICharacterService _characterService; - public Relation_InvitationReceive_Handler(ICharacterService characterService, IPlayerManager playerManager) + public Relation_InvitationReceive_Handler(ILogger log, IPlayerManager playerManager, ICharacterService characterService) : base(log) { - _characterService = characterService; _playerManager = playerManager; + _characterService = characterService; } protected override async Task Handle(RelationInvitationReceiveEvent e, CancellationToken cancellation) @@ -48,8 +50,8 @@ protected override async Task Handle(RelationInvitationReceiveEvent e, Cancellat senderInfo = target.Character; } - PacketBase acceptPacket = new FInsPacket { CharacterId = e.Invitation.OwnerId, Type = FInsPacketType.Accept }; - PacketBase refusePacket = new FInsPacket { CharacterId = e.Invitation.OwnerId, Type = FInsPacketType.Refuse }; + PacketBase acceptPacket = new FinsPacket { CharacterId = e.Invitation.OwnerId, Type = FinsPacketType.Accepted }; + PacketBase refusePacket = new FinsPacket { CharacterId = e.Invitation.OwnerId, Type = FinsPacketType.Rejected }; string question = player.GetLanguageFormat(PlayerMessages.FRIEND_X_INVITED_YOU_TO_JOIN_HIS_FRIENDLIST, senderInfo.Name); await player.SendDialog(acceptPacket, refusePacket, question); } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs index 637ff469..1a831138 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/ReqInfoEventHandler.cs @@ -6,7 +6,9 @@ using ChickenAPI.Game.Entities.Npc.Extensions; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; +using ChickenAPI.Game.Extensions.PacketGeneration; using ChickenAPI.Game.Managers; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs index b8b2aa9c..b7a816c9 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs @@ -6,6 +6,7 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.i18n; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Data.Character; using ChickenAPI.Data.Item; @@ -31,10 +32,8 @@ public class Shop_Buy_Event : GenericEventPostProcessorBase { private readonly IRandomGenerator _randomGenerator; - public Shop_Buy_Event(IRandomGenerator randomGenerator) - { - _randomGenerator = randomGenerator; - } + + public Shop_Buy_Event(ILogger log, IRandomGenerator randomGenerator) : base(log) => _randomGenerator = randomGenerator; protected override async Task Handle(ShopBuyEvent e, CancellationToken cancellation) { @@ -97,13 +96,13 @@ private static async Task HandleNpcSkillBuyRequest(IPlayerEntity player, ShopBuy } // check skill cooldown - if (player.SkillComponent.CooldownsBySkillId.Any(s => s.Item2 == shopBuy.Slot)) + if (player.CooldownsBySkillId.Any(s => s.Item2 == shopBuy.Slot)) { return; } // check skill already exists in player skills - if (player.SkillComponent.Skills.ContainsKey(shopBuy.Slot)) + if (player.Skills.ContainsKey(shopBuy.Slot)) { return; } @@ -149,9 +148,6 @@ private static async Task HandleNpcSkillBuyRequest(IPlayerEntity player, ShopBuy case CharacterClassType.MartialArtist: minimumLevel = skillShop.Skill.MinimumWrestlerLevel; break; - - case CharacterClassType.Unknown: - break; } if (skillShop.Skill.MinimumSwordmanLevel == 0 && skillShop.Skill.MinimumArcherLevel == 0 && skillShop.Skill.MinimumMagicianLevel == 0) @@ -179,11 +175,11 @@ private static async Task HandleNpcSkillBuyRequest(IPlayerEntity player, ShopBuy if (skillShop.SkillId < 200) { - foreach (CharacterSkillDto skill in player.SkillComponent.CharacterSkills.Select(s => s.Value)) + foreach (CharacterSkillDto skill in player.CharacterSkills.Select(s => s.Value)) { if (skillShop.Skill.CastId == skill.Skill.CastId && skill.Skill.Id < 200) { - player.SkillComponent.CharacterSkills.Remove(skill.Id); + player.CharacterSkills.Remove(skill.Id); } } } @@ -192,11 +188,11 @@ private static async Task HandleNpcSkillBuyRequest(IPlayerEntity player, ShopBuy // remove old upgrade if (skillShop.SkillId >= 200 && skillShop.Skill.UpgradeSkill != 0) { - CharacterSkillDto oldupgrade = player.SkillComponent.CharacterSkills.FirstOrDefault(s => + CharacterSkillDto oldupgrade = player.CharacterSkills.FirstOrDefault(s => s.Value.Skill.UpgradeSkill == skillShop.Skill.UpgradeSkill && s.Value.Skill.UpgradeType == skillShop.Skill.UpgradeType && s.Value.Skill.UpgradeSkill != 0).Value; if (oldupgrade != null) { - player.SkillComponent.CharacterSkills.Remove(oldupgrade.Id); + player.CharacterSkills.Remove(oldupgrade.Id); } } @@ -255,7 +251,7 @@ private async Task HandleNpcItemBuyRequest(IPlayerEntity player, ShopBuyEvent sh if (!isReputBuy && price < 0 && price * percent > player.Character.Gold) { - await player.SendPacketAsync(player.GenerateShopMemoPacket(SMemoPacketType.FailNpc, player.GetLanguage(PlayerMessages.YOU_DONT_HAVE_ENOUGH_GOLD))); + await player.SendPacketAsync(player.GenerateShopMemoPacket(SMemoType.Error, player.GetLanguage(PlayerMessages.YOU_DONT_HAVE_ENOUGH_GOLD))); return; } @@ -263,7 +259,7 @@ private async Task HandleNpcItemBuyRequest(IPlayerEntity player, ShopBuyEvent sh { if (price > player.Character.Reput) { - await player.SendPacketAsync(player.GenerateShopMemoPacket(SMemoPacketType.FailNpc, player.GetLanguage(PlayerMessages.YOU_DONT_HAVE_ENOUGH_REPUTATION))); + await player.SendPacketAsync(player.GenerateShopMemoPacket(SMemoType.Error, player.GetLanguage(PlayerMessages.YOU_DONT_HAVE_ENOUGH_REPUTATION))); return; } @@ -288,7 +284,7 @@ private async Task HandleNpcItemBuyRequest(IPlayerEntity player, ShopBuyEvent sh bool canAddItem = player.Inventory.CanAddItem(item.Item, amount); if (!canAddItem) { - await player.SendPacketAsync(player.GenerateShopMemoPacket(SMemoPacketType.FailNpc, player.GetLanguage(PlayerMessages.YOU_DONT_HAVE_ENOUGH_SPACE_IN_INVENTORY))); + await player.SendPacketAsync(player.GenerateShopMemoPacket(SMemoType.Error, player.GetLanguage(PlayerMessages.YOU_DONT_HAVE_ENOUGH_SPACE_IN_INVENTORY))); return; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs index 53acddaf..102a6d03 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs @@ -8,6 +8,7 @@ using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Skills; using ChickenAPI.Game.Skills.Args; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Skills { @@ -20,12 +21,12 @@ protected override async Task Handle(PlayerAddSkillEvent e, CancellationToken ca return; } - SkillComponent component = player.SkillComponent; if (e.Skill is null) { return; //the skill doesn't exist? } + if (e.ForceChecks) { if (player.Character is null) @@ -75,10 +76,6 @@ protected override async Task Handle(PlayerAddSkillEvent e, CancellationToken ca case CharacterClassType.MartialArtist: classLevel = e.Skill.MinimumWrestlerLevel; break; - - case CharacterClassType.Unknown: - classLevel = e.Skill.LevelMinimum; - break; } if (classLevel > player.Level) @@ -89,38 +86,38 @@ protected override async Task Handle(PlayerAddSkillEvent e, CancellationToken ca if (e.Skill.Id < 200) { - foreach (SkillDto skill in component.Skills.Values) + foreach (SkillDto skill in player.Skills.Values) { if (e.Skill.CastId == skill.CastId && skill.Id < 200) { - component.Skills.Remove(skill.Id); + player.Skills.Remove(skill.Id); } } } else { - if (component.Skills.ContainsKey(e.Skill.Id)) + if (player.Skills.ContainsKey(e.Skill.Id)) { return; //we already have that skill! } if (e.Skill.UpgradeSkill != 0) //means it's not a skill but an upgrade { - SkillDto oldUpgrade = component.Skills.Values.FirstOrDefault( + SkillDto oldUpgrade = player.Skills.Values.FirstOrDefault( s => s.UpgradeSkill == e.Skill.UpgradeSkill && s.UpgradeType == e.Skill.UpgradeType && s.UpgradeSkill != 0); if (!(oldUpgrade is null)) { - component.Skills.Remove(oldUpgrade.Id); + player.Skills.Remove(oldUpgrade.Id); } } } - if (!component.Skills.ContainsKey(e.Skill.Id)) + if (!player.Skills.ContainsKey(e.Skill.Id)) { - component.Skills.Add(e.Skill.Id, e.Skill); + player.Skills.Add(e.Skill.Id, e.Skill); } //todo: send different packets to add the skill. diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs index b600ba13..e05460b1 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs @@ -3,6 +3,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Enums.Game.Skill; @@ -13,6 +14,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game.Skills.Args; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.EventHandlers.Skills { @@ -20,10 +22,8 @@ public class Skill_UseSkill_Handler : GenericEventPostProcessorBase _hitRequestFactory = hitRequestFactory; protected override async Task Handle(UseSkillEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs index fbf62cc2..b8219ca3 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs @@ -22,6 +22,7 @@ using ChickenAPI.Game.Skills.Extensions; using ChickenAPI.Game.Specialists.Args; using ChickenAPI.Game.Specialists.Extensions; +using ChickenAPI.Packets.ClientPackets.Specialists; using ChickenAPI.Packets.Enumerations; using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; @@ -78,7 +79,7 @@ protected override async Task Handle(SpTransformEvent e, CancellationToken cance if (e.Wait) { - await player.SendDelayAsync(5000, DelayPacketType.Locomotion, $"#sl^0"); + await player.SendDelayAsync(5000, DelayPacketType.Locomotion, new SpTransformPacket()); return; } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs index 9f9771b6..349bb6b6 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Celloning_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -13,6 +14,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers { public class Upgrading_Celloning_Handler : GenericEventPostProcessorBase { + public Upgrading_Celloning_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(CellonItemEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs index b5eb0e8e..51083928 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Summing_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; @@ -10,8 +11,8 @@ using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; +using ChickenAPI.Packets.ClientPackets.Inventory; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.Old.Game.Client.Inventory; namespace SaltyEmu.BasicPlugin.EventHandlers { @@ -20,10 +21,11 @@ public class Upgrading_Summing_Handler : GenericEventPostProcessorBase(); + // private static readonly Logger Log = Logger.GetLogger(); /// /// This method will teleport the requester to Act 6 @@ -28,7 +28,7 @@ public static void OnEmoticonRequest(IPlayerEntity player, GuriEvent e) // todo receiver type player.BroadcastAsync(player.EmojiToEffectPacket((EmojiType)e.Data)).ConfigureAwait(false).GetAwaiter().GetResult(); - Log.Info($"[GURI][EMOTICON] {player.Character.Name} used emoji : "); + // Log.Info($"[GURI][EMOTICON] {player.Character.Name} used emoji : "); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs index ecf07c08..94dd8c27 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs @@ -6,12 +6,13 @@ using ChickenAPI.Game.GuriHandling.Handling; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.GuriHandlers { public class ReleasePetsHandler { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); /// /// This method will teleport the requester to Act 6 @@ -40,7 +41,7 @@ public static void ReleasePets(IPlayerEntity player, GuriEvent e) Option = 50 }); - Log.Info($"[GURI][RELEASE_PETS] {player.Character.Name} used Pearl : "); + // Log.Info($"[GURI][RELEASE_PETS] {player.Character.Name} used Pearl : "); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ShellIdentifyingGuriHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ShellIdentifyingGuriHandler.cs index c98e2d53..6458ede2 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ShellIdentifyingGuriHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ShellIdentifyingGuriHandler.cs @@ -7,7 +7,7 @@ namespace SaltyEmu.BasicPlugin.GuriHandlers { public class ShellIdentifyingGuriHandler { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); /// /// This method will teleport the requester to Act 6 @@ -18,7 +18,7 @@ public class ShellIdentifyingGuriHandler [GuriEffect(204)] public static void OnShellIdentifyRequest(IPlayerEntity player, GuriEvent e) { - Log.Info($"[GURI][SHELL_IDENTIFY] {player.Character.Name} identified shell : "); + // Log.Info($"[GURI][SHELL_IDENTIFY] {player.Character.Name} identified shell : "); } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs index c13a1f06..8bc0f518 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs @@ -13,7 +13,7 @@ namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { public class RarifyItemHandler { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); [ItemUpgradeHandler(UpgradePacketType.RarifyItem)] public static void RarifyNpc(IPlayerEntity player, ItemUpgradeEvent e) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs index 001ecf5b..db599da8 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs @@ -7,6 +7,7 @@ using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.ItemUsage; using ChickenAPI.Game.Mates.Events; +using ChickenAPI.Packets.ClientPackets.Player; namespace SaltyEmu.BasicPlugin.ItemUsageHandlers.Handler.BoxItem { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs index acc8774c..0eb06117 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs @@ -6,13 +6,14 @@ using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.ItemUsage; -using ChickenAPI.Packets.Old.Game.Client.Inventory; +using ChickenAPI.Packets.ClientPackets.Inventory; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.ItemUsageHandlers.Handler { public class WingsSpCardHandler : IUseItemRequestHandlerAsync { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); public ItemType Type => ItemType.Special; public long EffectId => 650; @@ -29,14 +30,14 @@ public async Task Handle(IPlayerEntity player, InventoryUseItemEvent e) return; } - await player.SendQuestionAsync(new UiPacket + await player.SendQuestionAsync(new UseItemPacket { VisualType = VisualType.Player, - CharacterId = player.Id, - InventoryType = e.Item.Type, - InventorySlot = (byte)e.Item.Slot, - Unknown2 = 3, - Unknown3 = 0 + VisualId = player.Id, + Type = e.Item.Type, + Slot = (byte)e.Item.Slot, + Parameter = 3, + Mode = 0, }, "ASK_WINGS_CHANGE"); return; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs index dbb57cdd..ca6c2e81 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs @@ -4,12 +4,13 @@ using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers { public class DialogHandler { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); [NpcDialogHandler(1)] public static void ChangeJobMiMi(IPlayerEntity player, NpcDialogEvent args) @@ -36,7 +37,7 @@ public static void ChangeJobMiMi(IPlayerEntity player, NpcDialogEvent args) return; } - player.ChangeClass((CharacterClassType)args.Type); + player.ChangeClass((CharacterClassType)args.Type).ConfigureAwait(false).GetAwaiter().GetResult(); // TODO : LATER /* if (Session.Character.Inventory.All(i => i.Type == PocketType.Wear)) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/FamilyHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/FamilyHandler.cs index 977fe1b9..917a259c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/FamilyHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/FamilyHandler.cs @@ -1,16 +1,14 @@ using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Families; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers { public class FamilyHandler { - private static readonly Logger Log = Logger.GetLogger(); - [NpcDialogHandler(23)] public static void CreateFamily(IPlayerEntity player, NpcDialogEvent args) { @@ -52,6 +50,7 @@ public static void UpgradeFamilySize2(IPlayerEntity player, NpcDialogEvent args) { return; } + if (player.FamilyCharacter.Authority != FamilyAuthority.Head) { /* await session.SendPacketAsync(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("ONLY_HEAD_CAN_BUY"), 10)); @@ -65,6 +64,7 @@ public static void UpgradeFamilySize2(IPlayerEntity player, NpcDialogEvent args) //await session.SendPacketAsync(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("NOT_ENOUGH_MONEY"), 10)); return; } + player.GoldLess(10000000); player.Family.MaxSize = 100; /*FamilyDTO fam = Session.Character.Family; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs index 41d8b489..6383ce07 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/Handlers/Families/NpcDialog_UpgradeFamily_Handler.cs @@ -23,7 +23,7 @@ public async Task Execute(IPlayerEntity player, NpcDialogEvent e) return; } - if (player.FamilyCharacter.Authority != ChickenAPI.Enums.Game.Families.FamilyAuthority.Head) + if (player.FamilyCharacter.Authority != FamilyAuthority.Head) { await player.SendChatMessageAsync(PlayerMessages.FAMILY_YOU_NEED_TO_BE_LEADER, SayColorType.Yellow); await player.SendModalAsync(PlayerMessages.FAMILY_YOU_NEED_TO_BE_LEADER, ModalPacketType.Default); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/TeleporterHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/TeleporterHandler.cs index 0fc7aa53..ed428595 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/TeleporterHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/TeleporterHandler.cs @@ -10,8 +10,6 @@ namespace SaltyEmu.BasicPlugin.NpcDialogHandlers { public class TeleporterHandler { - private static readonly Logger Log = Logger.GetLogger(); - /// /// This method will teleport the requester to Krem or Alveus, depending on which dialog type he choosed /// @@ -28,7 +26,7 @@ public static void OnNpcDialogTeleport(IPlayerEntity player, NpcDialogEvent args if (player.Character.Gold <= 1000 * args.Type) { // No Money -> SendMsg(NOMONEY); - Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); + // Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); return; } @@ -45,7 +43,7 @@ public static void OnNpcDialogTeleport(IPlayerEntity player, NpcDialogEvent args break; } } - + [NpcDialogHandler(17)] public static void EnterArenaInstance(IPlayerEntity player, NpcDialogEvent args) { @@ -71,7 +69,7 @@ public static void EnterArenaInstance(IPlayerEntity player, NpcDialogEvent args) if (player.Character.Gold <= 500 * 1 * args.Type) { // No Money -> SendMsg(NOMONEY); - Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); + // Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); return; } @@ -93,10 +91,10 @@ public static void EnterArenaInstance(IPlayerEntity player, NpcDialogEvent args) [NpcDialogHandler(301)] public static void OnGrahamDialogTeleport(IPlayerEntity player, NpcDialogEvent args) { - Log.Info($"[TELEPORT][GRAHAM] {player.Character.Name}"); + // Log.Info($"[TELEPORT][GRAHAM] {player.Character.Name}"); // need to provide implementation } - + [NpcDialogHandler(26)] public static void TeleportUnknow(IPlayerEntity player, NpcDialogEvent args) { @@ -109,7 +107,7 @@ public static void TeleportUnknow(IPlayerEntity player, NpcDialogEvent args) if (player.Character.Gold <= 5000 * args.Type) { // No Money -> SendMsg(NOMONEY); - Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); + // Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); return; } @@ -117,7 +115,7 @@ public static void TeleportUnknow(IPlayerEntity player, NpcDialogEvent args) //TeleportationHelper.TeleportTo(player, 20, 10, 91); } - + [NpcDialogHandler(45)] public static void TeleportUnknow2(IPlayerEntity player, NpcDialogEvent args) { @@ -130,7 +128,7 @@ public static void TeleportUnknow2(IPlayerEntity player, NpcDialogEvent args) if (player.Character.Gold <= 500) { // No Money -> SendMsg(NOMONEY); - Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); + // Log.Info($"[TELEPORT][NO-MONEY] {player.Character.Name}"); return; } @@ -138,7 +136,7 @@ public static void TeleportUnknow2(IPlayerEntity player, NpcDialogEvent args) player.TeleportTo(20, 10, 91); } - + [NpcDialogHandler(132)] public static void TeleportUnknow3(IPlayerEntity player, NpcDialogEvent args) { @@ -150,7 +148,7 @@ public static void TeleportUnknow3(IPlayerEntity player, NpcDialogEvent args) //TeleportationHelper.TeleportTo(player, 20, 10, 91); } - + [NpcDialogHandler(301)] public static void TeleportUnknow4(IPlayerEntity player, NpcDialogEvent args) { @@ -162,7 +160,7 @@ public static void TeleportUnknow4(IPlayerEntity player, NpcDialogEvent args) //TeleportationHelper.TeleportTo(player, 20, 10, 91); } - + [NpcDialogHandler(150)] public static void EnterLod(IPlayerEntity player, NpcDialogEvent args) { @@ -193,19 +191,19 @@ public static void EnterLod(IPlayerEntity player, NpcDialogEvent args) player.TeleportTo(150, 153, 145); } - + [NpcDialogHandler(5004)] public static void AlveusFromAct4(IPlayerEntity player, NpcDialogEvent args) { player.TeleportTo(145, 50, 41); } - + [NpcDialogHandler(5011)] public static void GoToAct5(IPlayerEntity player, NpcDialogEvent args) { player.TeleportTo(170, 127, 46); } - + [NpcDialogHandler(5012)] public static void TpUnknow(IPlayerEntity player, NpcDialogEvent args) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj b/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj index 2d46b84a..a906964e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/SaltyEmu.BasicPlugin.csproj @@ -10,6 +10,7 @@ + diff --git a/src/libs/SaltyEmu.Core/Logging/Logger.cs b/src/libs/SaltyEmu.Core/Logging/Logger.cs index 05fa807b..06898188 100644 --- a/src/libs/SaltyEmu.Core/Logging/Logger.cs +++ b/src/libs/SaltyEmu.Core/Logging/Logger.cs @@ -13,7 +13,7 @@ public class Logger : ChickenAPI.Core.Logging.ILogger public Logger(Type type) => Log = LogManager.GetLogger(type.ToString()); public Logger(string prefix) => Log = LogManager.GetLogger(prefix); - private ILogger Log { get; } + private NLog.ILogger Log { get; } /// /// Initialize logger's configuration. diff --git a/src/libs/SaltyEmu.Core/PacketHandling/GenericGamePacketHandlerAsync.cs b/src/libs/SaltyEmu.Core/PacketHandling/GenericGamePacketHandlerAsync.cs index 1b986661..e2f0d4ab 100644 --- a/src/libs/SaltyEmu.Core/PacketHandling/GenericGamePacketHandlerAsync.cs +++ b/src/libs/SaltyEmu.Core/PacketHandling/GenericGamePacketHandlerAsync.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace SaltyEmu.Core.PacketHandling { diff --git a/src/libs/SaltyEmu.Core/PacketHandling/GenericSessionPacketHandlerAsync.cs b/src/libs/SaltyEmu.Core/PacketHandling/GenericSessionPacketHandlerAsync.cs index fb88423e..7b8b6be8 100644 --- a/src/libs/SaltyEmu.Core/PacketHandling/GenericSessionPacketHandlerAsync.cs +++ b/src/libs/SaltyEmu.Core/PacketHandling/GenericSessionPacketHandlerAsync.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Game._Network; using ChickenAPI.Packets; +using ChickenAPI.Packets.Interfaces; namespace SaltyEmu.Core.PacketHandling { diff --git a/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj b/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj index 2bd445bf..43be11a5 100644 --- a/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj +++ b/src/libs/SaltyEmu.Core/SaltyEmu.Core.csproj @@ -7,10 +7,11 @@ + - + diff --git a/src/libs/SaltyEmu.Redis/RedisConfiguration.cs b/src/libs/SaltyEmu.Redis/RedisConfiguration.cs index 15938875..02f19743 100644 --- a/src/libs/SaltyEmu.Redis/RedisConfiguration.cs +++ b/src/libs/SaltyEmu.Redis/RedisConfiguration.cs @@ -1,6 +1,8 @@ -namespace SaltyEmu.Redis +using ChickenAPI.Core.Configurations; + +namespace SaltyEmu.Redis { - public class RedisConfiguration + public class RedisConfiguration : IConfiguration { public RedisConfiguration() { From 363ed81e362e6e55955a157605b95c7fccfc9046 Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 26 Apr 2019 16:34:21 +0800 Subject: [PATCH 16/24] migrating --- vendor/ChickenAPI.Packets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index 3ac0e414..265e3900 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit 3ac0e41404e4a0fc9cac59024578bebaefeddf84 +Subproject commit 265e39005497c143ff7b1820048d408425794187 From ba53b2699960c91a87984235f8152fe530b6eb8d Mon Sep 17 00:00:00 2001 From: Blowa Date: Sun, 19 May 2019 17:37:31 +0800 Subject: [PATCH 17/24] SaltyEmu now compiles (should rework some essential things before merging to master) --- SaltyEmu.sln | 7 - .../Game/Character/CharacterDignity.cs | 12 - .../Game/Character/CharacterRep.cs | 55 -- .../Game/Families/FamilyAuthorityType.cs | 9 - .../_TOCLEAN/EqPacketExtensions.cs | 6 +- .../_TOCLEAN/FdPacketExtension.cs | 1 + .../Decoder/NostaleLoginDecoder.cs | 4 +- .../Encoder/NostaleLoginEncoder.cs | 4 +- src/Login/LoginServer.cs | 6 +- src/Login/Network/ClientSession.cs | 5 +- src/Login/Network/NetworkManager.cs | 12 +- src/Login/SimplePluginManager.cs | 4 +- .../NosSharp.DatabasePlugin/DatabasePlugin.cs | 2 +- .../Services/Card/CardDao.cs | 3 +- .../Services/Drop/DropDao.cs | 3 +- .../Services/Families/FamilyDao.cs | 3 +- .../Services/Item/ItemDao.cs | 3 +- .../Services/Map/MapDao.cs | 3 +- .../Services/Map/MapMonsterDao.cs | 4 +- .../Services/Map/MapNpcDao.cs | 4 +- .../Services/Map/MapPortalDao.cs | 3 +- .../Services/NpcMonster/NpcMonsterDao.cs | 3 +- .../Services/NpcMonster/NpcMonsterSkillDao.cs | 3 +- .../Services/Shop/RecipeDao.cs | 3 +- .../Services/Shop/RecipeItemDao.cs | 3 +- .../Services/Shop/ShopDao.cs | 3 +- .../Services/Shop/ShopItemDao.cs | 3 +- .../Services/Shop/ShopSkillDao.cs | 3 +- .../Services/Skill/SkillDao.cs | 3 +- .../Utils/PluginDependencyInjector.cs | 6 +- .../Chat/SayPacketHandling.cs | 5 + .../Entity/ReqInfoPacketHandling.cs | 5 + .../Inventory/MviPacketHandling.cs | 5 + .../Npc/Dialog/NRunPacketHandling.cs | 10 +- .../Shops/NpcReqPacketHandling.cs | 19 +- .../Skill/QuickListPacketHandling.cs | 5 + .../RedisPlugin.cs | 12 +- .../Battle/Battle_FillHitRequest_Handler.cs | 6 +- .../Family/Family_Kick_Handler.cs | 5 +- .../Family/Family_Leave_Handler.cs | 6 +- .../Groups/Group_InvitationAccept_Handler.cs | 7 +- .../Groups/Group_InvitationRefuse_Handler.cs | 5 + .../Groups/Group_Join_Handler.cs | 5 + .../EventHandlers/Guri/GuriEventHandler.cs | 6 +- .../Inventory/Inventory_AddItem_Handler.cs | 4 + .../Inventory/Inventory_ItemInfo_Handler.cs | 5 + .../Inventory_LoadInventory_Handler.cs | 6 +- .../Inventory/Inventory_MoveItem_Handler.cs | 6 +- .../Inventory/Inventory_Pickup_Handler.cs | 6 +- .../Inventory/Inventory_RemoveItem_Event.cs | 8 +- .../Inventory_SendDetails_Handler.cs | 5 + .../Inventory/Inventory_UseItem_Handler.cs | 6 +- .../Inventory/Inventory_WearItem_Handler.cs | 5 + .../Locomotion_Transform_Handler.cs | 5 + .../Locomotion_Untransform_Handler.cs | 7 +- .../EventHandlers/Maps/Map_Join_Handler.cs | 5 + .../Monsters/Monster_DeathEvent_Handler.cs | 19 +- .../Movement_PlayerMovement_Handler.cs | 4 + .../Movements/Movement_Sit_Handler.cs | 5 + .../NpcDialog/NpcDialogEventHandler.cs | 7 +- .../Npcs/Npc_DeathEvent_Handler.cs | 5 + .../Players/Player_LevelUp_Handler.cs | 4 +- .../Portals/PortalEventHandler.cs | 6 +- .../Quicklist/Quicklist_AddElement_Handler.cs | 4 + .../Quicklist_RemoveElement_Handler.cs | 5 + .../Quicklist_SwapElement_Handler.cs | 5 + .../Relation_InvitationProcess_Handler.cs | 6 +- .../Relation_InvitationSend_Handler.cs | 6 +- .../EventHandlers/ReqInfoEventHandler.cs | 5 +- .../Shops/Shop_CreateShop_Handler.cs | 5 + .../Shops/Shop_GetInformation_Handler.cs | 5 + .../EventHandlers/Shops/Shop_Sell_Handler.cs | 5 + .../Skills/Skill_AddSkill_Handler.cs | 5 + .../Upgrading_ItemUpgrading_Handler.cs | 7 +- .../Upgrading/Upgrading_PerfectSp_Handler.cs | 6 +- .../Upgrading/Upgrading_Rarify_Handler.cs | 2 +- .../Upgrading_UpgradeEquipment_Handler.cs | 6 +- .../Upgrading/Upgrading_UpgradeSp_Handler.cs | 4 +- .../Visibility_Invisible_Handler.cs | 5 + .../Visibility/Visibility_Visible_Handler.cs | 5 + .../NpcDialogHandlers/WopenHandler.cs | 9 +- src/Toolkit/Cleaners/InPacketCleaner.cs | 1 - src/Toolkit/Cleaners/PortalPacketCleaner.cs | 2 - src/Toolkit/Cleaners/ShopPacketCleaner.cs | 2 +- src/Toolkit/CliProgram.cs | 4 +- src/Toolkit/Commands/CleanCommand.cs | 6 +- src/Toolkit/Commands/DocumentationCommand.cs | 30 -- src/Toolkit/Commands/LanguageCommand.cs | 3 +- src/Toolkit/Commands/ParseCommand.cs | 3 +- src/Toolkit/Converter/CardDatConverter.cs | 3 +- src/Toolkit/Converter/EInfoFiller.cs | 3 +- src/Toolkit/Converter/ItemDatConverter.cs | 5 +- src/Toolkit/Converter/MapDatConverter.cs | 3 +- src/Toolkit/Converter/MonsterDatConverter.cs | 3 +- src/Toolkit/Converter/SkillDatConverter.cs | 3 +- .../FromPackets/MapMonsterGenerator.cs | 3 +- .../Generators/FromPackets/MapNpcGenerator.cs | 3 +- .../FromPackets/PacketPortalGenerator.cs | 5 +- .../Generators/FromPackets/RecipeGenerator.cs | 3 +- .../FromPackets/ShopItemGenerator.cs | 1 + .../FromPackets/ShopParserGenerator.cs | 3 +- .../FromPackets/ShopSkillGenerator.cs | 3 +- src/World/Network/ClientSession.cs | 187 +------ src/World/Network/Server.cs | 3 +- src/World/Packets/PacketInformation.cs | 12 - src/World/Packets/PacketPropertyContainer.cs | 14 - src/World/Packets/PluggablePacketFactory.cs | 500 ------------------ src/World/WorldServer.cs | 17 +- src/libs/SaltyEmu.Core/Logging/Logger.cs | 6 + .../Plugins/SimplePluginManager.cs | 4 +- .../DAO/CharacterSkillServiceDao.cs | 10 +- .../SaltyEmu.CharacterSkillService/Program.cs | 3 +- .../DAO/RelationDao.cs | 3 +- .../DAO/RelationInvitationDao.cs | 3 +- .../DAO/RelationMessageDao.cs | 3 +- .../GetInvitationsByCharacterIdHandler.cs | 7 +- .../GetRelationsByCharacterIdHandler.cs | 6 +- .../Handling/ProcessInvitationHandler.cs | 4 +- .../Handling/RemoveRelationsHandler.cs | 6 +- .../Handling/SendInvitationHandler.cs | 3 +- .../RelationService.cs | 8 +- .../ChickenAPI.Game.Test.csproj | 27 - .../Inventory/Inventory_Get_Test.cs | 38 -- .../Mocks/MapLayerMock.cs | 6 - .../ChickenAPI.Game.Test/Mocks/SessionMock.cs | 97 ---- vendor/ChickenAPI.Packets | 2 +- 126 files changed, 374 insertions(+), 1184 deletions(-) delete mode 100644 src/ChickenAPI.Enums/Game/Character/CharacterDignity.cs delete mode 100644 src/ChickenAPI.Enums/Game/Character/CharacterRep.cs delete mode 100644 src/ChickenAPI.Enums/Game/Families/FamilyAuthorityType.cs delete mode 100644 src/Toolkit/Commands/DocumentationCommand.cs delete mode 100644 src/World/Packets/PacketInformation.cs delete mode 100644 src/World/Packets/PacketPropertyContainer.cs delete mode 100644 src/World/Packets/PluggablePacketFactory.cs delete mode 100644 test/ChickenAPI.Game.Test/ChickenAPI.Game.Test.csproj delete mode 100644 test/ChickenAPI.Game.Test/Inventory/Inventory_Get_Test.cs delete mode 100644 test/ChickenAPI.Game.Test/Mocks/MapLayerMock.cs delete mode 100644 test/ChickenAPI.Game.Test/Mocks/SessionMock.cs diff --git a/SaltyEmu.sln b/SaltyEmu.sln index 1b07deee..eb800f90 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -33,8 +33,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Communication", "s EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Data", "src\ChickenAPI.Data\ChickenAPI.Data.csproj", "{548F9115-2EF6-4B73-B224-5CEB8D7F4276}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game.Test", "test\ChickenAPI.Game.Test\ChickenAPI.Game.Test.csproj", "{0C47ED85-6577-4338-9976-8A2B00016609}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{7A642CDF-7BF0-4D43-B5CB-430FC64A32D1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.FamilyService", "src\services\SaltyEmu.FamilyService\SaltyEmu.FamilyService.csproj", "{61CDB363-EC3A-47AA-A5CA-ABB4BCE2CC85}" @@ -135,10 +133,6 @@ Global {548F9115-2EF6-4B73-B224-5CEB8D7F4276}.Debug|Any CPU.Build.0 = Debug|Any CPU {548F9115-2EF6-4B73-B224-5CEB8D7F4276}.Release|Any CPU.ActiveCfg = Release|Any CPU {548F9115-2EF6-4B73-B224-5CEB8D7F4276}.Release|Any CPU.Build.0 = Release|Any CPU - {0C47ED85-6577-4338-9976-8A2B00016609}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C47ED85-6577-4338-9976-8A2B00016609}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C47ED85-6577-4338-9976-8A2B00016609}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C47ED85-6577-4338-9976-8A2B00016609}.Release|Any CPU.Build.0 = Release|Any CPU {61CDB363-EC3A-47AA-A5CA-ABB4BCE2CC85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {61CDB363-EC3A-47AA-A5CA-ABB4BCE2CC85}.Debug|Any CPU.Build.0 = Debug|Any CPU {61CDB363-EC3A-47AA-A5CA-ABB4BCE2CC85}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -222,7 +216,6 @@ Global {48D59236-CC25-497E-A98D-DAB290E4A8B7} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {AA0972AB-A59A-4EB7-AF5A-B31F61D25644} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} {548F9115-2EF6-4B73-B224-5CEB8D7F4276} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} - {0C47ED85-6577-4338-9976-8A2B00016609} = {4E7156D8-18DC-4638-9C9B-5BE5CFF76F13} {61CDB363-EC3A-47AA-A5CA-ABB4BCE2CC85} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {A0DBCE58-3322-4539-BEAF-D9B577CBF3CF} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {9746EFA1-B25D-4945-A25C-3A960ACF2262} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} diff --git a/src/ChickenAPI.Enums/Game/Character/CharacterDignity.cs b/src/ChickenAPI.Enums/Game/Character/CharacterDignity.cs deleted file mode 100644 index 2363d8a0..00000000 --- a/src/ChickenAPI.Enums/Game/Character/CharacterDignity.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum CharacterDignity : byte - { - Basic = 1, // Basic Dignity ( Dignity are not changed ) - Suspected = 2, // Suspected RANK (Dignity: -100 ~ -200) - BluffedNameOnly = 3, // Bluffed name only RANK (Dignity: -201 ~ -400) - NotQualifiedFor = 4, // Not qualified for RANK (Dignity: -401 ~ -600) - Useless = 5, // Useless RANK (Dignity: -601 ~ -800) - StupidMinded = 6 // Stupid minded RANK (Dignity: -801 ~ -1.000) - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Character/CharacterRep.cs b/src/ChickenAPI.Enums/Game/Character/CharacterRep.cs deleted file mode 100644 index ddaf6099..00000000 --- a/src/ChickenAPI.Enums/Game/Character/CharacterRep.cs +++ /dev/null @@ -1,55 +0,0 @@ -namespace ChickenAPI.Enums.Game.Character -{ - public enum CharacterRep : sbyte - { - StupidMinded = -6, // Stupid minded RANK (Dignity: -801 ~ -1.000) - Useless = -5, // Useless RANK (Dignity: -601 ~ -800) - NotQualifiedFor = -4, // Not qualified for RANK (Dignity: -401 ~ -600) - BluffedNameOnly = -3, // Bluffed name only RANK (Dignity: -201 ~ -400) - Suspected = -2, // Suspected RANK (Dignity: -100 ~ -200) - Basic = -1, // Basic Dignity ( Dignity are not changed ) - Beginner = 1, // (0 ~ 250 Reputation) - - IDk = 2, // IDK ? - IDk2 = 3, // IDK ? - - TraineeG = 4, // (Reputation: 251 ~ 500) - TraineeB = 5, //(Reputation:501 ~ 750) - TraineeR = 6, //(Reputation: 750 ~ 1.000) - - TheExperiencedG = 7, // (Reputation: 1.001 ~ 2.250) - TheExperiencedB = 8, // (Reputation: 2.251 ~ 3.500) - TheExperiencedR = 9, // (Reputation: 3.501 ~ 5.000) - - BattleSoldierG = 10, // (Reputation: 5 001 ~ 9.500) - BattleSoldierB = 11, // (Reputation: 9.501 ~ 19.000) - BattleSoldierR = 12, // (Reputation: 19.001 ~ 25.000) - - ExpertG = 13, // (Reputation: 25.001 ~ 40.000) - ExpertB = 14, // (Reputation: 40.001 ~ 60.000) - ExpertR = 15, // (Reputation: 60.001 ~ 85.000) - - LeaderG = 16, // (Reputation: 85.001 ~ 115.000) - LeaderB = 17, // (Reputation: 115.001 ~ 150.000) - LeaderR = 18, // (Reputation: 150.001 ~ 190.000) - - MasterG = 19, // (Reputation: 190.001 ~ 235.000) - MasterB = 20, // (Reputation: 235.001 ~ 185.000) - MasterR = 21, // (Reputation: 285.001 ~ 350.000) - - NosG = 22, // (Reputation: 350.001 ~ 500.000) - NosB = 23, // (Reputation: 500.001 ~ 1.500.000) - NosR = 24, // (Reputation: 1.500.001 ~ 2.500.000) - - EliteG = 25, // (Reputation: 2.500.001 ~ 3.750.000) - EliteB = 26, // (Reputation: 3.750.001 ~ 5.000.000) - EliteR = 27, // (Reputation: 5.000.001 and more ) - - LegendG = 28, // (43 th to 14 th place at the reputation ranking : 5.000.000 and more) - LegendB = 29, // (14 th to 4 th place at the reputation ranking : 5.000.000 and more) - - AncienHeros = 30, // (3 rd place at the reputation ranking : 5.000.000 and more) - MysteriousHeros = 31, // (2 nd place in the reputation ranking : 5.000.000 and more) - LegendaryHeros = 32 // (1 st place in the reputation ranking : 5.000.000 and more) - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Enums/Game/Families/FamilyAuthorityType.cs b/src/ChickenAPI.Enums/Game/Families/FamilyAuthorityType.cs deleted file mode 100644 index 2b255358..00000000 --- a/src/ChickenAPI.Enums/Game/Families/FamilyAuthorityType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Enums.Game.Families -{ - public enum FamilyAuthorityType - { - NONE = 0, - PUT = 1, - ALL = 2 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs index 9ca23885..9c7a3055 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EqPacketExtensions.cs @@ -25,7 +25,7 @@ public static class EqPacketExtensions public static UpgradeRareSubPacket GenerateEqRareInfoPacket(this InventoryComponent inventory, EquipmentType type) => new UpgradeRareSubPacket { Upgrade = inventory.Wear[(int)type]?.Upgrade ?? 0, - Rare = (byte)(inventory.Wear[(int)type]?.Rarity ?? 0) + Rare = inventory.Wear[(int)type]?.Rarity ?? 0 }; public static EqPacket GenerateEqPacket(this IPlayerEntity player) => new EqPacket @@ -90,12 +90,12 @@ EquipmentSubPacket generateEquipmentSubPacket(EquipmentType eqType) var weapon = new UpgradeRareSubPacket { Upgrade = player.Weapon?.Upgrade ?? 0, - Rare = (byte)(player.Weapon?.Rarity ?? 0) + Rare = (player.Weapon?.Rarity ?? 0) }; var armor = new UpgradeRareSubPacket { Upgrade = player.Armor?.Upgrade ?? 0, - Rare = (byte)(player.Armor?.Rarity ?? 0) + Rare = (player.Armor?.Rarity ?? 0) }; return new EquipPacket diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs index 1f6db194..91143498 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs @@ -1,5 +1,6 @@ using System; using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Player; namespace ChickenAPI.Game.Entities.Player.Extensions diff --git a/src/Login/Cryptography/Decoder/NostaleLoginDecoder.cs b/src/Login/Cryptography/Decoder/NostaleLoginDecoder.cs index bcee8057..efacff04 100644 --- a/src/Login/Cryptography/Decoder/NostaleLoginDecoder.cs +++ b/src/Login/Cryptography/Decoder/NostaleLoginDecoder.cs @@ -10,8 +10,6 @@ namespace Login.Cryptography.Decoder { public class NostaleLoginDecoder : MessageToMessageDecoder, IDecoder { - private static readonly Logger Log = Logger.GetLogger(); - protected override void Decode(IChannelHandlerContext context, IByteBuffer message, List output) { try @@ -29,7 +27,7 @@ protected override void Decode(IChannelHandlerContext context, IByteBuffer messa } catch (Exception e) { - Log.Error("[DECODE]", e); + // Log.Error("[DECODE]", e); } } } diff --git a/src/Login/Cryptography/Encoder/NostaleLoginEncoder.cs b/src/Login/Cryptography/Encoder/NostaleLoginEncoder.cs index d0cde3fe..b3484eac 100644 --- a/src/Login/Cryptography/Encoder/NostaleLoginEncoder.cs +++ b/src/Login/Cryptography/Encoder/NostaleLoginEncoder.cs @@ -10,7 +10,7 @@ namespace Login.Cryptography.Encoder { public class NostaleLoginEncoder : MessageToMessageEncoder, IEncoder { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); protected override void Encode(IChannelHandlerContext context, string message, List output) { @@ -33,7 +33,7 @@ protected override void Encode(IChannelHandlerContext context, string message, L } catch (Exception e) { - Log.Error("[ENCODE]", e); + // Log.Error("[ENCODE]", e); } } } diff --git a/src/Login/LoginServer.cs b/src/Login/LoginServer.cs index 3127ddf5..7553c625 100644 --- a/src/Login/LoginServer.cs +++ b/src/Login/LoginServer.cs @@ -16,7 +16,7 @@ namespace Login { internal class LoginServer { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); private static readonly IPluginManager PluginManager = new SimplePluginManager(); private static ushort _port; @@ -42,7 +42,7 @@ private static void PrintHeader() private static void InitializeLogger() { - Logger.Initialize(); + // Logger.Initialize(); } private static void InitializeConfiguration() @@ -76,7 +76,7 @@ private static void InitializePlugins() } catch (Exception e) { - Log.Error("[PLUGINS]", e); + // Log.Error("[PLUGINS]", e); } } diff --git a/src/Login/Network/ClientSession.cs b/src/Login/Network/ClientSession.cs index 47cd5e23..ac565477 100644 --- a/src/Login/Network/ClientSession.cs +++ b/src/Login/Network/ClientSession.cs @@ -16,7 +16,7 @@ namespace Login.Network { public class ClientSession : ChannelHandlerAdapter { - public static readonly Logger Log = Logger.GetLogger(); + public readonly ILogger Log; public static ISessionService SessionService; public static IAccountService AccountService; public static IServerApiService ServerApi; @@ -26,9 +26,10 @@ public class ClientSession : ChannelHandlerAdapter private readonly IChannel _channel; private IPEndPoint _endPoint; - public ClientSession(IChannel channel) + public ClientSession(IChannel channel, ILogger log) { _channel = channel; + Log = log; } public override void ChannelRegistered(IChannelHandlerContext context) diff --git a/src/Login/Network/NetworkManager.cs b/src/Login/Network/NetworkManager.cs index 50169a84..c930828d 100644 --- a/src/Login/Network/NetworkManager.cs +++ b/src/Login/Network/NetworkManager.cs @@ -1,6 +1,8 @@ using System; using System.Threading; using System.Threading.Tasks; +using Autofac; +using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using DotNetty.Buffers; using DotNetty.Codecs; @@ -13,7 +15,7 @@ namespace Login.Network { public class NetworkManager { - public static readonly Logger Log = Logger.GetLogger(); + // public static readonly Logger Log = Logger.GetLogger(); public static async Task RunServerAsync(int port, IPacketCryptoFactory factory) { @@ -32,13 +34,13 @@ public static async Task RunServerAsync(int port, IPacketCryptoFactory factory) IChannelPipeline pipeline = channel.Pipeline; pipeline.AddLast("encoder", (MessageToMessageEncoder)factory.GetEncoder()); pipeline.AddLast("decoder", (MessageToMessageDecoder)factory.GetDecoder()); - pipeline.AddLast("session", new ClientSession(channel)); + pipeline.AddLast("session", new ClientSession(channel, ChickenContainer.Instance.Resolve())); })); IChannel bootstrapChannel = await bootstrap.BindAsync(port).ConfigureAwait(false); - Log.Info($"[LISTENING] Server is listening"); - Log.Info($"-> PORT : {port}"); + // Log.Info($"[LISTENING] Server is listening"); + // Log.Info($"-> PORT : {port}"); while (Console.ReadLine() != "quit") { @@ -49,7 +51,7 @@ public static async Task RunServerAsync(int port, IPacketCryptoFactory factory) } catch (Exception ex) { - Log.Error("[SERVER]", ex); + // Log.Error("[SERVER]", ex); } finally { diff --git a/src/Login/SimplePluginManager.cs b/src/Login/SimplePluginManager.cs index e2d69daf..8432c4c7 100644 --- a/src/Login/SimplePluginManager.cs +++ b/src/Login/SimplePluginManager.cs @@ -10,7 +10,7 @@ namespace Login { public class SimplePluginManager : IPluginManager { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); public IPlugin[] LoadPlugin(FileInfo file) { @@ -35,7 +35,7 @@ public IPlugin[] LoadPlugin(FileInfo file) foreach (Type type in pluginTypes) { var plugin = (IPlugin)Activator.CreateInstance(type); - Log.Info($"{plugin.Name} Loaded !"); + //Log.Info($"{plugin.Name} Loaded !"); plugins.Add(plugin); } diff --git a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs index b53f02e2..933bcfe9 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs @@ -1,6 +1,7 @@ using System; using System.Data.SqlClient; using ChickenAPI.Core.Configurations; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; using ChickenAPI.Core.Plugins.Exceptions; using ChickenAPI.Game.Impl; @@ -8,7 +9,6 @@ using SaltyEmu.DatabasePlugin.Configuration; using SaltyEmu.DatabasePlugin.Context; using SaltyEmu.DatabasePlugin.Utils; -using ILogger = ChickenAPI.Core.Logging.ILogger; namespace SaltyEmu.DatabasePlugin { diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Card/CardDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Card/CardDao.cs index 3abaf265..d86a602b 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Card/CardDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Card/CardDao.cs @@ -1,4 +1,5 @@ using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -8,7 +9,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Card { public class CardDao : MappedRepositoryBase, ICardService { - public CardDao(DbContext context, IMapper mapper) : base(context, mapper) + public CardDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Drop/DropDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Drop/DropDao.cs index fcafb415..6d30f99e 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Drop/DropDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Drop/DropDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Drop; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -18,7 +19,7 @@ public class DropDao : MappedRepositoryBase, IDropService { private readonly Dictionary _items = new Dictionary(); - public DropDao(DbContext context, IMapper mapper) : base(context, mapper) + public DropDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Families/FamilyDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Families/FamilyDao.cs index dad483cd..09525595 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Families/FamilyDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Families/FamilyDao.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Families; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -10,7 +11,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Families { public class FamilyDao : MappedRepositoryBase, IFamilyService { - public FamilyDao(DbContext context, IMapper mapper) : base(context, mapper) + public FamilyDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Item/ItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Item/ItemDao.cs index 105c5102..c1967487 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Item/ItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Item/ItemDao.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -14,7 +15,7 @@ public class ItemDao : MappedRepositoryBase, IItemService { private readonly Dictionary _items; - public ItemDao(DbContext context, IMapper mapper) : base(context, mapper) + public ItemDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { _items = new Dictionary(Get().ToDictionary(s => s.Id, s => s)); } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapDao.cs index ff433a06..9c8b6a3a 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapDao.cs @@ -1,4 +1,5 @@ using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -8,7 +9,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Map { public class MapDao : MappedRepositoryBase, IMapService { - public MapDao(DbContext context, IMapper mapper) : base(context, mapper) + public MapDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapMonsterDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapMonsterDao.cs index 008dbf56..57070b40 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapMonsterDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapMonsterDao.cs @@ -3,10 +3,10 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; -using SaltyEmu.DatabasePlugin.Context; using SaltyEmu.DatabasePlugin.Models.Map; namespace SaltyEmu.DatabasePlugin.Services.Map @@ -15,7 +15,7 @@ public class MapMonsterDao : MappedRepositoryBase _monsters; - public MapMonsterDao(DbContext context, IMapper mapper) : base(context, mapper) + public MapMonsterDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { _monsters = new Dictionary(Get().GroupBy(s => s.MapId).ToDictionary(dtos => dtos.Key, dtos => dtos.ToArray())); } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapNpcDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapNpcDao.cs index 9204f88f..a12adf76 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapNpcDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapNpcDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -14,11 +15,12 @@ public class MapNpcDao : MappedRepositoryBase, IMapNpcSe { private readonly Dictionary _npcs; - public MapNpcDao(DbContext context, IMapper mapper) : base(context, mapper) + public MapNpcDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { _npcs = new Dictionary(Get().GroupBy(s => s.MapId).ToDictionary(s => (long)s.Key, s => s.ToArray())); } + public IEnumerable GetByMapId(long mapId) { try diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapPortalDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapPortalDao.cs index 62ec9d37..ab0afc91 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapPortalDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Map/MapPortalDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -12,7 +13,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Map { public class MapPortalDao : MappedRepositoryBase, IPortalService { - public MapPortalDao(DbContext context, IMapper mapper) : base(context, mapper) + public MapPortalDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterDao.cs index 2eff1033..5f7d03b5 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterDao.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.NpcMonster; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -13,7 +14,7 @@ public class NpcMonsterDao : MappedRepositoryBase _monsters; - public NpcMonsterDao(DbContext context, IMapper mapper) : base(context, mapper) + public NpcMonsterDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { _monsters = Get().ToDictionary(s => s.Id, s => s); } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterSkillDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterSkillDao.cs index 0f6dfbdd..d3195b8c 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterSkillDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/NpcMonster/NpcMonsterSkillDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.NpcMonster; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -14,7 +15,7 @@ public class NpcMonsterSkillDao : MappedRepositoryBase _cacheByNpcMonsterId; - public NpcMonsterSkillDao(DbContext context, IMapper mapper) : base(context, mapper) + public NpcMonsterSkillDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { IEnumerable tmp = Get(); _cacheByNpcMonsterId = tmp.GroupBy(s => s.NpcMonsterId).ToDictionary(s => s.Key, s => s.ToArray()); diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeDao.cs index 5ef2f8f8..b7b495ef 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -13,7 +14,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Shop { public class RecipeDao : MappedRepositoryBase, IRecipeService { - public RecipeDao(DbContext context, IMapper mapper) : base(context, mapper) + public RecipeDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeItemDao.cs index a51e6606..d3c599ad 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/RecipeItemDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -13,7 +14,7 @@ namespace SaltyEmu.DatabasePlugin.Services.Shop { public class RecipeItemDao : MappedRepositoryBase, IRecipeItemService { - public RecipeItemDao(DbContext context, IMapper mapper) : base(context, mapper) + public RecipeItemDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopDao.cs index d6177a53..6b856f4d 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -14,7 +15,7 @@ public class ShopDao : MappedRepositoryBase, IShopService { private readonly Dictionary _shops; - public ShopDao(DbContext context, IMapper mapper) : base(context, mapper) + public ShopDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { IEnumerable all = Get(); IEnumerable> tmp = all.GroupBy(s => s.MapNpcId); diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopItemDao.cs index cd17cd54..f74b1442 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopItemDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -15,7 +16,7 @@ public class ShopItemDao : MappedRepositoryBase, ISh { private readonly Dictionary _shops; - public ShopItemDao(DbContext context, IMapper mapper) : base(context, mapper) + public ShopItemDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { _shops = new Dictionary(Get().GroupBy(s => s.ShopId).ToDictionary(s => s.Key, s => s.ToArray())); } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopSkillDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopSkillDao.cs index 28473575..8672a4e5 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopSkillDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Shop/ShopSkillDao.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -15,7 +16,7 @@ public class ShopSkillDao : MappedRepositoryBase, { private readonly Dictionary _shop; - public ShopSkillDao(DbContext context, IMapper mapper) : base(context, mapper) + public ShopSkillDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { _shop = new Dictionary(Get().GroupBy(s => s.ShopId).ToDictionary(s => s.Key, s => s.ToArray())); } diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Skill/SkillDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Skill/SkillDao.cs index 827a1739..5f60140f 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Skill/SkillDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Skill/SkillDao.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using AutoMapper; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; @@ -14,7 +15,7 @@ public class SkillDao : MappedRepositoryBase, ISkillServic private readonly Dictionary _skills; private readonly Dictionary _skillsByClassId; - public SkillDao(DbContext context, IMapper mapper) : base(context, mapper) + public SkillDao(DbContext context, IMapper mapper, ILogger log) : base(context, mapper, log) { IEnumerable tmp = Get(); _skills = tmp.ToDictionary(s => s.Id, s => s); diff --git a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs index 72d05d93..e480486c 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs @@ -1,4 +1,5 @@ -using Autofac; +using System.Reflection; +using Autofac; using AutoMapper; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; @@ -73,6 +74,8 @@ public static void RegisterDaos() State = CharacterState.Active }; // data + ChickenContainer.Builder.RegisterTypes(typeof(PluginDependencyInjector).Assembly.GetTypes()).AsImplementedInterfaces().InstancePerLifetimeScope(); + /* ChickenContainer.Builder.Register(s => new MapDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new SkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new BCardDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); @@ -112,6 +115,7 @@ public static void RegisterDaos() // recipes ChickenContainer.Builder.Register(s => new RecipeDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new RecipeItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + */ } public static void RegisterDependencies() diff --git a/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs index cfb816bf..8152a50d 100644 --- a/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Chat/SayPacketHandling.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Chat.Events; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.ClientPackets.Chat; @@ -9,6 +10,10 @@ namespace NW.Plugins.PacketHandling.Chat { public class SayPacketHandling : GenericGamePacketHandlerAsync { + public SayPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(ClientSayPacket packet, IPlayerEntity player) { try diff --git a/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs index 70ed52a6..117ed5bc 100644 --- a/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Entity/ReqInfoPacketHandling.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Events; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.ServerPackets.Entities; @@ -8,6 +9,10 @@ namespace NW.Plugins.PacketHandling.Entity { public class ReqInfoPacketHandling : GenericGamePacketHandlerAsync { + public ReqInfoPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(ReqInfoPacket packet, IPlayerEntity player) { if (packet.MateVNum.HasValue) diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs index 85eec52a..f9d7538b 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/MviPacketHandling.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Packets.ClientPackets.Inventory; @@ -8,6 +9,10 @@ namespace NW.Plugins.PacketHandling.Inventory { public class MviPacketHandling : GenericGamePacketHandlerAsync { + public MviPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(MviPacket packet, IPlayerEntity player) { await player.EmitEventAsync(new InventoryMoveEvent diff --git a/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs index 27632225..987c2660 100644 --- a/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Npc/Dialog/NRunPacketHandling.cs @@ -13,13 +13,15 @@ public NRunPacketHandling(ILogger log) : base(log) { } - protected override Task Handle(NrunPacket packet, IPlayerEntity player) => - player.EmitEventAsync(new NpcDialogEvent + protected override async Task Handle(NrunPacket packet, IPlayerEntity player) + { + await player.EmitEventAsync(new NpcDialogEvent { DialogId = (long)packet.Runner, - Type = packet.Type, + Type = packet.Type.GetValueOrDefault(), Value = (int)packet.VisualType, - NpcId = packet.VisualId + NpcId = packet.VisualId.GetValueOrDefault() }); + } } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs index 6b4cfa04..2ee79100 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/NpcReqPacketHandling.cs @@ -3,23 +3,24 @@ using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; +using ChickenAPI.Packets.ClientPackets.Npcs; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Shop; using NW.Plugins.PacketHandling.Utils; namespace NW.Plugins.PacketHandling.Shops { - public class NpcReqPacketHandling : GenericGamePacketHandlerAsync + public class NpcReqPacketHandling : GenericGamePacketHandlerAsync { public NpcReqPacketHandling(ILogger log) : base(log) { } - protected override async Task Handle(NpcReqPacket packet, IPlayerEntity player) + protected override async Task Handle(RequestNpcPacket packet, IPlayerEntity player) { - if (packet.VisualType == VisualType.Player) + if (packet.Type == VisualType.Player) { - IPlayerEntity shop = player.CurrentMap.GetPlayerById(packet.VisualId); + IPlayerEntity shop = player.CurrentMap.GetPlayerById(packet.TargetId); if (shop == null) { return; @@ -29,18 +30,18 @@ protected override async Task Handle(NpcReqPacket packet, IPlayerEntity player) return; } - var npc = player.CurrentMap.GetEntity(packet.VisualId, VisualType.Npc); + var npc = player.CurrentMap.GetEntity(packet.TargetId, VisualType.Npc); if (npc == null) { return; } - await player.SendPacketAsync(new NpcReqPacket() + await player.SendPacketAsync(new RequestNpcPacket() { - VisualType = VisualType.Npc, - VisualId = npc.MapNpc.Id, - Dialog = npc.MapNpc.Dialog + Type = VisualType.Npc, + TargetId = npc.MapNpc.Id, + Data = npc.MapNpc.Dialog }); } } diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs index 13e683ac..286dc1fb 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/QuickListPacketHandling.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Quicklist.Events; using ChickenAPI.Packets.ClientPackets.Quicklist; @@ -8,6 +9,10 @@ namespace NW.Plugins.PacketHandling.Skill { public class QuickListPacketHandling : GenericGamePacketHandlerAsync { + public QuickListPacketHandling(ILogger log) : base(log) + { + } + protected override async Task Handle(QsetPacket packet, IPlayerEntity player) { switch (packet.Type) diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs b/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs index 6b3a4061..9e44c6a9 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs @@ -1,16 +1,12 @@ using System; using Autofac; using ChickenAPI.Core.Configurations; -using ChickenAPI.Core.i18n; using ChickenAPI.Core.IoC; -using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; -using ChickenAPI.Core.Utils; using ChickenAPI.Data.Server; using ChickenAPI.Game._i18n; using ChickenAPI.Game.Impl; using SaltyEmu.Redis; -using SaltyEmu.RedisWrappers.Redis; namespace SaltyEmu.RedisWrappers { @@ -23,7 +19,6 @@ public class RedisPlugin : IPlugin public void OnDisable() { - throw new NotImplementedException(); } public void OnEnable() @@ -35,9 +30,10 @@ public void OnLoad() { IConfigurationManager conf = new ConfigurationHelper(new JsonConfigurationSerializer()); _configuration = conf.Load(_configurationPath, true); - ChickenContainer.Builder.Register(s => new RedisSessionService(_configuration)).As(); - ChickenContainer.Builder.Register(s => new RedisServerApi(_configuration)).As(); - ChickenContainer.Builder.Register(s => new RedisGameLanguageService(_configuration)).As(); + ChickenContainer.Builder.Register(s => _configuration).As(); + ChickenContainer.Builder.RegisterType().As(); + ChickenContainer.Builder.RegisterType().As(); + ChickenContainer.Builder.RegisterType().As(); } public void ReloadConfig() diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_FillHitRequest_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_FillHitRequest_Handler.cs index 04c34e3c..2aedd5dd 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_FillHitRequest_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Battle/Battle_FillHitRequest_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Battle.Events; using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; @@ -11,10 +12,7 @@ public class Battle_FillHitRequest_Handler : GenericEventPostProcessorBase _algorithm = algorithm; protected override Task Handle(FillHitRequestEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Kick_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Kick_Handler.cs index 3f9549bd..c2e05376 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Kick_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Kick_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Families.Events; @@ -15,11 +16,11 @@ public class Family_Kick_Handler : GenericEventPostProcessorBase _characterFamilyService = characterFamilyService; protected override async Task Handle(FamilyLeaveEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs index d04cdca5..3abc85cc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationAccept_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Groups; @@ -15,10 +16,8 @@ public class Group_InvitationAccept_Handler : GenericEventPostProcessorBase _groupManager = groupManager; protected override async Task Handle(GroupInvitationAcceptEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationRefuse_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationRefuse_Handler.cs index 091cbadc..149004bf 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationRefuse_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_InvitationRefuse_Handler.cs @@ -1,12 +1,17 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Groups.Events; namespace SaltyEmu.BasicPlugin.EventHandlers { public class Group_InvitationRefuse_Handler : GenericEventPostProcessorBase { + public Group_InvitationRefuse_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(GroupInvitationRefuseEvent e, CancellationToken cancellation) { return Task.CompletedTask; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_Join_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_Join_Handler.cs index 24d53d47..49a0b6f1 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_Join_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Groups/Group_Join_Handler.cs @@ -5,12 +5,17 @@ using Autofac; using ChickenAPI.Core.Events; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Groups.Events; namespace SaltyEmu.BasicPlugin.EventHandlers { public class Group_Join_Handler : GenericEventPostProcessorBase { + public Group_Join_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(GroupJoinEvent e, CancellationToken cancellation) { // ? diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/GuriEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/GuriEventHandler.cs index 0750bf50..98bc6b52 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/GuriEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Guri/GuriEventHandler.cs @@ -16,10 +16,8 @@ public class GuriEventHandler : GenericEventPostProcessorBase { private readonly IGuriHandler _guriHandler; - public GuriEventHandler(IGuriHandler guriHandler) - { - _guriHandler = guriHandler; - } + + public GuriEventHandler(ILogger log, IGuriHandler guriHandler) : base(log) => _guriHandler = guriHandler; protected override Task Handle(GuriEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_AddItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_AddItem_Handler.cs index 27c40135..645fb414 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_AddItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_AddItem_Handler.cs @@ -16,6 +16,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { public class Inventory_AddItem_Handler : GenericEventPostProcessorBase { + public Inventory_AddItem_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(InventoryAddItemEvent e, CancellationToken cancellation) { if (!(e.Sender is IInventoriedEntity inventoried)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs index c4a076ea..b1c3af13 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; @@ -13,6 +14,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { public class Inventory_ItemInfo_Handler : GenericEventPostProcessorBase { + public Inventory_ItemInfo_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(InventoryEqInfoEvent eqInfo, CancellationToken cancellation) { if (!(eqInfo.Sender is IPlayerEntity playerEntity)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs index 767176b9..ecaba21a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs @@ -3,6 +3,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; @@ -16,10 +17,7 @@ public class Inventory_LoadInventory_Handler : GenericEventPostProcessorBase _characterItemService = characterItemService; protected override async Task Handle(InventoryLoadEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs index ce8dcbef..dc2ca5ec 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game; @@ -17,10 +18,7 @@ public class Inventory_MoveItem_Handler : GenericEventPostProcessorBase _gameConfiguration = gameConfiguration; protected override async Task Handle(InventoryMoveEvent args, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_Pickup_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_Pickup_Handler.cs index 198382b6..9bf21b38 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_Pickup_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_Pickup_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -13,10 +14,7 @@ public class Inventory_Pickup_Handler : GenericEventPostProcessorBase _itemFactory = itemFactory; protected override async Task Handle(InventoryPickUpEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_RemoveItem_Event.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_RemoveItem_Event.cs index d15ae6e7..5eb2347c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_RemoveItem_Event.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_RemoveItem_Event.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Item; @@ -21,11 +22,12 @@ public class Inventory_RemoveItem_Event : GenericEventPostProcessorBase { + public Inventory_SendDetails_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(InventoryRequestDetailsEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_UseItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_UseItem_Handler.cs index 91022cc7..08e98f39 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_UseItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_UseItem_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.ItemUsage; @@ -11,10 +12,7 @@ public class Inventory_UseItem_Handler : GenericEventPostProcessorBase _itemUsageHandler = itemUsageHandler; protected override Task Handle(InventoryUseItemEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs index 5048fa69..95e12277 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Effects; @@ -17,6 +18,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { public class Inventory_WearItem_Handler : GenericEventPostProcessorBase { + public Inventory_WearItem_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(InventoryWearEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Transform_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Transform_Handler.cs index 7f7c4c89..8ea680ed 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Transform_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Transform_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Player; @@ -12,6 +13,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Locomotion { public class Locomotion_Transform_Handler : GenericEventPostProcessorBase { + public Locomotion_Transform_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(LocomotionTransformEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Untransform_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Untransform_Handler.cs index 0a970992..5eba22ee 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Untransform_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Locomotion/Locomotion_Untransform_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -13,10 +14,8 @@ public class Locomotion_Untransform_Handler : GenericEventPostProcessorBase _algorithm = algorithm; protected override async Task Handle(LocomotionUntransformEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Join_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Join_Handler.cs index 02c8b7cc..97c00bee 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Join_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Maps/Map_Join_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -13,6 +14,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Maps { public class Map_Join_Handler : GenericEventPostProcessorBase { + public Map_Join_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(MapJoinEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Monsters/Monster_DeathEvent_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Monsters/Monster_DeathEvent_Handler.cs index d95adf36..e65cdd03 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Monsters/Monster_DeathEvent_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Monsters/Monster_DeathEvent_Handler.cs @@ -5,6 +5,7 @@ using Autofac; using ChickenAPI.Core.Events; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Core.Utils; using ChickenAPI.Data.NpcMonster; @@ -20,13 +21,13 @@ namespace SaltyEmu.BasicPlugin.EventHandlers { public class Monster_DeathEvent_Handler : GenericEventPostProcessorBase { - private readonly IRandomGenerator Random; - private readonly IPathfinder PathFinder; + private readonly IRandomGenerator _random; + private readonly IPathfinder _pathFinder; - public Monster_DeathEvent_Handler(IRandomGenerator random, IPathfinder pathFinder) + public Monster_DeathEvent_Handler(ILogger log, IRandomGenerator random, IPathfinder pathFinder) : base(log) { - Random = random; - PathFinder = pathFinder; + _random = random; + _pathFinder = pathFinder; } protected override async Task Handle(MonsterDeathEvent e, CancellationToken cancellation) @@ -49,16 +50,16 @@ protected override async Task Handle(MonsterDeathEvent e, CancellationToken canc await player.EmitEventAsync(new ExperienceGainEvent { Experience = xp, JobExperience = jobXp, HeroExperience = heroXp }); } - if (Random.Next(100) < 100) // 100 should be modified with GoldDropRate + if (_random.Next(100) < 100) // 100 should be modified with GoldDropRate { - Position[] pos = PathFinder.GetNeighbors(monster.Position, monster.CurrentMap.Map); + Position[] pos = _pathFinder.GetNeighbors(monster.Position, monster.CurrentMap.Map); IDropEntity drop = new ItemDropEntity(monster.CurrentMap.GetNextId()) { ItemVnum = 1046, IsGold = true, DroppedTimeUtc = DateTime.Now, - Position = pos.Length > 1 ? pos[Random.Next(pos.Length)] : monster.Position, - Quantity = Random.Next(6 * monster.NpcMonster.Level, 12 * monster.NpcMonster.Level) + Position = pos.Length > 1 ? pos[_random.Next(pos.Length)] : monster.Position, + Quantity = _random.Next(6 * monster.NpcMonster.Level, 12 * monster.NpcMonster.Level) }; drop.TransferEntity(monster.CurrentMap); await monster.CurrentMap.BroadcastAsync(drop.GenerateDropPacket()); diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_PlayerMovement_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_PlayerMovement_Handler.cs index ebc3e632..1eeb6bca 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_PlayerMovement_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_PlayerMovement_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Movements.Events; @@ -10,6 +11,9 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Movements { public class Movement_PlayerMovement_Handler : GenericEventPostProcessorBase { + public Movement_PlayerMovement_Handler(ILogger log) : base(log) + { + } private static bool PreMovementChecks(IPlayerEntity player, PlayerMovementRequestEvent e) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_Sit_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_Sit_Handler.cs index 5f59798e..9fd9a97e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_Sit_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Movements/Movement_Sit_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Movements; using ChickenAPI.Game.Movements.Events; @@ -8,6 +9,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Movements { public class Movement_Sit_Handler : GenericEventPostProcessorBase { + public Movement_Sit_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(TriggerSitEvent e, CancellationToken cancellation) { if (!(e.Sender is IMovableEntity movable)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/NpcDialog/NpcDialogEventHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/NpcDialog/NpcDialogEventHandler.cs index 86648f0a..389a9bc2 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/NpcDialog/NpcDialogEventHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/NpcDialog/NpcDialogEventHandler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog; using ChickenAPI.Game.NpcDialog.Events; @@ -11,10 +12,8 @@ public class NpcDialogEventHandler : GenericEventPostProcessorBase _npcDialogHandler = npcDialogHandler; protected override Task Handle(NpcDialogEvent e, CancellationToken cancellation) => _npcDialogHandler.Execute(e.Sender as IPlayerEntity, e); } diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Npcs/Npc_DeathEvent_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Npcs/Npc_DeathEvent_Handler.cs index f4d4f5cc..43f2b400 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Npcs/Npc_DeathEvent_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Npcs/Npc_DeathEvent_Handler.cs @@ -3,6 +3,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Npc.Events; @@ -10,6 +11,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers { public class Npc_DeathEvent_Handler : GenericEventPostProcessorBase { + public Npc_DeathEvent_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(NpcDeathEvent e, CancellationToken cancellation) { return Task.CompletedTask; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs index b3b87060..fb280318 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Players/Player_LevelUp_Handler.cs @@ -1,8 +1,8 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Entities.Player; @@ -17,7 +17,7 @@ public class Player_LevelUp_Handler : GenericEventPostProcessorBase _mapManager = mapManager; protected override Task Handle(PortalTriggerEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_AddElement_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_AddElement_Handler.cs index 406dd836..824f90e8 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_AddElement_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_AddElement_Handler.cs @@ -13,6 +13,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Quicklist { public class Quicklist_AddElement_Handler : GenericEventPostProcessorBase { + public Quicklist_AddElement_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(QuicklistAddElementEvent args, CancellationToken cancellation) { if (!(args.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_RemoveElement_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_RemoveElement_Handler.cs index 7a828e97..e6115daa 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_RemoveElement_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_RemoveElement_Handler.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Quicklist.Events; @@ -11,6 +12,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Quicklist { public class Quicklist_RemoveElement_Handler : GenericEventPostProcessorBase { + public Quicklist_RemoveElement_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(QuicklistRemoveElementEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_SwapElement_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_SwapElement_Handler.cs index 6c6a7648..63ae334b 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_SwapElement_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Quicklist/Quicklist_SwapElement_Handler.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Quicklist.Events; @@ -11,6 +12,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Quicklist { public class Quicklist_SwapElement_Handler : GenericEventPostProcessorBase { + public Quicklist_SwapElement_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(QuicklistSwapElementEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationProcess_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationProcess_Handler.cs index 87247b2a..3ac87ddc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationProcess_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationProcess_Handler.cs @@ -6,6 +6,7 @@ using Autofac; using ChickenAPI.Core.Events; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using ChickenAPI.Game.Relations.Events; @@ -15,10 +16,7 @@ public class Relation_InvitationProcess_Handler : GenericEventPostProcessorBase< { private readonly IRelationService _relationService; - public Relation_InvitationProcess_Handler(IRelationService relationService) - { - _relationService = relationService; - } + public Relation_InvitationProcess_Handler(ILogger log, IRelationService relationService) : base(log) => _relationService = relationService; protected override async Task Handle(RelationInvitationProcessEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationSend_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationSend_Handler.cs index a59ad123..b958ed42 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationSend_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Relations/Relation_InvitationSend_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.Relations; using ChickenAPI.Game.Relations.Events; @@ -12,10 +13,11 @@ public class Relation_InvitationSend_Handler : GenericEventPostProcessorBase { private readonly IPlayerManager _playerManager; private readonly INpcMonsterService _npcMonsterService; - - public ReqInfoEventHandler(IPlayerManager playerManager, INpcMonsterService npcMonsterService) + + public ReqInfoEventHandler(IPlayerManager playerManager, INpcMonsterService npcMonsterService, ILogger log) : base(log) { _playerManager = playerManager; _npcMonsterService = npcMonsterService; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_CreateShop_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_CreateShop_Handler.cs index 7f911b7e..ad5c9945 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_CreateShop_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_CreateShop_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Shops; @@ -12,6 +13,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Shops public class Shop_CreateShop_Handler : GenericEventPostProcessorBase { + public Shop_CreateShop_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(ShopPlayerShopCreateEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_GetInformation_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_GetInformation_Handler.cs index 805ed2f4..d77779ae 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_GetInformation_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_GetInformation_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; @@ -10,6 +11,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Shops { public class Shop_GetInformation_Handler : GenericEventPostProcessorBase { + public Shop_GetInformation_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(ShopGetInformationEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Sell_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Sell_Handler.cs index 1f50684a..5d462238 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Sell_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Sell_Handler.cs @@ -1,12 +1,17 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Shops.Events; namespace SaltyEmu.BasicPlugin.EventHandlers.Shops { public class Shop_Sell_Handler : GenericEventPostProcessorBase { + public Shop_Sell_Handler(ILogger log) : base(log) + { + } + protected override Task Handle(ShopSellEvent e, CancellationToken cancellation) { return Task.CompletedTask; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs index 102a6d03..86db0096 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs @@ -2,6 +2,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; @@ -14,6 +15,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Skills { public class Skill_AddSkill_Handler : GenericEventPostProcessorBase { + public Skill_AddSkill_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(PlayerAddSkillEvent e, CancellationToken cancellation) { if (!(e.Sender is IPlayerEntity player)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_ItemUpgrading_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_ItemUpgrading_Handler.cs index 1e6dc430..cc6badf5 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_ItemUpgrading_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_ItemUpgrading_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.ItemUpgrade; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; @@ -12,10 +13,8 @@ public class Upgrading_ItemUpgrading_Handler : GenericEventPostProcessorBase _itemUpgradeHandler = itemUpgradeHandler; protected override Task Handle(ItemUpgradeEvent e, CancellationToken cancellation) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs index e167542c..1d9e5dce 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_PerfectSp_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; @@ -19,10 +20,11 @@ public class Upgrading_PerfectSp_Handler : GenericEventPostProcessorBase= 8 ? _configuration.UpgradeItem.UpFailR8 : _configuration.UpgradeItem.UpFail; short[] upfix = e.Item.Rarity >= 8 ? _configuration.UpgradeItem.UpFixR8 : _configuration.UpgradeItem.UpFix; int[] goldprice = e.Item.Rarity >= 8 ? _configuration.UpgradeItem.GoldPriceR8 : _configuration.UpgradeItem.GoldPrice; @@ -164,7 +166,7 @@ await player.SendPacketAsync(player.GenerateShopEndPacket(player.Inventory.HasIt if (e.HasAmulet == FixedUpMode.HasAmulet && e.Item.IsFixed) { - var amulet = player.Inventory.GetWeared(EquipmentType.Amulet); + ItemInstanceDto amulet = player.Inventory.GetWeared(EquipmentType.Amulet); /*amulet.DurabilityPoint -= 1; if (amulet.DurabilityPoint <= 0) { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs index b18b3af7..2f548a15 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.Items; @@ -22,7 +23,8 @@ public class Upgrading_UpgradeSp_Handler : GenericEventPostProcessorBase { + public Visibility_Invisible_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(VisibilitySetInvisibleEvent e, CancellationToken cancellation) { if (!(e.Sender is IVisibleCapacity visible)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs index c80a59bf..f18f0c41 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; using ChickenAPI.Core.Events; +using ChickenAPI.Core.Logging; using ChickenAPI.Enums.Game.Visibility; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; @@ -11,6 +12,10 @@ namespace SaltyEmu.BasicPlugin.EventHandlers.Visibility { public class Visibility_Visible_Handler : GenericEventPostProcessorBase { + public Visibility_Visible_Handler(ILogger log) : base(log) + { + } + protected override async Task Handle(VisibilitySetVisibleEvent e, CancellationToken cancellation) { if (!(e.Sender is IVisibleCapacity visible)) diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs index 90f50320..45d4cc19 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs @@ -2,6 +2,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; +using ChickenAPI.Packets.ClientPackets.Npcs; using ChickenAPI.Packets.ServerPackets.Player; using ChickenAPI.Packets.ServerPackets.Shop; @@ -67,11 +68,11 @@ public static void Recipe(IPlayerEntity player, NpcDialogEvent args) [NpcDialogHandler(18)] public static void TimeCircle(IPlayerEntity player, NpcDialogEvent args) { - player.SendPacketAsync(new NpcReqPacket + player.SendPacketAsync(new RequestNpcPacket { - VisualType = player.Type, - VisualId = player.Id, - Dialog = 17 + Type = player.Type, + TargetId = player.Id, + Data = 17 }); } diff --git a/src/Toolkit/Cleaners/InPacketCleaner.cs b/src/Toolkit/Cleaners/InPacketCleaner.cs index 09069ad0..5ff88dcd 100644 --- a/src/Toolkit/Cleaners/InPacketCleaner.cs +++ b/src/Toolkit/Cleaners/InPacketCleaner.cs @@ -9,7 +9,6 @@ namespace Toolkit.Cleaners { public class InPacketCleaner { - private static readonly Logger Log = Logger.GetLogger(); private readonly List _packetList = new List(); public void Filter(string filePath, string outputPath) diff --git a/src/Toolkit/Cleaners/PortalPacketCleaner.cs b/src/Toolkit/Cleaners/PortalPacketCleaner.cs index 8c2b35f1..b713bec6 100644 --- a/src/Toolkit/Cleaners/PortalPacketCleaner.cs +++ b/src/Toolkit/Cleaners/PortalPacketCleaner.cs @@ -8,7 +8,6 @@ namespace Toolkit.Cleaners { public class PortalPacketCleaner { - private static readonly Logger Log = Logger.GetLogger(); private readonly Queue _packetList = new Queue(); public void Filter(string filePath, string outputPath) @@ -36,7 +35,6 @@ public void Filter(string filePath, string outputPath) builder.Replace('\t', ' '); File.WriteAllText(outputPath, builder.ToString(), Encoding.UTF8); - Log.Info("Portals packet cleaned into " + outputPath); } } } \ No newline at end of file diff --git a/src/Toolkit/Cleaners/ShopPacketCleaner.cs b/src/Toolkit/Cleaners/ShopPacketCleaner.cs index 40d37b88..e0a05f73 100644 --- a/src/Toolkit/Cleaners/ShopPacketCleaner.cs +++ b/src/Toolkit/Cleaners/ShopPacketCleaner.cs @@ -8,7 +8,7 @@ namespace Toolkit.Cleaners { public class ShopPacketCleaner { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); private readonly Queue _packetList = new Queue(); public void Filter(string filePath, string outputPath) diff --git a/src/Toolkit/CliProgram.cs b/src/Toolkit/CliProgram.cs index 427bbc09..c15a8b75 100644 --- a/src/Toolkit/CliProgram.cs +++ b/src/Toolkit/CliProgram.cs @@ -2,13 +2,14 @@ using System.Text; using ChickenAPI.Core.Logging; using CommandLine; +using SaltyEmu.Core.Logging; using Toolkit.Commands; namespace Toolkit { internal class CliProgram { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = new Logger(typeof(CliProgram)); private static int Main(string[] args) { @@ -20,7 +21,6 @@ private static int Main(string[] args) (ParseCommand opts) => ParseCommand.Handle(opts), (CleanCommand opts) => CleanCommand.Handle(opts), (LanguageCommand opts) => LanguageCommand.Handle(opts), - (DocumentationCommand opts) => DocumentationCommand.Handle(opts), errs => 1); } } diff --git a/src/Toolkit/Commands/CleanCommand.cs b/src/Toolkit/Commands/CleanCommand.cs index 83483322..ca0dd315 100644 --- a/src/Toolkit/Commands/CleanCommand.cs +++ b/src/Toolkit/Commands/CleanCommand.cs @@ -1,6 +1,7 @@ using System.IO; using ChickenAPI.Core.Logging; using CommandLine; +using SaltyEmu.Core.Logging; using Toolkit.Cleaners; namespace Toolkit.Commands @@ -27,11 +28,6 @@ public static int Handle(CleanCommand opts) return 1; } - if (opts.Verbose) - { - Logger.Initialize(); - } - switch (opts.CleanType) { case "e_info": diff --git a/src/Toolkit/Commands/DocumentationCommand.cs b/src/Toolkit/Commands/DocumentationCommand.cs deleted file mode 100644 index 5ac587a2..00000000 --- a/src/Toolkit/Commands/DocumentationCommand.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Old.Attributes; - -namespace Toolkit.Commands -{ - public class DocumentationCommand - { - public static int Handle(DocumentationCommand command) - { - foreach (Type packet in typeof(SayPacket).Assembly.GetTypes().Where(s => s.GetCustomAttribute() != null)) - { - var header = packet.GetCustomAttribute(); - var packetDesc = packet.GetCustomAttribute(); - List properties = new List(); - - foreach (PropertyInfo property in packet.GetProperties().Where(info => info.GetCustomAttribute() != null)) - { - var propertyDesc = property.GetCustomAttribute(); - } - // serialize packet to markdown file - } - - return 0; - } - } -} \ No newline at end of file diff --git a/src/Toolkit/Commands/LanguageCommand.cs b/src/Toolkit/Commands/LanguageCommand.cs index 2cd356df..76c0de97 100644 --- a/src/Toolkit/Commands/LanguageCommand.cs +++ b/src/Toolkit/Commands/LanguageCommand.cs @@ -9,6 +9,7 @@ using ChickenAPI.Game._i18n; using CommandLine; using SaltyEmu.Core; +using SaltyEmu.Core.Logging; using SaltyEmu.RedisWrappers; namespace Toolkit.Commands @@ -16,7 +17,7 @@ namespace Toolkit.Commands [Verb("langs", HelpText = "Input languages from langs/ to running GameLanguageService")] public class LanguageCommand { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private static readonly IGameLanguageService _langs = new Lazy(ChickenContainer.Instance.Resolve).Value; [Value(0, HelpText = "fr, en, de, all")] diff --git a/src/Toolkit/Commands/ParseCommand.cs b/src/Toolkit/Commands/ParseCommand.cs index 20c02a52..192ff183 100644 --- a/src/Toolkit/Commands/ParseCommand.cs +++ b/src/Toolkit/Commands/ParseCommand.cs @@ -10,6 +10,7 @@ using ChickenAPI.Enums; using CommandLine; using SaltyEmu.BasicAlgorithmPlugin; +using SaltyEmu.Core.Logging; using SaltyEmu.DatabasePlugin; using Toolkit.Converter; using Toolkit.Generators.FromPackets; @@ -19,7 +20,7 @@ namespace Toolkit.Commands [Verb("parse")] public class ParseCommand { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); [Value(0, Default = "all", HelpText = "Parsing type : card, skill, map, item, einfo, monster")] public string ParsingType { get; set; } diff --git a/src/Toolkit/Converter/CardDatConverter.cs b/src/Toolkit/Converter/CardDatConverter.cs index d7f6e2d6..29c695fc 100644 --- a/src/Toolkit/Converter/CardDatConverter.cs +++ b/src/Toolkit/Converter/CardDatConverter.cs @@ -9,13 +9,14 @@ using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.BCard; using ChickenAPI.Enums.Game.Buffs; +using SaltyEmu.Core.Logging; namespace Toolkit.Converter { public class CardDatConverter { private const string FILE = "Card.dat"; - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private static string _inputDirectory; private readonly Queue _cardBcards = new Queue(); diff --git a/src/Toolkit/Converter/EInfoFiller.cs b/src/Toolkit/Converter/EInfoFiller.cs index eda05cab..7e3c548c 100644 --- a/src/Toolkit/Converter/EInfoFiller.cs +++ b/src/Toolkit/Converter/EInfoFiller.cs @@ -7,12 +7,13 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.NpcMonster; +using SaltyEmu.Core.Logging; namespace Toolkit.Converter { public class EInfoFiller { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _npcMonsters = new List(); private INpcMonsterService _npcMonsterService; diff --git a/src/Toolkit/Converter/ItemDatConverter.cs b/src/Toolkit/Converter/ItemDatConverter.cs index 0fefbaff..a40b0900 100644 --- a/src/Toolkit/Converter/ItemDatConverter.cs +++ b/src/Toolkit/Converter/ItemDatConverter.cs @@ -10,12 +10,15 @@ using ChickenAPI.Data.Item; using ChickenAPI.Enums.Game.BCard; using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Packets.Enumerations; +using SaltyEmu.Core.Logging; +using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; namespace Toolkit.Converter { public class ItemDatConverter { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private static readonly string _file = "Item.dat"; private readonly List _itemCards = new List(); private readonly List _items = new List(); diff --git a/src/Toolkit/Converter/MapDatConverter.cs b/src/Toolkit/Converter/MapDatConverter.cs index a2fe6b8a..f1b979b7 100644 --- a/src/Toolkit/Converter/MapDatConverter.cs +++ b/src/Toolkit/Converter/MapDatConverter.cs @@ -6,12 +6,13 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; +using SaltyEmu.Core.Logging; namespace Toolkit.Converter { public class MapDatConverter { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _maps = new List(); private IMapService _mapService; diff --git a/src/Toolkit/Converter/MonsterDatConverter.cs b/src/Toolkit/Converter/MonsterDatConverter.cs index 3dc99264..12bd24d9 100644 --- a/src/Toolkit/Converter/MonsterDatConverter.cs +++ b/src/Toolkit/Converter/MonsterDatConverter.cs @@ -15,12 +15,13 @@ using ChickenAPI.Enums.Game.Drop; using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Packets.Enumerations; +using SaltyEmu.Core.Logging; namespace Toolkit.Converter { public class MonsterDatConverter { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private static readonly string _file = "Monster.dat"; private static string _inputDirectory; private readonly List _monsterBcards = new List(); diff --git a/src/Toolkit/Converter/SkillDatConverter.cs b/src/Toolkit/Converter/SkillDatConverter.cs index a535c3aa..8bacd473 100644 --- a/src/Toolkit/Converter/SkillDatConverter.cs +++ b/src/Toolkit/Converter/SkillDatConverter.cs @@ -10,13 +10,14 @@ using ChickenAPI.Data.BCard; using ChickenAPI.Data.Skills; using ChickenAPI.Enums.Game.BCard; +using SaltyEmu.Core.Logging; namespace Toolkit.Converter { public class SkillDatConverter { private const string FILE = "Skill.dat"; - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private static string _inputDirectory; private readonly List _skillBCards = new List(); diff --git a/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs b/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs index 46e16102..05559c7b 100644 --- a/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs @@ -9,12 +9,13 @@ using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Enums.Game.Entity; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { public class MapMonsterGenerator { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _monsters = new List(); diff --git a/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs b/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs index 54e7a200..c813070e 100644 --- a/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs @@ -8,12 +8,13 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using ChickenAPI.Enums.Game.Entity; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { public class MapNpcGenerator { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _npcs = new List(); diff --git a/src/Toolkit/Generators/FromPackets/PacketPortalGenerator.cs b/src/Toolkit/Generators/FromPackets/PacketPortalGenerator.cs index 0aca0aa7..14e5ad3f 100644 --- a/src/Toolkit/Generators/FromPackets/PacketPortalGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/PacketPortalGenerator.cs @@ -7,13 +7,14 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; -using ChickenAPI.Enums.Game.Portals; +using ChickenAPI.Packets.Enumerations; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { public class PacketPortalGenerator { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _destinationPortals = new List(); private readonly List _sourcePortals = new List(); diff --git a/src/Toolkit/Generators/FromPackets/RecipeGenerator.cs b/src/Toolkit/Generators/FromPackets/RecipeGenerator.cs index 3795a741..f4a8eff5 100644 --- a/src/Toolkit/Generators/FromPackets/RecipeGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/RecipeGenerator.cs @@ -7,12 +7,13 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { public class RecipeGenerator { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _recipeItems = new List(); private readonly List _recipes = new List(); diff --git a/src/Toolkit/Generators/FromPackets/ShopItemGenerator.cs b/src/Toolkit/Generators/FromPackets/ShopItemGenerator.cs index 1e458121..01592617 100644 --- a/src/Toolkit/Generators/FromPackets/ShopItemGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/ShopItemGenerator.cs @@ -7,6 +7,7 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { diff --git a/src/Toolkit/Generators/FromPackets/ShopParserGenerator.cs b/src/Toolkit/Generators/FromPackets/ShopParserGenerator.cs index fa850a39..ba2595e1 100644 --- a/src/Toolkit/Generators/FromPackets/ShopParserGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/ShopParserGenerator.cs @@ -8,12 +8,13 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Map; using ChickenAPI.Data.Shop; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { public class ShopParserGenerator { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _shops = new List(); diff --git a/src/Toolkit/Generators/FromPackets/ShopSkillGenerator.cs b/src/Toolkit/Generators/FromPackets/ShopSkillGenerator.cs index f549ecd2..02d48b93 100644 --- a/src/Toolkit/Generators/FromPackets/ShopSkillGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/ShopSkillGenerator.cs @@ -7,12 +7,13 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Shop; +using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets { public class ShopSkillGenerator { - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private readonly List _shopSkills = new List(); diff --git a/src/World/Network/ClientSession.cs b/src/World/Network/ClientSession.cs index ca3c113d..71c55dbd 100644 --- a/src/World/Network/ClientSession.cs +++ b/src/World/Network/ClientSession.cs @@ -18,7 +18,8 @@ using SaltyEmu.Commands.Interfaces; using ChickenAPI.Game._Network; using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Old; +using ChickenAPI.Packets.Interfaces; +using SaltyEmu.Core.Logging; namespace World.Network { @@ -32,7 +33,8 @@ public class ClientSession : ChannelHandlerAdapter, ISession private static readonly ICommandContainer Commands = new Lazy(ChickenContainer.Instance.Resolve).Value; private static readonly IPacketPipelineAsync PacketPipeline = new Lazy(ChickenContainer.Instance.Resolve).Value; - private static readonly IPacketFactory PacketFactory = new Lazy(ChickenContainer.Instance.Resolve).Value; + private static readonly IDeserializer packetDeserializer = new Lazy(ChickenContainer.Instance.Resolve).Value; + private static readonly ISerializer packetSerializer = new Lazy(ChickenContainer.Instance.Resolve).Value; private static readonly Logger Log = Logger.GetLogger(); private static Guid _worldServerId; @@ -124,7 +126,7 @@ public void SendPacket(T packet) where T : IPacket return; } - string tmp = PacketFactory.Serialize(packet); + string tmp = packetSerializer.Serialize(packet); #if DEBUG if (BlacklistedDebug.All(s => !tmp.StartsWith(s))) @@ -153,7 +155,7 @@ public void SendPackets(IEnumerable packets) where T : IPacket continue; } - string tmp = PacketFactory.Serialize(packet); + string tmp = packetSerializer.Serialize(packet); #if DEBUG if (BlacklistedDebug.All(s => !tmp.StartsWith(s))) { @@ -184,7 +186,7 @@ public void SendPackets(IEnumerable packets) continue; } - string tmp = PacketFactory.Serialize(packet); + string tmp = packetSerializer.Serialize(packet); #if DEBUG if (BlacklistedDebug.All(s => !tmp.StartsWith(s))) { @@ -211,7 +213,7 @@ public Task SendPacketAsync(T packet) where T : IPacket return Task.CompletedTask; } - string tmp = PacketFactory.Serialize(packet); + string tmp = packetSerializer.Serialize(packet); #if DEBUG if (BlacklistedDebug.All(s => !tmp.StartsWith(s))) @@ -219,8 +221,8 @@ public Task SendPacketAsync(T packet) where T : IPacket Log.Debug($"[{Ip}][SOCKET_WRITE] {tmp}"); } #endif - - var task = _channel.WriteAsync(tmp); + + Task task = _channel.WriteAsync(tmp); _channel.Flush(); return Task.CompletedTask; } @@ -241,7 +243,7 @@ public Task SendPacketsAsync(IEnumerable packets) where T : IPacket continue; } - string tmp = PacketFactory.Serialize(packet); + string tmp = packetSerializer.Serialize(packet); #if DEBUG if (BlacklistedDebug.All(s => !tmp.StartsWith(s))) { @@ -259,6 +261,7 @@ public Task SendPacketsAsync(IEnumerable packets) where T : IPacket Log.Error("[SendPackets]", e); Disconnect(); } + return Task.CompletedTask; } @@ -273,7 +276,7 @@ public Task SendPacketsAsync(IEnumerable packets) continue; } - string tmp = PacketFactory.Serialize(packet); + string tmp = packetSerializer.Serialize(packet); #if DEBUG if (BlacklistedDebug.All(s => !tmp.StartsWith(s))) { @@ -291,6 +294,7 @@ public Task SendPacketsAsync(IEnumerable packets) Log.Error("[SendPackets(IPacket)]", e); Disconnect(); } + return Task.CompletedTask; } @@ -328,7 +332,7 @@ public override void ExceptionCaught(IChannelHandlerContext context, Exception e #endif context.CloseAsync(); } - + public override void ChannelRead(IChannelHandlerContext context, object message) { try @@ -343,8 +347,6 @@ public override void ChannelRead(IChannelHandlerContext context, object message) BufferToUnauthedPackets(buff, context); return; } - - BufferToPackets(buff); } catch (Exception e) { @@ -379,33 +381,8 @@ private void BufferToUnauthedPackets(string packets, IChannelHandlerContext cont SessionId = sessid; SocketSessionManager.Instance.RegisterSession(context.Channel.Id.AsLongText(), this); // CLIENT ARRIVED - if (!_waitForPacketsAmount.HasValue) - { - TriggerHandler("EntryPoint", string.Empty, false); - } } - private bool WaitForPackets(string packetstring, IReadOnlyList packetsplit) - { - _waitForPacketList.Add(packetstring); - string[] packetssplit = packetstring.Split(' '); - if (packetssplit.Length > 3 && packetsplit[1] == "DAC") - { - _waitForPacketList.Add("0 CrossServerAuthenticate"); - } - - if (_waitForPacketList.Count != _waitForPacketsAmount) - { - return true; - } - - _waitForPacketsAmount = null; - string queuedPackets = string.Join(" ", _waitForPacketList.ToArray()); - string header = queuedPackets.Split(' ', '^')[1]; - TriggerHandler(header, queuedPackets, true); - _waitForPacketList.Clear(); - return false; - } private void KeepAliveCheck(int nextKeepAlive) { @@ -423,140 +400,6 @@ private void KeepAliveCheck(int nextKeepAlive) } private const string CommandPrefix = "$"; - - private void BufferToPackets(string packets) - { - foreach (string packet in packets.Split((char)PACKET_SPLIT_CHARACTER, StringSplitOptions.RemoveEmptyEntries)) - { - string packetstring = packet.Replace('^', ' '); - string[] packetsplit = packetstring.Split(' '); - - // keep alive - string nextKeepAliveRaw = packetsplit[0]; - if (!int.TryParse(nextKeepAliveRaw, out int nextKeepAlive) && nextKeepAlive != (LastKeepAliveIdentity + 1)) - { - Disconnect(); - return; - } - - KeepAliveCheck(nextKeepAlive); - - if (_waitForPacketsAmount.HasValue) - { - if (WaitForPackets(packetstring, packetsplit)) - { - continue; - } - - return; - } - - if (packetsplit.Length <= 1) - { - continue; - } - - if (packetsplit[1].Length >= 1 && ChatDelimiter.Any(s => s == packetsplit[1][0])) - { - packetsplit[1] = packetsplit[1][0].ToString(); - packetstring = packet.Insert(packet.IndexOf(' ') + 2, " "); - - //^ wtf is this - - if (packetsplit[1] == CommandPrefix) //it's a command - { - // temporary fix on the deadlock - // todo fix where the deadlock appear - _ = Task.Run(() => Commands.HandleMessageAsync(packetstring, Player)); - } - } - - if (packetsplit[1] != "0") - { - TriggerHandler(packetsplit[1].Replace("#", ""), packetstring, false); - } - } - } - - private static readonly char[] ChatDelimiter = { '/', ':', ';', '$' }; - - private void GameHandler(string packetHeader, string packet) - { - Type type = PacketPipeline.PacketTypeByHeader(packetHeader); - - if (type == null) - { - Log.Debug($"[{Ip}][GAME_HANDLER_NOT_FOUND] {packetHeader}"); - return; - } - -#if DEBUG - Log.Debug($"[{Ip}][HANDLING] {packet}"); -#endif - - IPacket deserializedPacketBase; - try - { - deserializedPacketBase = PacketFactory.Deserialize(packet, type, IsAuthenticated); - Task.Run(() => PacketPipeline.Handle(deserializedPacketBase, this)).ConfigureAwait(false).GetAwaiter().GetResult(); - } - catch (Exception e) - { - Log.Warn($"[GAME_HANDLER] {e.Message}"); - return; - } - } - - private void CharacterHandler(string packet, Type packetType) - { - IPacket deserializedPacketBase; - try - { - deserializedPacketBase = PacketFactory.Deserialize(packet, packetType, IsAuthenticated); - } - catch (Exception e) - { - Log.Warn($"[CHARACTER_HANDLER] {e.Message}"); - return; - } - - Task.Run(() => PacketPipeline.Handle(deserializedPacketBase, this)).ConfigureAwait(false).GetAwaiter().GetResult(); - } - - private void TriggerHandler(string packetHeader, string packet, bool force) - { - if (Player != null) - { - GameHandler(packetHeader, packet); - return; - } - - Type packetType = PacketPipeline.PacketTypeByHeader(packetHeader); - if (packetType == null) - { -#if DEBUG - Log.Warn($"[{Ip}][HANDLER_NOT_FOUND] {packetHeader}"); -#endif - return; - } - - if (force) - { - CharacterHandler(packet, packetType); - return; - } - - // hardcoded for entrypoint since entwell sucks - var headerAttribute = packetType.GetCustomAttribute(); - if (headerAttribute != null && headerAttribute.Amount > 1 && !_waitForPacketsAmount.HasValue) - { - _waitForPacketsAmount = headerAttribute.Amount; - _waitForPacketList.Add(packet != string.Empty ? packet : $"1 {packetHeader} "); - return; - } - - CharacterHandler(packet, packetType); - } } #endregion diff --git a/src/World/Network/Server.cs b/src/World/Network/Server.cs index 01264063..ca8320e5 100644 --- a/src/World/Network/Server.cs +++ b/src/World/Network/Server.cs @@ -12,13 +12,14 @@ using DotNetty.Transport.Bootstrapping; using DotNetty.Transport.Channels; using DotNetty.Transport.Channels.Sockets; +using SaltyEmu.Core.Logging; namespace World.Network { public class Server { // Server Tick config - private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); public static WorldServerDto WorldServer; private static IEntityManagerContainer _container; diff --git a/src/World/Packets/PacketInformation.cs b/src/World/Packets/PacketInformation.cs deleted file mode 100644 index 4b69073c..00000000 --- a/src/World/Packets/PacketInformation.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace World.Packets -{ - public class PacketInformation - { - public string Header { get; set; } - public Type Type { get; set; } - - public PacketPropertyContainer[] PacketProps { get; set; } - } -} \ No newline at end of file diff --git a/src/World/Packets/PacketPropertyContainer.cs b/src/World/Packets/PacketPropertyContainer.cs deleted file mode 100644 index 7bda3c2b..00000000 --- a/src/World/Packets/PacketPropertyContainer.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Reflection; -using ChickenAPI.Packets.Attributes; - -namespace World.Packets -{ - public class PacketPropertyContainer - { - public PacketIndexAttribute PacketIndex { get; set; } - public PropertyInfo PropertyInfo { get; set; } - public IEnumerable Validations { get; set; } - } -} \ No newline at end of file diff --git a/src/World/Packets/PluggablePacketFactory.cs b/src/World/Packets/PluggablePacketFactory.cs deleted file mode 100644 index fda59f42..00000000 --- a/src/World/Packets/PluggablePacketFactory.cs +++ /dev/null @@ -1,500 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using ChickenAPI.Core.Logging; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Old; -using World.Extensions; -using PacketBase = ChickenAPI.Packets.PacketBase; - -namespace World.Packets -{ - /// - /// First version of a pluggable PacketFactory - /// - public class PluggablePacketFactory : IPacketFactory - { - private static readonly Logger Log = Logger.GetLogger(); - private readonly Dictionary _packetTypesByHeader = new Dictionary(); - private readonly Dictionary _deserializationInformations = new Dictionary(); - - - public string Serialize(IPacket packet) => Serialize(packet, packet.GetType()); - - public string Serialize(TPacket packet) where TPacket : IPacket => - Serialize(packet, typeof(TPacket)); - - public string Serialize(IPacket packet, Type type) - { - try - { - // load pregenerated serialization information - PacketInformation serializationInformation = GetSerializationInformation(type); - - var builder = new StringBuilder(); - builder.Append(serializationInformation.Header); - - int lastIndex = 0; - - foreach (PacketPropertyContainer property in serializationInformation.PacketProps) - { - PacketIndexAttribute packetIndex = property.PacketIndex; - PropertyInfo propertyType = property.PropertyInfo; - IEnumerable validations = property.Validations; - // check if we need to add a non mapped values (pseudovalues) - if (packetIndex.Index > lastIndex + 1) - { - int amountOfEmptyValuesToAdd = packetIndex.Index - (lastIndex + 1); - - for (int j = 0; j < amountOfEmptyValuesToAdd; j++) - { - builder.Append(" 0"); - } - } - - // add value for current configuration - builder.Append(SerializeValue(propertyType.PropertyType, propertyType.GetValue(packet), validations, packetIndex)); - - // check if the value should be serialized to end - if (packetIndex.SerializeToEnd) - { - // we reached the end - break; - } - - // set new index - lastIndex = packetIndex.Index; - } - - return builder.ToString(); - } - catch (Exception e) - { - Log.Error($"Wrong Packet format {type}\n", e); - return string.Empty; - } - } - - public IPacket Deserialize(string packetContent, Type packetType, bool includesKeepAliveIdentity) - { - try - { - PacketInformation serializationInformation = GetSerializationInformation(packetType); - var deserializedPacket = (PacketBase)packetType.CreateInstance(); - SetDeserializationInformations(deserializedPacket, packetContent, serializationInformation.Header, packetType); - return Deserialize(packetContent, deserializedPacket, serializationInformation, includesKeepAliveIdentity); - } - catch (Exception e) - { - Log.Error($"The serialized packetBase has the wrong format. Packet: {packetContent}", e); - return null; - } - } - - #region Serialization - - private string SerializeValue(Type propertyType, object value, IEnumerable validationAttributes, PacketIndexAttribute packetIndexAttribute = null) - { - if (propertyType == null && validationAttributes.All(a => a.IsValid(value))) - { - return string.Empty; - } - - if (packetIndexAttribute?.IsOptional == true && string.IsNullOrEmpty(Convert.ToString(value))) - { - return string.Empty; - } - - // check for nullable without value or string - if (propertyType == typeof(string) && string.IsNullOrEmpty(Convert.ToString(value))) - { - return $"{packetIndexAttribute?.SeparatorBeforeProperty}-"; - } - - if (Nullable.GetUnderlyingType(propertyType) != null && string.IsNullOrEmpty(Convert.ToString(value))) - { - return $"{packetIndexAttribute?.SeparatorBeforeProperty}-1"; - } - - // enum should be casted to number - if (propertyType.BaseType?.Equals(typeof(Enum)) == true) - { - return $"{packetIndexAttribute?.SeparatorBeforeProperty}{Convert.ToInt16(value)}"; - } - - if (propertyType == typeof(bool)) - { - // bool is 0 or 1 not True or False - return Convert.ToBoolean(value) ? $"{packetIndexAttribute?.SeparatorBeforeProperty}1" : $"{packetIndexAttribute?.SeparatorBeforeProperty}0"; - } - - if (value is PacketBase) - { - PacketInformation subpacketSerializationInfo = GetSerializationInformation(value.GetType()); - return SerializeSubpacket(value, subpacketSerializationInfo, packetIndexAttribute?.IsReturnPacket ?? false, packetIndexAttribute?.RemoveSeparator ?? false); - } - - if (propertyType.BaseType?.Equals(typeof(PacketBase)) == true) - { - PacketInformation subpacketSerializationInfo = GetSerializationInformation(propertyType); - return SerializeSubpacket(value, subpacketSerializationInfo, packetIndexAttribute?.IsReturnPacket ?? false, packetIndexAttribute?.RemoveSeparator ?? false); - } - - if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>)) - && propertyType.GenericTypeArguments[0].BaseType == typeof(PacketBase)) - { - return packetIndexAttribute?.SeparatorBeforeProperty + SerializeSubpackets((IList)value, propertyType, packetIndexAttribute?.RemoveSeparator ?? false); - } - - if (propertyType.IsGenericType && propertyType.GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))) //simple list - { - return packetIndexAttribute?.SeparatorBeforeProperty + SerializeSimpleList((IList)value, propertyType, packetIndexAttribute); - } - - return $"{packetIndexAttribute?.SeparatorBeforeProperty}{value}"; - } - - private string SerializeSimpleList(IList listValues, Type propertyType, PacketIndexAttribute index) - { - string resultListPacket = string.Empty; - int listValueCount = listValues.Count; - if (listValueCount <= 0) - { - return resultListPacket; - } - - resultListPacket += SerializeValue(propertyType.GenericTypeArguments[0], listValues[0], propertyType.GenericTypeArguments[0].GetCustomAttributes()); - - for (int i = 1; i < listValueCount; i++) - { - resultListPacket += - $"{index.SeparatorNestedElements}{SerializeValue(propertyType.GenericTypeArguments[0], listValues[i], propertyType.GenericTypeArguments[0].GetCustomAttributes()).Replace(" ", "")}"; - } - - return resultListPacket; - } - - private string SerializeSubpacket(object value, PacketInformation subpacketSerializationInfo, bool isReturnPacket, - bool shouldRemoveSeparator) - { - string serializedSubpacket = isReturnPacket ? $" #{subpacketSerializationInfo.Header}^" : " "; - - // iterate thru configure subpacket properties - foreach (PacketPropertyContainer tmp in subpacketSerializationInfo.PacketProps) - { - PacketIndexAttribute key = tmp.PacketIndex; - PropertyInfo propertyInfo = tmp.PropertyInfo; - // first element - if (key.Index != 0) - { - serializedSubpacket += isReturnPacket ? "^" : shouldRemoveSeparator ? key.SeparatorBeforeProperty : key.SeparatorNestedElements; - } - - serializedSubpacket += SerializeValue(propertyInfo.PropertyType, propertyInfo.GetValue(value), tmp.Validations, key).Replace(" ", ""); - } - - return serializedSubpacket; - } - - private PacketInformation GenerateSerializationInformations(Type serializationType) - { - string header = serializationType.GetCustomAttribute()?.Identification; - - if (string.IsNullOrEmpty(header)) - { - throw new Exception($"Packet header cannot be empty. PacketType: {serializationType.Name}"); - } - - Dictionary packetsForPacketDefinition = new Dictionary(); - - IEnumerable packetIndexProperties = serializationType.GetProperties().Where(x => x.GetCustomAttributes(false).OfType().Any()).ToArray(); - - - List packetProperties = - (from packetBasePropertyInfo in packetIndexProperties.OrderBy(s => s.GetCustomAttribute(false).Index) - let indexAttribute = packetBasePropertyInfo.GetCustomAttributes(false).OfType().FirstOrDefault() - where indexAttribute != null - select new PacketPropertyContainer - { - PacketIndex = indexAttribute, PropertyInfo = packetBasePropertyInfo, - Validations = packetBasePropertyInfo.GetCustomAttributes() - }).ToList(); - - var tmp = new PacketInformation - { - Type = serializationType, - Header = header, - PacketProps = packetProperties.OrderBy(container => container.PacketIndex.Index).ToArray() - }; - - if (!_packetTypesByHeader.ContainsKey(tmp.Header)) - { - _packetTypesByHeader.Add(tmp.Header, serializationType); - } - - _deserializationInformations.Add(serializationType, tmp); - - return tmp; - } - - private PacketInformation GetSerializationInformation(Type serializationType) - { - if (_deserializationInformations.TryGetValue(serializationType, out PacketInformation packetInfo)) - { - return packetInfo; - } - - return GenerateSerializationInformations(serializationType); - } - - private string SerializeSubpackets(ICollection listValues, Type packetBasePropertyType, bool shouldRemoveSeparator) - { - string serializedSubPacket = string.Empty; - PacketInformation subpacketSerializationInfo = GetSerializationInformation(packetBasePropertyType.GetGenericArguments()[0]); - - if (listValues?.Count > 0) - { - serializedSubPacket = listValues.Cast().Aggregate(serializedSubPacket, - (current, listValue) => current + SerializeSubpacket(listValue, subpacketSerializationInfo, false, shouldRemoveSeparator)); - } - - return serializedSubPacket; - } - - #endregion - - - #region Deserialization - - private PacketBase Deserialize(string packetContent, PacketBase packet, PacketInformation serializeInfos, bool includeKeepAlive) - { - MatchCollection matches = Regex.Matches(packetContent, @"([^\040]+[\.][^\040]+[\040]?)+((?=\040)|$)|([^\040]+)((?=\040)|$)"); - if (matches.Count <= 0) - { - return packet; - } - - for (int i = 0; i < serializeInfos.PacketProps.Length; i++) - { - int currentIndex = i + (includeKeepAlive ? 2 : 1); - if (currentIndex >= matches.Count) - { - break; - } - - PacketIndexAttribute index = serializeInfos.PacketProps[i].PacketIndex; - PropertyInfo property = serializeInfos.PacketProps[i].PropertyInfo; - IEnumerable validations = serializeInfos.PacketProps[i].Validations; - - if (index.SerializeToEnd) - { - // get the value to the end and stop deserialization - int tmp = matches.Count > currentIndex ? matches[currentIndex].Index : packetContent.Length; - string valueToEnd = packetContent.Substring(tmp, packetContent.Length - tmp); - property.SetValue(packet, DeserializeValue(property.PropertyType, valueToEnd, index, validations, matches, includeKeepAlive)); - break; - } - - string currentValue = matches[currentIndex].Value; - - // set the value & convert currentValue - property.SetValue(packet, DeserializeValue(property.PropertyType, currentValue, index, validations, matches, includeKeepAlive)); - } - - return packet; - } - - private IList DeserializeSimpleList(string currentValues, Type genericListType) - { - var subpackets = (IList)Convert.ChangeType((IList)genericListType.CreateInstance(), genericListType); - IEnumerable splittedValues = currentValues.Split('.'); - - foreach (string currentValue in splittedValues) - { - object value = DeserializeValue(genericListType.GenericTypeArguments[0], currentValue, null, genericListType.GenericTypeArguments[0].GetCustomAttributes(), null); - subpackets.Add(value); - } - - return subpackets; - } - - private object DeserializeSubpacket(string currentSubValues, Type packetBasePropertyType, PacketInformation subpacketSerializationInfo, bool isReturnPacket = false) - { - string[] subpacketValues = currentSubValues.Split(isReturnPacket ? '^' : '.'); - object newSubpacket = packetBasePropertyType.CreateInstance(); - foreach (PacketPropertyContainer tmp in subpacketSerializationInfo.PacketProps) - { - PacketIndexAttribute key = tmp.PacketIndex; - PropertyInfo value = tmp.PropertyInfo; - int currentSubIndex = isReturnPacket ? key.Index + 1 : key.Index; // return packets do include header - string currentSubValue = subpacketValues[currentSubIndex]; - - value.SetValue(newSubpacket, DeserializeValue(value.PropertyType, currentSubValue, key, tmp.Validations, null)); - } - - return newSubpacket; - } - - private IList DeserializeSubpackets(string currentValue, Type packetBasePropertyType, bool shouldRemoveSeparator, MatchCollection packetMatchCollections, int? currentIndex, - bool includesKeepAliveIdentity) - { - // split into single values - List splittedSubpackets = currentValue.Split(' ').ToList(); - // generate new list - var subpackets = (IList)Convert.ChangeType(packetBasePropertyType.CreateInstance(), packetBasePropertyType); - - Type subPacketType = packetBasePropertyType.GetGenericArguments()[0]; - PacketInformation subpacketSerializationInfo = GetSerializationInformation(subPacketType); - - // handle subpackets with separator - if (shouldRemoveSeparator) - { - if (!currentIndex.HasValue || packetMatchCollections == null) - { - return subpackets; - } - - List splittedSubpacketParts = packetMatchCollections.Select(m => m.Value).ToList(); - splittedSubpackets = new List(); - - string generatedPseudoDelimitedString = string.Empty; - int subPacketTypePropertiesCount = subpacketSerializationInfo.PacketProps.Length; - - // check if the amount of properties can be serialized properly - if (((splittedSubpacketParts.Count + (includesKeepAliveIdentity ? 1 : 0)) - % subPacketTypePropertiesCount) == 0) // amount of properties per subpacket does match the given value amount in % - { - for (int i = currentIndex.Value + 1 + (includesKeepAliveIdentity ? 1 : 0); i < splittedSubpacketParts.Count; i++) - { - int j; - for (j = i; j < i + subPacketTypePropertiesCount; j++) - { - // add delimited value - generatedPseudoDelimitedString += splittedSubpacketParts[j] + "."; - } - - i = j - 1; - - //remove last added separator - generatedPseudoDelimitedString = generatedPseudoDelimitedString.Substring(0, generatedPseudoDelimitedString.Length - 1); - - // add delimited values to list of values to serialize - splittedSubpackets.Add(generatedPseudoDelimitedString); - generatedPseudoDelimitedString = string.Empty; - } - } - else - { - throw new Exception("The amount of splitted subpacket values without delimiter do not match the % property amount of the serialized type."); - } - } - - foreach (string subpacket in splittedSubpackets) - { - subpackets.Add(DeserializeSubpacket(subpacket, subPacketType, subpacketSerializationInfo)); - } - - return subpackets; - } - - private object DeserializeValue(Type packetPropertyType, string currentValue, PacketIndexAttribute packetIndexAttribute, IEnumerable validationAttributes, - MatchCollection packetMatches, - bool includesKeepAliveIdentity = false) - { - foreach (ValidationAttribute i in validationAttributes) - { - if (!i.IsValid(currentValue)) - { - throw new ValidationException(i.ErrorMessage); - } - } - - // check for empty value and cast it to null - if (currentValue == "-1" || currentValue == "-") - { - currentValue = null; - } - - // enum should be casted to number - if (packetPropertyType.BaseType?.Equals(typeof(Enum)) == true) - { - object convertedValue = null; - try - { - if (currentValue != null && packetPropertyType.IsEnumDefined(Enum.Parse(packetPropertyType, currentValue))) - { - convertedValue = Enum.Parse(packetPropertyType, currentValue); - } - } - catch (Exception) - { - Log.Warn($"Could not convert value {currentValue} to type {packetPropertyType.Name}"); - } - - return convertedValue; - } - - if (packetPropertyType == typeof(bool)) // handle boolean values - { - return currentValue != "0"; - } - - if (packetPropertyType.BaseType?.Equals(typeof(PacketBase)) == true) // subpacket - { - PacketInformation subpacketSerializationInfo = GetSerializationInformation(packetPropertyType); - return DeserializeSubpacket(currentValue, packetPropertyType, subpacketSerializationInfo, packetIndexAttribute?.IsReturnPacket ?? false); - } - - if (packetPropertyType.IsGenericType && packetPropertyType.GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>)) // subpacket list - && packetPropertyType.GenericTypeArguments[0].BaseType == typeof(PacketBase)) - { - return DeserializeSubpackets(currentValue, packetPropertyType, packetIndexAttribute?.RemoveSeparator ?? false, packetMatches, packetIndexAttribute?.Index, includesKeepAliveIdentity); - } - - if (packetPropertyType.IsGenericType && packetPropertyType.GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))) // simple list - { - return DeserializeSimpleList(currentValue, packetPropertyType); - } - - if (Nullable.GetUnderlyingType(packetPropertyType) != null && string.IsNullOrEmpty(currentValue)) // empty nullable value - { - return null; - } - - if (Nullable.GetUnderlyingType(packetPropertyType) != null) // nullable value - { - return packetPropertyType.GenericTypeArguments[0]?.BaseType == typeof(Enum) - ? Enum.Parse(packetPropertyType.GenericTypeArguments[0], currentValue) - : Convert.ChangeType(currentValue, packetPropertyType.GenericTypeArguments[0]); - } - - if (packetPropertyType == typeof(string) && string.IsNullOrEmpty(currentValue) && !packetIndexAttribute.SerializeToEnd) - { - throw new NullReferenceException(); - } - - if (packetPropertyType == typeof(string) && currentValue == null) - { - currentValue = string.Empty; - } - - return Convert.ChangeType(currentValue, packetPropertyType); // cast to specified type - } - - - private static void SetDeserializationInformations(PacketBase packetBaseDefinition, string packetContent, string packetHeader, Type packetType) - { - packetBaseDefinition.OriginalContent = packetContent; - packetBaseDefinition.SentDateUtc = DateTime.UtcNow; - packetBaseDefinition.Header = packetHeader; - packetBaseDefinition.PacketType = packetType; - } - - #endregion - } -} \ No newline at end of file diff --git a/src/World/WorldServer.cs b/src/World/WorldServer.cs index a8b07423..c1457d8c 100644 --- a/src/World/WorldServer.cs +++ b/src/World/WorldServer.cs @@ -2,15 +2,13 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using System.Text; using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Plugins; using ChickenAPI.Core.Plugins.Exceptions; using ChickenAPI.Packets; -using ChickenAPI.Packets.Attributes; -using ChickenAPI.Packets.Old; +using ChickenAPI.Packets.Interfaces; using Essentials; using NLog; using NW.Plugins.PacketHandling; @@ -23,8 +21,7 @@ using SaltyEmu.PathfinderPlugin; using SaltyEmu.RedisWrappers; using World.Network; -using World.Packets; -using Logger = ChickenAPI.Core.Logging.Logger; +using Logger = SaltyEmu.Core.Logging.Logger; namespace World { @@ -139,7 +136,15 @@ private static void Main() PrintHeader(); InitializeLogger(); InitializeConfigs(); - ChickenContainer.Builder.Register(_ => new PluggablePacketFactory()).As().SingleInstance(); + IEnumerable packetTypes = typeof(IPacket).Assembly.GetTypes() + .Where(p => p.Namespace != "ChickenAPI.Packets.ServerPackets.Login" && p.Name != "NoS0575Packet" + && p.GetInterfaces().Contains(typeof(IPacket)) && p.IsClass && !p.IsAbstract).ToArray(); + ChickenContainer.Builder.Register(c => new Deserializer(packetTypes)) + .AsImplementedInterfaces() + .SingleInstance(); + ChickenContainer.Builder.Register(c => new Serializer(packetTypes)) + .AsImplementedInterfaces() + .SingleInstance(); if (InitializePlugins()) { return; diff --git a/src/libs/SaltyEmu.Core/Logging/Logger.cs b/src/libs/SaltyEmu.Core/Logging/Logger.cs index 06898188..f7ff0c94 100644 --- a/src/libs/SaltyEmu.Core/Logging/Logger.cs +++ b/src/libs/SaltyEmu.Core/Logging/Logger.cs @@ -13,6 +13,12 @@ public class Logger : ChickenAPI.Core.Logging.ILogger public Logger(Type type) => Log = LogManager.GetLogger(type.ToString()); public Logger(string prefix) => Log = LogManager.GetLogger(prefix); + public static Logger GetLogger(string prefix) => new Logger(prefix); + + public static Logger GetLogger(Type type) => GetLogger(type.ToString()); + + public static Logger GetLogger() where TClass : class => GetLogger(typeof(TClass)); + private NLog.ILogger Log { get; } /// diff --git a/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs b/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs index bf210b48..3f7b9615 100644 --- a/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs +++ b/src/libs/SaltyEmu.Core/Plugins/SimplePluginManager.cs @@ -11,7 +11,7 @@ namespace SaltyEmu.Core.Plugins { public class SimplePluginManager : IPluginManager { - private static readonly Logger Log = Logger.GetLogger(); + // private static readonly Logger Log = Logger.GetLogger(); public IPlugin[] LoadPlugin(FileInfo file) { @@ -36,7 +36,7 @@ public IPlugin[] LoadPlugin(FileInfo file) foreach (Type type in pluginTypes) { var plugin = (IPlugin)Activator.CreateInstance(type); - Log.Info($"{plugin.Name} Loaded !"); + // Log.Info($"{plugin.Name} Loaded !"); plugin.OnLoad(); plugins.Add(plugin); } diff --git a/src/services/SaltyEmu.CharacterSkillService/DAO/CharacterSkillServiceDao.cs b/src/services/SaltyEmu.CharacterSkillService/DAO/CharacterSkillServiceDao.cs index 140cde16..cefb1604 100644 --- a/src/services/SaltyEmu.CharacterSkillService/DAO/CharacterSkillServiceDao.cs +++ b/src/services/SaltyEmu.CharacterSkillService/DAO/CharacterSkillServiceDao.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Threading.Tasks; -using ChickenAPI.Data; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; -using MongoDB.Bson.Serialization.Attributes; -using MongoDB.Bson.Serialization.IdGenerators; using MongoDB.Driver; using SaltyEmu.Database.MongoDB; @@ -13,7 +9,7 @@ namespace SaltyEmu.CharacterSkillService.DAO { public class CharacterSkillServiceDao : SynchronizedMongoRepository, ICharacterSkillService { - public CharacterSkillServiceDao(MongoConfigurationBuilder builder) : base(builder) + public CharacterSkillServiceDao(MongoConfigurationBuilder builder, ILogger log) : base(builder, log) { } diff --git a/src/services/SaltyEmu.CharacterSkillService/Program.cs b/src/services/SaltyEmu.CharacterSkillService/Program.cs index 6fea6722..6dba2cba 100644 --- a/src/services/SaltyEmu.CharacterSkillService/Program.cs +++ b/src/services/SaltyEmu.CharacterSkillService/Program.cs @@ -7,6 +7,7 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; using ChickenAPI.Core.Plugins.Exceptions; +using SaltyEmu.Core.Logging; using SaltyEmu.Core.Plugins; namespace SaltyEmu.CharacterSkillService @@ -14,7 +15,7 @@ namespace SaltyEmu.CharacterSkillService class Program { private static readonly IPluginManager PluginManager = new SimplePluginManager(); - private static readonly Logger Log = Logger.GetLogger("RelationService"); + private static readonly ILogger Log = Logger.GetLogger(); private static void PrintHeader() { diff --git a/src/services/SaltyEmu.RelationService/DAO/RelationDao.cs b/src/services/SaltyEmu.RelationService/DAO/RelationDao.cs index fad84966..503f1494 100644 --- a/src/services/SaltyEmu.RelationService/DAO/RelationDao.cs +++ b/src/services/SaltyEmu.RelationService/DAO/RelationDao.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using SaltyEmu.Redis; @@ -8,7 +9,7 @@ namespace SaltyEmu.RelationService.DAO { public class RelationDao : GenericRedisCacheClient, IRelationDao { - public RelationDao(RedisConfiguration conf) : base(conf) + public RelationDao(RedisConfiguration conf, ILogger log) : base(conf, log) { } diff --git a/src/services/SaltyEmu.RelationService/DAO/RelationInvitationDao.cs b/src/services/SaltyEmu.RelationService/DAO/RelationInvitationDao.cs index a05d80b9..6ef391d5 100644 --- a/src/services/SaltyEmu.RelationService/DAO/RelationInvitationDao.cs +++ b/src/services/SaltyEmu.RelationService/DAO/RelationInvitationDao.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using SaltyEmu.Redis; @@ -8,7 +9,7 @@ namespace SaltyEmu.RelationService.DAO { public class RelationInvitationDao : GenericRedisCacheClient, IRelationInvitationDao { - public RelationInvitationDao(RedisConfiguration conf) : base(conf) + public RelationInvitationDao(RedisConfiguration conf, ILogger log) : base(conf, log) { } diff --git a/src/services/SaltyEmu.RelationService/DAO/RelationMessageDao.cs b/src/services/SaltyEmu.RelationService/DAO/RelationMessageDao.cs index 2338a350..2480f40a 100644 --- a/src/services/SaltyEmu.RelationService/DAO/RelationMessageDao.cs +++ b/src/services/SaltyEmu.RelationService/DAO/RelationMessageDao.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using SaltyEmu.Redis; @@ -8,7 +9,7 @@ namespace SaltyEmu.RelationService.DAO { public class RelationMessageDao : GenericRedisCacheClient, IRelationMessageDao { - public RelationMessageDao(RedisConfiguration conf) : base(conf) + public RelationMessageDao(RedisConfiguration conf, ILogger log) : base(conf, log) { } diff --git a/src/services/SaltyEmu.RelationService/Handling/GetInvitationsByCharacterIdHandler.cs b/src/services/SaltyEmu.RelationService/Handling/GetInvitationsByCharacterIdHandler.cs index 286a6843..9a055d4f 100644 --- a/src/services/SaltyEmu.RelationService/Handling/GetInvitationsByCharacterIdHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/GetInvitationsByCharacterIdHandler.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using SaltyEmu.Communication.Utils; using SaltyEmu.FriendsPlugin.Protocol; @@ -10,10 +11,8 @@ public class GetInvitationsByCharacterIdHandler : GenericIpcRequestHandler _repository = repository; protected override async Task Handle(GetRelationsInvitationByCharacterId request) { diff --git a/src/services/SaltyEmu.RelationService/Handling/GetRelationsByCharacterIdHandler.cs b/src/services/SaltyEmu.RelationService/Handling/GetRelationsByCharacterIdHandler.cs index 7c0118b1..4fd5b4bb 100644 --- a/src/services/SaltyEmu.RelationService/Handling/GetRelationsByCharacterIdHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/GetRelationsByCharacterIdHandler.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.IPC.Protocol; +using ChickenAPI.Core.Logging; using ChickenAPI.Data.Relations; using SaltyEmu.Communication.Utils; using SaltyEmu.FriendsPlugin.Protocol; @@ -10,10 +11,7 @@ public class GetRelationsByCharacterIdHandler : GenericIpcRequestHandler _repository = repository; protected override async Task Handle(GetRelationsByCharacterId request) { diff --git a/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs b/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs index c02e2c50..320bd267 100644 --- a/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using ChickenAPI.Core.IPC.Protocol; +using ChickenAPI.Core.Logging; using ChickenAPI.Data; using ChickenAPI.Data.Character; using ChickenAPI.Data.Relations; @@ -18,7 +19,8 @@ public class ProcessInvitationHandler : GenericIpcRequestHandler _relations = relations; protected override Task Handle(RemoveRelations request) { diff --git a/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs b/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs index 01cd9139..f4ed1952 100644 --- a/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/SendInvitationHandler.cs @@ -12,7 +12,8 @@ public class SendInvitationHandler : GenericAsyncRpcRequestHandler _invitations = invitation; + + public SendInvitationHandler(ILogger log, IRelationInvitationDao invitations) : base(log) => _invitations = invitations; protected override async Task Handle(SendInvitation request) { diff --git a/src/services/SaltyEmu.RelationService/RelationService.cs b/src/services/SaltyEmu.RelationService/RelationService.cs index 55b8674e..11564971 100644 --- a/src/services/SaltyEmu.RelationService/RelationService.cs +++ b/src/services/SaltyEmu.RelationService/RelationService.cs @@ -11,6 +11,7 @@ using ChickenAPI.Core.Utils; using SaltyEmu.Communication.Configs; using SaltyEmu.Communication.Utils; +using SaltyEmu.Core.Logging; using SaltyEmu.Core.Plugins; using SaltyEmu.Redis; @@ -18,8 +19,10 @@ namespace SaltyEmu.RelationService { internal class RelationService { + private static ILogger Log; + private static readonly IPluginManager PluginManager = new SimplePluginManager(); - private static readonly Logger Log = Logger.GetLogger("RelationService"); + //private static readonly Logger Log = Logger.GetLogger("RelationService"); private static void PrintHeader() { @@ -79,6 +82,7 @@ private static bool InitializePlugins() private static void InitializeLogger() { + ChickenContainer.Builder.Register(s => new Logger(typeof(RelationService))).As(); Logger.Initialize(); } @@ -115,7 +119,7 @@ private static void Main() CommunicationIocInjector.Inject(); ChickenContainer.Initialize(); EnablePlugins(PluginEnableTime.PostContainerBuild); - var server = ChickenContainer.Instance.Resolve(); + var server = ChickenContainer.Instance.Resolve(); var container = ChickenContainer.Instance.Resolve(); foreach (Type handlerType in typeof(RelationService).Assembly.GetTypesImplementingGenericClass(typeof(GenericIpcRequestHandler<,>), typeof(GenericAsyncRpcRequestHandler<>))) { diff --git a/test/ChickenAPI.Game.Test/ChickenAPI.Game.Test.csproj b/test/ChickenAPI.Game.Test/ChickenAPI.Game.Test.csproj deleted file mode 100644 index d939ca79..00000000 --- a/test/ChickenAPI.Game.Test/ChickenAPI.Game.Test.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - netcoreapp2.1 - - false - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/ChickenAPI.Game.Test/Inventory/Inventory_Get_Test.cs b/test/ChickenAPI.Game.Test/Inventory/Inventory_Get_Test.cs deleted file mode 100644 index 21ac3260..00000000 --- a/test/ChickenAPI.Game.Test/Inventory/Inventory_Get_Test.cs +++ /dev/null @@ -1,38 +0,0 @@ -using ChickenAPI.Data.Character; -using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game.Families; -using ChickenAPI.Game.Inventory.Extensions; -using NUnit.Framework; - -namespace ChickenAPI.Game.Test.Inventory -{ - - [TestFixture] - public class Inventory_Get_Test - { - [OneTimeSetUp] - public void Setup() - { - } - - [Test] - public void Inventory_Get_Item_Quantity_By_Id() - { - Assert.Pass("NOT YET FINISHED"); - } - - [Test] - public void Inventory_Can_Add_Item_Inventory_Free() - { - //_player.Inventory.CanAddItem(); - Assert.Pass("NOT YET FINISHED"); - } - - [Test] - public void Inventory_Can_Add_Item_Inventory_Full() - { - - Assert.Pass("Inventory_Can_Add_Item_Inventory_Full"); - } - } -} diff --git a/test/ChickenAPI.Game.Test/Mocks/MapLayerMock.cs b/test/ChickenAPI.Game.Test/Mocks/MapLayerMock.cs deleted file mode 100644 index 234302ed..00000000 --- a/test/ChickenAPI.Game.Test/Mocks/MapLayerMock.cs +++ /dev/null @@ -1,6 +0,0 @@ -using ChickenAPI.Data.Map; -using ChickenAPI.Game.Maps; - -namespace ChickenAPI.Game.Test.Mocks -{ -} \ No newline at end of file diff --git a/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs b/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs deleted file mode 100644 index d501a876..00000000 --- a/test/ChickenAPI.Game.Test/Mocks/SessionMock.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Threading.Tasks; -using ChickenAPI.Core.i18n; -using ChickenAPI.Data.Account; -using ChickenAPI.Data.Character; -using ChickenAPI.Enums; -using ChickenAPI.Game.Entities.Player; -using ChickenAPI.Game._Network; -using ChickenAPI.Packets; -using ChickenAPI.Packets.Old; -using Moq; - -namespace ChickenAPI.Game.Test.Mocks -{ - public class SessionMock : ISession - { - private readonly ISession _session; - private readonly List> _packets = new List>(); - - public SessionMock() - { - Mock mock = new Mock(); - mock.Setup(_ => _.Account).Returns(new AccountDto - { - Authority = AuthorityType.User - }); - _session = mock.Object; - } - - public int SessionId => _session.SessionId; - - public long CharacterId => _session.CharacterId; - - public bool IsAuthenticated => _session.IsAuthenticated; - - public IPAddress Ip => _session.Ip; - - public AccountDto Account => _session.Account; - - public IPlayerEntity Player => _session.Player; - - public LanguageKey Language => _session.Language; - - public void InitializeAccount(AccountDto dto) - { - _session.InitializeAccount(dto); - } - - public void InitializeCharacterId(long id) - { - _session.InitializeCharacterId(id); - } - - public void InitializeEntity(IPlayerEntity ett) - { - _session.InitializeEntity(ett); - } - - public void SendPacket(T packet) where T : IPacket - { - _packets.Add(new Tuple(typeof(T), packet)); - _session.SendPacketAsync(packet); - } - - public IReadOnlyList> Packets => _packets; - - public void SendPackets(IEnumerable packets) where T : IPacket - { - foreach (T i in packets) - { - SendPacket(i); - } - } - - public void SendPackets(IEnumerable packets) - { - foreach (IPacket packet in packets) - { - _packets.Add(new Tuple(packet.GetType(), packet)); - _session.SendPacketAsync(packet); - } - } - - public Task SendPacketAsync(T packet) where T : IPacket => throw new NotImplementedException(); - - public Task SendPacketsAsync(IEnumerable packets) where T : IPacket => throw new NotImplementedException(); - - public Task SendPacketsAsync(IEnumerable packets) => throw new NotImplementedException(); - - public void Disconnect() - { - _session.Disconnect(); - } - } -} \ No newline at end of file diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets index 265e3900..3007eec0 160000 --- a/vendor/ChickenAPI.Packets +++ b/vendor/ChickenAPI.Packets @@ -1 +1 @@ -Subproject commit 265e39005497c143ff7b1820048d408425794187 +Subproject commit 3007eec00ebd104d6d7bdbfb9faca0ce6a63ab5c From bf5d3f21fb986a50519be9b786e2de407c534acc Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 31 May 2019 20:13:24 +0200 Subject: [PATCH 18/24] Removed submodule vendor/ChickenAPI.Packets --- .gitmodules | 3 --- vendor/ChickenAPI.Packets | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 vendor/ChickenAPI.Packets diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2168fc39..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "vendor/ChickenAPI.Packets"] - path = vendor/ChickenAPI.Packets - url = git@github.com:ChickenAPI/ChickenAPI.Packets.git diff --git a/vendor/ChickenAPI.Packets b/vendor/ChickenAPI.Packets deleted file mode 160000 index 3007eec0..00000000 --- a/vendor/ChickenAPI.Packets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3007eec00ebd104d6d7bdbfb9faca0ce6a63ab5c From c30523ef8aa02dbc9489c33dad0c594da8e77dce Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 31 May 2019 20:21:48 +0200 Subject: [PATCH 19/24] move to package & add CI (circleci) --- .circleci/config.yml | 38 +++++++++++++++++++ SaltyEmu.sln | 7 ---- src/ChickenAPI.Data/ChickenAPI.Data.csproj | 4 +- .../ChickenAPI.Game.Extensions.csproj | 3 +- src/ChickenAPI.Game/ChickenAPI.Game.csproj | 5 +-- .../NpcDialogHandlers/WopenHandler.cs | 22 ++++++----- src/Toolkit/Toolkit.csproj | 2 +- 7 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..eb542529 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,38 @@ +version: 2 +jobs: + build: + docker: + - image: microsoft/dotnet:2.2-sdk-alpine + steps: + - checkout + - run: + name: Build solution + command : | + dotnet restore + dotnet build + test_unit_testing: + docker: + - image: microsoft/dotnet:2.2-sdk-alpine + steps: + - checkout + - run: + name: Run tests on ChickenAPI.Packets + command : echo "todo" + test_code_quality: + docker: + - image: microsoft/dotnet:2.2-sdk-alpine + steps: + - run: + name: Test Code Quality + command : echo "todo" +workflows: + version: 2 + build_and_test: + jobs: + - build + - test_unit_testing: + requires: + - build + - test_code_quality: + requires: + - build diff --git a/SaltyEmu.sln b/SaltyEmu.sln index eb800f90..b9911e58 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -73,8 +73,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Database.MongoDB", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game.Impl", "src\ChickenAPI.Game.Impl\ChickenAPI.Game.Impl.csproj", "{E5F9DC97-664E-42B5-B68F-F93AC4019051}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Packets", "vendor\ChickenAPI.Packets\src\ChickenAPI.Packets\ChickenAPI.Packets.csproj", "{9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -197,10 +195,6 @@ Global {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Debug|Any CPU.Build.0 = Debug|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.Build.0 = Release|Any CPU - {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -234,7 +228,6 @@ Global {7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {48886586-562B-4CE6-B105-3F231FE6C97E} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} {E5F9DC97-664E-42B5-B68F-F93AC4019051} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} - {9B4BEEDC-D2FF-430A-B0CA-602E928BFE7B} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {33B1EC1B-965D-4770-B047-390647E82322} diff --git a/src/ChickenAPI.Data/ChickenAPI.Data.csproj b/src/ChickenAPI.Data/ChickenAPI.Data.csproj index 86745f7d..370579e7 100644 --- a/src/ChickenAPI.Data/ChickenAPI.Data.csproj +++ b/src/ChickenAPI.Data/ChickenAPI.Data.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -6,10 +6,10 @@ + - diff --git a/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj b/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj index 2951e437..1cd295be 100644 --- a/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj +++ b/src/ChickenAPI.Game.Extensions/ChickenAPI.Game.Extensions.csproj @@ -6,11 +6,10 @@ - + - diff --git a/src/ChickenAPI.Game/ChickenAPI.Game.csproj b/src/ChickenAPI.Game/ChickenAPI.Game.csproj index 846208b3..5b691784 100644 --- a/src/ChickenAPI.Game/ChickenAPI.Game.csproj +++ b/src/ChickenAPI.Game/ChickenAPI.Game.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -26,11 +26,10 @@ - + - diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs index 45d4cc19..8ba30a27 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs @@ -3,8 +3,10 @@ using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; using ChickenAPI.Packets.ClientPackets.Npcs; +using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Player; using ChickenAPI.Packets.ServerPackets.Shop; +using ChickenAPI.Packets.ServerPackets.UI; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers { @@ -15,8 +17,8 @@ public static void UpgradeFromNpc(IPlayerEntity player, NpcDialogEvent args) { player.SendPacketAsync(new WopenPacket { - Type = 1, - Unknow = 0 + Type = WindowType.UpgradeItem, + Unknown = 0, }); } @@ -25,8 +27,8 @@ public static void Cellon(IPlayerEntity player, NpcDialogEvent args) { player.SendPacketAsync(new WopenPacket { - Type = 3, - Unknow = 0 + Type = WindowType.CellonItem, + Unknown = 0 }); } @@ -35,8 +37,8 @@ public static void Idk(IPlayerEntity player, NpcDialogEvent args) { player.SendPacketAsync(new WopenPacket { - Type = args.Type, - Unknow = 0 + Type = (WindowType)args.Type, + Unknown = 0 }); } @@ -45,8 +47,8 @@ public static void Recipe(IPlayerEntity player, NpcDialogEvent args) { player.SendPacketAsync(new WopenPacket { - Type = 27, - Unknow = 0 + Type = WindowType.Production, + Unknown = 0 }); // Recipe /*string recipelist = "m_list 2"; @@ -92,8 +94,8 @@ public static void OpenBazzar(IPlayerEntity player, NpcDialogEvent args) */ player.SendPacketAsync(new WopenPacket { - Type = 32, - Unknow = 1 + Type = WindowType.NosBazaar, + Unknown = 1 }); } } diff --git a/src/Toolkit/Toolkit.csproj b/src/Toolkit/Toolkit.csproj index acfb9fc1..3ecd603c 100644 --- a/src/Toolkit/Toolkit.csproj +++ b/src/Toolkit/Toolkit.csproj @@ -15,7 +15,7 @@ - + From 4b927f7ed93c037b51fe8c55f46ed68d67fd7f45 Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 31 May 2019 21:04:32 +0200 Subject: [PATCH 20/24] change parsing repository link --- docs/started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/started.md b/docs/started.md index 48af21a2..840fa4b9 100644 --- a/docs/started.md +++ b/docs/started.md @@ -53,7 +53,7 @@ Use [SSMS](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-managem ## Fill your database data with the toolkit -Pull the following [repository](https://gitlab.com/SaltyNos/Server/parsing) +Pull the following [Parsing repository](https://github.com/BlowaXD/nostale-parsing) ### /!\ ACHTUNG ! /!\ #### RUN THAT COMMAND IN YOUR TERMINAL (CMD / POWERSHELL / SHELL / BASH) From 41b51e3ef5580214e04b4081db06f5dc299cad33 Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 31 May 2019 22:21:55 +0200 Subject: [PATCH 21/24] continue SaltyEmu's rework --- .../ChickenAPI.Game.Impl.csproj | 4 ++ .../JsonConfigurationSerializer.cs | 8 ++-- src/Login/Login.csproj | 5 ++- src/Login/LoginServer.cs | 12 +++--- src/Login/SimplePluginManager.cs | 4 -- .../NosSharp.DatabasePlugin/DatabasePlugin.cs | 4 ++ .../Utils/PluginDependencyInjector.cs | 39 +++++++++---------- .../RedisPlugin.cs | 7 ++++ .../NpcDialogHandlers/WopenHandler.cs | 5 +-- src/Toolkit/Commands/GenerateCommand.cs | 3 +- src/Toolkit/Commands/LanguageCommand.cs | 4 +- src/Toolkit/Commands/ParseCommand.cs | 2 +- src/World/Network/ClientSession.cs | 3 -- src/World/WorldServer.cs | 4 +- .../RelationService.cs | 2 +- 15 files changed, 58 insertions(+), 48 deletions(-) diff --git a/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj b/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj index 0a344e0d..f4c77679 100644 --- a/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj +++ b/src/ChickenAPI.Game.Impl/ChickenAPI.Game.Impl.csproj @@ -4,6 +4,10 @@ netstandard2.0 + + + + diff --git a/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs b/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs index 7415974b..1fee633c 100644 --- a/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs +++ b/src/ChickenAPI.Game.Impl/JsonConfigurationSerializer.cs @@ -1,11 +1,13 @@ -using ChickenAPI.Core.Configurations; +using System; +using ChickenAPI.Core.Configurations; +using Newtonsoft.Json; namespace ChickenAPI.Game.Impl { public class JsonConfigurationSerializer : IConfigurationSerializer { - public string Serialize(T conf) where T : IConfiguration => throw new System.NotImplementedException(); + public string Serialize(T conf) where T : IConfiguration => JsonConvert.SerializeObject(conf); - public T Deserialize(string buffer) where T : IConfiguration => throw new System.NotImplementedException(); + public T Deserialize(string buffer) where T : IConfiguration => JsonConvert.DeserializeObject(buffer); } } \ No newline at end of file diff --git a/src/Login/Login.csproj b/src/Login/Login.csproj index 137f175e..0eb13c94 100644 --- a/src/Login/Login.csproj +++ b/src/Login/Login.csproj @@ -25,12 +25,13 @@ - - + + + diff --git a/src/Login/LoginServer.cs b/src/Login/LoginServer.cs index 7553c625..69bc0485 100644 --- a/src/Login/LoginServer.cs +++ b/src/Login/LoginServer.cs @@ -9,6 +9,7 @@ using ChickenAPI.Data.Server; using Login.Cryptography.Factories; using Login.Network; +using SaltyEmu.Core.Logging; using SaltyEmu.DatabasePlugin; using SaltyEmu.RedisWrappers; @@ -16,7 +17,7 @@ namespace Login { internal class LoginServer { - // private static readonly Logger Log = Logger.GetLogger(); + private static readonly ILogger Log = Logger.GetLogger(); private static readonly IPluginManager PluginManager = new SimplePluginManager(); private static ushort _port; @@ -42,7 +43,8 @@ private static void PrintHeader() private static void InitializeLogger() { - // Logger.Initialize(); + ChickenContainer.Builder.Register(s => Logger.GetLogger(s.GetType())).As().InstancePerDependency(); + Logger.Initialize(); } private static void InitializeConfiguration() @@ -62,9 +64,9 @@ private static void InitializePlugins() try { IPlugin[] plugins = PluginManager.LoadPlugins(new DirectoryInfo("plugins")); - var dbPlugin = new DatabasePlugin(); + var dbPlugin = new DatabasePlugin(Logger.GetLogger()); dbPlugin.OnLoad(); - var redisPlugin = new RedisPlugin(); + var redisPlugin = new RedisPlugin(Logger.GetLogger()); redisPlugin.OnLoad(); dbPlugin.OnEnable(); @@ -76,7 +78,7 @@ private static void InitializePlugins() } catch (Exception e) { - // Log.Error("[PLUGINS]", e); + Log.Error("[PLUGINS]", e); } } diff --git a/src/Login/SimplePluginManager.cs b/src/Login/SimplePluginManager.cs index 8432c4c7..cd125f28 100644 --- a/src/Login/SimplePluginManager.cs +++ b/src/Login/SimplePluginManager.cs @@ -67,9 +67,5 @@ public IPlugin[] LoadPlugins(DirectoryInfo directory) directory.Create(); return null; } - - public DirectoryInfo GetPluginDirectory() => null; - - public DirectoryInfo GetConfigDirectory() => null; } } \ No newline at end of file diff --git a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs index 933bcfe9..24f3d2fa 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/DatabasePlugin.cs @@ -14,6 +14,10 @@ namespace SaltyEmu.DatabasePlugin { public class DatabasePlugin : IPlugin { + public DatabasePlugin(ILogger log) + { + Log = log; + } private readonly ILogger Log; private readonly string _configurationFilePath = $"plugins/config/{nameof(DatabasePlugin)}/conf.json"; private DatabaseConfiguration _configuration; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs index e480486c..1fbf51cb 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System; using Autofac; using AutoMapper; using ChickenAPI.Core.IoC; @@ -74,18 +74,18 @@ public static void RegisterDaos() State = CharacterState.Active }; // data - ChickenContainer.Builder.RegisterTypes(typeof(PluginDependencyInjector).Assembly.GetTypes()).AsImplementedInterfaces().InstancePerLifetimeScope(); - /* - ChickenContainer.Builder.Register(s => new MapDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new SkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + //ChickenContainer.Builder.RegisterTypes(typeof(PluginDependencyInjector).Assembly.GetTypes()).AsImplementedInterfaces().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new MapDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new SkillDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new BCardDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new CardDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new ItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new NpcMonsterDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new NpcMonsterSkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new DropDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new CardDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new ItemDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new NpcMonsterDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new NpcMonsterSkillDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new DropDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); // character + Console.WriteLine("Registering AccountDAO"); ChickenContainer.Builder.Register(s => new AccountDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); ChickenContainer.Builder.Register(s => new CharacterDao(s.Resolve(), s.Resolve(), characterConf, s.Resolve())).As() .InstancePerLifetimeScope(); @@ -100,22 +100,21 @@ public static void RegisterDaos() .InstancePerLifetimeScope(); // family - ChickenContainer.Builder.Register(s => new FamilyDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new FamilyDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); // map elements - ChickenContainer.Builder.Register(s => new MapMonsterDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new MapNpcDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new MapPortalDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new MapMonsterDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new MapNpcDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new MapPortalDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); // shops - ChickenContainer.Builder.Register(s => new ShopDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new ShopItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new ShopSkillDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new ShopDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new ShopItemDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new ShopSkillDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); // recipes - ChickenContainer.Builder.Register(s => new RecipeDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - ChickenContainer.Builder.Register(s => new RecipeItemDao(s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); - */ + ChickenContainer.Builder.Register(s => new RecipeDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); + ChickenContainer.Builder.Register(s => new RecipeItemDao(s.Resolve(), s.Resolve(), s.Resolve())).As().InstancePerLifetimeScope(); } public static void RegisterDependencies() diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs b/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs index 9e44c6a9..116a53b2 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/RedisPlugin.cs @@ -2,6 +2,7 @@ using Autofac; using ChickenAPI.Core.Configurations; using ChickenAPI.Core.IoC; +using ChickenAPI.Core.Logging; using ChickenAPI.Core.Plugins; using ChickenAPI.Data.Server; using ChickenAPI.Game._i18n; @@ -12,6 +13,12 @@ namespace SaltyEmu.RedisWrappers { public class RedisPlugin : IPlugin { + public RedisPlugin(ILogger log) + { + _log = log; + } + + private readonly ILogger _log; private readonly string _configurationPath = $"plugins/config/{nameof(RedisPlugin)}/conf.json"; private RedisConfiguration _configuration; public PluginEnableTime EnableTime => PluginEnableTime.PreContainerBuild; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs index 8ba30a27..9a25e3d4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/WopenHandler.cs @@ -1,11 +1,8 @@ -using ChickenAPI.Core.Logging; -using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.NpcDialog.Events; using ChickenAPI.Game.NpcDialog.Handling; using ChickenAPI.Packets.ClientPackets.Npcs; using ChickenAPI.Packets.Enumerations; -using ChickenAPI.Packets.ServerPackets.Player; -using ChickenAPI.Packets.ServerPackets.Shop; using ChickenAPI.Packets.ServerPackets.UI; namespace SaltyEmu.BasicPlugin.NpcDialogHandlers diff --git a/src/Toolkit/Commands/GenerateCommand.cs b/src/Toolkit/Commands/GenerateCommand.cs index 2b0ae094..19313946 100644 --- a/src/Toolkit/Commands/GenerateCommand.cs +++ b/src/Toolkit/Commands/GenerateCommand.cs @@ -2,6 +2,7 @@ using ChickenAPI.Core.Logging; using CommandLine; using SaltyEmu.BasicAlgorithmPlugin; +using SaltyEmu.Core.Logging; using SaltyEmu.DatabasePlugin; using Toolkit.Generators.FromPackets; @@ -21,7 +22,7 @@ public static int Handle(GenerateCommand command) var algo = new BasicAlgorithmPlugin(); algo.OnLoad(); algo.OnEnable(); - var tmp = new DatabasePlugin(); + var tmp = new DatabasePlugin(Logger.GetLogger()); tmp.OnLoad(); tmp.OnEnable(); diff --git a/src/Toolkit/Commands/LanguageCommand.cs b/src/Toolkit/Commands/LanguageCommand.cs index 76c0de97..0f7a2d2b 100644 --- a/src/Toolkit/Commands/LanguageCommand.cs +++ b/src/Toolkit/Commands/LanguageCommand.cs @@ -53,8 +53,8 @@ private static void ReadFileAndFillService(string file, LanguageKey key) public static int Handle(LanguageCommand command) { - new RedisPlugin().OnLoad(); - new RedisPlugin().OnEnable(); + new RedisPlugin(Logger.GetLogger()).OnLoad(); + new RedisPlugin(Logger.GetLogger()).OnEnable(); ChickenContainer.Initialize(); foreach (object enume in Enum.GetValues(typeof(LanguageKey))) { diff --git a/src/Toolkit/Commands/ParseCommand.cs b/src/Toolkit/Commands/ParseCommand.cs index 192ff183..9444171c 100644 --- a/src/Toolkit/Commands/ParseCommand.cs +++ b/src/Toolkit/Commands/ParseCommand.cs @@ -104,7 +104,7 @@ public static int Handle(ParseCommand command) var algo = new BasicAlgorithmPlugin(); algo.OnLoad(); algo.OnEnable(); - var tmp = new DatabasePlugin(); + var tmp = new DatabasePlugin(Logger.GetLogger()); tmp.OnLoad(); tmp.OnEnable(); ChickenContainer.Initialize(); diff --git a/src/World/Network/ClientSession.cs b/src/World/Network/ClientSession.cs index 71c55dbd..684c2f7f 100644 --- a/src/World/Network/ClientSession.cs +++ b/src/World/Network/ClientSession.cs @@ -25,9 +25,6 @@ namespace World.Network { public class ClientSession : ChannelHandlerAdapter, ISession { - private const byte PACKET_SPLIT_CHARACTER = 0xFF; - - private static readonly IPlayerManager PlayerManager = new Lazy(ChickenContainer.Instance.Resolve).Value; private static readonly ISessionService SessionService = new Lazy(ChickenContainer.Instance.Resolve).Value; private static readonly ICommandContainer Commands = new Lazy(ChickenContainer.Instance.Resolve).Value; diff --git a/src/World/WorldServer.cs b/src/World/WorldServer.cs index c1457d8c..c49d35a0 100644 --- a/src/World/WorldServer.cs +++ b/src/World/WorldServer.cs @@ -32,9 +32,9 @@ internal class WorldServer private static readonly List Plugins = new List { - new DatabasePlugin(), + new DatabasePlugin(Logger.GetLogger()), new BasicAlgorithmPlugin(), - new RedisPlugin(), + new RedisPlugin(Logger.GetLogger()), new BasicPlugin(), new PathfinderPlugin(), new PacketHandlerPlugin(), diff --git a/src/services/SaltyEmu.RelationService/RelationService.cs b/src/services/SaltyEmu.RelationService/RelationService.cs index 11564971..360df3e8 100644 --- a/src/services/SaltyEmu.RelationService/RelationService.cs +++ b/src/services/SaltyEmu.RelationService/RelationService.cs @@ -46,7 +46,7 @@ private static void PrintHeader() private static readonly List Plugins = new List { - new DatabasePlugin.DatabasePlugin(), + new DatabasePlugin.DatabasePlugin(Logger.GetLogger()), }; From ca243029456a8d22ce61616d53ad0de33912dfa2 Mon Sep 17 00:00:00 2001 From: Blowa Date: Fri, 31 May 2019 22:48:22 +0200 Subject: [PATCH 22/24] move SimplePluginManager to IoCPluginManager // needs some rework --- SaltyEmu.sln | 7 +++ src/Login/IoCPluginManager.cs | 73 ++++++++++++++++++++++++++++++++ src/Login/LoginServer.cs | 8 +--- src/Login/SimplePluginManager.cs | 71 ------------------------------- 4 files changed, 81 insertions(+), 78 deletions(-) create mode 100644 src/Login/IoCPluginManager.cs delete mode 100644 src/Login/SimplePluginManager.cs diff --git a/SaltyEmu.sln b/SaltyEmu.sln index b9911e58..5ab37c28 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -73,6 +73,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Database.MongoDB", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game.Impl", "src\ChickenAPI.Game.Impl\ChickenAPI.Game.Impl.csproj", "{E5F9DC97-664E-42B5-B68F-F93AC4019051}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Core", "vendor\ChickenAPI.Core\src\ChickenAPI.Core\ChickenAPI.Core.csproj", "{682C9D0E-B064-436B-9FB8-DE342C8B2FC9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -195,6 +197,10 @@ Global {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Debug|Any CPU.Build.0 = Debug|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.Build.0 = Release|Any CPU + {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -228,6 +234,7 @@ Global {7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {48886586-562B-4CE6-B105-3F231FE6C97E} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} {E5F9DC97-664E-42B5-B68F-F93AC4019051} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} + {682C9D0E-B064-436B-9FB8-DE342C8B2FC9} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {33B1EC1B-965D-4770-B047-390647E82322} diff --git a/src/Login/IoCPluginManager.cs b/src/Login/IoCPluginManager.cs new file mode 100644 index 00000000..3ef37c95 --- /dev/null +++ b/src/Login/IoCPluginManager.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using Autofac; +using ChickenAPI.Core.Logging; +using ChickenAPI.Core.Plugins; + +namespace Login +{ + public class IoCPluginManager + { + private readonly ILogger _log; + + public IoCPluginManager(ILogger log) + { + _log = log; + } + + private bool PluginMatcher(Type type) + { + return !type.IsInterface && !type.IsAbstract && type.GetInterface(typeof(IPlugin).FullName) != null; + } + + public void RegisterPlugins(Assembly assembly, ContainerBuilder builder) + { + builder.RegisterTypes(assembly.GetTypes().Where(PluginMatcher).ToArray()).AsImplementedInterfaces().AsSelf().InstancePerDependency(); + } + + public void RegisterPlugins(FileInfo file, ContainerBuilder builder) + { + try + { + if (file == null) + { + throw new ArgumentNullException(nameof(file)); + } + + Assembly assembly = Assembly.LoadFrom(file.FullName); + + if (assembly == null) + { + return; + } + + RegisterPlugins(assembly, builder); + } + catch (Exception e) + { + _log.Error("Register plugins", e); + } + } + + public void RegisterPlugins(DirectoryInfo directory, ContainerBuilder builder) + { + if (directory == null) + { + throw new ArgumentNullException(nameof(directory)); + } + + if (directory.Exists) + { + foreach (FileInfo dynamicLibrary in directory.GetFiles("*.dll")) + { + RegisterPlugins(dynamicLibrary, builder); + } + } + + directory.Create(); + } + } +} \ No newline at end of file diff --git a/src/Login/LoginServer.cs b/src/Login/LoginServer.cs index 69bc0485..d102dda4 100644 --- a/src/Login/LoginServer.cs +++ b/src/Login/LoginServer.cs @@ -18,7 +18,6 @@ namespace Login internal class LoginServer { private static readonly ILogger Log = Logger.GetLogger(); - private static readonly IPluginManager PluginManager = new SimplePluginManager(); private static ushort _port; @@ -63,7 +62,7 @@ private static void InitializePlugins() { try { - IPlugin[] plugins = PluginManager.LoadPlugins(new DirectoryInfo("plugins")); + new IoCPluginManager(Logger.GetLogger()).RegisterPlugins(new DirectoryInfo("plugins"), ChickenContainer.Builder); var dbPlugin = new DatabasePlugin(Logger.GetLogger()); dbPlugin.OnLoad(); var redisPlugin = new RedisPlugin(Logger.GetLogger()); @@ -71,10 +70,6 @@ private static void InitializePlugins() dbPlugin.OnEnable(); redisPlugin.OnEnable(); - - if (plugins == null) - { - } } catch (Exception e) { @@ -88,7 +83,6 @@ private static void Main(string[] args) InitializeLogger(); InitializeConfiguration(); InitializePlugins(); - ChickenContainer.Builder.Register(s => PluginManager).As(); ChickenContainer.Initialize(); ClientSession.AccountService = ChickenContainer.Instance.Resolve(); ClientSession.ServerApi = ChickenContainer.Instance.Resolve(); diff --git a/src/Login/SimplePluginManager.cs b/src/Login/SimplePluginManager.cs deleted file mode 100644 index cd125f28..00000000 --- a/src/Login/SimplePluginManager.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using ChickenAPI.Core.Logging; -using ChickenAPI.Core.Plugins; - -namespace Login -{ - public class SimplePluginManager : IPluginManager - { - // private static readonly Logger Log = Logger.GetLogger(); - - public IPlugin[] LoadPlugin(FileInfo file) - { - try - { - if (file == null) - { - throw new ArgumentNullException(nameof(file)); - } - - Assembly assembly = Assembly.LoadFrom(file.FullName); - - if (assembly == null) - { - return null; - } - - Type[] types = assembly.GetTypes(); - Type pluginType = typeof(IPlugin); - ICollection pluginTypes = types.Where(type => !type.IsInterface && !type.IsAbstract && type.GetInterface(pluginType.FullName) != null).ToArray(); - ICollection plugins = new List(pluginTypes.Count); - foreach (Type type in pluginTypes) - { - var plugin = (IPlugin)Activator.CreateInstance(type); - //Log.Info($"{plugin.Name} Loaded !"); - plugins.Add(plugin); - } - - return plugins.ToArray(); - } - catch - { - return null; - } - } - - public IPlugin[] LoadPlugins(DirectoryInfo directory) - { - if (directory == null) - { - throw new ArgumentNullException(nameof(directory)); - } - - if (directory.Exists) - { - return directory.GetFiles("*.dll").SelectMany(s => - { - IPlugin[] tmp = LoadPlugin(s); - - return tmp; - }).Where(s => s != null).ToArray(); - } - - directory.Create(); - return null; - } - } -} \ No newline at end of file From 77eb5acda046c43150d8451699c658b356ab6ed7 Mon Sep 17 00:00:00 2001 From: Blowa Date: Sat, 1 Jun 2019 20:34:44 +0200 Subject: [PATCH 23/24] fix compiling --- SaltyEmu.sln | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SaltyEmu.sln b/SaltyEmu.sln index 5ab37c28..b9911e58 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -73,8 +73,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.Database.MongoDB", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game.Impl", "src\ChickenAPI.Game.Impl\ChickenAPI.Game.Impl.csproj", "{E5F9DC97-664E-42B5-B68F-F93AC4019051}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Core", "vendor\ChickenAPI.Core\src\ChickenAPI.Core\ChickenAPI.Core.csproj", "{682C9D0E-B064-436B-9FB8-DE342C8B2FC9}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -197,10 +195,6 @@ Global {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Debug|Any CPU.Build.0 = Debug|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5F9DC97-664E-42B5-B68F-F93AC4019051}.Release|Any CPU.Build.0 = Release|Any CPU - {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {682C9D0E-B064-436B-9FB8-DE342C8B2FC9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -234,7 +228,6 @@ Global {7D0D4B40-86E2-436F-BC57-5CA8A7E16D2F} = {7A642CDF-7BF0-4D43-B5CB-430FC64A32D1} {48886586-562B-4CE6-B105-3F231FE6C97E} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} {E5F9DC97-664E-42B5-B68F-F93AC4019051} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} - {682C9D0E-B064-436B-9FB8-DE342C8B2FC9} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {33B1EC1B-965D-4770-B047-390647E82322} From 8d975af8b72d6e8338c8b5ce14308a128205a14d Mon Sep 17 00:00:00 2001 From: Blowa Date: Sat, 1 Jun 2019 20:54:35 +0200 Subject: [PATCH 24/24] cleanup unnecessary files --- SaltyEmu.sln | 7 - src/ChickenAPI.Core/ChickenAPI.Core.csproj | 23 -- .../Events/BasicEventPipelineAsync.cs | 96 ------- src/ChickenAPI.Core/Events/ChickenEvent.cs | 8 - .../Events/GenericEventPostProcessorBase.cs | 25 -- .../Events/IEventNotification.cs | 9 - src/ChickenAPI.Core/Events/IEventPipeline.cs | 80 ------ .../Events/IEventPostProcessor.cs | 13 - .../Events/IEventPreprocessor.cs | 16 -- src/ChickenAPI.Core/IPC/IIpcClient.cs | 11 - src/ChickenAPI.Core/IPC/IIpcPacketHandler.cs | 10 - .../IPC/IIpcPacketHandlersContainer.cs | 16 -- src/ChickenAPI.Core/IPC/IIpcPacketRouter.cs | 31 --- src/ChickenAPI.Core/IPC/IIpcServer.cs | 11 - .../IPC/IRoutingInformation.cs | 8 - .../IPC/IRoutingInformationFactory.cs | 9 - .../IPC/Protocol/IIpcPacket.cs | 9 - .../IPC/Protocol/IIpcRequest.cs | 9 - .../IPC/Protocol/IIpcResponse.cs | 9 - src/ChickenAPI.Core/IoC/ChickenContainer.cs | 16 -- src/ChickenAPI.Core/IoC/ServiceFactory.cs | 13 - .../IoC/ServiceFactoryExtensions.cs | 13 - src/ChickenAPI.Core/Logging/Logger.cs | 105 -------- src/ChickenAPI.Core/Maths/IRandomGenerator.cs | 11 - src/ChickenAPI.Core/Maths/RandomGenerator.cs | 31 --- .../Exceptions/CriticalPluginException.cs | 12 - .../Plugins/Exceptions/PluginException.cs | 11 - src/ChickenAPI.Core/Plugins/IPlugin.cs | 31 --- .../Plugins/IPluginConfiguration.cs | 13 - src/ChickenAPI.Core/Plugins/IPluginManager.cs | 10 - .../Plugins/PluginEnableTime.cs | 8 - .../Utils/AssemblyExtensions.cs | 82 ------ .../Utils/ConfigurationHelper.cs | 41 --- .../Utils/EventHandlerWithoutArgs.cs | 4 - src/ChickenAPI.Core/Utils/Position.cs | 83 ------ src/ChickenAPI.Core/Utils/PositionHelper.cs | 18 -- src/ChickenAPI.Core/Utils/StringExtensions.cs | 19 -- .../Utils/TypedSenderEventHandler.cs | 8 - .../i18n/ILogLanguageService.cs | 23 -- src/ChickenAPI.Core/i18n/LanguageKey.cs | 14 - src/ChickenAPI.Core/i18n/LogI18NKeys.cs | 7 - src/ChickenAPI.Data/Account/AccountDto.cs | 2 +- src/ChickenAPI.Data/BCard/BCardDto.cs | 2 +- src/ChickenAPI.Data/BCard/IBCardService.cs | 2 +- src/ChickenAPI.Data/Character/CharacterDto.cs | 2 +- .../Character/CharacterFamilyDto.cs | 2 +- .../Character/CharacterMateDto.cs | 2 +- .../Character/IAlgorithmService.cs | 3 +- .../Character/ICharacterService.cs | 2 +- src/ChickenAPI.Data/ChickenAPI.Data.csproj | 2 +- src/ChickenAPI.Data/Drop/DropDto.cs | 2 +- .../Enums}/AuthResponse.cs | 2 +- .../Enums}/AuthenticationState.cs | 2 +- .../Enums}/AuthorityType.cs | 2 +- .../Enums}/Game/BCard/BCardRelationType.cs | 2 +- .../Enums}/Game/BCard/BCardType.cs | 2 +- .../Enums}/Game/BCard/BCard_Additional.cs | 2 +- .../Enums}/Game/Buffs/BuffType.cs | 2 +- .../Enums}/Game/Character/ChannelColor.cs | 2 +- .../Game/Character/CharacterNameAppearance.cs | 2 +- .../Enums}/Game/Character/CharacterOption.cs | 2 +- .../Enums}/Game/Character/CharacterState.cs | 2 +- .../Enums}/Game/Character/MinilandState.cs | 2 +- .../Game/Character/ReputationIconType.cs | 2 +- .../Enums}/Game/Drop/DropType.cs | 2 +- .../Enums}/Game/Effects/EmojiType.cs | 2 +- .../Enums}/Game/Entity/DirectionType.cs | 2 +- .../Enums}/Game/Entity/MateType.cs | 2 +- .../Enums}/Game/Entity/MonsterType.cs | 2 +- .../Enums}/Game/Entity/NpcMonsterRaceType.cs | 2 +- .../Enums}/Game/Entity/ReqInfoType.cs | 0 .../Enums}/Game/Families/FamilyLogType.cs | 2 +- .../Enums}/Game/Families/FamilyMemberRank.cs | 2 +- .../Enums}/Game/Groups/GroupDropType.cs | 2 +- .../Enums}/Game/Items/ArmorOptionType.cs | 2 +- .../Enums}/Game/Items/EquipmentOptionType.cs | 2 +- .../Enums}/Game/Items/EquipmentType.cs | 2 +- .../Enums}/Game/Items/ItemClassType.cs | 2 +- .../Enums}/Game/Items/ItemType.cs | 2 +- .../Enums}/Game/Items/ItemWearType.cs | 2 +- .../Enums}/Game/Items/JewelOptionType.cs | 2 +- .../Game/Items/Upgrade/FixedUpModeType.cs | 2 +- .../Game/Items/Upgrade/RarifyModeType.cs | 2 +- .../Items/Upgrade/RarifyProtectionType.cs | 2 +- .../Game/Items/Upgrade/UpgradeModeType.cs | 2 +- .../Items/Upgrade/UpgradeProtectionType.cs | 2 +- .../Game/Items/Upgrade/UpgradeTypeEvent.cs | 2 +- .../Game/Items/WeaponOptionLevelType.cs | 2 +- .../Enums}/Game/Items/WeaponOptionType.cs | 2 +- .../Enums}/Game/Maps/MapLayerType.cs | 2 +- .../Enums}/Game/Mates/SpPartnerRank.cs | 2 +- .../Game/NosBazaar/NosBazaarCategoryType.cs | 2 +- .../Game/NosBazaar/NosBazaarOrderType.cs | 2 +- .../Enums}/Game/PlayerSessionState.cs | 2 +- .../Game/Quicklist/QuicklistItemSlotType.cs | 2 +- .../Game/Quicklist/QuicklistSkillSlotType.cs | 2 +- .../Relations/RelationInvitationProcess.cs | 2 +- .../Enums}/Game/Skill/SkillTargetType.cs | 2 +- .../Enums}/Game/Visibility/VisibilityType.cs | 2 +- .../Enums}/RegionType.cs | 2 +- src/ChickenAPI.Data/Families/FamilyDto.cs | 3 +- .../Item/IItemInstanceService.cs | 2 +- src/ChickenAPI.Data/Item/ItemDto.cs | 4 +- src/ChickenAPI.Data/Item/ItemInstanceDto.cs | 2 - src/ChickenAPI.Data/Map/MapMonsterDto.cs | 4 +- src/ChickenAPI.Data/Map/MapNpcDto.cs | 4 +- .../NpcMonster/INpcMonsterAlgorithmService.cs | 2 +- .../NpcMonster/NpcMonsterDto.cs | 2 +- .../Relations/IRelationService.cs | 2 +- src/ChickenAPI.Data/Relations/RelationDto.cs | 1 - .../Relations/RelationInvitationDto.cs | 1 - .../Server/PlayerSessionDto.cs | 2 +- src/ChickenAPI.Data/Server/WorldServerDto.cs | 2 +- src/ChickenAPI.Data/Skills/CardDto.cs | 2 +- src/ChickenAPI.Enums/ChickenAPI.Enums.csproj | 11 - .../Helpers/CellonGeneratorHelper.cs | 2 +- .../Helpers/EmojiHelper.cs | 2 +- .../PacketGeneration/ChatPacketExtensions.cs | 1 - .../PacketGeneration/TcInfoPacketExtension.cs | 4 +- .../_TOCLEAN/EInfoPacketExtensions.cs | 6 +- .../_TOCLEAN/FdPacketExtension.cs | 1 - .../GenerateHeroicShellExtensioncs.cs | 3 +- .../_TOCLEAN/InventoryGetExtensions.cs | 2 +- .../_TOCLEAN/InventoryUseExtension.cs | 2 +- .../_TOCLEAN/IvnPacketExtension.cs | 1 - .../MapLayerInformationsExtensions.cs | 1 - .../_TOCLEAN/MateExtension.cs | 2 +- .../_TOCLEAN/NInvPacketExtensions.cs | 2 - .../NotifyResultAndSetRarityPointExtension.cs | 4 +- .../_TOCLEAN/PairyPacketExtension.cs | 3 +- .../_TOCLEAN/PlayerExtension.cs | 3 - .../_TOCLEAN/PlayerMatesExtensions.cs | 2 +- .../_TOCLEAN/PlayerUiExtension.cs | 1 - .../_TOCLEAN/RestEntityExtensions.cs | 3 +- .../_TOCLEAN/SetRarityPointExtension.cs | 2 +- .../_TOCLEAN/SkillExtensions.cs | 1 - .../_TOCLEAN/TpPacketExtension.cs | 3 +- src/ChickenAPI.Game.Impl/IASystem.cs | 2 +- src/ChickenAPI.Game.Impl/ItemDropEntity.cs | 1 - src/ChickenAPI.Game.Impl/MateEntity.cs | 4 +- src/ChickenAPI.Game.Impl/MonsterEntity.cs | 4 +- src/ChickenAPI.Game.Impl/MovableComponent.cs | 2 +- src/ChickenAPI.Game.Impl/MovableSystem.cs | 1 - src/ChickenAPI.Game.Impl/NpcEntity.cs | 4 +- src/ChickenAPI.Game.Impl/PlayerEntity.cs | 10 +- src/ChickenAPI.Game.Impl/RespawnSystem.cs | 1 - src/ChickenAPI.Game.Impl/SimpleMapLayer.cs | 1 - .../BCards/BCardEffectHandlerAttribute.cs | 2 +- .../BCards/BasicBCardHandler.cs | 2 +- .../BCards/IBCardEffectHandler.cs | 2 +- src/ChickenAPI.Game/Buffs/BuffContainer.cs | 2 +- .../Builders/WeaponOptionBuilder.cs | 2 +- src/ChickenAPI.Game/ChickenAPI.Game.csproj | 7 - .../Entities/Player/IPlayerEntity.cs | 2 +- .../Entities/Portal/PortalEntity.cs | 1 - src/ChickenAPI.Game/Groups/Group.cs | 2 +- .../Inventory/Events/InventoryMoveEvent.cs | 3 +- .../Inventory/Events/InventoryWearEvent.cs | 2 +- .../ItemUpgrade/Events/RarifyEvent.cs | 4 +- .../ItemUpgrade/Events/UpgradeEquipment.cs | 4 +- .../Events/UpgradeSpecialistEvent.cs | 4 +- .../ItemUsage/IUseItemRequestHandlerAsync.cs | 4 +- .../Mates/Events/AddPetEvent.cs | 2 +- .../Movements/IMovableCapacity.cs | 2 +- .../Events/RelationInvitationProcessEvent.cs | 2 +- .../Events/RelationInvitationSendEvent.cs | 3 +- .../Shops/Events/ShopBuyEvent.cs | 3 +- .../Shops/Events/ShowShopEvent.cs | 3 +- .../Visibility/IVisibleCapacity.cs | 2 +- .../Visibility/VisibilityChangeEventArgs.cs | 2 +- .../Visibility/VisibilityComponent.cs | 2 +- .../_ECS/Entities/EntityBase.cs | 1 - .../_ECS/Entities/EntityManagerBase.cs | 1 - src/ChickenAPI.Game/_ECS/Entities/IEntity.cs | 1 - .../_ECS/Entities/IEntityManager.cs | 1 - .../Attributes/PacketClientAttribute.cs | 17 -- .../Attributes/PacketDescriptionAttribute.cs | 18 -- .../Attributes/PacketHeaderAttribute.cs | 59 ----- .../Attributes/PacketIndexAttribute.cs | 79 ------ .../PacketPropertyDescriptionAttribute.cs | 18 -- .../Attributes/PacketServerAttribute.cs | 17 -- .../Client/CharNewPacketBase.cs | 24 -- .../Client/CharNewWrestlerPacketBase.cs | 24 -- .../Client/CharacterDeletePacketBase.cs | 14 - .../Client/EntryPointPacketBase.cs | 27 -- .../Client/GameStartPacketBase.cs | 9 - .../Client/SelectPacketBase.cs | 11 - .../Server/CListStartPacket.cs | 15 -- .../Server/ClistEndPacketBase.cs | 10 - .../Server/ClistPacketBase.cs | 65 ----- .../Server/OkPacketBase.cs | 9 - .../ChickenAPI.Packets.Old.csproj | 16 -- .../Client/Battle/MultiTargetListPacket.cs | 19 -- .../Client/Battle/MultiTargetListSubPacket.cs | 14 - .../Game/Client/Battle/NcifPacket.cs | 18 -- .../Game/Client/Battle/UseAoeSkillPacket.cs | 17 -- .../Game/Client/Battle/UseSkillPacket.cs | 23 -- .../Game/Client/Chat/ClientSayPacket.cs | 11 - .../Game/Client/Drops/DropPacket.cs | 32 --- .../Game/Client/Drops/GetPacket.cs | 20 -- .../Client/Families/CreateFamilyPacket.cs | 15 -- .../Game/Client/Families/GInfoPacket.cs | 67 ----- .../Game/Client/Families/GidxPacket.cs | 26 -- .../Game/Client/Inventory/BiPacket.cs | 15 -- .../Game/Client/Inventory/MviPacket.cs | 21 -- .../Game/Client/Inventory/PdtiPacket.cs | 26 -- .../Game/Client/Inventory/PutPacket.cs | 18 -- .../Game/Client/Inventory/RemovePacket.cs | 14 - .../Game/Client/Inventory/UiPacket.cs | 27 -- .../Game/Client/Inventory/WearPacket.cs | 14 - .../Game/Client/Mates/PsOpPacket.cs | 21 -- .../Game/Client/Mates/PslPacket.cs | 12 - .../Game/Client/Mates/SuCtlPacket.cs | 23 -- .../Game/Client/Mates/UPsPacket.cs | 26 -- .../Game/Client/Mates/UpetPacket.cs | 20 -- .../Game/Client/Miniland/AddobjPacket.cs | 17 -- .../Game/Client/Miniland/MlObjPacket.cs | 38 --- .../Game/Client/Miniland/RmvobjPacket.cs | 11 - .../Game/Client/Movement/DirectionPacket.cs | 22 -- .../Game/Client/Movement/PreqPacket.cs | 9 - .../Game/Client/Movement/SitPacket.cs | 19 -- .../Game/Client/Movement/SitSubPacket.cs | 14 - .../Game/Client/Movement/WalkPacket.cs | 24 -- .../Game/Client/Npcs/NrunPacket.cs | 24 -- .../Game/Client/Npcs/WopenPacket.cs | 18 -- .../Client/Player/CharacterOptionPacket.cs | 15 -- .../Game/Client/Player/ClientGuriPacket.cs | 23 -- .../Game/Client/Player/ComplimentPacket.cs | 15 -- .../Game/Client/Player/EffectPacket.cs | 17 -- .../Game/Client/Player/NpInfoPacket.cs | 11 - .../Game/Client/Player/QsetPacket.cs | 27 -- .../Game/Client/Player/ScrPacket.cs | 26 -- .../Game/Client/Player/TcInfoPacket.cs | 129 ---------- .../Game/Client/Shops/BuyPacket.cs | 24 -- .../Game/Client/Shops/MShopPacket.cs | 18 -- .../Game/Client/Shops/NInvPacket.cs | 27 -- .../Game/Client/Shops/ReceivedNpcReqPacket.cs | 14 - .../Game/Client/Shops/SentNpcReqPacket.cs | 17 -- .../Game/Client/Shops/ShopPacket.cs | 26 -- .../Game/Client/Shops/ShoppingPacket.cs | 20 -- .../Game/Client/Specialists/SlPacket.cs | 31 --- .../Game/Client/Specialists/SpPacket.cs | 20 -- .../Game/Client/UI/EInfoPacket.cs | 87 ------- .../Game/Client/UpgradePacket.cs | 35 --- .../Game/Server/Auction/RcbListPacket.cs | 62 ----- .../Game/Server/Auction/RcsListPacket.cs | 59 ----- .../Game/Server/Battle/BfPacket.cs | 26 -- .../Game/Server/Battle/CancelPacket.cs | 15 -- .../Game/Server/Battle/CtPacket.cs | 29 --- .../Game/Server/Battle/DmPacket.cs | 17 -- .../Game/Server/Battle/MscPacket.cs | 11 - .../Game/Server/Battle/RcPacket.cs | 20 -- .../Game/Server/Battle/SuPacket.cs | 54 ---- .../Game/Server/Chat/SayItemPacket.cs | 49 ---- .../Game/Server/Entities/CharScPacket.cs | 17 -- .../Game/Server/Entities/DropPacket.cs | 32 --- .../Game/Server/Entities/MvPacket.cs | 23 -- .../Game/Server/Entities/OutPacket.cs | 14 - .../Game/Server/Entities/ReqInfoPacket.cs | 18 -- .../Game/Server/Entities/RestPacket.cs | 17 -- .../Game/Server/Entities/StPacket.cs | 42 --- .../Game/Server/Entities/TpPacket.cs | 23 -- .../Game/Server/Group/PInitPacket.cs | 81 ------ .../Game/Server/Group/PJoinPacket.cs | 19 -- .../Game/Server/Group/PidxPacket.cs | 25 -- .../Game/Server/Group/PstPacket.cs | 43 ---- .../Game/Server/Inventory/EInfoPacket.cs | 89 ------- .../Game/Server/Inventory/EqListInfo.cs | 35 --- .../Game/Server/Inventory/EqPacket.cs | 33 --- .../Game/Server/Inventory/EqRareInfo.cs | 20 -- .../Game/Server/Inventory/EquipPacket.cs | 35 --- .../Server/Inventory/EquipmentInfoPacket.cs | 21 -- .../Server/Inventory/EquipmentListItem.cs | 24 -- .../Game/Server/Inventory/GetPacket.cs | 20 -- .../Game/Server/Inventory/GoldPacket.cs | 14 - .../Game/Server/Inventory/InvPacket.cs | 16 -- .../Inventory/InventoryWearSubPacket.cs | 35 --- .../Game/Server/Inventory/IvnPacket.cs | 27 -- .../Game/Server/Inventory/PairyPacket.cs | 27 -- .../Game/Server/Inventory/SlInfoPacket.cs | 141 ---------- .../Game/Server/Map/MapoutPacket.cs | 9 - .../Game/Server/Mates/PSkiPacket.cs | 17 -- .../Game/Server/Mates/SayPetPacket.cs | 14 - .../Game/Server/Mates/ScnPacket.cs | 242 ------------------ .../Game/Server/Mates/ScpPacket.cs | 110 -------- .../Game/Server/MiniMap/AtPacketBase.cs | 36 --- .../Game/Server/MiniMap/CMapPacket.cs | 21 -- .../Game/Server/MiniMap/RsfpPacket.cs | 14 - .../Game/Server/Player/BnPacket.cs | 14 - .../Game/Server/Player/CInfoPacket.cs | 67 ----- .../Game/Server/Player/CModePacketBase.cs | 30 --- .../Game/Server/Player/CondPacketBase.cs | 23 -- .../Game/Server/Player/FdPacket.cs | 24 -- .../Game/Server/Player/FsPacket.cs | 12 - .../Game/Server/Player/LevPacket.cs | 45 ---- .../Game/Server/Player/LevelUpPacket.cs | 11 - .../Game/Server/Player/QSlotPacket.cs | 14 - .../Game/Server/Player/QsetPacketReceive.cs | 21 -- .../Game/Server/Player/RagePacket.cs | 14 - .../Game/Server/Player/SayPacket.cs | 25 -- .../Game/Server/Player/ScPacket.cs | 80 ------ .../Game/Server/Player/StatPacket.cs | 26 -- .../Game/Server/Player/TitPacket.cs | 14 - .../Game/Server/Portals/GpPacket.cs | 30 --- .../Game/Server/Raids/RlPacket.cs | 51 ---- .../Game/Server/Relations/BlInitPacket.cs | 22 -- .../Game/Server/Relations/FInitPacket.cs | 29 --- .../Game/Server/Relations/FInsPacket.cs | 15 -- .../Game/Server/Shop/IShopPacket.cs | 9 - .../Game/Server/Shop/PFlagPacket.cs | 17 -- .../Game/Server/Shop/SMemoPacket.cs | 15 -- .../Game/Server/Shop/ShopEndPacket.cs | 12 - .../Game/Server/Specialist/SdPacket.cs | 11 - .../Game/Server/UserInterface/Act6Packet.cs | 9 - .../Game/Server/UserInterface/BSInfoPacket.cs | 20 -- .../Game/Server/UserInterface/ChdmPacket.cs | 20 -- .../Game/Server/UserInterface/DelayPacket.cs | 18 -- .../Game/Server/UserInterface/DialogPacket.cs | 17 -- .../Game/Server/UserInterface/GuriPacket.cs | 21 -- .../Game/Server/UserInterface/InfoPacket.cs | 11 - .../Game/Server/UserInterface/ModalPacket.cs | 15 -- .../Game/Server/UserInterface/MsgPacket.cs | 15 -- .../Game/Server/UserInterface/PClearPacket.cs | 9 - .../Game/Server/UserInterface/QnaPacket.cs | 14 - .../Game/Server/UserInterface/ZzimPacket.cs | 9 - .../Server/Visibility/InAliveSubPacketBase.cs | 18 -- .../Visibility/InCharacterSubPacketBase.cs | 107 -------- .../Server/Visibility/InItemSubPacketBase.cs | 21 -- .../Game/Server/Visibility/InMateSubPacket.cs | 69 ----- .../Server/Visibility/InMonsterSubPacket.cs | 68 ----- .../Visibility/InNonPlayerSubPacketBase.cs | 18 -- .../Game/Server/Visibility/InNpcSubPacket.cs | 68 ----- .../Visibility/InOwnableSubPacketBase.cs | 18 -- .../Game/Server/Visibility/InPacket.cs | 52 ---- src/ChickenAPI.Packets/IPacket.cs | 25 -- src/ChickenAPI.Packets/IPacketFactory.cs | 13 - src/ChickenAPI.Packets/PacketBase.cs | 22 -- src/Login/Network/ClientSession.cs | 4 +- .../Essentials/Character/CharacterModule.cs | 5 +- src/Plugins/Essentials/Item/ItemModule.cs | 2 +- .../Essentials/MapManagement/ButcherModule.cs | 3 +- .../Essentials/Teleport/TeleportModule.cs | 4 +- .../AlgorithmService.cs | 1 - .../Close/CloseDefenceAlgorithm.cs | 3 +- .../Damage/CriticalDistAlgorithm.cs | 3 +- .../Damage/CriticalDistRateAlgorithm.cs | 3 +- .../Damage/CriticalHitAlgortihmcs.cs | 3 +- .../Damage/CriticalHitRateAlgorithm.cs | 3 +- .../Damage/HitRateAlgorithm.cs | 3 +- .../Damage/MaxDistanceAlgorithm.cs | 3 +- .../Damage/MaxHitAlgorithm.cs | 3 +- .../Damage/MinDistanceAlgorithm.cs | 1 - .../Damage/MinHitAlgorithm.cs | 3 +- .../Distance/RangedDefenceAlgorithm.cs | 3 +- .../Distance/RangedDodgeAlgorithm.cs | 3 +- .../CharacterAlgorithms/HpMp/HpMax.cs | 3 +- .../CharacterAlgorithms/HpMp/HpRegen.cs | 1 - .../HpMp/HpRegenSitting.cs | 1 - .../CharacterAlgorithms/HpMp/MpMax.cs | 3 +- .../HpMp/MpRegenSitting.cs | 1 - .../ICharacterStatAlgorithm.cs | 3 +- .../Magical/MagicDefenceAlgorithm.cs | 3 +- .../Magical/MagicDodgeAlgorithm.cs | 3 +- .../CharacterAlgorithms/SpeedAlgorithm.cs | 1 - .../NpcMonsterAlgorithmService.cs | 4 +- .../NpcMonsterAlgorithms/HeroXp.cs | 2 +- .../NpcMonsterAlgorithms/HpMax.cs | 2 +- .../IMonsterRaceStatAlgorithm.cs | 2 +- .../NpcMonsterAlgorithms/JobXp.cs | 2 +- .../NpcMonsterAlgorithms/MpMax.cs | 2 +- .../NpcMonsterAlgorithms/Xp.cs | 2 +- .../Models/Cards/CardModel.cs | 2 +- .../Models/Character/AccountModel.cs | 2 +- .../Models/Character/CharacterFamilyModel.cs | 2 +- .../Models/Character/CharacterItemModel.cs | 2 - .../Models/Character/CharacterMateModel.cs | 2 +- .../Models/Character/CharacterModel.cs | 2 +- .../Models/Families/FamilyModel.cs | 2 - .../Models/Item/ItemModel.cs | 4 +- .../Models/Map/MapMonsterModel.cs | 2 +- .../Models/Map/MapNpcModel.cs | 2 +- .../Models/NpcMonster/NpcMonsterModel.cs | 2 +- .../Services/BCard/BCardDao.cs | 2 +- .../Services/Character/CharacterDao.cs | 2 +- .../Services/Character/CharacterItemDao.cs | 3 +- .../Utils/NosSharpDatabasePluginMapper.cs | 4 +- .../Utils/PluginDependencyInjector.cs | 2 +- .../CharacterScreenLoadHandler.cs | 4 +- .../CharacterScreen/CreateCharacterHandler.cs | 2 +- .../CreateCharacterWrestlerHandler.cs | 2 +- .../CharacterScreen/DeleteCharacterHandler.cs | 2 +- .../Inventory/WearPacketHandling.cs | 2 +- .../Relations/FInsPacketHandling.cs | 2 +- .../Shops/ShoppingPacketHandling.cs | 1 - .../Skill/UseSkillPacketHandling.cs | 1 - .../Specialists/SlPacketHandling.cs | 2 +- .../Redis/SessionService.cs | 2 +- .../RedisSessionService.cs | 2 +- .../BCardHandlers/BCardBuffHandler.cs | 2 +- .../BasicBCardHandlerContainer.cs | 2 +- .../Family/Family_Creation_Handler.cs | 1 - .../Family/Family_Join_Handler.cs | 2 +- .../Inventory/Inventory_ItemInfo_Handler.cs | 2 +- .../Inventory_LoadInventory_Handler.cs | 1 - .../Inventory/Inventory_MoveItem_Handler.cs | 1 - .../Inventory_SendDetails_Handler.cs | 1 - .../Inventory/Inventory_WearItem_Handler.cs | 4 +- .../EventHandlers/Shops/Shop_Buy_Event.cs | 2 - .../Skills/Skill_AddSkill_Handler.cs | 1 - .../Skills/Skill_UseSkill_Handler.cs | 3 +- .../Specialist_Transform_Handler.cs | 4 +- .../Upgrading/Upgrading_Rarify_Handler.cs | 5 +- .../Upgrading_UpgradeEquipment_Handler.cs | 4 +- .../Upgrading/Upgrading_UpgradeSp_Handler.cs | 2 +- .../Visibility_Invisible_Handler.cs | 2 +- .../Visibility/Visibility_Visible_Handler.cs | 2 +- .../GuriHandlers/EmoticonGuriHandler.cs | 2 +- .../GuriHandlers/ReleasePetsHandler.cs | 1 - .../ItemUpgradeHandlers/PerfectSpCard.cs | 2 +- .../ItemUpgradeHandlers/RarifyItemHandler.cs | 4 +- .../ItemUpgradeHandlers/SumItem.cs | 2 +- .../ItemUpgradeHandlers/UpgradeItemHandler.cs | 4 +- .../ItemUpgradeHandlers/UpgradeSpCard.cs | 4 +- .../BoxItem/PearlPetsReleaseHandler.cs | 4 +- .../Handler/LocomotionHandler.cs | 2 +- .../ItemUsageHandlers/Handler/WingsSpCard.cs | 3 +- .../ItemUsageHandlers/UseItemHandlerAsync.cs | 2 +- .../NpcDialogHandlers/DialogHandler.cs | 1 - .../SaltyEmu.FamilyPlugin.csproj | 1 - .../Protocol/ProcessInvitation.cs | 2 +- .../Services/RelationServiceClient.cs | 2 +- src/Toolkit/Commands/ParseCommand.cs | 2 +- src/Toolkit/Converter/CardDatConverter.cs | 4 +- src/Toolkit/Converter/ItemDatConverter.cs | 6 +- src/Toolkit/Converter/MonsterDatConverter.cs | 6 +- src/Toolkit/Converter/SkillDatConverter.cs | 2 +- .../FromPackets/MapMonsterGenerator.cs | 2 +- .../Generators/FromPackets/MapNpcGenerator.cs | 2 +- src/World/Network/Server.cs | 2 +- .../Checks/RequireAuthorityAttribute.cs | 2 +- .../SaltyEmu.FamilyService.csproj | 1 - .../Handling/ProcessInvitationHandler.cs | 2 +- .../SaltyEmu.RelationService.csproj | 1 - .../RelationInvitationProcessing.cs | 2 +- 444 files changed, 235 insertions(+), 6019 deletions(-) delete mode 100644 src/ChickenAPI.Core/ChickenAPI.Core.csproj delete mode 100644 src/ChickenAPI.Core/Events/BasicEventPipelineAsync.cs delete mode 100644 src/ChickenAPI.Core/Events/ChickenEvent.cs delete mode 100644 src/ChickenAPI.Core/Events/GenericEventPostProcessorBase.cs delete mode 100644 src/ChickenAPI.Core/Events/IEventNotification.cs delete mode 100644 src/ChickenAPI.Core/Events/IEventPipeline.cs delete mode 100644 src/ChickenAPI.Core/Events/IEventPostProcessor.cs delete mode 100644 src/ChickenAPI.Core/Events/IEventPreprocessor.cs delete mode 100644 src/ChickenAPI.Core/IPC/IIpcClient.cs delete mode 100644 src/ChickenAPI.Core/IPC/IIpcPacketHandler.cs delete mode 100644 src/ChickenAPI.Core/IPC/IIpcPacketHandlersContainer.cs delete mode 100644 src/ChickenAPI.Core/IPC/IIpcPacketRouter.cs delete mode 100644 src/ChickenAPI.Core/IPC/IIpcServer.cs delete mode 100644 src/ChickenAPI.Core/IPC/IRoutingInformation.cs delete mode 100644 src/ChickenAPI.Core/IPC/IRoutingInformationFactory.cs delete mode 100644 src/ChickenAPI.Core/IPC/Protocol/IIpcPacket.cs delete mode 100644 src/ChickenAPI.Core/IPC/Protocol/IIpcRequest.cs delete mode 100644 src/ChickenAPI.Core/IPC/Protocol/IIpcResponse.cs delete mode 100644 src/ChickenAPI.Core/IoC/ChickenContainer.cs delete mode 100644 src/ChickenAPI.Core/IoC/ServiceFactory.cs delete mode 100644 src/ChickenAPI.Core/IoC/ServiceFactoryExtensions.cs delete mode 100644 src/ChickenAPI.Core/Logging/Logger.cs delete mode 100644 src/ChickenAPI.Core/Maths/IRandomGenerator.cs delete mode 100644 src/ChickenAPI.Core/Maths/RandomGenerator.cs delete mode 100644 src/ChickenAPI.Core/Plugins/Exceptions/CriticalPluginException.cs delete mode 100644 src/ChickenAPI.Core/Plugins/Exceptions/PluginException.cs delete mode 100644 src/ChickenAPI.Core/Plugins/IPlugin.cs delete mode 100644 src/ChickenAPI.Core/Plugins/IPluginConfiguration.cs delete mode 100644 src/ChickenAPI.Core/Plugins/IPluginManager.cs delete mode 100644 src/ChickenAPI.Core/Plugins/PluginEnableTime.cs delete mode 100644 src/ChickenAPI.Core/Utils/AssemblyExtensions.cs delete mode 100644 src/ChickenAPI.Core/Utils/ConfigurationHelper.cs delete mode 100644 src/ChickenAPI.Core/Utils/EventHandlerWithoutArgs.cs delete mode 100644 src/ChickenAPI.Core/Utils/Position.cs delete mode 100644 src/ChickenAPI.Core/Utils/PositionHelper.cs delete mode 100644 src/ChickenAPI.Core/Utils/StringExtensions.cs delete mode 100644 src/ChickenAPI.Core/Utils/TypedSenderEventHandler.cs delete mode 100644 src/ChickenAPI.Core/i18n/ILogLanguageService.cs delete mode 100644 src/ChickenAPI.Core/i18n/LanguageKey.cs delete mode 100644 src/ChickenAPI.Core/i18n/LogI18NKeys.cs rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/AuthResponse.cs (89%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/AuthenticationState.cs (89%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/AuthorityType.cs (89%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/BCard/BCardRelationType.cs (73%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/BCard/BCardType.cs (98%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/BCard/BCard_Additional.cs (99%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Buffs/BuffType.cs (67%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Character/ChannelColor.cs (72%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Character/CharacterNameAppearance.cs (78%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Character/CharacterOption.cs (89%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Character/CharacterState.cs (69%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Character/MinilandState.cs (68%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Character/ReputationIconType.cs (66%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Drop/DropType.cs (67%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Effects/EmojiType.cs (90%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Entity/DirectionType.cs (79%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Entity/MateType.cs (64%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Entity/MonsterType.cs (83%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Entity/NpcMonsterRaceType.cs (65%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Entity/ReqInfoType.cs (100%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Families/FamilyLogType.cs (89%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Families/FamilyMemberRank.cs (92%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Groups/GroupDropType.cs (75%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/ArmorOptionType.cs (97%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/EquipmentOptionType.cs (66%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/EquipmentType.cs (89%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/ItemClassType.cs (74%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/ItemType.cs (93%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/ItemWearType.cs (64%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/JewelOptionType.cs (78%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/Upgrade/FixedUpModeType.cs (60%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/Upgrade/RarifyModeType.cs (68%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/Upgrade/RarifyProtectionType.cs (78%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/Upgrade/UpgradeModeType.cs (62%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/Upgrade/UpgradeProtectionType.cs (60%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/Upgrade/UpgradeTypeEvent.cs (60%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/WeaponOptionLevelType.cs (69%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Items/WeaponOptionType.cs (97%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Maps/MapLayerType.cs (59%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Mates/SpPartnerRank.cs (79%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/NosBazaar/NosBazaarCategoryType.cs (85%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/NosBazaar/NosBazaarOrderType.cs (75%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/PlayerSessionState.cs (73%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Quicklist/QuicklistItemSlotType.cs (68%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Quicklist/QuicklistSkillSlotType.cs (69%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Relations/RelationInvitationProcess.cs (64%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Skill/SkillTargetType.cs (70%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/Game/Visibility/VisibilityType.cs (61%) rename src/{ChickenAPI.Enums => ChickenAPI.Data/Enums}/RegionType.cs (80%) delete mode 100644 src/ChickenAPI.Enums/ChickenAPI.Enums.csproj delete mode 100644 src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs delete mode 100644 src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs delete mode 100644 src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs delete mode 100644 src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs delete mode 100644 src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs delete mode 100644 src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/ChickenAPI.Packets.Old.csproj delete mode 100644 src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs delete mode 100644 src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs delete mode 100644 src/ChickenAPI.Packets/IPacket.cs delete mode 100644 src/ChickenAPI.Packets/IPacketFactory.cs delete mode 100644 src/ChickenAPI.Packets/PacketBase.cs diff --git a/SaltyEmu.sln b/SaltyEmu.sln index b9911e58..508fdaa8 100644 --- a/SaltyEmu.sln +++ b/SaltyEmu.sln @@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.BasicAlgorithmPlug EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Game", "src\ChickenAPI.Game\ChickenAPI.Game.csproj", "{34BBD274-3133-4894-8776-783731D126BC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChickenAPI.Enums", "src\ChickenAPI.Enums\ChickenAPI.Enums.csproj", "{2C706520-AA6F-45FA-910F-DCDD42C52192}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit", "src\Toolkit\Toolkit.csproj", "{5F14B226-7842-4F6E-BE2E-1CC01C530F3B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SaltyEmu.PathfinderPlugin", "src\Plugins\NosSharp.Pathfinder\SaltyEmu.PathfinderPlugin.csproj", "{48D59236-CC25-497E-A98D-DAB290E4A8B7}" @@ -111,10 +109,6 @@ Global {34BBD274-3133-4894-8776-783731D126BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {34BBD274-3133-4894-8776-783731D126BC}.Release|Any CPU.ActiveCfg = Release|Any CPU {34BBD274-3133-4894-8776-783731D126BC}.Release|Any CPU.Build.0 = Release|Any CPU - {2C706520-AA6F-45FA-910F-DCDD42C52192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C706520-AA6F-45FA-910F-DCDD42C52192}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2C706520-AA6F-45FA-910F-DCDD42C52192}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2C706520-AA6F-45FA-910F-DCDD42C52192}.Release|Any CPU.Build.0 = Release|Any CPU {5F14B226-7842-4F6E-BE2E-1CC01C530F3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5F14B226-7842-4F6E-BE2E-1CC01C530F3B}.Debug|Any CPU.Build.0 = Debug|Any CPU {5F14B226-7842-4F6E-BE2E-1CC01C530F3B}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -206,7 +200,6 @@ Global {45E04475-DFC4-400A-9D35-44BAF5180ACD} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {28B389E6-9863-4306-B32E-756A2C6D9E99} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {34BBD274-3133-4894-8776-783731D126BC} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} - {2C706520-AA6F-45FA-910F-DCDD42C52192} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} {48D59236-CC25-497E-A98D-DAB290E4A8B7} = {7A7E9A02-CEFC-4E77-A495-70804348CA47} {AA0972AB-A59A-4EB7-AF5A-B31F61D25644} = {9FEA092D-17C0-4EAA-8D15-40A0CF3B0699} {548F9115-2EF6-4B73-B224-5CEB8D7F4276} = {88C85787-06D8-4E6D-9E87-38FCFD2F6CB0} diff --git a/src/ChickenAPI.Core/ChickenAPI.Core.csproj b/src/ChickenAPI.Core/ChickenAPI.Core.csproj deleted file mode 100644 index 5131dc0d..00000000 --- a/src/ChickenAPI.Core/ChickenAPI.Core.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - netstandard2.0 - latest - - - - - - - - - - - C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.ILGeneration.dll - - - C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.Lightweight.dll - - - - diff --git a/src/ChickenAPI.Core/Events/BasicEventPipelineAsync.cs b/src/ChickenAPI.Core/Events/BasicEventPipelineAsync.cs deleted file mode 100644 index 090c4ebe..00000000 --- a/src/ChickenAPI.Core/Events/BasicEventPipelineAsync.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using ChickenAPI.Core.Logging; - -namespace ChickenAPI.Core.Events -{ - public class BasicEventPipelineAsync : IEventPipeline - { - private static readonly Logger Log = Logger.GetLogger(); - private readonly Dictionary> _postprocessorsDictionary = new Dictionary>(); - private readonly Dictionary> _preprocessorsDictionary = new Dictionary>(); - - public async Task Notify(TNotification notification, CancellationToken cancellationToken = default) where TNotification : IEventNotification - { - if (!_postprocessorsDictionary.TryGetValue(typeof(TNotification), out List processors)) - { - return; - } - - if (!await CanSendEvent(notification, typeof(TNotification), cancellationToken)) - { - return; - } - - foreach (IEventPostProcessor postProcessor in processors) - { - try - { - await postProcessor.Handle(notification, cancellationToken); - } - catch (Exception e) - { - Log.Error("Notify()", e); - } - } - } - - public Task RegisterPreprocessorAsync(IEventPreprocessor preprocessor) where T : IEventNotification => RegisterPreprocessorAsync(preprocessor, typeof(T)); - - public Task RegisterPreprocessorAsync(IEventPreprocessor preprocessor, Type type) - { - if (!_preprocessorsDictionary.TryGetValue(type, out List handlers)) - { - handlers = new List(); - _preprocessorsDictionary[type] = handlers; - } - - handlers.Add(preprocessor); - return Task.CompletedTask; - } - - public Task UnregisterPreprocessorAsync(IEventPreprocessor preprocessor) where T : IEventNotification => UnregisterPreprocessorAsync(preprocessor, typeof(T)); - - public Task UnregisterPreprocessorAsync(IEventPreprocessor preprocessor, Type type) => Task.CompletedTask; - - public Task RegisterPostProcessorAsync(IEventPostProcessor postProcessor, Type type) - { - if (!_postprocessorsDictionary.TryGetValue(type, out List handlers)) - { - handlers = new List(); - _postprocessorsDictionary[type] = handlers; - } - - handlers.Add(postProcessor); - return Task.CompletedTask; - } - - public Task RegisterPostProcessorAsync(IEventPostProcessor postProcessor) where T : IEventNotification => RegisterPostProcessorAsync(postProcessor, typeof(T)); - - public Task UnregisterPostprocessorAsync(IEventPostProcessor preprocessor) where T : IEventNotification => UnregisterPostprocessorAsync(preprocessor, typeof(T)); - - public Task UnregisterPostprocessorAsync(IEventPostProcessor postProcessor, Type type) => Task.CompletedTask; - - - private async Task CanSendEvent(IEventNotification e, Type type, CancellationToken cancellationToken) - { - if (!_preprocessorsDictionary.TryGetValue(type, out List filters)) - { - return true; - } - - foreach (IEventPreprocessor filter in filters) - { - // filter is not passed correctly - if (await filter.Handle(e, cancellationToken) == false) - { - return false; - } - } - - return true; - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Events/ChickenEvent.cs b/src/ChickenAPI.Core/Events/ChickenEvent.cs deleted file mode 100644 index b41dca1f..00000000 --- a/src/ChickenAPI.Core/Events/ChickenEvent.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace ChickenAPI.Core.Events -{ - public class ChickenEvent : EventArgs, IEventNotification - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Events/GenericEventPostProcessorBase.cs b/src/ChickenAPI.Core/Events/GenericEventPostProcessorBase.cs deleted file mode 100644 index 10b6f6c3..00000000 --- a/src/ChickenAPI.Core/Events/GenericEventPostProcessorBase.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using ChickenAPI.Core.Logging; - -namespace ChickenAPI.Core.Events -{ - public abstract class GenericEventPostProcessorBase : IEventPostProcessor where TNotification : IEventNotification - { - protected readonly Logger Log = Logger.GetLogger($"[HANDLER:({typeof(TNotification)})]"); - public Type Type => typeof(TNotification); - - public Task Handle(IEventNotification notification, CancellationToken cancellation) - { - if (notification is TNotification typedNotification) - { - return Handle(typedNotification, cancellation); - } - - return Task.CompletedTask; - } - - protected abstract Task Handle(TNotification e, CancellationToken cancellation); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Events/IEventNotification.cs b/src/ChickenAPI.Core/Events/IEventNotification.cs deleted file mode 100644 index c4479826..00000000 --- a/src/ChickenAPI.Core/Events/IEventNotification.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ChickenAPI.Core.Events -{ - /// - /// Interface for every type of event notification - /// - public interface IEventNotification - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Events/IEventPipeline.cs b/src/ChickenAPI.Core/Events/IEventPipeline.cs deleted file mode 100644 index d2ad0115..00000000 --- a/src/ChickenAPI.Core/Events/IEventPipeline.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace ChickenAPI.Core.Events -{ - public interface IEventPipeline - { - /// - /// Asynchronously send a notification to handlers of type T - /// - /// Notification object - /// Optional cancellation token - /// A task that represents the publish operation. - Task Notify(TNotification notification, CancellationToken cancellationToken = default) where TNotification : IEventNotification; - - - /// - /// Asynchronously registers a preprocessor in the pipeline for events of type - /// - /// - /// - /// - Task RegisterPreprocessorAsync(IEventPreprocessor preprocessor) where T : IEventNotification; - - /// - /// Asynchronously registers a filter in filters in piepline for event of the given type - /// - /// - /// - Task RegisterPreprocessorAsync(IEventPreprocessor preprocessor, Type type); - - /// - /// Asynchronously unregisters the preprocessor for handled type from the pipeline - /// - /// - /// - Task UnregisterPreprocessorAsync(IEventPreprocessor preprocessor) where T : IEventNotification; - - /// - /// Asynchronously unregisters the preprocessor from the pipeline - /// - /// - /// - /// - Task UnregisterPreprocessorAsync(IEventPreprocessor preprocessor, Type type); - - - /// - /// Asynchronously registers a PostProcessor (aka Handler) in the pipeline for events of type - /// - /// - /// - /// Type of event handled by the post processor - /// - Task RegisterPostProcessorAsync(IEventPostProcessor postProcessor, Type type); - - /// - /// Asynchronously registers a PostProcessor (aka Handler) in the pipeline for events of type - /// - /// - /// - /// - Task RegisterPostProcessorAsync(IEventPostProcessor postProcessor) where T : IEventNotification; - - /// - /// Asynchronously unregisters the postprocessor for handled type from the pipeline - /// - /// - /// - Task UnregisterPostprocessorAsync(IEventPostProcessor preprocessor) where T : IEventNotification; - - /// - /// Asynchronously unregisters the postprocessor from the pipeline - /// - /// - /// - Task UnregisterPostprocessorAsync(IEventPostProcessor postProcessor, Type type); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Events/IEventPostProcessor.cs b/src/ChickenAPI.Core/Events/IEventPostProcessor.cs deleted file mode 100644 index 5cf82422..00000000 --- a/src/ChickenAPI.Core/Events/IEventPostProcessor.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace ChickenAPI.Core.Events -{ - /// - /// Defines a handler for any type of notification - /// - public interface IEventPostProcessor - { - Task Handle(IEventNotification notification, CancellationToken cancellation); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Events/IEventPreprocessor.cs b/src/ChickenAPI.Core/Events/IEventPreprocessor.cs deleted file mode 100644 index 30a9f00f..00000000 --- a/src/ChickenAPI.Core/Events/IEventPreprocessor.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace ChickenAPI.Core.Events -{ - public interface IEventPreprocessor - { - /// - /// Handles the preprocessor - /// - /// - /// - /// - Task Handle(IEventNotification notification, CancellationToken token); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IIpcClient.cs b/src/ChickenAPI.Core/IPC/IIpcClient.cs deleted file mode 100644 index 50cc5847..00000000 --- a/src/ChickenAPI.Core/IPC/IIpcClient.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading.Tasks; -using ChickenAPI.Core.IPC.Protocol; - -namespace ChickenAPI.Core.IPC -{ - public interface IIpcClient - { - Task RequestAsync(IIpcRequest request) where T : class, IIpcResponse; - Task BroadcastAsync(T packet) where T : IIpcPacket; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IIpcPacketHandler.cs b/src/ChickenAPI.Core/IPC/IIpcPacketHandler.cs deleted file mode 100644 index bfb9f7fb..00000000 --- a/src/ChickenAPI.Core/IPC/IIpcPacketHandler.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; -using ChickenAPI.Core.IPC.Protocol; - -namespace ChickenAPI.Core.IPC -{ - public interface IIpcPacketHandler - { - Task Handle(IIpcPacket packet); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IIpcPacketHandlersContainer.cs b/src/ChickenAPI.Core/IPC/IIpcPacketHandlersContainer.cs deleted file mode 100644 index 8810b8db..00000000 --- a/src/ChickenAPI.Core/IPC/IIpcPacketHandlersContainer.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Threading.Tasks; -using ChickenAPI.Core.IPC.Protocol; - -namespace ChickenAPI.Core.IPC -{ - public interface IIpcPacketHandlersContainer - { - event EventHandler Registered; - event EventHandler Unregistered; - Task RegisterAsync(IIpcPacketHandler handler, Type type); - - Task UnregisterAsync(Type type); - Task HandleAsync(IIpcPacket request, Type type); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IIpcPacketRouter.cs b/src/ChickenAPI.Core/IPC/IIpcPacketRouter.cs deleted file mode 100644 index f28a016e..00000000 --- a/src/ChickenAPI.Core/IPC/IIpcPacketRouter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace ChickenAPI.Core.IPC -{ - public interface IIpcPacketRouter - { - /// - /// Will register and generate the default routing informations related to Router's configuration - /// - /// - /// - Task RegisterAsync(Type type); - - /// - /// Will register the packet routing information for a given type - /// - /// - /// - /// - Task RegisterAsync(Type type, IRoutingInformation routingInformation); - - /// - /// Get the routing informations from the router - /// re - /// - /// - /// - Task GetRoutingInformationsAsync(Type type); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IIpcServer.cs b/src/ChickenAPI.Core/IPC/IIpcServer.cs deleted file mode 100644 index dcbbfc4f..00000000 --- a/src/ChickenAPI.Core/IPC/IIpcServer.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Threading.Tasks; -using ChickenAPI.Core.IPC.Protocol; - -namespace ChickenAPI.Core.IPC -{ - public interface IIpcServer - { - Task ResponseAsync(T response, Type requestType) where T : IIpcResponse; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IRoutingInformation.cs b/src/ChickenAPI.Core/IPC/IRoutingInformation.cs deleted file mode 100644 index 15a893f4..00000000 --- a/src/ChickenAPI.Core/IPC/IRoutingInformation.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Core.IPC -{ - public interface IRoutingInformation - { - string IncomingTopic { get; } - string OutgoingTopic { get; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/IRoutingInformationFactory.cs b/src/ChickenAPI.Core/IPC/IRoutingInformationFactory.cs deleted file mode 100644 index cb6f34bf..00000000 --- a/src/ChickenAPI.Core/IPC/IRoutingInformationFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; - -namespace ChickenAPI.Core.IPC -{ - public interface IRoutingInformationFactory - { - Task Create(string topic, string responseTopic); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/Protocol/IIpcPacket.cs b/src/ChickenAPI.Core/IPC/Protocol/IIpcPacket.cs deleted file mode 100644 index 7cb9d33a..00000000 --- a/src/ChickenAPI.Core/IPC/Protocol/IIpcPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace ChickenAPI.Core.IPC.Protocol -{ - public interface IIpcPacket - { - Guid Id { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/Protocol/IIpcRequest.cs b/src/ChickenAPI.Core/IPC/Protocol/IIpcRequest.cs deleted file mode 100644 index b0a757d7..00000000 --- a/src/ChickenAPI.Core/IPC/Protocol/IIpcRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; - -namespace ChickenAPI.Core.IPC.Protocol -{ - public interface IIpcRequest : IIpcPacket - { - Task ReplyAsync(T response) where T : IIpcResponse; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IPC/Protocol/IIpcResponse.cs b/src/ChickenAPI.Core/IPC/Protocol/IIpcResponse.cs deleted file mode 100644 index 0ddd852c..00000000 --- a/src/ChickenAPI.Core/IPC/Protocol/IIpcResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace ChickenAPI.Core.IPC.Protocol -{ - public interface IIpcResponse : IIpcPacket - { - Guid RequestId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IoC/ChickenContainer.cs b/src/ChickenAPI.Core/IoC/ChickenContainer.cs deleted file mode 100644 index 325a02ab..00000000 --- a/src/ChickenAPI.Core/IoC/ChickenContainer.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Autofac; - -namespace ChickenAPI.Core.IoC -{ - public static class ChickenContainer - { - public static ContainerBuilder Builder = new ContainerBuilder(); - - public static IContainer Instance { get; private set; } - - public static void Initialize() - { - Instance = Builder.Build(); - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IoC/ServiceFactory.cs b/src/ChickenAPI.Core/IoC/ServiceFactory.cs deleted file mode 100644 index 93cc2455..00000000 --- a/src/ChickenAPI.Core/IoC/ServiceFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace ChickenAPI.Core.IoC -{ - /// - /// Factory method used to resolve all services. For multiple instances, it will resolve against - /// - /// - /// Type of service to resolve - /// An instance of type - public delegate object ServiceFactory(Type serviceType); -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/IoC/ServiceFactoryExtensions.cs b/src/ChickenAPI.Core/IoC/ServiceFactoryExtensions.cs deleted file mode 100644 index 1094be99..00000000 --- a/src/ChickenAPI.Core/IoC/ServiceFactoryExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; - -namespace ChickenAPI.Core.IoC -{ - public static class ServiceFactoryExtensions - { - public static T GetInstance(this ServiceFactory factory) - => (T)factory(typeof(T)); - - public static IEnumerable GetInstances(this ServiceFactory factory) - => (IEnumerable)factory(typeof(IEnumerable)); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Logging/Logger.cs b/src/ChickenAPI.Core/Logging/Logger.cs deleted file mode 100644 index cce1d29b..00000000 --- a/src/ChickenAPI.Core/Logging/Logger.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using NLog; -using NLog.Conditions; -using NLog.Config; -using NLog.Targets; - -namespace ChickenAPI.Core.Logging -{ - public class Logger - { - private const string DefaultLayout = "[${date}][${level:uppercase=true}][${logger:shortName=true}] ${message} ${exception:format=tostring}"; - - private Logger(Type type) => Log = LogManager.GetLogger(type.ToString()); - private Logger(string prefix) => Log = LogManager.GetLogger(prefix); - - private ILogger Log { get; } - - /// - /// Initialize logger's configuration. - /// Please refer to https://github.com/nlog/NLog/wiki/Layout-Renderers for custom layouts. - /// - /// - /// - public static void Initialize(string consoleLayout, string fileLayout) - { - var config = new LoggingConfiguration(); - var consoleTarget = new ColoredConsoleTarget(); - var fileTarget = new FileTarget(); - - consoleTarget.Layout = consoleLayout; - - var infoHighlightRule = new ConsoleRowHighlightingRule - { - Condition = ConditionParser.ParseExpression("level == LogLevel.Info"), - ForegroundColor = ConsoleOutputColor.Green - }; - var errorHighlightRule = new ConsoleRowHighlightingRule - { - Condition = ConditionParser.ParseExpression("level == LogLevel.Error"), - ForegroundColor = ConsoleOutputColor.Red - }; - var warnHighlightingRule = new ConsoleRowHighlightingRule - { - Condition = ConditionParser.ParseExpression("level == LogLevel.Warn"), - ForegroundColor = ConsoleOutputColor.DarkYellow - }; - consoleTarget.RowHighlightingRules.Add(infoHighlightRule); - consoleTarget.RowHighlightingRules.Add(errorHighlightRule); - consoleTarget.RowHighlightingRules.Add(warnHighlightingRule); - - fileTarget.Layout = fileLayout; - fileTarget.FileName = "logs/" + DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss") + ".log"; - - config.AddTarget("console", consoleTarget); - config.AddTarget("file", fileTarget); - - var rule1 = new LoggingRule("*", LogLevel.Debug, consoleTarget); - config.LoggingRules.Add(rule1); - - var rule2 = new LoggingRule("*", LogLevel.Debug, fileTarget); - config.LoggingRules.Add(rule2); - - LogManager.Configuration = config; - } - - public static void Initialize() - { - Initialize(DefaultLayout, DefaultLayout); - } - - public static Logger GetLogger(string prefix) => new Logger(prefix); - - public static Logger GetLogger() where TClass : class => new Logger(typeof(TClass)); - - public void Trace(string msg) - { - Log?.Trace(msg); - } - - public void Debug(string msg) - { - Log?.Debug(msg); - } - - public void Info(string msg) - { - Log?.Info(msg); - } - - public void Warn(string msg) - { - Log?.Warn(msg); - } - - public void Error(string msg, Exception ex) - { - Log?.Error(ex, msg); - } - - public void Fatal(string msg, Exception ex) - { - Log?.Fatal(ex, msg); - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Maths/IRandomGenerator.cs b/src/ChickenAPI.Core/Maths/IRandomGenerator.cs deleted file mode 100644 index c8099d38..00000000 --- a/src/ChickenAPI.Core/Maths/IRandomGenerator.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace ChickenAPI.Core.Maths -{ - public interface IRandomGenerator - { - int Next(int min, int max); - - int Next(int max); - - double Next(); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Maths/RandomGenerator.cs b/src/ChickenAPI.Core/Maths/RandomGenerator.cs deleted file mode 100644 index c50cbe47..00000000 --- a/src/ChickenAPI.Core/Maths/RandomGenerator.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Security.Cryptography; - -namespace ChickenAPI.Core.Maths -{ - public class RandomGenerator : IRandomGenerator - { - public RandomGenerator() => RngProvider = new RNGCryptoServiceProvider(); - - private RNGCryptoServiceProvider RngProvider { get; } - - public int Next(int min, int max) => (int)Math.Floor(min + ((double)max - min) * Next()); - - public int Next(int max) => Next(0, max); - - public double Next() - { - byte[] bytes = new byte[sizeof(uint)]; - GetBytes(bytes); - - uint rnd = BitConverter.ToUInt32(bytes, 0); - - return rnd / (uint.MaxValue + 1.0); - } - - private void GetBytes(byte[] data) - { - RngProvider.GetBytes(data); - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Plugins/Exceptions/CriticalPluginException.cs b/src/ChickenAPI.Core/Plugins/Exceptions/CriticalPluginException.cs deleted file mode 100644 index 75826990..00000000 --- a/src/ChickenAPI.Core/Plugins/Exceptions/CriticalPluginException.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace ChickenAPI.Core.Plugins.Exceptions -{ - /// - /// This exception should be thrown only if you need to stop the software - /// - public class CriticalPluginException : PluginException - { - public CriticalPluginException(IPlugin plugin, string message = "Critical Plugin Exception") : base($"[{plugin.Name}] {message}") => Plugin = plugin; - - public IPlugin Plugin { get; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Plugins/Exceptions/PluginException.cs b/src/ChickenAPI.Core/Plugins/Exceptions/PluginException.cs deleted file mode 100644 index ee4bf6b4..00000000 --- a/src/ChickenAPI.Core/Plugins/Exceptions/PluginException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace ChickenAPI.Core.Plugins.Exceptions -{ - public class PluginException : Exception - { - public PluginException(string message) : base(message) - { - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Plugins/IPlugin.cs b/src/ChickenAPI.Core/Plugins/IPlugin.cs deleted file mode 100644 index ee044d30..00000000 --- a/src/ChickenAPI.Core/Plugins/IPlugin.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace ChickenAPI.Core.Plugins -{ - public interface IPlugin - { - PluginEnableTime EnableTime { get; } - - /// - /// Name of the plugin - /// - string Name { get; } - - /// - /// Called when this plugin is disabled - /// - void OnDisable(); - - /// - /// Called when this plugin is enabled - /// - void OnEnable(); - - /// - /// Called when this plugin is loaded but before it has been enabled - /// - void OnLoad(); - - void ReloadConfig(); - void SaveConfig(); - void SaveDefaultConfig(); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Plugins/IPluginConfiguration.cs b/src/ChickenAPI.Core/Plugins/IPluginConfiguration.cs deleted file mode 100644 index b6ff0bce..00000000 --- a/src/ChickenAPI.Core/Plugins/IPluginConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.IO; - -namespace ChickenAPI.Core.Plugins -{ - public interface IPluginConfiguration - { - void Load(FileInfo file); - void Load(string filePath); - - void Save(FileInfo file); - void Save(string filePath); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Plugins/IPluginManager.cs b/src/ChickenAPI.Core/Plugins/IPluginManager.cs deleted file mode 100644 index a305d404..00000000 --- a/src/ChickenAPI.Core/Plugins/IPluginManager.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.IO; - -namespace ChickenAPI.Core.Plugins -{ - public interface IPluginManager - { - IPlugin[] LoadPlugin(FileInfo file); - IPlugin[] LoadPlugins(DirectoryInfo directory); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Plugins/PluginEnableTime.cs b/src/ChickenAPI.Core/Plugins/PluginEnableTime.cs deleted file mode 100644 index 8cdc2b5f..00000000 --- a/src/ChickenAPI.Core/Plugins/PluginEnableTime.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ChickenAPI.Core.Plugins -{ - public enum PluginEnableTime - { - PreContainerBuild, - PostContainerBuild - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/AssemblyExtensions.cs b/src/ChickenAPI.Core/Utils/AssemblyExtensions.cs deleted file mode 100644 index 67d7e079..00000000 --- a/src/ChickenAPI.Core/Utils/AssemblyExtensions.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace ChickenAPI.Core.Utils -{ - public static class AssemblyExtensions - { - public static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) - { - if (generic == toCheck) return false; - while (toCheck != null && toCheck != typeof(object)) - { - Type cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck; - if (generic == cur) - { - return true; - } - - toCheck = toCheck.BaseType; - } - - return false; - } - - public static List GetTypesImplementingInterface(this Assembly assembly, params Type[] types) - { - List list = new List(); - foreach (Type type in types) - { - list.AddRange(assembly.GetTypesImplementingInterface(type)); - } - - return list; - } - - public static List GetTypesImplementingInterface(this Assembly assembly) - { - return assembly.GetTypesImplementingInterface(typeof(T)); - } - - public static List GetTypesImplementingInterface(this Assembly assembly, Type type) - { - List list = new List(); - list.AddRange(assembly.GetTypes().Where(s => s.ImplementsInterface(type))); - - return list; - } - - public static bool ImplementsInterface(this Type type) - { - return type.GetInterfaces().Any(s => s == typeof(T)); - } - - public static bool ImplementsInterface(this Type type, Type interfaceType) - { - return type.GetInterfaces().Any(s => s == interfaceType); - } - - public static List GetTypesImplementingGenericClass(this Assembly assembly, params Type[] types) - { - List list = new List(); - foreach (Type type in types) - { - list.AddRange(assembly.GetTypesImplementingGenericClass(type)); - } - - return list; - } - - public static List GetTypesImplementingGenericClass(this Assembly assembly, Type type) - { - return assembly.GetTypes().Where(s => IsSubclassOfRawGeneric(type, s)).ToList(); - } - - public static List GetTypesDerivedFrom(this Assembly assembly) - { - return assembly.GetTypes().Where(s => s.IsSubclassOf(typeof(T))).ToList(); - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/ConfigurationHelper.cs b/src/ChickenAPI.Core/Utils/ConfigurationHelper.cs deleted file mode 100644 index d08e256a..00000000 --- a/src/ChickenAPI.Core/Utils/ConfigurationHelper.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.IO; -using Newtonsoft.Json; - -namespace ChickenAPI.Core.Utils -{ - public class ConfigurationHelper - { - public static T Load(string path) where T : class, new() => Load(path, false); - - public static T Load(string path, bool createIfNotExists) where T : class, new() - { - if (!File.Exists(path)) - { - if (createIfNotExists) - { - Save(path, new T()); - } - else - { - throw new IOException(path); - } - } - - string fileContent = File.ReadAllText(path); - - return JsonConvert.DeserializeObject(fileContent); - } - - public static void Save(string path, T value) - { - if (!Directory.Exists(path)) - { - Directory.CreateDirectory(Path.GetDirectoryName(path)); - } - - string valueSerialized = JsonConvert.SerializeObject(value, Formatting.Indented); - - File.WriteAllText(path, valueSerialized); - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/EventHandlerWithoutArgs.cs b/src/ChickenAPI.Core/Utils/EventHandlerWithoutArgs.cs deleted file mode 100644 index b9734dca..00000000 --- a/src/ChickenAPI.Core/Utils/EventHandlerWithoutArgs.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace ChickenAPI.Core.Utils -{ - public delegate void EventHandlerWithoutArgs(TSender sender) where TSender : class; -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/Position.cs b/src/ChickenAPI.Core/Utils/Position.cs deleted file mode 100644 index 9dac547b..00000000 --- a/src/ChickenAPI.Core/Utils/Position.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace ChickenAPI.Core.Utils -{ - public class Position : IEquatable> - { - public Position(T x, T y) - { - X = x; - Y = y; - } - - public Position() - { - } - - public T X { get; set; } - public T Y { get; set; } - - public bool Equals(Position other) - { - if (other is null) - { - return false; - } - - if (ReferenceEquals(this, other)) - { - return true; - } - - return EqualityComparer.Default.Equals(X, other.X) && EqualityComparer.Default.Equals(Y, other.Y); - } - - public static bool operator ==(Position obj1, Position obj2) - { - if (ReferenceEquals(obj1, obj2)) - { - return true; - } - - if (obj1 is null) - { - return false; - } - - if (obj2 is null) - { - return false; - } - - return EqualityComparer.Default.Equals(obj1.X, obj2.X) && EqualityComparer.Default.Equals(obj1.Y, obj2.Y); - } - - public static bool operator !=(Position obj1, Position obj2) => !(obj1 == obj2); - - public override bool Equals(object obj) - { - if (obj is null) - { - return false; - } - - if (ReferenceEquals(this, obj)) - { - return true; - } - - return obj.GetType() == GetType() && Equals((Position)obj); - } - - public override int GetHashCode() - { - unchecked - { - return EqualityComparer.Default.GetHashCode(X) * 397 ^ EqualityComparer.Default.GetHashCode(Y); - } - } - - public override string ToString() => "(" + X + "," + Y + ")"; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/PositionHelper.cs b/src/ChickenAPI.Core/Utils/PositionHelper.cs deleted file mode 100644 index d7199385..00000000 --- a/src/ChickenAPI.Core/Utils/PositionHelper.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace ChickenAPI.Core.Utils -{ - public static class PositionHelper - { - public static double Octile(int x, int y) - { - int min = Math.Min(x, y); - int max = Math.Max(x, y); - return min * Math.Sqrt(2) + max - min; - } - - public static int GetDistance(Position src, short x, short y) => (int)Octile(Math.Abs(src.X - x), Math.Abs(src.Y - y)); - - public static int GetDistance(Position src, Position dest) => (int)Octile(Math.Abs(src.X - dest.X), Math.Abs(src.Y - dest.Y)); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/StringExtensions.cs b/src/ChickenAPI.Core/Utils/StringExtensions.cs deleted file mode 100644 index ef6e5be5..00000000 --- a/src/ChickenAPI.Core/Utils/StringExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Linq; -using System.Security.Cryptography; -using System.Text; - -namespace ChickenAPI.Core.Utils -{ - public static class StringExtensions - { - public static string ToSha512(this string str) - { - using (SHA512 hash = SHA512.Create()) - { - return string.Concat(hash.ComputeHash(Encoding.UTF8.GetBytes(str)).Select(item => item.ToString("x2"))); - } - } - - public static string Truncate(this string str, int length) => str.Length > length ? str.Substring(0, length) : str; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/Utils/TypedSenderEventHandler.cs b/src/ChickenAPI.Core/Utils/TypedSenderEventHandler.cs deleted file mode 100644 index e6a18e20..00000000 --- a/src/ChickenAPI.Core/Utils/TypedSenderEventHandler.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace ChickenAPI.Core.Utils -{ - public delegate void TypedSenderEventHandler(TSender sender, TEventArgs e) - where TSender : class - where TEventArgs : EventArgs; -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/i18n/ILogLanguageService.cs b/src/ChickenAPI.Core/i18n/ILogLanguageService.cs deleted file mode 100644 index df243cd9..00000000 --- a/src/ChickenAPI.Core/i18n/ILogLanguageService.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace ChickenAPI.Core.i18n -{ - public interface ILogLanguageService - { - /// - /// Will return the string by its key & region - /// Used for ChickenAPI mainly - /// - /// - /// - /// - string GetLanguage(LogI18NKeys key, LanguageKey type); - - /// - /// Will register the key and value by its region type - /// Used for ChickenAPI mainly - /// - /// - /// - /// - void SetLanguage(LogI18NKeys key, string value, LanguageKey type); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/i18n/LanguageKey.cs b/src/ChickenAPI.Core/i18n/LanguageKey.cs deleted file mode 100644 index f6befc93..00000000 --- a/src/ChickenAPI.Core/i18n/LanguageKey.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace ChickenAPI.Core.i18n -{ - public enum LanguageKey - { - FR, - EN, - DE, - PL, - IT, - ES, - CZ, - TR - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Core/i18n/LogI18NKeys.cs b/src/ChickenAPI.Core/i18n/LogI18NKeys.cs deleted file mode 100644 index 82f018dc..00000000 --- a/src/ChickenAPI.Core/i18n/LogI18NKeys.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace ChickenAPI.Core.i18n -{ - public enum LogI18NKeys - { - - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Data/Account/AccountDto.cs b/src/ChickenAPI.Data/Account/AccountDto.cs index f263eea1..cb2f73ce 100644 --- a/src/ChickenAPI.Data/Account/AccountDto.cs +++ b/src/ChickenAPI.Data/Account/AccountDto.cs @@ -1,5 +1,5 @@ using ChickenAPI.Core.i18n; -using ChickenAPI.Enums; +using ChickenAPI.Data.Enums; namespace ChickenAPI.Data.Account { diff --git a/src/ChickenAPI.Data/BCard/BCardDto.cs b/src/ChickenAPI.Data/BCard/BCardDto.cs index f1a25f07..8a549485 100644 --- a/src/ChickenAPI.Data/BCard/BCardDto.cs +++ b/src/ChickenAPI.Data/BCard/BCardDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; namespace ChickenAPI.Data.BCard { diff --git a/src/ChickenAPI.Data/BCard/IBCardService.cs b/src/ChickenAPI.Data/BCard/IBCardService.cs index 46fc9c81..940374b0 100644 --- a/src/ChickenAPI.Data/BCard/IBCardService.cs +++ b/src/ChickenAPI.Data/BCard/IBCardService.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; namespace ChickenAPI.Data.BCard { diff --git a/src/ChickenAPI.Data/Character/CharacterDto.cs b/src/ChickenAPI.Data/Character/CharacterDto.cs index 68939f40..07b5b8cc 100644 --- a/src/ChickenAPI.Data/Character/CharacterDto.cs +++ b/src/ChickenAPI.Data/Character/CharacterDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Character diff --git a/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs b/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs index 3b4e22e2..7c327901 100644 --- a/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs +++ b/src/ChickenAPI.Data/Character/CharacterFamilyDto.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Game.Families; +using ChickenAPI.Data.Enums.Game.Families; using FamilyAuthority = ChickenAPI.Packets.Enumerations.FamilyAuthority; namespace ChickenAPI.Data.Character diff --git a/src/ChickenAPI.Data/Character/CharacterMateDto.cs b/src/ChickenAPI.Data/Character/CharacterMateDto.cs index be36f20a..818f2dc2 100644 --- a/src/ChickenAPI.Data/Character/CharacterMateDto.cs +++ b/src/ChickenAPI.Data/Character/CharacterMateDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Data/Character/IAlgorithmService.cs b/src/ChickenAPI.Data/Character/IAlgorithmService.cs index dda259f0..ac12741a 100644 --- a/src/ChickenAPI.Data/Character/IAlgorithmService.cs +++ b/src/ChickenAPI.Data/Character/IAlgorithmService.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Data/Character/ICharacterService.cs b/src/ChickenAPI.Data/Character/ICharacterService.cs index fad1522d..50d86184 100644 --- a/src/ChickenAPI.Data/Character/ICharacterService.cs +++ b/src/ChickenAPI.Data/Character/ICharacterService.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; namespace ChickenAPI.Data.Character { diff --git a/src/ChickenAPI.Data/ChickenAPI.Data.csproj b/src/ChickenAPI.Data/ChickenAPI.Data.csproj index 370579e7..e99a5613 100644 --- a/src/ChickenAPI.Data/ChickenAPI.Data.csproj +++ b/src/ChickenAPI.Data/ChickenAPI.Data.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/ChickenAPI.Data/Drop/DropDto.cs b/src/ChickenAPI.Data/Drop/DropDto.cs index 8b9bafb3..daf54856 100644 --- a/src/ChickenAPI.Data/Drop/DropDto.cs +++ b/src/ChickenAPI.Data/Drop/DropDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Drop; +using ChickenAPI.Data.Enums.Game.Drop; namespace ChickenAPI.Data.Drop { diff --git a/src/ChickenAPI.Enums/AuthResponse.cs b/src/ChickenAPI.Data/Enums/AuthResponse.cs similarity index 89% rename from src/ChickenAPI.Enums/AuthResponse.cs rename to src/ChickenAPI.Data/Enums/AuthResponse.cs index b2071193..66740319 100644 --- a/src/ChickenAPI.Enums/AuthResponse.cs +++ b/src/ChickenAPI.Data/Enums/AuthResponse.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums +namespace ChickenAPI.Data.Enums { public enum AuthResponse { diff --git a/src/ChickenAPI.Enums/AuthenticationState.cs b/src/ChickenAPI.Data/Enums/AuthenticationState.cs similarity index 89% rename from src/ChickenAPI.Enums/AuthenticationState.cs rename to src/ChickenAPI.Data/Enums/AuthenticationState.cs index a6c8a9f4..5526731e 100644 --- a/src/ChickenAPI.Enums/AuthenticationState.cs +++ b/src/ChickenAPI.Data/Enums/AuthenticationState.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums +namespace ChickenAPI.Data.Enums { public enum AuthenticationState { diff --git a/src/ChickenAPI.Enums/AuthorityType.cs b/src/ChickenAPI.Data/Enums/AuthorityType.cs similarity index 89% rename from src/ChickenAPI.Enums/AuthorityType.cs rename to src/ChickenAPI.Data/Enums/AuthorityType.cs index 97a5a96f..98a2db0c 100644 --- a/src/ChickenAPI.Enums/AuthorityType.cs +++ b/src/ChickenAPI.Data/Enums/AuthorityType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums +namespace ChickenAPI.Data.Enums { /// /// Account basic groups diff --git a/src/ChickenAPI.Enums/Game/BCard/BCardRelationType.cs b/src/ChickenAPI.Data/Enums/Game/BCard/BCardRelationType.cs similarity index 73% rename from src/ChickenAPI.Enums/Game/BCard/BCardRelationType.cs rename to src/ChickenAPI.Data/Enums/Game/BCard/BCardRelationType.cs index 1fa01736..4089f932 100644 --- a/src/ChickenAPI.Enums/Game/BCard/BCardRelationType.cs +++ b/src/ChickenAPI.Data/Enums/Game/BCard/BCardRelationType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.BCard +namespace ChickenAPI.Data.Enums.Game.BCard { public enum BCardRelationType { diff --git a/src/ChickenAPI.Enums/Game/BCard/BCardType.cs b/src/ChickenAPI.Data/Enums/Game/BCard/BCardType.cs similarity index 98% rename from src/ChickenAPI.Enums/Game/BCard/BCardType.cs rename to src/ChickenAPI.Data/Enums/Game/BCard/BCardType.cs index e99fbc3c..0b552195 100644 --- a/src/ChickenAPI.Enums/Game/BCard/BCardType.cs +++ b/src/ChickenAPI.Data/Enums/Game/BCard/BCardType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.BCard +namespace ChickenAPI.Data.Enums.Game.BCard { public enum BCardType { diff --git a/src/ChickenAPI.Enums/Game/BCard/BCard_Additional.cs b/src/ChickenAPI.Data/Enums/Game/BCard/BCard_Additional.cs similarity index 99% rename from src/ChickenAPI.Enums/Game/BCard/BCard_Additional.cs rename to src/ChickenAPI.Data/Enums/Game/BCard/BCard_Additional.cs index 9adb9d06..ac5c60f9 100644 --- a/src/ChickenAPI.Enums/Game/BCard/BCard_Additional.cs +++ b/src/ChickenAPI.Data/Enums/Game/BCard/BCard_Additional.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.BCard +namespace ChickenAPI.Data.Enums.Game.BCard { public static class BCardSubTypes { diff --git a/src/ChickenAPI.Enums/Game/Buffs/BuffType.cs b/src/ChickenAPI.Data/Enums/Game/Buffs/BuffType.cs similarity index 67% rename from src/ChickenAPI.Enums/Game/Buffs/BuffType.cs rename to src/ChickenAPI.Data/Enums/Game/Buffs/BuffType.cs index c2a34710..a1189451 100644 --- a/src/ChickenAPI.Enums/Game/Buffs/BuffType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Buffs/BuffType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Buffs +namespace ChickenAPI.Data.Enums.Game.Buffs { public enum BuffType { diff --git a/src/ChickenAPI.Enums/Game/Character/ChannelColor.cs b/src/ChickenAPI.Data/Enums/Game/Character/ChannelColor.cs similarity index 72% rename from src/ChickenAPI.Enums/Game/Character/ChannelColor.cs rename to src/ChickenAPI.Data/Enums/Game/Character/ChannelColor.cs index 0c8e0126..25cb75ad 100644 --- a/src/ChickenAPI.Enums/Game/Character/ChannelColor.cs +++ b/src/ChickenAPI.Data/Enums/Game/Character/ChannelColor.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Character +namespace ChickenAPI.Data.Enums.Game.Character { public enum ChannelColor : byte { diff --git a/src/ChickenAPI.Enums/Game/Character/CharacterNameAppearance.cs b/src/ChickenAPI.Data/Enums/Game/Character/CharacterNameAppearance.cs similarity index 78% rename from src/ChickenAPI.Enums/Game/Character/CharacterNameAppearance.cs rename to src/ChickenAPI.Data/Enums/Game/Character/CharacterNameAppearance.cs index 38bd9750..7a661ff3 100644 --- a/src/ChickenAPI.Enums/Game/Character/CharacterNameAppearance.cs +++ b/src/ChickenAPI.Data/Enums/Game/Character/CharacterNameAppearance.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Character +namespace ChickenAPI.Data.Enums.Game.Character { public enum CharacterNameAppearance { diff --git a/src/ChickenAPI.Enums/Game/Character/CharacterOption.cs b/src/ChickenAPI.Data/Enums/Game/Character/CharacterOption.cs similarity index 89% rename from src/ChickenAPI.Enums/Game/Character/CharacterOption.cs rename to src/ChickenAPI.Data/Enums/Game/Character/CharacterOption.cs index 91ba0588..fe2212da 100644 --- a/src/ChickenAPI.Enums/Game/Character/CharacterOption.cs +++ b/src/ChickenAPI.Data/Enums/Game/Character/CharacterOption.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Character +namespace ChickenAPI.Data.Enums.Game.Character { public enum CharacterOption { diff --git a/src/ChickenAPI.Enums/Game/Character/CharacterState.cs b/src/ChickenAPI.Data/Enums/Game/Character/CharacterState.cs similarity index 69% rename from src/ChickenAPI.Enums/Game/Character/CharacterState.cs rename to src/ChickenAPI.Data/Enums/Game/Character/CharacterState.cs index fe9898bf..2f67de50 100644 --- a/src/ChickenAPI.Enums/Game/Character/CharacterState.cs +++ b/src/ChickenAPI.Data/Enums/Game/Character/CharacterState.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Character +namespace ChickenAPI.Data.Enums.Game.Character { public enum CharacterState : byte { diff --git a/src/ChickenAPI.Enums/Game/Character/MinilandState.cs b/src/ChickenAPI.Data/Enums/Game/Character/MinilandState.cs similarity index 68% rename from src/ChickenAPI.Enums/Game/Character/MinilandState.cs rename to src/ChickenAPI.Data/Enums/Game/Character/MinilandState.cs index a9840fac..7d785f5d 100644 --- a/src/ChickenAPI.Enums/Game/Character/MinilandState.cs +++ b/src/ChickenAPI.Data/Enums/Game/Character/MinilandState.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Character +namespace ChickenAPI.Data.Enums.Game.Character { public enum MinilandState : byte { diff --git a/src/ChickenAPI.Enums/Game/Character/ReputationIconType.cs b/src/ChickenAPI.Data/Enums/Game/Character/ReputationIconType.cs similarity index 66% rename from src/ChickenAPI.Enums/Game/Character/ReputationIconType.cs rename to src/ChickenAPI.Data/Enums/Game/Character/ReputationIconType.cs index 7bdaed02..d9dfd045 100644 --- a/src/ChickenAPI.Enums/Game/Character/ReputationIconType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Character/ReputationIconType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Character +namespace ChickenAPI.Data.Enums.Game.Character { public enum ReputationIconType : byte { diff --git a/src/ChickenAPI.Enums/Game/Drop/DropType.cs b/src/ChickenAPI.Data/Enums/Game/Drop/DropType.cs similarity index 67% rename from src/ChickenAPI.Enums/Game/Drop/DropType.cs rename to src/ChickenAPI.Data/Enums/Game/Drop/DropType.cs index 7267e246..d7b0ead7 100644 --- a/src/ChickenAPI.Enums/Game/Drop/DropType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Drop/DropType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Drop +namespace ChickenAPI.Data.Enums.Game.Drop { public enum DropType { diff --git a/src/ChickenAPI.Enums/Game/Effects/EmojiType.cs b/src/ChickenAPI.Data/Enums/Game/Effects/EmojiType.cs similarity index 90% rename from src/ChickenAPI.Enums/Game/Effects/EmojiType.cs rename to src/ChickenAPI.Data/Enums/Game/Effects/EmojiType.cs index d5f77b5c..af833515 100644 --- a/src/ChickenAPI.Enums/Game/Effects/EmojiType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Effects/EmojiType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Effects +namespace ChickenAPI.Data.Enums.Game.Effects { public enum EmojiType { diff --git a/src/ChickenAPI.Enums/Game/Entity/DirectionType.cs b/src/ChickenAPI.Data/Enums/Game/Entity/DirectionType.cs similarity index 79% rename from src/ChickenAPI.Enums/Game/Entity/DirectionType.cs rename to src/ChickenAPI.Data/Enums/Game/Entity/DirectionType.cs index 540dc836..f9b0eed8 100644 --- a/src/ChickenAPI.Enums/Game/Entity/DirectionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Entity/DirectionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Entity +namespace ChickenAPI.Data.Enums.Game.Entity { public enum DirectionType { diff --git a/src/ChickenAPI.Enums/Game/Entity/MateType.cs b/src/ChickenAPI.Data/Enums/Game/Entity/MateType.cs similarity index 64% rename from src/ChickenAPI.Enums/Game/Entity/MateType.cs rename to src/ChickenAPI.Data/Enums/Game/Entity/MateType.cs index 3e78b0ea..5e797928 100644 --- a/src/ChickenAPI.Enums/Game/Entity/MateType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Entity/MateType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Entity +namespace ChickenAPI.Data.Enums.Game.Entity { public enum MateType : byte { diff --git a/src/ChickenAPI.Enums/Game/Entity/MonsterType.cs b/src/ChickenAPI.Data/Enums/Game/Entity/MonsterType.cs similarity index 83% rename from src/ChickenAPI.Enums/Game/Entity/MonsterType.cs rename to src/ChickenAPI.Data/Enums/Game/Entity/MonsterType.cs index d3cdcc48..b8b4aa3e 100644 --- a/src/ChickenAPI.Enums/Game/Entity/MonsterType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Entity/MonsterType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Entity +namespace ChickenAPI.Data.Enums.Game.Entity { public enum MonsterType { diff --git a/src/ChickenAPI.Enums/Game/Entity/NpcMonsterRaceType.cs b/src/ChickenAPI.Data/Enums/Game/Entity/NpcMonsterRaceType.cs similarity index 65% rename from src/ChickenAPI.Enums/Game/Entity/NpcMonsterRaceType.cs rename to src/ChickenAPI.Data/Enums/Game/Entity/NpcMonsterRaceType.cs index b1b84f2f..f74b9d4d 100644 --- a/src/ChickenAPI.Enums/Game/Entity/NpcMonsterRaceType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Entity/NpcMonsterRaceType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Entity +namespace ChickenAPI.Data.Enums.Game.Entity { public enum NpcMonsterRaceType { diff --git a/src/ChickenAPI.Enums/Game/Entity/ReqInfoType.cs b/src/ChickenAPI.Data/Enums/Game/Entity/ReqInfoType.cs similarity index 100% rename from src/ChickenAPI.Enums/Game/Entity/ReqInfoType.cs rename to src/ChickenAPI.Data/Enums/Game/Entity/ReqInfoType.cs diff --git a/src/ChickenAPI.Enums/Game/Families/FamilyLogType.cs b/src/ChickenAPI.Data/Enums/Game/Families/FamilyLogType.cs similarity index 89% rename from src/ChickenAPI.Enums/Game/Families/FamilyLogType.cs rename to src/ChickenAPI.Data/Enums/Game/Families/FamilyLogType.cs index 4c5c01bd..62ce570e 100644 --- a/src/ChickenAPI.Enums/Game/Families/FamilyLogType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Families/FamilyLogType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Families +namespace ChickenAPI.Data.Enums.Game.Families { public enum FamilyLogType { diff --git a/src/ChickenAPI.Enums/Game/Families/FamilyMemberRank.cs b/src/ChickenAPI.Data/Enums/Game/Families/FamilyMemberRank.cs similarity index 92% rename from src/ChickenAPI.Enums/Game/Families/FamilyMemberRank.cs rename to src/ChickenAPI.Data/Enums/Game/Families/FamilyMemberRank.cs index 967373e6..2f3bc549 100644 --- a/src/ChickenAPI.Enums/Game/Families/FamilyMemberRank.cs +++ b/src/ChickenAPI.Data/Enums/Game/Families/FamilyMemberRank.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Families +namespace ChickenAPI.Data.Enums.Game.Families { public enum FamilyMemberRank { diff --git a/src/ChickenAPI.Enums/Game/Groups/GroupDropType.cs b/src/ChickenAPI.Data/Enums/Game/Groups/GroupDropType.cs similarity index 75% rename from src/ChickenAPI.Enums/Game/Groups/GroupDropType.cs rename to src/ChickenAPI.Data/Enums/Game/Groups/GroupDropType.cs index 135d75d4..fcf2b3ea 100644 --- a/src/ChickenAPI.Enums/Game/Groups/GroupDropType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Groups/GroupDropType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Groups +namespace ChickenAPI.Data.Enums.Game.Groups { public enum GroupDropType { diff --git a/src/ChickenAPI.Enums/Game/Items/ArmorOptionType.cs b/src/ChickenAPI.Data/Enums/Game/Items/ArmorOptionType.cs similarity index 97% rename from src/ChickenAPI.Enums/Game/Items/ArmorOptionType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/ArmorOptionType.cs index b401e796..50336b08 100644 --- a/src/ChickenAPI.Enums/Game/Items/ArmorOptionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/ArmorOptionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum ArmorOptionType { diff --git a/src/ChickenAPI.Enums/Game/Items/EquipmentOptionType.cs b/src/ChickenAPI.Data/Enums/Game/Items/EquipmentOptionType.cs similarity index 66% rename from src/ChickenAPI.Enums/Game/Items/EquipmentOptionType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/EquipmentOptionType.cs index 7d619aab..5fe20293 100644 --- a/src/ChickenAPI.Enums/Game/Items/EquipmentOptionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/EquipmentOptionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum EquipmentOptionType { diff --git a/src/ChickenAPI.Enums/Game/Items/EquipmentType.cs b/src/ChickenAPI.Data/Enums/Game/Items/EquipmentType.cs similarity index 89% rename from src/ChickenAPI.Enums/Game/Items/EquipmentType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/EquipmentType.cs index f85b0e09..eba8df3f 100644 --- a/src/ChickenAPI.Enums/Game/Items/EquipmentType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/EquipmentType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum EquipmentType : byte { diff --git a/src/ChickenAPI.Enums/Game/Items/ItemClassType.cs b/src/ChickenAPI.Data/Enums/Game/Items/ItemClassType.cs similarity index 74% rename from src/ChickenAPI.Enums/Game/Items/ItemClassType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/ItemClassType.cs index b5f7a101..70c5d6ce 100644 --- a/src/ChickenAPI.Enums/Game/Items/ItemClassType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/ItemClassType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum ItemClassType { diff --git a/src/ChickenAPI.Enums/Game/Items/ItemType.cs b/src/ChickenAPI.Data/Enums/Game/Items/ItemType.cs similarity index 93% rename from src/ChickenAPI.Enums/Game/Items/ItemType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/ItemType.cs index 7736098c..0b91e3c1 100644 --- a/src/ChickenAPI.Enums/Game/Items/ItemType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/ItemType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum ItemType : byte { diff --git a/src/ChickenAPI.Enums/Game/Items/ItemWearType.cs b/src/ChickenAPI.Data/Enums/Game/Items/ItemWearType.cs similarity index 64% rename from src/ChickenAPI.Enums/Game/Items/ItemWearType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/ItemWearType.cs index 779f9417..ac431fd4 100644 --- a/src/ChickenAPI.Enums/Game/Items/ItemWearType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/ItemWearType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum ItemWearType { diff --git a/src/ChickenAPI.Enums/Game/Items/JewelOptionType.cs b/src/ChickenAPI.Data/Enums/Game/Items/JewelOptionType.cs similarity index 78% rename from src/ChickenAPI.Enums/Game/Items/JewelOptionType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/JewelOptionType.cs index f0f81114..43230ebd 100644 --- a/src/ChickenAPI.Enums/Game/Items/JewelOptionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/JewelOptionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum JewelOptionType { diff --git a/src/ChickenAPI.Enums/Game/Items/Upgrade/FixedUpModeType.cs b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/FixedUpModeType.cs similarity index 60% rename from src/ChickenAPI.Enums/Game/Items/Upgrade/FixedUpModeType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/Upgrade/FixedUpModeType.cs index 7f409286..6d9a02f3 100644 --- a/src/ChickenAPI.Enums/Game/Items/Upgrade/FixedUpModeType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/FixedUpModeType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items.Upgrade { public enum FixedUpMode { diff --git a/src/ChickenAPI.Enums/Game/Items/Upgrade/RarifyModeType.cs b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/RarifyModeType.cs similarity index 68% rename from src/ChickenAPI.Enums/Game/Items/Upgrade/RarifyModeType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/Upgrade/RarifyModeType.cs index 38fcaad7..f760fb0b 100644 --- a/src/ChickenAPI.Enums/Game/Items/Upgrade/RarifyModeType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/RarifyModeType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items.Upgrade { public enum RarifyMode { diff --git a/src/ChickenAPI.Enums/Game/Items/Upgrade/RarifyProtectionType.cs b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/RarifyProtectionType.cs similarity index 78% rename from src/ChickenAPI.Enums/Game/Items/Upgrade/RarifyProtectionType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/Upgrade/RarifyProtectionType.cs index f25eb2c0..8cebbc2a 100644 --- a/src/ChickenAPI.Enums/Game/Items/Upgrade/RarifyProtectionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/RarifyProtectionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items.Upgrade { public enum RarifyProtection { diff --git a/src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeModeType.cs b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeModeType.cs similarity index 62% rename from src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeModeType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeModeType.cs index 70ade927..482963ac 100644 --- a/src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeModeType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeModeType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items.Upgrade { public enum UpgradeMode { diff --git a/src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeProtectionType.cs b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeProtectionType.cs similarity index 60% rename from src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeProtectionType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeProtectionType.cs index 9ddb439f..01134f29 100644 --- a/src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeProtectionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeProtectionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items.Upgrade { public enum UpgradeProtection { diff --git a/src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeTypeEvent.cs b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeTypeEvent.cs similarity index 60% rename from src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeTypeEvent.cs rename to src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeTypeEvent.cs index 7c342972..489921f6 100644 --- a/src/ChickenAPI.Enums/Game/Items/Upgrade/UpgradeTypeEvent.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/Upgrade/UpgradeTypeEvent.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items.Upgrade { public enum UpgradeTypeEvent { diff --git a/src/ChickenAPI.Enums/Game/Items/WeaponOptionLevelType.cs b/src/ChickenAPI.Data/Enums/Game/Items/WeaponOptionLevelType.cs similarity index 69% rename from src/ChickenAPI.Enums/Game/Items/WeaponOptionLevelType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/WeaponOptionLevelType.cs index 8c23f681..526f689d 100644 --- a/src/ChickenAPI.Enums/Game/Items/WeaponOptionLevelType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/WeaponOptionLevelType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum WeaponOptionLevelType : byte { diff --git a/src/ChickenAPI.Enums/Game/Items/WeaponOptionType.cs b/src/ChickenAPI.Data/Enums/Game/Items/WeaponOptionType.cs similarity index 97% rename from src/ChickenAPI.Enums/Game/Items/WeaponOptionType.cs rename to src/ChickenAPI.Data/Enums/Game/Items/WeaponOptionType.cs index 0cbcbe68..88745b1c 100644 --- a/src/ChickenAPI.Enums/Game/Items/WeaponOptionType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Items/WeaponOptionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Items +namespace ChickenAPI.Data.Enums.Game.Items { public enum WeaponOptionType : byte { diff --git a/src/ChickenAPI.Enums/Game/Maps/MapLayerType.cs b/src/ChickenAPI.Data/Enums/Game/Maps/MapLayerType.cs similarity index 59% rename from src/ChickenAPI.Enums/Game/Maps/MapLayerType.cs rename to src/ChickenAPI.Data/Enums/Game/Maps/MapLayerType.cs index 55a77afe..aadd710a 100644 --- a/src/ChickenAPI.Enums/Game/Maps/MapLayerType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Maps/MapLayerType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Maps +namespace ChickenAPI.Data.Enums.Game.Maps { public enum MapLayerType { diff --git a/src/ChickenAPI.Enums/Game/Mates/SpPartnerRank.cs b/src/ChickenAPI.Data/Enums/Game/Mates/SpPartnerRank.cs similarity index 79% rename from src/ChickenAPI.Enums/Game/Mates/SpPartnerRank.cs rename to src/ChickenAPI.Data/Enums/Game/Mates/SpPartnerRank.cs index eb1f535c..29e6f166 100644 --- a/src/ChickenAPI.Enums/Game/Mates/SpPartnerRank.cs +++ b/src/ChickenAPI.Data/Enums/Game/Mates/SpPartnerRank.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Mates +namespace ChickenAPI.Data.Enums.Game.Mates { public enum SpPartnerRank { diff --git a/src/ChickenAPI.Enums/Game/NosBazaar/NosBazaarCategoryType.cs b/src/ChickenAPI.Data/Enums/Game/NosBazaar/NosBazaarCategoryType.cs similarity index 85% rename from src/ChickenAPI.Enums/Game/NosBazaar/NosBazaarCategoryType.cs rename to src/ChickenAPI.Data/Enums/Game/NosBazaar/NosBazaarCategoryType.cs index 22ea6464..34c7ef63 100644 --- a/src/ChickenAPI.Enums/Game/NosBazaar/NosBazaarCategoryType.cs +++ b/src/ChickenAPI.Data/Enums/Game/NosBazaar/NosBazaarCategoryType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.NosBazaar +namespace ChickenAPI.Data.Enums.Game.NosBazaar { public enum NosBazaarCategoryType { diff --git a/src/ChickenAPI.Enums/Game/NosBazaar/NosBazaarOrderType.cs b/src/ChickenAPI.Data/Enums/Game/NosBazaar/NosBazaarOrderType.cs similarity index 75% rename from src/ChickenAPI.Enums/Game/NosBazaar/NosBazaarOrderType.cs rename to src/ChickenAPI.Data/Enums/Game/NosBazaar/NosBazaarOrderType.cs index c8ab1003..7b483c33 100644 --- a/src/ChickenAPI.Enums/Game/NosBazaar/NosBazaarOrderType.cs +++ b/src/ChickenAPI.Data/Enums/Game/NosBazaar/NosBazaarOrderType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.NosBazaar +namespace ChickenAPI.Data.Enums.Game.NosBazaar { public enum NosBazaarOrderType { diff --git a/src/ChickenAPI.Enums/Game/PlayerSessionState.cs b/src/ChickenAPI.Data/Enums/Game/PlayerSessionState.cs similarity index 73% rename from src/ChickenAPI.Enums/Game/PlayerSessionState.cs rename to src/ChickenAPI.Data/Enums/Game/PlayerSessionState.cs index 0a05fe6a..ddb48ee6 100644 --- a/src/ChickenAPI.Enums/Game/PlayerSessionState.cs +++ b/src/ChickenAPI.Data/Enums/Game/PlayerSessionState.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game +namespace ChickenAPI.Data.Enums.Game { public enum PlayerSessionState { diff --git a/src/ChickenAPI.Enums/Game/Quicklist/QuicklistItemSlotType.cs b/src/ChickenAPI.Data/Enums/Game/Quicklist/QuicklistItemSlotType.cs similarity index 68% rename from src/ChickenAPI.Enums/Game/Quicklist/QuicklistItemSlotType.cs rename to src/ChickenAPI.Data/Enums/Game/Quicklist/QuicklistItemSlotType.cs index 08de7f26..60ecaf24 100644 --- a/src/ChickenAPI.Enums/Game/Quicklist/QuicklistItemSlotType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Quicklist/QuicklistItemSlotType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Quicklist +namespace ChickenAPI.Data.Enums.Game.Quicklist { public enum QuicklistItemSlotType { diff --git a/src/ChickenAPI.Enums/Game/Quicklist/QuicklistSkillSlotType.cs b/src/ChickenAPI.Data/Enums/Game/Quicklist/QuicklistSkillSlotType.cs similarity index 69% rename from src/ChickenAPI.Enums/Game/Quicklist/QuicklistSkillSlotType.cs rename to src/ChickenAPI.Data/Enums/Game/Quicklist/QuicklistSkillSlotType.cs index 6dbc3f30..4eb6a7b9 100644 --- a/src/ChickenAPI.Enums/Game/Quicklist/QuicklistSkillSlotType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Quicklist/QuicklistSkillSlotType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Quicklist +namespace ChickenAPI.Data.Enums.Game.Quicklist { public enum QuicklistSkillSlotType { diff --git a/src/ChickenAPI.Enums/Game/Relations/RelationInvitationProcess.cs b/src/ChickenAPI.Data/Enums/Game/Relations/RelationInvitationProcess.cs similarity index 64% rename from src/ChickenAPI.Enums/Game/Relations/RelationInvitationProcess.cs rename to src/ChickenAPI.Data/Enums/Game/Relations/RelationInvitationProcess.cs index 8ed73e36..4d8b96de 100644 --- a/src/ChickenAPI.Enums/Game/Relations/RelationInvitationProcess.cs +++ b/src/ChickenAPI.Data/Enums/Game/Relations/RelationInvitationProcess.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Relations +namespace ChickenAPI.Data.Enums.Game.Relations { public enum RelationInvitationProcessType { diff --git a/src/ChickenAPI.Enums/Game/Skill/SkillTargetType.cs b/src/ChickenAPI.Data/Enums/Game/Skill/SkillTargetType.cs similarity index 70% rename from src/ChickenAPI.Enums/Game/Skill/SkillTargetType.cs rename to src/ChickenAPI.Data/Enums/Game/Skill/SkillTargetType.cs index 378590a7..c9dc85ce 100644 --- a/src/ChickenAPI.Enums/Game/Skill/SkillTargetType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Skill/SkillTargetType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Skill +namespace ChickenAPI.Data.Enums.Game.Skill { public enum SkillTargetType { diff --git a/src/ChickenAPI.Enums/Game/Visibility/VisibilityType.cs b/src/ChickenAPI.Data/Enums/Game/Visibility/VisibilityType.cs similarity index 61% rename from src/ChickenAPI.Enums/Game/Visibility/VisibilityType.cs rename to src/ChickenAPI.Data/Enums/Game/Visibility/VisibilityType.cs index d95bbfc2..7353bb50 100644 --- a/src/ChickenAPI.Enums/Game/Visibility/VisibilityType.cs +++ b/src/ChickenAPI.Data/Enums/Game/Visibility/VisibilityType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums.Game.Visibility +namespace ChickenAPI.Data.Enums.Game.Visibility { public enum VisibilityType { diff --git a/src/ChickenAPI.Enums/RegionType.cs b/src/ChickenAPI.Data/Enums/RegionType.cs similarity index 80% rename from src/ChickenAPI.Enums/RegionType.cs rename to src/ChickenAPI.Data/Enums/RegionType.cs index 52f49e1a..1f1a7f15 100644 --- a/src/ChickenAPI.Enums/RegionType.cs +++ b/src/ChickenAPI.Data/Enums/RegionType.cs @@ -1,4 +1,4 @@ -namespace ChickenAPI.Enums +namespace ChickenAPI.Data.Enums { public enum RegionType { diff --git a/src/ChickenAPI.Data/Families/FamilyDto.cs b/src/ChickenAPI.Data/Families/FamilyDto.cs index faa2bb42..fed8d917 100644 --- a/src/ChickenAPI.Data/Families/FamilyDto.cs +++ b/src/ChickenAPI.Data/Families/FamilyDto.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Families; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Families { diff --git a/src/ChickenAPI.Data/Item/IItemInstanceService.cs b/src/ChickenAPI.Data/Item/IItemInstanceService.cs index 76fe1bf4..65837d16 100644 --- a/src/ChickenAPI.Data/Item/IItemInstanceService.cs +++ b/src/ChickenAPI.Data/Item/IItemInstanceService.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using ChickenAPI.Data.Character; -using ChickenAPI.Enums; +using ChickenAPI.Data.Enums; namespace ChickenAPI.Data.Item { diff --git a/src/ChickenAPI.Data/Item/ItemDto.cs b/src/ChickenAPI.Data/Item/ItemDto.cs index 14f2e14a..0f212e30 100644 --- a/src/ChickenAPI.Data/Item/ItemDto.cs +++ b/src/ChickenAPI.Data/Item/ItemDto.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Data.Item { diff --git a/src/ChickenAPI.Data/Item/ItemInstanceDto.cs b/src/ChickenAPI.Data/Item/ItemInstanceDto.cs index 92ebc3d0..30afdac5 100644 --- a/src/ChickenAPI.Data/Item/ItemInstanceDto.cs +++ b/src/ChickenAPI.Data/Item/ItemInstanceDto.cs @@ -1,6 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Item diff --git a/src/ChickenAPI.Data/Map/MapMonsterDto.cs b/src/ChickenAPI.Data/Map/MapMonsterDto.cs index f539d83d..79fd6754 100644 --- a/src/ChickenAPI.Data/Map/MapMonsterDto.cs +++ b/src/ChickenAPI.Data/Map/MapMonsterDto.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.NpcMonster; namespace ChickenAPI.Data.Map { diff --git a/src/ChickenAPI.Data/Map/MapNpcDto.cs b/src/ChickenAPI.Data/Map/MapNpcDto.cs index bc8abc07..444db583 100644 --- a/src/ChickenAPI.Data/Map/MapNpcDto.cs +++ b/src/ChickenAPI.Data/Map/MapNpcDto.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.NpcMonster; namespace ChickenAPI.Data.Map { diff --git a/src/ChickenAPI.Data/NpcMonster/INpcMonsterAlgorithmService.cs b/src/ChickenAPI.Data/NpcMonster/INpcMonsterAlgorithmService.cs index 94d2ae2d..668b5bcf 100644 --- a/src/ChickenAPI.Data/NpcMonster/INpcMonsterAlgorithmService.cs +++ b/src/ChickenAPI.Data/NpcMonster/INpcMonsterAlgorithmService.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace ChickenAPI.Data.NpcMonster { diff --git a/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs b/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs index 1bb04c57..b680db91 100644 --- a/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs +++ b/src/ChickenAPI.Data/NpcMonster/NpcMonsterDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.NpcMonster diff --git a/src/ChickenAPI.Data/Relations/IRelationService.cs b/src/ChickenAPI.Data/Relations/IRelationService.cs index 6c18604c..963dca1e 100644 --- a/src/ChickenAPI.Data/Relations/IRelationService.cs +++ b/src/ChickenAPI.Data/Relations/IRelationService.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Relations diff --git a/src/ChickenAPI.Data/Relations/RelationDto.cs b/src/ChickenAPI.Data/Relations/RelationDto.cs index 1769219f..1b21acd6 100644 --- a/src/ChickenAPI.Data/Relations/RelationDto.cs +++ b/src/ChickenAPI.Data/Relations/RelationDto.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Relations diff --git a/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs b/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs index 5d58f299..2e977c93 100644 --- a/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs +++ b/src/ChickenAPI.Data/Relations/RelationInvitationDto.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Data.Relations diff --git a/src/ChickenAPI.Data/Server/PlayerSessionDto.cs b/src/ChickenAPI.Data/Server/PlayerSessionDto.cs index 9101b733..67e4f2b3 100644 --- a/src/ChickenAPI.Data/Server/PlayerSessionDto.cs +++ b/src/ChickenAPI.Data/Server/PlayerSessionDto.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Game; +using ChickenAPI.Data.Enums.Game; namespace ChickenAPI.Data.Server { diff --git a/src/ChickenAPI.Data/Server/WorldServerDto.cs b/src/ChickenAPI.Data/Server/WorldServerDto.cs index e67182f8..51de2409 100644 --- a/src/ChickenAPI.Data/Server/WorldServerDto.cs +++ b/src/ChickenAPI.Data/Server/WorldServerDto.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; namespace ChickenAPI.Data.Server { diff --git a/src/ChickenAPI.Data/Skills/CardDto.cs b/src/ChickenAPI.Data/Skills/CardDto.cs index a5858040..f8dd3a9d 100644 --- a/src/ChickenAPI.Data/Skills/CardDto.cs +++ b/src/ChickenAPI.Data/Skills/CardDto.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Buffs; +using ChickenAPI.Data.Enums.Game.Buffs; namespace ChickenAPI.Data.Skills { diff --git a/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj b/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj deleted file mode 100644 index d8e0b0b4..00000000 --- a/src/ChickenAPI.Enums/ChickenAPI.Enums.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/ChickenAPI.Game.Extensions/Helpers/CellonGeneratorHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/CellonGeneratorHelper.cs index d02bf65d..aec713e3 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/CellonGeneratorHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/CellonGeneratorHelper.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; namespace ChickenAPI.Game.Helpers { diff --git a/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs b/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs index da4b4555..13c03a89 100644 --- a/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs +++ b/src/ChickenAPI.Game.Extensions/Helpers/EmojiHelper.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Effects; +using ChickenAPI.Data.Enums.Game.Effects; using ChickenAPI.Game.Effects; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Packets.ServerPackets.Player; diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs index 700f5d42..83c8d157 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/ChatPacketExtensions.cs @@ -1,5 +1,4 @@ using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs b/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs index 9bf45a69..06e7013c 100644 --- a/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/PacketGeneration/TcInfoPacketExtension.cs @@ -1,12 +1,10 @@ using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Player; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Extensions.PacketGeneration { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs index a924d89f..fdb8451e 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/EInfoPacketExtensions.cs @@ -1,8 +1,8 @@ -using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; +using ChickenAPI.Data.Item; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs index 91143498..12a841f0 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/FdPacketExtension.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Player; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GenerateHeroicShellExtensioncs.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GenerateHeroicShellExtensioncs.cs index 4d4cb9e3..dc531e49 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/GenerateHeroicShellExtensioncs.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/GenerateHeroicShellExtensioncs.cs @@ -3,8 +3,9 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Maths; +using ChickenAPI.Data.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs index 36b08a3c..68f25202 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryGetExtensions.cs @@ -8,7 +8,7 @@ using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs index e9807d44..94ad878a 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/InventoryUseExtension.cs @@ -1,7 +1,7 @@ using System; using ChickenAPI.Data.Item; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs index d587eae8..540ea15b 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/IvnPacketExtension.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs index 12adb9ad..f3e0bf4f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MapLayerInformationsExtensions.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Linq; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs index 7c7d9ecb..075a5500 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/MateExtension.cs @@ -5,7 +5,7 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Game.Entities.Mates; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Extensions; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs index 8792f230..347a1d96 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NInvPacketExtensions.cs @@ -2,8 +2,6 @@ using System.Linq; using System.Text; using ChickenAPI.Data.Shop; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs index 52e3babb..fde17971 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/NotifyResultAndSetRarityPointExtension.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; @@ -8,7 +8,7 @@ using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Extension { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs index fa6c8a0e..fe666348 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PairyPacketExtension.cs @@ -1,9 +1,8 @@ using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.ServerPackets.Inventory; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Entities.Player.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs index 35efed10..e5bc7837 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerExtension.cs @@ -6,9 +6,6 @@ using ChickenAPI.Data.Character; using ChickenAPI.Data.Item; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Families.Extensions; using ChickenAPI.Game.Helpers; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerMatesExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerMatesExtensions.cs index 6428a473..a47bd398 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerMatesExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerMatesExtensions.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Game.Entities.Mates; namespace ChickenAPI.Game.Entities.Player.Extensions diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs index 35409b64..41d063cf 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/PlayerUiExtension.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Families.Extensions; using ChickenAPI.Game.Groups.Extensions; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs index 824f02ad..8b606a5c 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/RestEntityExtensions.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game.Entities.Monster; +using ChickenAPI.Game.Entities.Monster; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Entities; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SetRarityPointExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SetRarityPointExtension.cs index b11e4512..bda4fc8f 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SetRarityPointExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SetRarityPointExtension.cs @@ -2,8 +2,8 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Maths; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; namespace ChickenAPI.Game.Inventory.Extensions { diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs index b4c64caa..c3520584 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/SkillExtensions.cs @@ -6,7 +6,6 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Data.Character; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs index b504900e..46ff63b1 100644 --- a/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs +++ b/src/ChickenAPI.Game.Extensions/_TOCLEAN/TpPacketExtension.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game.Entities.Monster; +using ChickenAPI.Game.Entities.Monster; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements; diff --git a/src/ChickenAPI.Game.Impl/IASystem.cs b/src/ChickenAPI.Game.Impl/IASystem.cs index 00c72577..886b731a 100644 --- a/src/ChickenAPI.Game.Impl/IASystem.cs +++ b/src/ChickenAPI.Game.Impl/IASystem.cs @@ -6,8 +6,8 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Maths; using ChickenAPI.Core.Utils; +using ChickenAPI.Data.Enums.Game.Skill; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Skill; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Maps; using ChickenAPI.Game.Skills.Args; diff --git a/src/ChickenAPI.Game.Impl/ItemDropEntity.cs b/src/ChickenAPI.Game.Impl/ItemDropEntity.cs index d54f2ccd..e070b8ab 100644 --- a/src/ChickenAPI.Game.Impl/ItemDropEntity.cs +++ b/src/ChickenAPI.Game.Impl/ItemDropEntity.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game.Impl/MateEntity.cs b/src/ChickenAPI.Game.Impl/MateEntity.cs index a1cd1ccf..60236141 100644 --- a/src/ChickenAPI.Game.Impl/MateEntity.cs +++ b/src/ChickenAPI.Game.Impl/MateEntity.cs @@ -3,10 +3,10 @@ using System.Linq; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Visibility; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Buffs; using ChickenAPI.Game.Entities.Player; diff --git a/src/ChickenAPI.Game.Impl/MonsterEntity.cs b/src/ChickenAPI.Game.Impl/MonsterEntity.cs index 214d0532..6e17dc7b 100644 --- a/src/ChickenAPI.Game.Impl/MonsterEntity.cs +++ b/src/ChickenAPI.Game.Impl/MonsterEntity.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.Linq; using ChickenAPI.Core.Utils; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Visibility; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Buffs; using ChickenAPI.Game.Movements.DataObjects; diff --git a/src/ChickenAPI.Game.Impl/MovableComponent.cs b/src/ChickenAPI.Game.Impl/MovableComponent.cs index 1e63de84..45f9c212 100644 --- a/src/ChickenAPI.Game.Impl/MovableComponent.cs +++ b/src/ChickenAPI.Game.Impl/MovableComponent.cs @@ -4,7 +4,7 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Movements.Extensions; using ChickenAPI.Game._ECS.Components; diff --git a/src/ChickenAPI.Game.Impl/MovableSystem.cs b/src/ChickenAPI.Game.Impl/MovableSystem.cs index 0ef9f60e..022e83ab 100644 --- a/src/ChickenAPI.Game.Impl/MovableSystem.cs +++ b/src/ChickenAPI.Game.Impl/MovableSystem.cs @@ -3,7 +3,6 @@ using System.Linq.Expressions; using ChickenAPI.Core.Logging; using ChickenAPI.Core.Utils; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.IAs; using ChickenAPI.Game._ECS.Entities; diff --git a/src/ChickenAPI.Game.Impl/NpcEntity.cs b/src/ChickenAPI.Game.Impl/NpcEntity.cs index 5874a7b5..e54f5c25 100644 --- a/src/ChickenAPI.Game.Impl/NpcEntity.cs +++ b/src/ChickenAPI.Game.Impl/NpcEntity.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Linq; using ChickenAPI.Core.Utils; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Shop; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Visibility; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Buffs; using ChickenAPI.Game.Entities.Monster; diff --git a/src/ChickenAPI.Game.Impl/PlayerEntity.cs b/src/ChickenAPI.Game.Impl/PlayerEntity.cs index 2c57d191..f74526e8 100644 --- a/src/ChickenAPI.Game.Impl/PlayerEntity.cs +++ b/src/ChickenAPI.Game.Impl/PlayerEntity.cs @@ -6,13 +6,13 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Utils; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums; +using ChickenAPI.Data.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Data.Families; using ChickenAPI.Data.Item; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Visibility; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Buffs; using ChickenAPI.Game.Entities.Mates; @@ -35,7 +35,7 @@ using ChickenAPI.Game._Network; using ChickenAPI.Packets.Enumerations; using ChickenAPI.Packets.Interfaces; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace ChickenAPI.Game.Entities.Player { diff --git a/src/ChickenAPI.Game.Impl/RespawnSystem.cs b/src/ChickenAPI.Game.Impl/RespawnSystem.cs index a0dc5afb..290b87da 100644 --- a/src/ChickenAPI.Game.Impl/RespawnSystem.cs +++ b/src/ChickenAPI.Game.Impl/RespawnSystem.cs @@ -1,6 +1,5 @@ using System; using System.Linq.Expressions; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Monster; using ChickenAPI.Game.Entities.Npc; diff --git a/src/ChickenAPI.Game.Impl/SimpleMapLayer.cs b/src/ChickenAPI.Game.Impl/SimpleMapLayer.cs index 67cd5f90..b231aa27 100644 --- a/src/ChickenAPI.Game.Impl/SimpleMapLayer.cs +++ b/src/ChickenAPI.Game.Impl/SimpleMapLayer.cs @@ -8,7 +8,6 @@ using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Shop; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities; using ChickenAPI.Game.Entities.Monster; diff --git a/src/ChickenAPI.Game/BCards/BCardEffectHandlerAttribute.cs b/src/ChickenAPI.Game/BCards/BCardEffectHandlerAttribute.cs index 451f178d..05c2e01a 100644 --- a/src/ChickenAPI.Game/BCards/BCardEffectHandlerAttribute.cs +++ b/src/ChickenAPI.Game/BCards/BCardEffectHandlerAttribute.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; namespace ChickenAPI.Game.BCards { diff --git a/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs b/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs index 6755aef7..a1919a7e 100644 --- a/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs +++ b/src/ChickenAPI.Game/BCards/BasicBCardHandler.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Threading.Tasks; using ChickenAPI.Data.BCard; -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; using ChickenAPI.Game.Battle.Interfaces; namespace ChickenAPI.Game.BCards diff --git a/src/ChickenAPI.Game/BCards/IBCardEffectHandler.cs b/src/ChickenAPI.Game/BCards/IBCardEffectHandler.cs index 39539708..c5b9f8d5 100644 --- a/src/ChickenAPI.Game/BCards/IBCardEffectHandler.cs +++ b/src/ChickenAPI.Game/BCards/IBCardEffectHandler.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Data.BCard; -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; using ChickenAPI.Game.Battle.Interfaces; namespace ChickenAPI.Game.BCards diff --git a/src/ChickenAPI.Game/Buffs/BuffContainer.cs b/src/ChickenAPI.Game/Buffs/BuffContainer.cs index c32bcf62..0e08ac60 100644 --- a/src/ChickenAPI.Game/Buffs/BuffContainer.cs +++ b/src/ChickenAPI.Game/Buffs/BuffContainer.cs @@ -1,6 +1,6 @@ using System; +using ChickenAPI.Data.Enums.Game.Buffs; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Buffs; namespace ChickenAPI.Game.Buffs { diff --git a/src/ChickenAPI.Game/Builders/WeaponOptionBuilder.cs b/src/ChickenAPI.Game/Builders/WeaponOptionBuilder.cs index 1cfb12a5..d477c942 100644 --- a/src/ChickenAPI.Game/Builders/WeaponOptionBuilder.cs +++ b/src/ChickenAPI.Game/Builders/WeaponOptionBuilder.cs @@ -1,6 +1,6 @@ using System; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; namespace ChickenAPI.Game.Builders { diff --git a/src/ChickenAPI.Game/ChickenAPI.Game.csproj b/src/ChickenAPI.Game/ChickenAPI.Game.csproj index 5b691784..5dcb0fcd 100644 --- a/src/ChickenAPI.Game/ChickenAPI.Game.csproj +++ b/src/ChickenAPI.Game/ChickenAPI.Game.csproj @@ -18,12 +18,6 @@ latest - - - - - - @@ -31,6 +25,5 @@ - diff --git a/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs b/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs index e624247a..1a31ade7 100644 --- a/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs +++ b/src/ChickenAPI.Game/Entities/Player/IPlayerEntity.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Threading.Tasks; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Mates; using ChickenAPI.Game.Families; diff --git a/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs b/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs index e86ca859..0dae7225 100644 --- a/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs +++ b/src/ChickenAPI.Game/Entities/Portal/PortalEntity.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using ChickenAPI.Data.Map; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Portals; using ChickenAPI.Game.Visibility; using ChickenAPI.Game._ECS.Components; diff --git a/src/ChickenAPI.Game/Groups/Group.cs b/src/ChickenAPI.Game/Groups/Group.cs index b1f2ea0b..d9d84dcc 100644 --- a/src/ChickenAPI.Game/Groups/Group.cs +++ b/src/ChickenAPI.Game/Groups/Group.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using ChickenAPI.Enums.Game.Groups; +using ChickenAPI.Data.Enums.Game.Groups; using ChickenAPI.Game.Entities.Player; namespace ChickenAPI.Game.Groups diff --git a/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs b/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs index a2c75e21..8503985b 100644 --- a/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs +++ b/src/ChickenAPI.Game/Inventory/Events/InventoryMoveEvent.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Game._Events; +using ChickenAPI.Game._Events; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Inventory.Events diff --git a/src/ChickenAPI.Game/Inventory/Events/InventoryWearEvent.cs b/src/ChickenAPI.Game/Inventory/Events/InventoryWearEvent.cs index 0982ec1a..965216d9 100644 --- a/src/ChickenAPI.Game/Inventory/Events/InventoryWearEvent.cs +++ b/src/ChickenAPI.Game/Inventory/Events/InventoryWearEvent.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game._Events; namespace ChickenAPI.Game.Inventory.Events diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/RarifyEvent.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/RarifyEvent.cs index 94a4f6bd..bcfba5a3 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/RarifyEvent.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/RarifyEvent.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; +using ChickenAPI.Data.Item; using ChickenAPI.Game._Events; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Events diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeEquipment.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeEquipment.cs index 99d06b26..265fa524 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeEquipment.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeEquipment.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; +using ChickenAPI.Data.Item; using ChickenAPI.Game._Events; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Events diff --git a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeSpecialistEvent.cs b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeSpecialistEvent.cs index 13a21c45..594399c1 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeSpecialistEvent.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUpgrade/Events/UpgradeSpecialistEvent.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; +using ChickenAPI.Data.Item; using ChickenAPI.Game._Events; namespace ChickenAPI.Game.Inventory.ItemUpgrade.Events diff --git a/src/ChickenAPI.Game/Inventory/ItemUsage/IUseItemRequestHandlerAsync.cs b/src/ChickenAPI.Game/Inventory/ItemUsage/IUseItemRequestHandlerAsync.cs index 08811a3d..db41bfef 100644 --- a/src/ChickenAPI.Game/Inventory/ItemUsage/IUseItemRequestHandlerAsync.cs +++ b/src/ChickenAPI.Game/Inventory/ItemUsage/IUseItemRequestHandlerAsync.cs @@ -1,6 +1,6 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Game.Entities.Player; using System.Threading.Tasks; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game.Inventory.Events; namespace ChickenAPI.Game.Inventory.ItemUsage diff --git a/src/ChickenAPI.Game/Mates/Events/AddPetEvent.cs b/src/ChickenAPI.Game/Mates/Events/AddPetEvent.cs index f53f2aef..6876ef14 100644 --- a/src/ChickenAPI.Game/Mates/Events/AddPetEvent.cs +++ b/src/ChickenAPI.Game/Mates/Events/AddPetEvent.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Game._Events; namespace ChickenAPI.Game.Mates.Events diff --git a/src/ChickenAPI.Game/Movements/IMovableCapacity.cs b/src/ChickenAPI.Game/Movements/IMovableCapacity.cs index 0b04b2bc..de9f161d 100644 --- a/src/ChickenAPI.Game/Movements/IMovableCapacity.cs +++ b/src/ChickenAPI.Game/Movements/IMovableCapacity.cs @@ -1,6 +1,6 @@ using System; using ChickenAPI.Core.Utils; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Game.Visibility; namespace ChickenAPI.Game.Movements diff --git a/src/ChickenAPI.Game/Relations/Events/RelationInvitationProcessEvent.cs b/src/ChickenAPI.Game/Relations/Events/RelationInvitationProcessEvent.cs index 7a9dd9a7..b6d62b36 100644 --- a/src/ChickenAPI.Game/Relations/Events/RelationInvitationProcessEvent.cs +++ b/src/ChickenAPI.Game/Relations/Events/RelationInvitationProcessEvent.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Game._Events; namespace ChickenAPI.Game.Relations.Events diff --git a/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs b/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs index 5a2fb2cb..b703339e 100644 --- a/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs +++ b/src/ChickenAPI.Game/Relations/Events/RelationInvitationSendEvent.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Relations; -using ChickenAPI.Game._Events; +using ChickenAPI.Game._Events; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Relations.Events diff --git a/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs b/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs index 284d5e18..a3b08352 100644 --- a/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs +++ b/src/ChickenAPI.Game/Shops/Events/ShopBuyEvent.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game._Events; +using ChickenAPI.Game._Events; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Shops.Events diff --git a/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs b/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs index 33e79572..72f87489 100644 --- a/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs +++ b/src/ChickenAPI.Game/Shops/Events/ShowShopEvent.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Game._Events; +using ChickenAPI.Game._Events; using ChickenAPI.Packets.Enumerations; namespace ChickenAPI.Game.Shops.Events diff --git a/src/ChickenAPI.Game/Visibility/IVisibleCapacity.cs b/src/ChickenAPI.Game/Visibility/IVisibleCapacity.cs index 8a0d659b..954aa3a9 100644 --- a/src/ChickenAPI.Game/Visibility/IVisibleCapacity.cs +++ b/src/ChickenAPI.Game/Visibility/IVisibleCapacity.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Visibility; +using ChickenAPI.Data.Enums.Game.Visibility; namespace ChickenAPI.Game.Visibility { diff --git a/src/ChickenAPI.Game/Visibility/VisibilityChangeEventArgs.cs b/src/ChickenAPI.Game/Visibility/VisibilityChangeEventArgs.cs index c1189de3..4892ce39 100644 --- a/src/ChickenAPI.Game/Visibility/VisibilityChangeEventArgs.cs +++ b/src/ChickenAPI.Game/Visibility/VisibilityChangeEventArgs.cs @@ -1,5 +1,5 @@ using System; -using ChickenAPI.Enums.Game.Visibility; +using ChickenAPI.Data.Enums.Game.Visibility; namespace ChickenAPI.Game.Visibility { diff --git a/src/ChickenAPI.Game/Visibility/VisibilityComponent.cs b/src/ChickenAPI.Game/Visibility/VisibilityComponent.cs index f7bdd39f..1bcf2b44 100644 --- a/src/ChickenAPI.Game/Visibility/VisibilityComponent.cs +++ b/src/ChickenAPI.Game/Visibility/VisibilityComponent.cs @@ -1,6 +1,6 @@ using System; using ChickenAPI.Core.Utils; -using ChickenAPI.Enums.Game.Visibility; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._ECS.Entities; diff --git a/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs b/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs index 15ba37d9..69ab8f77 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/EntityBase.cs @@ -5,7 +5,6 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._Events; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs b/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs index aedb192f..5de92ee3 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/EntityManagerBase.cs @@ -4,7 +4,6 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game._ECS.Systems; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs b/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs index 951cd749..1c1ec20d 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/IEntity.cs @@ -1,6 +1,5 @@ using System; using System.Threading.Tasks; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Components; using ChickenAPI.Game._Events; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs b/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs index 51203ca3..dcc53a37 100644 --- a/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs +++ b/src/ChickenAPI.Game/_ECS/Entities/IEntityManager.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game._ECS.Systems; using ChickenAPI.Packets.Enumerations; diff --git a/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs deleted file mode 100644 index ed84083b..00000000 --- a/src/ChickenAPI.Packets/Attributes/PacketClientAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old.Attributes -{ - [AttributeUsage(AttributeTargets.Class)] - public class PacketClientAttribute : Attribute - { - public PacketClientAttribute() - { - } - - /// - /// Packet's header - /// - public string Header { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs deleted file mode 100644 index 8850aaf9..00000000 --- a/src/ChickenAPI.Packets/Attributes/PacketDescriptionAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old.Attributes -{ - [AttributeUsage(AttributeTargets.Class)] - public class PacketDescriptionAttribute : Attribute - { - public PacketDescriptionAttribute() - { - - } - - /// - /// Why this packet is sent and the different actions that are related to it - /// - public string Description { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs deleted file mode 100644 index 9a74c2f3..00000000 --- a/src/ChickenAPI.Packets/Attributes/PacketHeaderAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using ChickenAPI.Enums; - -namespace ChickenAPI.Packets.Old.Attributes -{ - [AttributeUsage(AttributeTargets.Class)] - public class PacketHeaderAttribute : Attribute - { - #region Instantiation - - public PacketHeaderAttribute(string identification) - { - Identification = identification; - NeedCharacter = true; - } - - public PacketHeaderAttribute(string identification, bool needCharacter) - { - Identification = identification; - NeedCharacter = needCharacter; - } - - public PacketHeaderAttribute(string identification, byte amount) - { - Identification = identification; - Amount = amount; - } - - public PacketHeaderAttribute(string identification, byte amount, bool needCharacter) - { - Identification = identification; - Amount = amount; - NeedCharacter = needCharacter; - } - - #endregion - - #region Properties - - /// - /// Permission to handle the packetBase - /// - public AuthorityType Authority { get; set; } - - /// - /// Unique identification of the Packet - /// - public string Identification { get; set; } - - /// - /// Amount of tcp message to create the Packet - /// - public byte Amount { get; set; } - - public bool NeedCharacter { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs deleted file mode 100644 index 34d4a80a..00000000 --- a/src/ChickenAPI.Packets/Attributes/PacketIndexAttribute.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace ChickenAPI.Packets.Old.Attributes -{ - [AttributeUsage(AttributeTargets.Property)] - public class PacketIndexAttribute : Attribute - { - #region Instantiation - - /// - /// Specify the Index of the packetBase to parse this property to. - /// - /// The zero based index starting from header (exclusive). - /// - /// - /// Adds an # to the Header and replaces Spaces with ^ if set to - /// true. - /// - /// - /// Defines if everything from this index should - /// be serialized into the underlying property - /// - /// - /// Removes - /// the separator (.) for packets. - /// - /// - /// - public PacketIndexAttribute(int index, bool isReturnPacket = false, bool serializeToEnd = false, bool removeSeparator = false, string separatorBeforeProperty = " ", - string separatorNestedElements = ".") - { - Index = index; - IsReturnPacket = isReturnPacket; - SerializeToEnd = serializeToEnd; - RemoveSeparator = removeSeparator; - SeparatorBeforeProperty = separatorBeforeProperty; - } - - #endregion - - #region Properties - - /// - /// The zero based index starting from the header (exclusive). - /// - public int Index { get; set; } - - /// - /// Adds an # to the Header and replaces Spaces with ^ - /// - public bool IsReturnPacket { get; set; } - - /// Removes the separator (.) for packets. - public bool RemoveSeparator { get; set; } - - /// - /// Defines if everything from this index should be serialized into the underlying property. - /// - public bool SerializeToEnd { get; set; } - - /// - /// Defines if this property will be added to the packet or not depending if there is a value - /// - public bool IsOptional { get; set; } - - /// - /// Defines the separator that will be used before property (by default : " ") - /// - public string SeparatorBeforeProperty { get; set; } - - /// - /// Defines the separator between every elements of an - /// - public string SeparatorNestedElements { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs deleted file mode 100644 index 4df5d06c..00000000 --- a/src/ChickenAPI.Packets/Attributes/PacketPropertyDescriptionAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old.Attributes -{ - [AttributeUsage(AttributeTargets.Property)] - public class PacketPropertyDescriptionAttribute : Attribute - { - public PacketPropertyDescriptionAttribute() - { - - } - - /// - /// Why is this property done for - /// - public string Description { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs b/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs deleted file mode 100644 index 42eb6292..00000000 --- a/src/ChickenAPI.Packets/Attributes/PacketServerAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old.Attributes -{ - [AttributeUsage(AttributeTargets.Class)] - public class PacketServerAttribute : Attribute - { - public PacketServerAttribute() - { - } - - /// - /// Packet's header - /// - public string Header { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs deleted file mode 100644 index 1dcb2849..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewPacketBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client -{ - [PacketHeader("Char_NEW", false)] - public class CharNewPacketBase : PacketBase - { - [PacketIndex(0)] - public string Name { get; set; } - - [PacketIndex(1)] - public byte Slot { get; set; } - - [PacketIndex(2)] - public GenderType Gender { get; set; } - - [PacketIndex(3)] - public HairStyleType HairStyle { get; set; } - - [PacketIndex(4)] - public HairColorType HairColor { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs deleted file mode 100644 index 53051362..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharNewWrestlerPacketBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client -{ - [PacketHeader("Char_NEW_Job", false)] - public class CharNewWrestlerPacketBase : PacketBase - { - [PacketIndex(0)] - public string Name { get; set; } - - [PacketIndex(1)] - public byte Slot { get; set; } - - [PacketIndex(2)] - public GenderType Gender { get; set; } - - [PacketIndex(3)] - public HairStyleType HairStyle { get; set; } - - [PacketIndex(4)] - public HairColorType HairColor { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs deleted file mode 100644 index 3c085f97..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/CharacterDeletePacketBase.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client -{ - [PacketHeader("Char_DEL", false)] - public class CharacterDeletePacketBase : PacketBase - { - [PacketIndex(0)] - public byte Slot { get; set; } - - [PacketIndex(1)] - public string Password { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs deleted file mode 100644 index 9734e1fd..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/EntryPointPacketBase.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client -{ - [PacketHeader("EntryPoint", 3, false)] - public class EntryPointPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public string Title { get; set; } - - [PacketIndex(1)] - public string Packet1Id { get; set; } - - [PacketIndex(2)] - public string Name { get; set; } - - [PacketIndex(3)] - public string Packet2Id { get; set; } - - [PacketIndex(4)] - public string Password { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs deleted file mode 100644 index 71fa83f2..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/GameStartPacketBase.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client -{ - [PacketHeader("game_start")] - public class GameStartPacketBase : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs deleted file mode 100644 index ec8d46c7..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Client/SelectPacketBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Client -{ - [PacketHeader("select", NeedCharacter = false)] - public class SelectPacketBase : PacketBase - { - [PacketIndex(0)] - public byte Slot { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs deleted file mode 100644 index c4cbc670..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/CListStartPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server -{ - [PacketHeader("clist_start")] - public class CListStartPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte Type { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs deleted file mode 100644 index 2808916a..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistEndPacketBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server -{ - [PacketHeader("clist_end")] - public class ClistEndPacketBase : PacketBase - { - // Useless packet - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs deleted file mode 100644 index f5860833..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/ClistPacketBase.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server -{ - [PacketHeader("clist")] - public class ClistPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte Slot { get; set; } - - [PacketIndex(1)] - public string Name { get; set; } - - [PacketIndex(2)] - public byte Unknown { get; set; } - - [PacketIndex(3)] - public GenderType Gender { get; set; } - - [PacketIndex(4)] - public HairStyleType HairStyle { get; set; } - - [PacketIndex(5)] - public HairColorType HairColor { get; set; } - - [PacketIndex(6)] - public byte Unknown1 { get; set; } - - [PacketIndex(7)] - public CharacterClassType Class { get; set; } - - [PacketIndex(8)] - public ushort Level { get; set; } - - [PacketIndex(9)] - public ushort HeroLevel { get; set; } - - [PacketIndex(10, SeparatorBeforeProperty = " ", SeparatorNestedElements = ".")] - public List Equipments { get; set; } - - [PacketIndex(11)] - public ushort JobLevel { get; set; } - - [PacketIndex(12)] - public byte QuestCompletion { get; set; } - - [PacketIndex(13)] - public byte QuestPart { get; set; } - - [PacketIndex(14, SeparatorBeforeProperty = " ", SeparatorNestedElements = ".")] - public List Pets { get; set; } - - [PacketIndex(15)] - public int Design { get; set; } - - [PacketIndex(16)] - public byte Unknown3 { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs b/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs deleted file mode 100644 index c0fac7d9..00000000 --- a/src/ChickenAPI.Packets/CharacterSelectionScreen/Server/OkPacketBase.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.CharacterSelectionScreen.Server -{ - [PacketHeader("OK")] - public class OkPacketBase : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/ChickenAPI.Packets.Old.csproj b/src/ChickenAPI.Packets/ChickenAPI.Packets.Old.csproj deleted file mode 100644 index 3ecb49db..00000000 --- a/src/ChickenAPI.Packets/ChickenAPI.Packets.Old.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - - - diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs deleted file mode 100644 index fdb86933..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListPacket.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Battle -{ - [PacketHeader("mtlist")] - public class MultiTargetListPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte TargetsAmount { get; set; } - - [PacketIndex(1, RemoveSeparator = true)] - public List Targets { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs deleted file mode 100644 index 639928e5..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Battle/MultiTargetListSubPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Battle -{ - [PacketHeader("multi_target_list_sub_packet")] - public class MultiTargetListSubPacket : PacketBase - { - [PacketIndex(0)] - public int SkillCastId { get; set; } - - [PacketIndex(1)] - public int TargetId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs deleted file mode 100644 index 5b33ae55..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Battle/NcifPacket.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Battle -{ - [PacketHeader("ncif")] - public class NcifPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public VisualType Type { get; set; } - - [PacketIndex(1)] - public long TargetId { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs deleted file mode 100644 index 1d054aff..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Battle/UseAoeSkillPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Battle -{ - [PacketHeader("u_as")] - public class UseAoeSkillPacket : PacketBase - { - [PacketIndex(0)] - public long CastId { get; set; } - - [PacketIndex(1)] - public short MapX { get; set; } - - [PacketIndex(2)] - public short MapY { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs b/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs deleted file mode 100644 index ed24b826..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Battle/UseSkillPacket.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Battle -{ - [PacketHeader("u_s")] - public class UseSkillPacket : PacketBase - { - [PacketIndex(0)] - public long CastId { get; set; } - - [PacketIndex(1)] - public VisualType TargetVisualType { get; set; } - - [PacketIndex(2)] - public long TargetId { get; set; } - - [PacketIndex(3, IsOptional = true)] - public short? MapX { get; set; } - - [PacketIndex(4, IsOptional = true)] - public short? MapY { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs b/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs deleted file mode 100644 index 5411a95d..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Chat/ClientSayPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Chat -{ - [PacketHeader("say")] - public class ClientSayPacket : PacketBase - { - [PacketIndex(0, SerializeToEnd = true)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs b/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs deleted file mode 100644 index f6aa1f05..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Drops/DropPacket.cs +++ /dev/null @@ -1,32 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Drops -{ - [PacketHeader("drop")] - internal class DropPacket : PacketBase - { - [PacketIndex(0)] - public long ItemVNum { get; set; } - - [PacketIndex(1)] - public long DropId { get; set; } - - [PacketIndex(2)] - public short MapX { get; set; } - - [PacketIndex(3)] - public short MapY { get; set; } - - [PacketIndex(4)] - public short Amount { get; set; } - - [PacketIndex(5)] - public bool IsQuestItem { get; set; } - - [PacketIndex(6)] - public byte Unknown { get; set; } // looks like always 0 - - [PacketIndex(7)] - public byte Unknown2 { get; set; } // looks like always -1 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs b/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs deleted file mode 100644 index 8f932db2..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Drops/GetPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Drops -{ - [PacketHeader("get")] - public class GetPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public short CharacterId { get; set; } - - [PacketIndex(2)] - public long DropId { get; set; } - - [PacketIndex(3)] - public byte Unknown2 { get; set; } // seems to be always 0 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs b/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs deleted file mode 100644 index 4b7bacaf..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Families/CreateFamilyPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Families -{ - [PacketHeader("glmk")] - public class CreateFamilyPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public string FamilyName { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs deleted file mode 100644 index a5c383ac..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Families/GInfoPacket.cs +++ /dev/null @@ -1,67 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Families; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Families -{ - [PacketHeader("ginfo")] - public class GInfoPacket : PacketBase - { - [PacketIndex(0)] - public string FamilyName { get; set; } - - [PacketIndex(1)] - public string CharacterName { get; set; } - - /// - /// Todo to confirm - /// - [PacketIndex(2)] - public GenderType FamilyHeadGenderType { get; set; } - - [PacketIndex(3)] - public short FamilyLevel { get; set; } - - [PacketIndex(4)] - public int FamilyXp { get; set; } - - [PacketIndex(5)] - public uint MaxFamilyXp { get; set; } - - [PacketIndex(6)] - public ushort MembersCount { get; set; } - - [PacketIndex(7)] - public ushort MembersCapacity { get; set; } - - [PacketIndex(8)] - public FamilyAuthority CharacterFamilyAuthority { get; set; } - - [PacketIndex(9)] - public bool FamilyManagerCanInvit { get; set; } - - [PacketIndex(10)] - public bool FamilyManagerCanNotice { get; set; } - - [PacketIndex(11)] - public bool FamilyManagerCanShout { get; set; } - - [PacketIndex(12)] - public bool FamilyManagerCanGetHistory { get; set; } - - [PacketIndex(13)] - public FamilyAuthorityType FamilyManagerAuthorityType { get; set; } - - [PacketIndex(14)] - public bool FamilyMemberCanGetHistory { get; set; } - - [PacketIndex(15)] - public FamilyAuthorityType FamilyMemberAuthorityType { get; set; } - - /// - /// Should replace ' ' by '^' - /// - [PacketIndex(16)] - public string FamilyMessage { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs b/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs deleted file mode 100644 index 851a6369..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Families/GidxPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Families -{ - [PacketHeader("gidx")] - public class GidxPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public long FamilyId { get; set; } - - [PacketIndex(3)] - public string FamilyName { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = "")] - public string FamilyCustomRank { get; set; } - - [PacketIndex(5)] - public byte FamilyLevel { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs deleted file mode 100644 index b3714109..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/BiPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("b_i")] - public class BiPacket : PacketBase - { - [PacketIndex(0)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(1)] - public short InventorySlot { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs deleted file mode 100644 index 35af6ede..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/MviPacket.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("mvi")] - public class MviPacket : PacketBase - { - [PacketIndex(0)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(1)] - public short InventorySlot { get; set; } - - [PacketIndex(2)] - public short Amount { get; set; } - - [PacketIndex(3)] - public short DestinationSlot { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs deleted file mode 100644 index 033dbd6b..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/PdtiPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("pdti")] - public class PdtiPacket : PacketBase - { - [PacketIndex(0)] - public short Unknow { get; set; } - - [PacketIndex(1)] - public long ItemVnum { get; set; } - - [PacketIndex(2)] - public short Unknow2 { get; set; } - - [PacketIndex(3)] - public short Unknow3 { get; set; } - - [PacketIndex(4)] - public short ItemUpgrade { get; set; } - - [PacketIndex(5)] - public short Unknow4 { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs deleted file mode 100644 index 0458f75f..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/PutPacket.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("put")] - public class PutPacket : PacketBase - { - [PacketIndex(0)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(1)] - public short InventorySlot { get; set; } - - [PacketIndex(2)] - public short Amount { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs deleted file mode 100644 index 38ddfda9..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/RemovePacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("remove")] - public class RemovePacket : PacketBase - { - [PacketIndex(0)] - public byte InventorySlot { get; set; } - - [PacketIndex(1)] - public long MateId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs deleted file mode 100644 index 19473aa7..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/UiPacket.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("u_i")] - public class UiPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long CharacterId { get; set; } - - [PacketIndex(2)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(3)] - public byte InventorySlot { get; set; } - - [PacketIndex(4)] - public byte Unknown2 { get; set; } //Seems to be always 0 - using accountbound costumes and accepting the dialog sends: "#u_i^1^1^7^0^1" - - [PacketIndex(5)] - public byte Unknown3 { get; set; } //Seems to be always 0 - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs b/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs deleted file mode 100644 index b4ba7ee8..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Inventory/WearPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Inventory -{ - [PacketHeader("wear")] - public class WearPacket : PacketBase - { - [PacketIndex(0)] - public short ItemSlot { get; set; } - - [PacketIndex(1)] - public byte WearPacketType { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs deleted file mode 100644 index 1ea246a0..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Mates/PsOpPacket.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Mates -{ - [PacketHeader("ps_op")] - public class PsopPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte PetSlot { get; set; } - - [PacketIndex(1)] - public byte SkillSlot { get; set; } - - [PacketIndex(2)] - public byte Option { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs deleted file mode 100644 index f3ff66c7..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Mates/PslPacket.cs +++ /dev/null @@ -1,12 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Mates -{ - [PacketHeader("psl")] - public class PslPacket : PacketBase - { - [PacketIndex(0)] - public PslPacketType Type { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs deleted file mode 100644 index 62b9c211..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Mates/SuCtlPacket.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Mates -{ - [PacketHeader("suctl")] - public class SuCtlPacket : PacketBase - { - [PacketIndex(0)] - public int CastId { get; set; } - - [PacketIndex(1)] - public int Unknown2 { get; set; } - - [PacketIndex(2)] - public long MateTransportId { get; set; } - - [PacketIndex(3)] - public VisualType TargetType { get; set; } - - [PacketIndex(4)] - public long TargetId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs deleted file mode 100644 index 11926c75..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Mates/UPsPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Mates -{ - [PacketHeader("u_ps")] - public class UpsPacket : PacketBase - { - [PacketIndex(0)] - public long MateTransportId { get; set; } - - [PacketIndex(1)] - public VisualType TargetType { get; set; } - - [PacketIndex(2)] - public long TargetId { get; set; } - - [PacketIndex(3)] - public int SkillSlot { get; set; } - - [PacketIndex(4)] - public short MapX { get; set; } - - [PacketIndex(5)] - public short MapY { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs b/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs deleted file mode 100644 index e505e2fc..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Mates/UpetPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Mates -{ - [PacketHeader("u_pet")] - public class UpetPacket : PacketBase - { - [PacketIndex(0)] - public long MateTransportId { get; set; } - - [PacketIndex(1)] - public VisualType TargetType { get; set; } - - [PacketIndex(2)] - public long TargetId { get; set; } - - [PacketIndex(3)] - public int Unknown2 { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs b/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs deleted file mode 100644 index 464d7c01..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Miniland/AddobjPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Miniland -{ - [PacketHeader("addobj")] - public class AddobjPacket : PacketBase - { - [PacketIndex(0)] - public short Slot { get; set; } - - [PacketIndex(1)] - public short MapX { get; set; } - - [PacketIndex(2)] - public short MapY { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs b/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs deleted file mode 100644 index 7832fb66..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Miniland/MlObjPacket.cs +++ /dev/null @@ -1,38 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Miniland -{ - [PacketHeader("mlobj")] - public class MlobjPacket : PacketBase - { - [PacketIndex(0)] - public bool Deleted { get; set; } - - [PacketIndex(1)] - public short Slot { get; set; } - - [PacketIndex(2)] - public short MapX { get; set; } - - [PacketIndex(3)] - public short MapY { get; set; } - - [PacketIndex(4)] - public short Width { get; set; } - - [PacketIndex(5)] - public short Height { get; set; } - - [PacketIndex(6)] - public byte Unknown { get; set; } // looks like always 0 - - [PacketIndex(7)] - public short DurabilityPoint { get; set; } - - [PacketIndex(8)] - public byte Unknown2 { get; set; } // looks like always 0 - - [PacketIndex(9)] - public bool IsWarehouse { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs b/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs deleted file mode 100644 index cdfbce21..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Miniland/RmvobjPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Miniland -{ - [PacketHeader("rmvobj")] - public class RmvobjPacket : PacketBase - { - [PacketIndex(0)] - public short Slot { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs deleted file mode 100644 index 6875ac73..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Movement/DirectionPacket.cs +++ /dev/null @@ -1,22 +0,0 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Movement -{ - [PacketHeader("dir")] - public class DirectionPacket : PacketBase - { - #region Properties - - [PacketIndex(1)] - public int Option { get; set; } - - [PacketIndex(0)] - public DirectionType DirectionType { get; set; } - - [PacketIndex(2)] - public long CharacterId { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs deleted file mode 100644 index b222932b..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Movement/PreqPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Movement -{ - [PacketHeader("preq")] - public class PreqPacket : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs deleted file mode 100644 index e66b6a33..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Movement/SitPacket.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Movement -{ - [PacketHeader("rest")] - public class SitPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte Ammout { get; set; } - - [PacketIndex(1, RemoveSeparator = true)] - public List Users { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs deleted file mode 100644 index fb35234a..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Movement/SitSubPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Movement -{ - [PacketHeader("sit_sub_packet")] // header will be ignored for serializing just sub list packets - public class SitSubPacket : PacketBase - { - [PacketIndex(0)] - public byte UserType { get; set; } - - [PacketIndex(1)] - public long UserId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs b/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs deleted file mode 100644 index f5271d38..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Movement/WalkPacket.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Movement -{ - [PacketHeader("walk")] - public class WalkPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short XCoordinate { get; set; } - - [PacketIndex(1)] - public short YCoordinate { get; set; } - - [PacketIndex(2)] - public short Unknown { get; set; } - - [PacketIndex(3)] - public byte Speed { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs b/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs deleted file mode 100644 index 717f7ee3..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Npcs/NrunPacket.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Npcs -{ - [PacketHeader("n_run")] - public class NrunPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short Runner { get; set; } - - [PacketIndex(1)] - public short Type { get; set; } - - [PacketIndex(2)] - public short Value { get; set; } - - [PacketIndex(3)] - public int NpcId { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs b/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs deleted file mode 100644 index 958ad3f8..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Npcs/WopenPacket.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Npcs -{ - [PacketHeader("wopen")] - public class WopenPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public long Type { get; set; } - - [PacketIndex(1)] - public long Unknow { get; set; } - - #endregion Properties - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs deleted file mode 100644 index 91245f6c..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/CharacterOptionPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("gop")] - public class CharacterOptionPacket : PacketBase - { - [PacketIndex(0)] - public CharacterOption Option { get; set; } - - [PacketIndex(1)] - public bool IsActive { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs deleted file mode 100644 index f429599e..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/ClientGuriPacket.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("guri")] - public class ClientGuriPacket : PacketBase - { - [PacketIndex(0)] - public int Type { get; set; } - - [PacketIndex(1)] - public int Argument { get; set; } - - [PacketIndex(2, IsOptional = true)] - public long? VisualId { get; set; } - - [PacketIndex(3, IsOptional = true)] - public long? Data { get; set; } - - [PacketIndex(4, IsOptional = true)] - public long? Value { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs deleted file mode 100644 index 7dbd7e28..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/ComplimentPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("compl")] - public class ComplimentPacket : PacketBase - { - #region Properties - - [PacketIndex(1)] - public long CharacterId { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs deleted file mode 100644 index 21f677f0..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/EffectPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("eff")] - public class EffectPacket : PacketBase - { - [PacketIndex(0)] - public VisualType EffectType { get; set; } - - [PacketIndex(1)] - public long CharacterId { get; set; } - - [PacketIndex(2)] - public long EffectId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs deleted file mode 100644 index 4d8b1d4c..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/NpInfoPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("npinfo")] - public class NpInfoPacket : PacketBase - { - [PacketIndex(0)] - public long UnKnow { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs deleted file mode 100644 index 68625d4b..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/QsetPacket.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("qset")] - public class QsetPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short Type { get; set; } - - [PacketIndex(1)] - public short Q1 { get; set; } - - [PacketIndex(2)] - public short Q2 { get; set; } - - [PacketIndex(3)] - public short? Data1 { get; set; } - - [PacketIndex(4)] - public short? Data2 { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs deleted file mode 100644 index 8a240c23..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/ScrPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("scr")] - public class ScrPacket : PacketBase - { - [PacketIndex(0)] - public int Unknow1 { get; set; } - - [PacketIndex(1)] - public int Unknow2 { get; set; } - - [PacketIndex(2)] - public int Unknow3 { get; set; } - - [PacketIndex(3)] - public int Unknow4 { get; set; } - - [PacketIndex(4)] - public int Unknow5 { get; set; } - - [PacketIndex(5)] - public int Unknow6 { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs deleted file mode 100644 index e1ef5615..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Player/TcInfoPacket.cs +++ /dev/null @@ -1,129 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Player -{ - [PacketHeader("tc_info")] - public class TcInfoPacket : PacketBase - { - // return $"tc_info {Level} {Name} {fairy?.Item.Element ?? 0} {ElementRate + (Buff.Any(s => s.Card.CardId == 131) ? 30 : 0)} - // {(byte)Class} {(byte)Gender} {(Family != null ? $"{Family.FamilyId} - // {Family.Name}({Language.Instance.GetMessageFromKey(FamilyCharacter?.Authority.ToString()?.ToUpper() ?? "")})" : "-1 -")} - // {GetReputationIco()} {GetDignityIco()} {(weapon != null ? 1 : 0)} {weapon?.Rare ?? 0} {weapon?.Upgrade ?? 0} {(weapon2 != null ? 1 : 0)} - // {weapon2?.Rare ?? 0} {weapon2?.Upgrade ?? 0} {(armor != null ? 1 : 0)} {armor?.Rare ?? 0} {armor?.Upgrade ?? 0} {Act4Kill} {Act4Dead} {Reputation} - // 0 0 0 {(UseSp ? Morph : 0)} {TalentWin} {TalentLose} {TalentSurrender} 0 {MasterPoints} {Compliment} {Act4Points} {(isPvpPrimary ? 1 : 0)} - // {(isPvpSecondary ? 1 : 0)} {(isPvpArmor ? 1 : 0)} {HeroLevel} - // {(string.IsNullOrEmpty(Biography) ? Language.Instance.GetMessageFromKey("NO_PREZ_MESSAGE") : Biography)}"; - [PacketIndex(0)] - public long Level { get; set; } - - [PacketIndex(1)] - public string Name { get; set; } - - [PacketIndex(2)] - public ElementType Element { get; set; } - - [PacketIndex(3)] - public long ElementRate { get; set; } - - [PacketIndex(4)] - public CharacterClassType Class { get; set; } - - [PacketIndex(5)] - public GenderType Gender { get; set; } - - [PacketIndex(6)] - public string Family { get; set; } - - [PacketIndex(7)] - public CharacterRep ReputationIco { get; set; } - - [PacketIndex(8)] - public CharacterDignity DignityIco { get; set; } - - [PacketIndex(9)] - public int HaveWeapon { get; set; } - - [PacketIndex(10)] - public long WeaponRare { get; set; } - - [PacketIndex(11)] - public long WeaponUpgrade { get; set; } - - [PacketIndex(12)] - public int HaveSecondary { get; set; } - - [PacketIndex(13)] - public long SecondaryRare { get; set; } - - [PacketIndex(14)] - public long SecondaryUpgrade { get; set; } - - [PacketIndex(15)] - public int HaveArmor { get; set; } - - [PacketIndex(16)] - public long ArmorRare { get; set; } - - [PacketIndex(17)] - public long ArmorUpgrade { get; set; } - - [PacketIndex(18)] - public long Act4Kill { get; set; } - - [PacketIndex(19)] - public long Act4Dead { get; set; } - - [PacketIndex(20)] - public long Reputation { get; set; } - - [PacketIndex(21)] - public long Unknow { get; set; } = 0; // Always 0 - - [PacketIndex(22)] - public long Unknow2 { get; set; } = 0; // Always 0 - - [PacketIndex(23)] - public long Unknow3 { get; set; } = 0; // Always 0 - - [PacketIndex(24)] - public long Morph { get; set; } - - [PacketIndex(25)] - public long TalentWin { get; set; } - - [PacketIndex(26)] - public long TalentLose { get; set; } - - [PacketIndex(27)] - public long TalentSurrender { get; set; } - - [PacketIndex(28)] - public long Unknow4 { get; set; } = 0; // always 0 - - [PacketIndex(29)] - public long MasterPoints { get; set; } - - [PacketIndex(30)] - public long Compliments { get; set; } - - [PacketIndex(31)] - public long Act4Points { get; set; } - - [PacketIndex(32)] - public bool isPvpPrimary { get; set; } - - [PacketIndex(33)] - public bool isPvpSecondary { get; set; } - - [PacketIndex(34)] - public bool isPvpArmor { get; set; } - - [PacketIndex(35)] - public long HeroLevel { get; set; } - - [PacketIndex(36)] - public string Biography { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs deleted file mode 100644 index 38b25df8..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/BuyPacket.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("buy")] - public class BuyPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public VisualType Type { get; set; } - - [PacketIndex(1)] - public long OwnerId { get; set; } - - [PacketIndex(2)] - public short Slot { get; set; } - - [PacketIndex(3)] - public short Amount { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs deleted file mode 100644 index a8ff5290..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/MShopPacket.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("m_shop")] - public class MShopPacket : PacketBase - { - [PacketIndex(0)] - public MShopPacketType Type { get; set; } - - /// - /// Todo write a better way to handle that - /// - [PacketIndex(1, SerializeToEnd = true)] - public string PacketData { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs deleted file mode 100644 index 544e4a95..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/NInvPacket.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("n_inv")] - public class NInvPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public byte Unknown { get; set; } = 0; - - [PacketIndex(3)] - public int ShopType { get; set; } - - [PacketIndex(4, IsOptional = true)] - public string ShopList { get; set; } - - [PacketIndex(5, IsOptional = true, SeparatorNestedElements = " ")] - public List ShopSkills { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs deleted file mode 100644 index 6d730c18..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/ReceivedNpcReqPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("npc_req")] - public class ReceivedNpcReqPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs deleted file mode 100644 index a6d552cf..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/SentNpcReqPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("npc_req")] - public class SentNpcReqPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2, IsOptional = true)] - public long? Dialog { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs deleted file mode 100644 index cd79612e..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/ShopPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("shop")] - public class ShopPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long EntityId { get; set; } - - [PacketIndex(2)] - public long ShopId { get; set; } - - [PacketIndex(3)] - public byte MenuType { get; set; } - - [PacketIndex(4)] - public byte ShopType { get; set; } - - [PacketIndex(5)] - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs b/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs deleted file mode 100644 index cc541fc3..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Shops/ShoppingPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Shops -{ - [PacketHeader("shopping")] - public class ShoppingPacket : PacketBase - { - [PacketIndex(0)] - public byte Type { get; set; } - - [PacketIndex(1)] - public int Unknown { get; set; } - - [PacketIndex(2)] - public int Unknown1 { get; set; } - - [PacketIndex(3)] - public int NpcId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs b/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs deleted file mode 100644 index d72d874f..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Specialists/SlPacket.cs +++ /dev/null @@ -1,31 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Specialists -{ - [PacketHeader("sl")] - public class SlPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public SlPacketType Type { get; set; } - - [PacketIndex(3)] - public int TransportId { get; set; } - - [PacketIndex(4)] - public short SpecialistDamage { get; set; } - - [PacketIndex(5)] - public short SpecialistDefense { get; set; } - - [PacketIndex(6)] - public short SpecialistElement { get; set; } - - [PacketIndex(7)] - public short SpecialistHp { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs b/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs deleted file mode 100644 index 5bcebffd..00000000 --- a/src/ChickenAPI.Packets/Game/Client/Specialists/SpPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.Specialists -{ - [PacketHeader("sp")] - public class SpPacket : PacketBase - { - [PacketIndex(0)] - public int AdditionalPoints { get; set; } - - [PacketIndex(1)] - public uint MaxAdditionalPoints { get; set; } - - [PacketIndex(2)] - public int Points { get; set; } - - [PacketIndex(3)] - public uint MaxDailyPoints { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs b/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs deleted file mode 100644 index a8a5a23c..00000000 --- a/src/ChickenAPI.Packets/Game/Client/UI/EInfoPacket.cs +++ /dev/null @@ -1,87 +0,0 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client.UI -{ - [PacketHeader("e_info")] - public class EInfoPacket : PacketBase - { - [PacketIndex(0)] - public short Unknown1 { get; set; } - - [PacketIndex(1)] - public long MonsterVnum { get; set; } - - [PacketIndex(2)] - public byte Level { get; set; } - - [PacketIndex(3)] - public ElementType Element { get; set; } - - [PacketIndex(4)] - public byte AttackClass { get; set; } - - [PacketIndex(5)] - public short ElementRate { get; set; } - - [PacketIndex(6)] - public byte AttackUpgrade { get; set; } - - [PacketIndex(7)] - public short DamageMinimum { get; set; } - - [PacketIndex(8)] - public short DamageMaximum { get; set; } - - [PacketIndex(9)] - public short Concentrate { get; set; } - - [PacketIndex(10)] - public byte CriticalChance { get; set; } - - [PacketIndex(11)] - public short CriticalRate { get; set; } - - [PacketIndex(12)] - public byte DefenceUpgrade { get; set; } - - [PacketIndex(13)] - public short CloseDefence { get; set; } - - [PacketIndex(14)] - public short DefenceDodge { get; set; } - - [PacketIndex(15)] - public short DistanceDefence { get; set; } - - [PacketIndex(16)] - public short DistanceDefenceDodge { get; set; } - - [PacketIndex(17)] - public short MagicDefence { get; set; } - - [PacketIndex(18)] - public sbyte FireResistance { get; set; } - - [PacketIndex(19)] - public sbyte WaterResistance { get; set; } - - [PacketIndex(20)] - public sbyte LightResistance { get; set; } - - [PacketIndex(21)] - public sbyte DarkResistance { get; set; } - - [PacketIndex(22)] - public int MaxHp { get; set; } - - [PacketIndex(23)] - public int MaxMp { get; set; } - - [PacketIndex(24)] - public short Unknown2 { get; set; } - - [PacketIndex(25)] - public string Name { get; set; } - } -} diff --git a/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs b/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs deleted file mode 100644 index 470434de..00000000 --- a/src/ChickenAPI.Packets/Game/Client/UpgradePacket.cs +++ /dev/null @@ -1,35 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Client -{ - [PacketHeader("up_gr")] - public class UpgradePacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public UpgradePacketType UpgradeType { get; set; } - - [PacketIndex(1)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(2)] - public byte Slot { get; set; } - - [PacketIndex(3, IsOptional = true)] - public InventoryType? InventoryType2 { get; set; } - - [PacketIndex(4, IsOptional = true)] - public byte? Slot2 { get; set; } - - [PacketIndex(5, IsOptional = true)] - public InventoryType? CellonInventoryType { get; set; } - - [PacketIndex(6, IsOptional = true)] - public byte? CellonSlot { get; set; } - - #endregion Properties - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs b/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs deleted file mode 100644 index 4977767f..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Auction/RcbListPacket.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; -using ChickenAPI.Packets.Old.Game.Server.Inventory; - -namespace ChickenAPI.Packets.Old.Game.Server.Auction -{ - [PacketHeader("rc_blist")] - public class RcbListPacket : PacketBase - { - [PacketIndex(0)] - public long PageIndex { get; set; } - - [PacketIndex(1, SeparatorNestedElements = " ")] - public List Items { get; set; } - - [PacketHeader("rc_blist_subpacket")] - public class RcbListElementPacket : PacketBase - { - [PacketIndex(0)] - public long AuctionId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "|")] - public long OwnerId { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = "|")] - public string OwnerName { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = "|")] - public long ItemId { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = "|")] - public long Amount { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = "|")] - public bool IsPackage { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = "|")] - public long Price { get; set; } - - [PacketIndex(7, SeparatorNestedElements = "|")] - public long MinutesLeft { get; set; } - - /// - /// Todo find signification but default known value is 2 - /// - [PacketIndex(8, SeparatorBeforeProperty = "|")] - public bool Unknown1 { get; set; } - - [PacketIndex(9, SeparatorBeforeProperty = "|")] - public long Unknown { get; set; } - - [PacketIndex(10, SeparatorBeforeProperty = "|")] - public long Rarity { get; set; } - - [PacketIndex(11, SeparatorBeforeProperty = "|")] - public long Upgrade { get; set; } - - [PacketIndex(12, SeparatorBeforeProperty = "|")] - public EInfoPacket EInfo { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs b/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs deleted file mode 100644 index 357b199d..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Auction/RcsListPacket.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; -using ChickenAPI.Packets.Old.Game.Server.Inventory; - -namespace ChickenAPI.Packets.Old.Game.Server.Auction -{ - [PacketHeader("rc_slist")] - public class RcsListPacket : PacketBase - { - [PacketIndex(0)] - public int PageNumber { get; set; } - - [PacketIndex(1, SeparatorNestedElements = " ")] - public List Items { get; set; } - - [PacketHeader("rc_slist_element")] - public class RcsListElementPacket : PacketBase - { - [PacketIndex(0)] - public long AuctionId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "|")] - public long OwnerId { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = "|")] - public long ItemId { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = "|")] - public long SoldAmount { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = "|")] - public long Amount { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = "|")] - public bool IsPackage { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = "|")] - public long Price { get; set; } - - [PacketIndex(7, SeparatorNestedElements = "|")] - public long MinutesLeft { get; set; } - - [PacketIndex(8, SeparatorBeforeProperty = "|")] - public bool IsSellerUsingMedal { get; set; } - - [PacketIndex(9, SeparatorBeforeProperty = "|")] - public long Unknown { get; set; } - - [PacketIndex(10, SeparatorBeforeProperty = "|")] - public long Rarity { get; set; } - - [PacketIndex(11, SeparatorBeforeProperty = "|")] - public long Upgrade { get; set; } - - [PacketIndex(12, SeparatorBeforeProperty = "|")] - public EInfoPacket EInfo { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs deleted file mode 100644 index 178709d0..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/BfPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("bf")] - public class BfPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public long ChargeValue { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public long BuffId { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".")] - public long Duration { get; set; } - - [PacketIndex(5)] - public long BuffLevel { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs deleted file mode 100644 index 17210499..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/CancelPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("cancel")] - public class CancelPacket : PacketBase - { - [PacketIndex(0)] - public CancelPacketType Type { get; set; } - - [PacketIndex(1)] - public long TargetId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs deleted file mode 100644 index 0e27c66e..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/CtPacket.cs +++ /dev/null @@ -1,29 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("ct")] - public class CtPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public VisualType TargetVisualType { get; set; } - - [PacketIndex(3)] - public long TargetId { get; set; } - - [PacketIndex(4)] - public long CastAnimationId { get; set; } - - [PacketIndex(5)] - public long CastEffect { get; set; } - - [PacketIndex(6)] - public long SkillId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs deleted file mode 100644 index 02fb2621..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/DmPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("dm")] - public class DmPacket - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public long Damages { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs deleted file mode 100644 index 53993c06..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/MscPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("ms_c")] - public class MscPacket : PacketBase - { - [PacketIndex(0)] - public long Unknown { get; set; } = 0; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs deleted file mode 100644 index afa840c8..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/RcPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("rc")] - public class RcPacket - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public long HealAmount { get; set; } - - [PacketIndex(3)] - public long Unknown { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs b/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs deleted file mode 100644 index 1c1a1c72..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Battle/SuPacket.cs +++ /dev/null @@ -1,54 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Battle -{ - [PacketHeader("su")] - public class SuPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public VisualType TargetVisualType { get; set; } - - [PacketIndex(3)] - public long TargetId { get; set; } - - [PacketIndex(4)] - public long SkillVnum { get; set; } - - [PacketIndex(5)] - public long SkillCooldown { get; set; } - - [PacketIndex(6)] - public long AttackAnimation { get; set; } - - [PacketIndex(7)] - public long SkillEffect { get; set; } - - [PacketIndex(8)] - public long PositionX { get; set; } - - [PacketIndex(9)] - public long PositionY { get; set; } - - [PacketIndex(10)] - public bool TargetIsAlive { get; set; } - - [PacketIndex(11)] - public byte HpPercentage { get; set; } - - [PacketIndex(12)] - public uint Damage { get; set; } - - [PacketIndex(13)] - public SuPacketHitMode HitMode { get; set; } - - [PacketIndex(14)] - public int SkillTypeMinusOne { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs b/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs deleted file mode 100644 index 3d6b25d2..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Chat/SayItemPacket.cs +++ /dev/null @@ -1,49 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; -using ChickenAPI.Packets.Old.Game.Server.Inventory; - -namespace ChickenAPI.Packets.Old.Game.Server.Chat -{ - [PacketHeader("sayitem")] - public class SayItemPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public byte OratorSlot { get; set; } - - - [PacketIndex(3)] - public string GlobalPrefix { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = "^")] - public string CharacterName { get; set; } - - [PacketIndex(5)] - public string ItemName { get; set; } - - /// - /// Spaces should be replaced by '^' - /// - [PacketIndex(6, IsOptional = true, SeparatorBeforeProperty = "^")] - public string Message { get; set; } - - [PacketIndex(6, IsOptional = true, SeparatorBeforeProperty = " ")] - public SayItemSubPacket ItemData { get; set; } - - [PacketHeader("say_item_subpacket")] - public class SayItemSubPacket : PacketBase - { - // disgusting but it's entwell - // :hap: - [PacketIndex(0, IsOptional = true, SeparatorBeforeProperty = "ItemInfo ")] - public long? IconId { get; set; } - - [PacketIndex(1, IsOptional = true, SeparatorBeforeProperty = " ")] - public EInfoPacket EquipmentInfo { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs deleted file mode 100644 index c345d066..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/CharScPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("char_sc")] - public class CharScPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public byte Size { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs deleted file mode 100644 index 39645738..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/DropPacket.cs +++ /dev/null @@ -1,32 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("drop")] - public class DropPacket : PacketBase - { - [PacketIndex(0)] - public long ItemVnum { get; set; } - - [PacketIndex(1)] - public long TransportId { get; set; } - - [PacketIndex(2)] - public short PositionX { get; set; } - - [PacketIndex(3)] - public short PositionY { get; set; } - - [PacketIndex(4)] - public long Quantity { get; set; } - - [PacketIndex(5)] - public bool IsQuestDrop { get; set; } - - [PacketIndex(6)] - public byte Unknown { get; set; } = 0; - - [PacketIndex(7)] - public short Unknown2 { get; set; } = -1; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs deleted file mode 100644 index 0d60a4be..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/MvPacket.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("mv")] - public class MvPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public short MapX { get; set; } - - [PacketIndex(3)] - public short MapY { get; set; } - - [PacketIndex(4)] - public short Speed { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs deleted file mode 100644 index b4b4a584..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/OutPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("out")] - public class OutPacket : PacketBase - { - [PacketIndex(0)] - public VisualType Type { get; set; } - - [PacketIndex(1)] - public long EntityId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs deleted file mode 100644 index 6f3a372c..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/ReqInfoPacket.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("req_info")] - public class ReqInfoPacket : PacketBase - { - [PacketIndex(0)] - public ReqInfoType ReqType { get; set; } - - [PacketIndex(1)] - public long TargetVNum { get; set; } - - [PacketIndex(2)] - public int? MateVNum { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs deleted file mode 100644 index 77aeef15..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/RestPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("rest")] - public class RestPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public bool IsSitting { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs deleted file mode 100644 index ad6a217b..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/StPacket.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("st")] - public class StPacket : PacketBase - { - //st 1 {CharacterId} {Level} {HeroLevel} {(int)(Hp / (float)HpLoad() * 100)} {(int)(Mp / (float)MpLoad() * 100)} {Hp} {Mp}{Buff.Aggregate(string.Empty, (current, buff) => current + $" {buff.Card.CardId}")} - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - - [PacketIndex(2)] - public byte Level { get; set; } - - - [PacketIndex(3)] - public byte HeroLevel { get; set; } - - - [PacketIndex(4)] - public long HpPercentage { get; set; } - - - [PacketIndex(5)] - public long MpPercentage { get; set; } - - - [PacketIndex(6)] - public long Hp { get; set; } - - [PacketIndex(7)] - public long Mp { get; set; } - - [PacketIndex(8, IsOptional = true, RemoveSeparator = true)] - public List CardIds { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs deleted file mode 100644 index f53a72f8..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Entities/TpPacket.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Entities -{ - [PacketHeader("tp")] - public class TpPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public short X { get; set; } - - [PacketIndex(3)] - public short Y { get; set; } - - [PacketIndex(4)] - public byte Unknown { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs deleted file mode 100644 index 687ffc81..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Group/PInitPacket.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Group -{ - [PacketHeader("pinit")] - public class PInitPacket : PacketBase - { - [PacketIndex(0)] - public long PartySize { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "", SeparatorNestedElements = " ", IsOptional = true)] - public List MateSubPackets { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = "", SeparatorNestedElements = " ", IsOptional = true)] - public List PlayerSubPackets { get; set; } - - [PacketHeader("pinit_subpacket")] - public class PInitMateSubPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "|")] - public long VisualId { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = "|")] - public byte GroupIndex { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = "|")] - public long Level { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = "|")] - public string Name { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = "|")] - public short Unknown { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = "|")] - public long MorphOrNpcMonsterId { get; set; } - - [PacketIndex(7, SeparatorBeforeProperty = "|")] - public short Unknown2 { get; set; } - } - - [PacketHeader("pinit_subpacket")] - public class PInitPlayerSubPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "|")] - public long VisualId { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = "|")] - public byte GroupIndex { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = "|")] - public long Level { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = "|")] - public string Name { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = "|")] - public byte Unknown { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = "|")] - public GenderType Gender { get; set; } - - [PacketIndex(7, SeparatorBeforeProperty = "|")] - public CharacterClassType Class { get; set; } - - [PacketIndex(8, SeparatorBeforeProperty = "|")] - public long MorphId { get; set; } - - [PacketIndex(9, SeparatorBeforeProperty = "|")] - public long HeroLevel { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs deleted file mode 100644 index b6e8d3fa..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Group/PJoinPacket.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Group -{ - [PacketHeader("pjoin")] - public class PJoinPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public PJoinPacketType RequestType { get; set; } - - [PacketIndex(1)] - public long CharacterId { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs deleted file mode 100644 index 7d93db61..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Group/PidxPacket.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Group -{ - [PacketHeader("pidx")] - public class PidxPacket : PacketBase - { - [PacketIndex(0)] - public long GroupId { get; set; } - - [PacketIndex(1, SeparatorNestedElements = " ")] - public List SubPackets { get; set; } - - [PacketHeader("pidx_subpacket")] - public class PidxSubPacket : PacketBase - { - [PacketIndex(0)] - public bool IsMemberOfGroup { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long CharacterId { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs b/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs deleted file mode 100644 index 05666a96..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Group/PstPacket.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Group -{ - [PacketHeader("pst")] - public class PstPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public long GroupIndex { get; set; } - - [PacketIndex(3)] - public int HpPercentage { get; set; } - - [PacketIndex(4)] - public int MpPercentage { get; set; } - - [PacketIndex(5)] - public int HpMax { get; set; } - - [PacketIndex(6)] - public int MpMax { get; set; } - - [PacketIndex(7)] - public GenderType Gender { get; set; } - - [PacketIndex(8)] - public CharacterClassType Class { get; set; } - - [PacketIndex(9)] - public int Morph { get; set; } - - [PacketIndex(10, SeparatorNestedElements = " ")] - public List Buffs { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs deleted file mode 100644 index af10ad6f..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EInfoPacket.cs +++ /dev/null @@ -1,89 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("e_info")] - public class EInfoPacket : PacketBase - { - [PacketIndex(0)] - public EInfoPacketType EInfoType { get; set; } - - [PacketIndex(1)] - public long ItemVNum { get; set; } - - [PacketIndex(2, IsOptional = true)] - public short? Rare { get; set; } - - [PacketIndex(3, IsOptional = true)] - public short? Upgrade { get; set; } - - [PacketIndex(4, IsOptional = true)] - public bool? Fixed { get; set; } - - [PacketIndex(5)] - public byte LevelMinimum { get; set; } - - [PacketIndex(13, IsOptional = true)] - public short? DurabilityPoint { get; set; } - - [PacketIndex(14, IsOptional = true)] - public int? Unknown { get; set; } // default 100 for Amulets - - [PacketIndex(15, IsOptional = true)] - public int? Unknown1 { get; set; } // default 0 for Amulets - - [PacketIndex(16, IsOptional = true)] - public byte? Element { get; set; } - - [PacketIndex(17, IsOptional = true)] - public short? ElementRate { get; set; } - - [PacketIndex(18, IsOptional = true)] - public long? Price { get; set; } - - [PacketIndex(19, IsOptional = true)] - public int? Unknown2 { get; set; } // default -1 for Weapons and Armors - - [PacketIndex(20, IsOptional = true)] - public short Rare2 { get; set; } - - [PacketIndex(21, IsOptional = true)] - public long BoundCharacterId { get; set; } - - [PacketIndex(22, IsOptional = true)] - public byte? ShellEffectCount { get; set; } // Review this - - [PacketIndex(23, IsOptional = true)] - public byte? ShellEffect { get; set; } // Review this - - #region Armor - - [PacketIndex(6, IsOptional = true)] - public short? CloseDefense { get; set; } - - [PacketIndex(7, IsOptional = true)] - public short? RangeDefense { get; set; } - - [PacketIndex(8, IsOptional = true)] - public short? MagicDefense { get; set; } - - [PacketIndex(9, IsOptional = true)] - public short? DefenseDodge { get; set; } - - [PacketIndex(10, IsOptional = true)] - public short? CriticalRate { get; set; } - - #endregion - - #region Weapon - - [PacketIndex(11, IsOptional = true)] - public byte? Ammo { get; set; } - - [PacketIndex(12, IsOptional = true)] - public byte? MaximumAmmo { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs deleted file mode 100644 index 107ffaa8..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EqListInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("subpacket_eq_list_info")] - public class EqListInfo : PacketBase - { - [PacketIndex(0)] - public long Hat { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long Armor { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public long MainWeapon { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public long SecondaryWeapon { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".")] - public long Mask { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = ".")] - public long Fairy { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = ".")] - public long CostumeSuit { get; set; } - - [PacketIndex(7, SeparatorBeforeProperty = ".")] - public long CostumeHat { get; set; } - - [PacketIndex(8, SeparatorBeforeProperty = ".")] - public long WeaponSkin { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs deleted file mode 100644 index 91aa63ab..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EqPacket.cs +++ /dev/null @@ -1,33 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("eq")] - public class EqPacket : PacketBase - { - [PacketIndex(0)] - public long CharacterId { get; set; } - - [PacketIndex(1)] - public CharacterNameAppearance NameAppearance { get; set; } - - [PacketIndex(2)] - public GenderType GenderType { get; set; } - - [PacketIndex(3)] - public HairStyleType HairStyleType { get; set; } - - [PacketIndex(4)] - public HairColorType HairColorType { get; set; } - - [PacketIndex(5)] - public CharacterClassType CharacterClassType { get; set; } - - [PacketIndex(6)] - public EqListInfo EqList { get; set; } - - [PacketIndex(7, RemoveSeparator = true)] - public EqRareInfo EqInfo { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs deleted file mode 100644 index 339ed79e..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EqRareInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("subpacket_eq_rare_info")] - public class EqRareInfo : PacketBase - { - [PacketIndex(0)] - public byte WeaponUpgrade { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "")] - public sbyte WeaponRarity { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = " ")] - public byte ArmorUpgrade { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = "")] - public sbyte ArmorRarity { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs deleted file mode 100644 index 2be3e4ff..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipPacket.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("equip")] - public class EquipPacket : PacketBase - { - [PacketIndex(0, RemoveSeparator = true)] - public EqRareInfo EqRare { get; set; } - - - [PacketIndex(1, SeparatorNestedElements = " ", IsOptional = true)] - public List EqList { get; set; } - - [PacketHeader("equip_subpacket")] - public class EquipSubPacket : PacketBase - { - [PacketIndex(0)] - public int WearIndex { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long ItemId { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public byte ItemRarity { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public byte UpgradeOrDesign { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".")] - public byte Unknown { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs deleted file mode 100644 index c319da6f..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentInfoPacket.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("eqinfo")] - public class EquipmentInfoPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte Type { get; set; } // todo more information - - [PacketIndex(1)] - public short Slot { get; set; } - - [PacketIndex(2)] - public long? ShopOwnerId { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs deleted file mode 100644 index d073e450..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/EquipmentListItem.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("subpacket_eq_list")] - public class EquipmentListItem - { - [PacketIndex(0)] - public EquipmentType EquipmentType { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long ItemId { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public sbyte ItemRarity { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public byte DesignOrUpgrade { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".")] - public byte Unknown { get; set; } = 0; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs deleted file mode 100644 index 7bca8705..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/GetPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("get")] - public class GetPacket : PacketBase - { - [PacketIndex(0)] - public byte Unknown1 { get; set; } = 1; - - [PacketIndex(1)] - public long CharacterId { get; set; } - - [PacketIndex(2)] - public long ItemId { get; set; } - - [PacketIndex(3)] - public byte Unknown2 { get; set; } = 0; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs deleted file mode 100644 index a4742a99..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/GoldPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("gold")] - public class GoldPacket : PacketBase - { - [PacketIndex(0)] - public long Gold { get; set; } - - [PacketIndex(1)] - public byte Unknown { get; set; } = 0; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs deleted file mode 100644 index 72203f81..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/InvPacket.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("inv")] - public class InvPacket : PacketBase - { - [PacketIndex(0)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(1, SeparatorNestedElements = " ", SeparatorBeforeProperty = " ", IsOptional = true)] - public List Items { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs deleted file mode 100644 index 39193398..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/InventoryWearSubPacket.cs +++ /dev/null @@ -1,35 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("eq_subpacket")] - public class InventoryWearSubPacket : PacketBase - { - [PacketIndex(0)] - public long Hat { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long Armor { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public long MainWeapon { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public long SecondaryWeapon { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".")] - public long Mask { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = ".")] - public long Fairy { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = ".")] - public long CostumeSuit { get; set; } - - [PacketIndex(7, SeparatorBeforeProperty = ".")] - public long CostumeHat { get; set; } - - [PacketIndex(8, SeparatorBeforeProperty = ".")] - public long WeaponSkin { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs deleted file mode 100644 index 90680736..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/IvnPacket.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("ivn")] - public class IvnPacket : PacketBase - { - [PacketIndex(0)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(1)] - public short Slot { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public long ItemId { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public short Rare { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".", IsOptional = true)] - public short? Upgrade { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = ".", IsOptional = true)] - public short? SpStoneUpgrade { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs deleted file mode 100644 index cf55777c..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/PairyPacket.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("pairy")] - public class PairyPacket : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long CharacterId { get; set; } - - [PacketIndex(2)] - public byte FairyMoveType { get; set; } - - [PacketIndex(3)] - public ElementType ElementType { get; set; } - - [PacketIndex(4)] - public short FairyLevel { get; set; } - - [PacketIndex(5)] - public short ItemMorph { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs deleted file mode 100644 index db591802..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Inventory/SlInfoPacket.cs +++ /dev/null @@ -1,141 +0,0 @@ -using ChickenAPI.Enums.Game.Items; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Inventory -{ - [PacketHeader("slinfo")] - public class SlInfoPacket : PacketBase - { - [PacketIndex(0)] - public InventoryType InventoryType { get; set; } - - [PacketIndex(1)] - public long ItemId { get; set; } - - [PacketIndex(2)] - public short ItemMorph { get; set; } - - [PacketIndex(3)] - public byte SpLevel { get; set; } - - [PacketIndex(4)] - public byte LevelJobMinimum { get; set; } - - [PacketIndex(5)] - public byte ReputationMinimum { get; set; } - - [PacketIndex(6)] - public int Unknown { get; set; } - - [PacketIndex(7)] - public int Unknown2 { get; set; } - - [PacketIndex(8)] - public int Unknown3 { get; set; } - - [PacketIndex(9)] - public int Unknown4 { get; set; } - - [PacketIndex(10)] - public int Unknown5 { get; set; } - - [PacketIndex(11)] - public int Unknown6 { get; set; } - - [PacketIndex(12)] - public int Unknown7 { get; set; } - - [PacketIndex(13)] - public byte SpType { get; set; } - - [PacketIndex(14)] - public short FireResistance { get; set; } - - [PacketIndex(15)] - public short WaterResistance { get; set; } - - [PacketIndex(16)] - public short LightResistance { get; set; } - - [PacketIndex(17)] - public short DarkResistance { get; set; } - - [PacketIndex(18)] - public long Xp { get; set; } - - [PacketIndex(19)] - public short SPXpData { get; set; } - - [PacketIndex(20)] - public string Skill { get; set; } - - [PacketIndex(21)] - public int TransportId { get; set; } - - [PacketIndex(22)] - public int SlHit { get; set; } - - [PacketIndex(23)] - public int FreeSpPoints { get; set; } - - [PacketIndex(24)] - public int SlDefence { get; set; } - - [PacketIndex(25)] - public int SlElement { get; set; } - - [PacketIndex(26)] - public int SlHp { get; set; } - - [PacketIndex(27)] - public byte Upgrade { get; set; } - - [PacketIndex(28)] - public int Unknown8 { get; set; } - - [PacketIndex(29)] - public int Unknown9 { get; set; } - - [PacketIndex(30)] - public byte IsSpDestroyed { get; set; } - - [PacketIndex(31)] - public int ShellHit { get; set; } - - [PacketIndex(32)] - public int ShellDefense { get; set; } - - [PacketIndex(33)] - public int ShellElement { get; set; } - - [PacketIndex(34)] - public int ShellHpMp { get; set; } - - [PacketIndex(35)] - public short SpStoneUpgrade { get; set; } - - [PacketIndex(36)] - public short AttackPoints { get; set; } - - [PacketIndex(37)] - public short DefensePoints { get; set; } - - [PacketIndex(38)] - public short ElementPoints { get; set; } - - [PacketIndex(39)] - public short HpMpPoints { get; set; } - - [PacketIndex(40)] - public short SpFireResistance { get; set; } - - [PacketIndex(41)] - public short SpWaterResistance { get; set; } - - [PacketIndex(42)] - public short SpLightResistance { get; set; } - - [PacketIndex(43)] - public short SpDarkResistance { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs b/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs deleted file mode 100644 index ec6119b2..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Map/MapoutPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Map -{ - [PacketHeader("mapout")] - public class MapoutPacket : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs deleted file mode 100644 index f760cd93..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Mates/PSkiPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Mates -{ - [PacketHeader("pski")] - public class PSkiPacket - { - [PacketIndex(0)] - public long FirstSkill { get; set; } - - [PacketIndex(1)] - public long SecondSkill { get; set; } - - [PacketIndex(2)] - public long ThirdSkill { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs deleted file mode 100644 index c86e4fee..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Mates/SayPetPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Mates -{ - [PacketHeader("say_p")] - public class SayPetPacket - { - [PacketIndex(0)] - public long PetId { get; set; } - - [PacketIndex(1, SerializeToEnd = true)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs deleted file mode 100644 index a356d280..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Mates/ScnPacket.cs +++ /dev/null @@ -1,242 +0,0 @@ -using ChickenAPI.Enums.Game.Mates; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Mates -{ - /// - /// Packets for partners - /// - [PacketHeader("sc_n")] - public class ScnPacket : PacketBase - { - [PacketIndex(0)] - public long PetId { get; set; } - - [PacketIndex(1)] - public long NpcMonsterVNum { get; set; } - - [PacketIndex(2)] - public long TransportId { get; set; } - - [PacketIndex(3)] - public short Level { get; set; } - - [PacketIndex(4)] - public short Loyalty { get; set; } - - [PacketIndex(5)] - public long Experience { get; set; } - - [PacketIndex(6)] - public ScEquipmentDetails WeaponInstanceDetails { get; set; } - - [PacketIndex(7)] - public ScEquipmentDetails ArmorInstanceDetails { get; set; } - - [PacketIndex(8)] - public ScEquipmentDetails GauntletInstanceDetails { get; set; } - - [PacketIndex(9)] - public ScEquipmentDetails BootsInstanceDetails { get; set; } - - [PacketIndex(10)] - public short Unknown { get; set; } - - [PacketIndex(11)] - public short Unknown2 { get; set; } - - [PacketIndex(12)] - public short Unknown3 { get; set; } - - [PacketIndex(13)] - public short AttackUpgrade { get; set; } - - [PacketIndex(14)] - public int MinimumAttack { get; set; } - - [PacketIndex(15)] - public int MaximumAttack { get; set; } - - [PacketIndex(16)] - public int Precision { get; set; } - - [PacketIndex(17)] - public int CriticalRate { get; set; } - - [PacketIndex(18)] - public int CriticalDamageRate { get; set; } - - [PacketIndex(19)] - public short DefenceUpgrade { get; set; } - - [PacketIndex(20)] - public int Defence { get; set; } - - [PacketIndex(21)] - public int DefenceDodge { get; set; } - - [PacketIndex(22)] - public int DistanceDefence { get; set; } - - [PacketIndex(23)] - public int DistanceDodge { get; set; } - - [PacketIndex(24)] - public int DodgeRate { get; set; } - - [PacketIndex(25)] - public int ElementRate { get; set; } - - [PacketIndex(26)] - public int FireResistance { get; set; } - - [PacketIndex(27)] - public int WaterResistance { get; set; } - - [PacketIndex(28)] - public int LightResistance { get; set; } - - [PacketIndex(29)] - public int DarkResistance { get; set; } - - [PacketIndex(30)] - public int Hp { get; set; } - - [PacketIndex(31)] - public int HpMax { get; set; } - - [PacketIndex(32)] - public int Mp { get; set; } - - [PacketIndex(33)] - public int MpMax { get; set; } - - [PacketIndex(34)] - public int Unknown21 { get; set; } - - [PacketIndex(35)] - public int Unknown22 { get; set; } - - /// - /// Spaces should be replaced by "^" - /// - [PacketIndex(36)] - public string Name { get; set; } - - /// - /// Sp Instance or Skin - /// - [PacketIndex(37)] - public int MorphId { get; set; } - - /// - /// Sp Instance or Skin - /// - [PacketIndex(38)] - public bool IsSummonable { get; set; } - - /// - /// Sp Instance or Skin - /// - [PacketIndex(39)] - public ScSpDetails SpDetails { get; set; } - - /// - /// Sp Instance or Skin - /// - [PacketIndex(40)] - public ScSkillDetails Skill1Details { get; set; } - - /// - /// Sp Instance or Skin - /// - [PacketIndex(41)] - public ScSkillDetails Skill2Details { get; set; } - - /// - /// Sp Instance or Skin - /// - [PacketIndex(42)] - public ScSkillDetails Skill3Details { get; set; } - - [PacketHeader("SUBPACKET_SC_SP")] - public class ScSpDetails : PacketBase - { - [PacketIndex(0)] - public long ItemId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public byte AgilityPercentage { get; set; } - } - - [PacketHeader("SUBPACKET_SC_EQ")] - public class ScEquipmentDetails : PacketBase - { - [PacketIndex(0)] - public long ItemId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long ItemRare { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public long ItemUpgrade { get; set; } - } - - [PacketHeader("SUBPACKET_SC_SP_SKILL")] - public class ScSkillDetails : PacketBase - { - [PacketIndex(0)] - public long SkillId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public SpPartnerRank Rank { get; set; } - } - } -} - -/* - sc_n - {PetId} - {NpcMonsterVNum} - {MateTransportId} - {Level} - {Loyalty} - {Experience} - {WeaponDetails (vnum.rare.upgrade) : "-1"} // weapon details - {ArmorDetails (vnum.rare.upgrade) : "-1"} // armor details - {GlovesDetails (vnum.0.0) : "-1"} // gaunt details - {BoostDetails (vnum.0.0) : "-1"} // boots details - 0 // unknown - 0 // unknown 2 - 1 // unknown 3 - 0 // unknown 4 - 142 // unknown 5 - 174 // unknown 6 - 232 // unknown 7 - 4 // unknown 8 - 70 // unknown 9 - 0 // unknown 10 - 73 // unknown 11 - 158 // unknown 12 - 86 // unknown 13 - 158 // unknown 14 - 69 // dodge rate - 0 // element rate 16 - 0 // unknown 17 - 0 // unknown 18 - 0 // unknown 19 - 0 // unknown 20 - {Hp} - {MaxHp} - {Mp} - {MaxMp} - 0 // unknown 21 - 285816 // unknown 22 - {Name.Replace(' ', '^')} - {-1} // skin - {(IsSummonable ? 1 : 0)} - {(SpInstance != null ? $"{SpInstance.ItemVNum}.100" : "-1")} - {(SkillId.SkillRank) :) // unknown 23 SpRank1 - -1 // unknown 24 SpRank2 - -1 // unknown 25 SpRank3 - */ \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs deleted file mode 100644 index ad36ede1..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Mates/ScpPacket.cs +++ /dev/null @@ -1,110 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Mates -{ - /// - /// Packets for pets - /// - [PacketHeader("sc_p")] - public class ScpPacket : PacketBase - { - [PacketIndex(0)] - public long PetId { get; set; } - - [PacketIndex(1)] - public long NpcMonsterVNum { get; set; } - - [PacketIndex(2)] - public long TransportId { get; set; } - - [PacketIndex(3)] - public short Level { get; set; } - - [PacketIndex(4)] - public short Loyalty { get; set; } - - [PacketIndex(5)] - public long Experience { get; set; } - - [PacketIndex(6)] - public long Unknow1 { get; set; } - - [PacketIndex(7)] - public long AttackUpgrade { get; set; } - - [PacketIndex(8)] - public long DamageMinimum { get; set; } - - [PacketIndex(9)] - public long DamageMaximum { get; set; } - - [PacketIndex(10)] - public long Concentrate { get; set; } - - [PacketIndex(11)] - public long CriticalChance { get; set; } - - [PacketIndex(12)] - public long CriticalRate { get; set; } - - [PacketIndex(13)] - public long DefenceUpgrade { get; set; } - - [PacketIndex(14)] - public long CloseDefence { get; set; } - - [PacketIndex(15)] - public long DefenceDodge { get; set; } - - [PacketIndex(16)] - public long DistanceDefence { get; set; } - - [PacketIndex(17)] - public long DistanceDefenceDodge { get; set; } - - [PacketIndex(18)] - public long MagicDefence { get; set; } - - [PacketIndex(19)] - public long Element { get; set; } - - [PacketIndex(20)] - public long FireResistance { get; set; } - - [PacketIndex(21)] - public long WaterResistance { get; set; } - - [PacketIndex(22)] - public long LightResistance { get; set; } - - [PacketIndex(23)] - public long DarkResistance { get; set; } - - [PacketIndex(24)] - public long Hp { get; set; } - - [PacketIndex(25)] - public long MaxHp { get; set; } - - [PacketIndex(26)] - public long Mp { get; set; } - - [PacketIndex(27)] - public long MaxMp { get; set; } - - [PacketIndex(28)] - public bool IsTeamMember { get; set; } - - [PacketIndex(29)] - public long XpLoad { get; set; } - - [PacketIndex(30)] - public bool CanPickUp { get; set; } - - [PacketIndex(31)] - public string Name { get; set; } - - [PacketIndex(32)] - public bool IsSummonable { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs deleted file mode 100644 index 630ea19c..00000000 --- a/src/ChickenAPI.Packets/Game/Server/MiniMap/AtPacketBase.cs +++ /dev/null @@ -1,36 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.MiniMap -{ - [PacketHeader("at")] - public class AtPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public long CharacterId { get; set; } - - [PacketIndex(1)] - public short MapId { get; set; } - - [PacketIndex(2)] - public short PositionX { get; set; } - - [PacketIndex(3)] - public short PositionY { get; set; } - - [PacketIndex(4)] - public byte Unknown1 { get; set; } - - [PacketIndex(5)] - public byte Unknown2 { get; set; } - - [PacketIndex(6)] - public int Music { get; set; } - - [PacketIndex(7)] - public short Unknown3 { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs b/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs deleted file mode 100644 index 38e4c6b9..00000000 --- a/src/ChickenAPI.Packets/Game/Server/MiniMap/CMapPacket.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.MiniMap -{ - [PacketHeader("c_map")] - public class CMapPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte Type { get; set; } // Seems to be always equal to 0 - - [PacketIndex(1)] - public short Id { get; set; } - - [PacketIndex(2)] - public byte MapType { get; set; } // depends on the maptype (1 = base & 0 = instanciated I think) - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs b/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs deleted file mode 100644 index 0a2b995a..00000000 --- a/src/ChickenAPI.Packets/Game/Server/MiniMap/RsfpPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.MiniMap -{ - [PacketHeader("rsfp")] - public class RsfpPacket : PacketBase - { - [PacketIndex(0)] - public long MapX { get; set; } = 0; - - [PacketIndex(1)] - public long MapY { get; set; } = -1; - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs deleted file mode 100644 index e5e502da..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/BnPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("bn")] - public class BnPacket : PacketBase - { - [PacketIndex(0)] - public byte BnNumber { get; set; } - - [PacketIndex(1)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs deleted file mode 100644 index c5e51dca..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/CInfoPacket.cs +++ /dev/null @@ -1,67 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("c_info")] - public class CInfoPacket : PacketBase - { - #region Propertiesf - - [PacketIndex(0)] - public string Name { get; set; } - - [PacketIndex(1)] - public string Unknown1 { get; set; } - - [PacketIndex(2)] - public short GroupId { get; set; } - - [PacketIndex(3)] - public long FamilyId { get; set; } - - [PacketIndex(4)] - public string FamilyName { get; set; } - - [PacketIndex(5)] - public long CharacterId { get; set; } - - [PacketIndex(6)] - public CharacterNameAppearance NameAppearance { get; set; } - - [PacketIndex(7)] - public GenderType Gender { get; set; } - - [PacketIndex(8)] - public HairStyleType HairStyle { get; set; } - - [PacketIndex(9)] - public HairColorType HairColor { get; set; } - - [PacketIndex(10)] - public CharacterClassType Class { get; set; } - - [PacketIndex(11)] - public byte Icon { get; set; } - - [PacketIndex(12)] - public short Compliment { get; set; } - - [PacketIndex(13)] - public short Morph { get; set; } - - [PacketIndex(14)] - public bool Invisible { get; set; } - - [PacketIndex(15)] - public byte FamilyLevel { get; set; } - - [PacketIndex(16)] - public byte SpUpgrade { get; set; } - - [PacketIndex(17)] - public bool ArenaWinner { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs deleted file mode 100644 index 5059aa70..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/CModePacketBase.cs +++ /dev/null @@ -1,30 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("c_mode")] - public class CModePacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long CharacterId { get; set; } - - [PacketIndex(2)] - public short Morph { get; set; } - - [PacketIndex(3)] - public byte SpUpgrade { get; set; } - - [PacketIndex(4)] - public byte SpDesign { get; set; } - - [PacketIndex(5, IsOptional = true)] - public bool ArenaWinner { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs deleted file mode 100644 index b46902cb..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/CondPacketBase.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("cond")] - public class CondPacketBase : PacketBase - { - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public bool NoAttack { get; set; } - - [PacketIndex(3)] - public bool NoMove { get; set; } - - [PacketIndex(4)] - public byte Speed { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs deleted file mode 100644 index b744ecde..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/FdPacket.cs +++ /dev/null @@ -1,24 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("fd")] - public class FdPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public long Reput { get; set; } - - [PacketIndex(1)] - public int ReputIcon { get; set; } - - [PacketIndex(2)] - public int Dignity { get; set; } - - [PacketIndex(3)] - public int DignityIcon { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs deleted file mode 100644 index 5cf5a56b..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/FsPacket.cs +++ /dev/null @@ -1,12 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("fs")] - public class FsPacket : PacketBase - { - [PacketIndex(0)] - public FactionType Faction { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs deleted file mode 100644 index 9b2aaeb2..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/LevPacket.cs +++ /dev/null @@ -1,45 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - /// - /// $"lev {Level} {LevelXp} {(UseSp? SpInstance.SpLevel : JobLevel)} {(UseSp ? SpInstance.XP : JobLevelXp)} {XpLoad()} - /// {(UseSp ? SpxpLoad() : JobXpLoad())} {Reput} {GetCp()} {HeroXp} {HeroLevel} {HeroXpLoad()}"; - /// - [PacketHeader("lev")] - public class LevPacket : PacketBase - { - [PacketIndex(0)] - public byte Level { get; set; } - - [PacketIndex(1)] - public int LevelXp { get; set; } - - [PacketIndex(2)] - public byte JobLevel { get; set; } - - [PacketIndex(3)] - public int JobLevelXp { get; set; } - - [PacketIndex(4)] - public long LevelXpMax { get; set; } - - [PacketIndex(5)] - public long JobLevelXpMax { get; set; } - - [PacketIndex(6)] - public long Reputation { get; set; } - - [PacketIndex(7)] - public int Cp { get; set; } - - [PacketIndex(8)] - public int HeroLevelXp { get; set; } - - [PacketIndex(9)] - public byte HeroLevel { get; set; } - - [PacketIndex(10)] - public int HeroLevelXpMax { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs deleted file mode 100644 index 42d91007..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/LevelUpPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("levelup")] - public class LevelUpPacket : PacketBase - { - [PacketIndex(0)] - public long CharacterId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs deleted file mode 100644 index 36812bca..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/QSlotPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("qslot")] - public class QSlotPacket : PacketBase - { - [PacketIndex(0)] - public long Slot { get; set; } - - [PacketIndex(1)] - public string Data { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs b/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs deleted file mode 100644 index 92fc45f6..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/QsetPacketReceive.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("qset")] - public class QsetPacketReceive : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short Q1 { get; set; } - - [PacketIndex(1)] - public short Q2 { get; set; } - - [PacketIndex(2)] - public string Data { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs deleted file mode 100644 index 4582c807..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/RagePacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("rage")] - public class RagePacket : PacketBase - { - [PacketIndex(0)] - public long RagePoints { get; set; } - - [PacketIndex(1)] - public long RagePointsMax { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs deleted file mode 100644 index c2942fda..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/SayPacket.cs +++ /dev/null @@ -1,25 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("say")] - public class SayPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1)] - public long VisualId { get; set; } - - [PacketIndex(2)] - public SayColorType Type { get; set; } - - [PacketIndex(3)] - public string Message { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs deleted file mode 100644 index 99575747..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/ScPacket.cs +++ /dev/null @@ -1,80 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("sc")] - public class ScPacket : PacketBase - { - [PacketIndex(0)] - public byte Type { get; set; } - - [PacketIndex(1)] - public byte MainWeaponUpgrade { get; set; } - - [PacketIndex(2)] - public int MinHit { get; set; } - - [PacketIndex(3)] - public int MaxHit { get; set; } - - [PacketIndex(4)] - public int HitRate { get; set; } - - [PacketIndex(5)] - public short CriticalHitRate { get; set; } - - [PacketIndex(6)] - public int CriticalHitMultiplier { get; set; } - - [PacketIndex(7)] - public byte Type2 { get; set; } - - [PacketIndex(8)] - public short SecondaryWeaponUpgrade { get; set; } - - [PacketIndex(9)] - public short SecondaryMinHit { get; set; } - - [PacketIndex(10)] - public short SecondaryMaxHit { get; set; } - - [PacketIndex(11)] - public short SecondaryHitRate { get; set; } - - [PacketIndex(12)] - public short SecondaryCriticalHitRate { get; set; } - - [PacketIndex(13)] - public short SecondaryCriticalHitMultiplier { get; set; } - - [PacketIndex(14)] - public byte ArmorUpgrade { get; set; } - - [PacketIndex(15)] - public short Defence { get; set; } - - [PacketIndex(16)] - public short DefenceRate { get; set; } - - [PacketIndex(17)] - public short DistanceDefence { get; set; } - - [PacketIndex(18)] - public short DistanceDefenceRate { get; set; } - - [PacketIndex(19)] - public short MagicalDefence { get; set; } - - [PacketIndex(20)] - public short FireResistance { get; set; } - - [PacketIndex(21)] - public short WaterResistance { get; set; } - - [PacketIndex(22)] - public short LightResistance { get; set; } - - [PacketIndex(23)] - public short DarkResistance { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs deleted file mode 100644 index a4edea4a..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/StatPacket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("stat")] - public class StatPacket : PacketBase - { - [PacketIndex(0)] - public long Hp { get; set; } - - [PacketIndex(1)] - public long HpMax { get; set; } - - [PacketIndex(2)] - public long Mp { get; set; } - - [PacketIndex(3)] - public long MpMax { get; set; } - - [PacketIndex(4)] - public long Unknown { get; set; } // seems to be 0 - - [PacketIndex(5)] - public double CharacterOption { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs deleted file mode 100644 index 829d3caf..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Player/TitPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Player -{ - [PacketHeader("tit")] - public class TitPacket : PacketBase - { - [PacketIndex(0)] - public string ClassType { get; set; } - - [PacketIndex(1)] - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs b/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs deleted file mode 100644 index 87e2bcdf..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Portals/GpPacket.cs +++ /dev/null @@ -1,30 +0,0 @@ -using ChickenAPI.Enums.Game.Portals; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Portals -{ - /// - /// gp {SourceX} {SourceY} {MapId} {Type} {PortalId} {IsDisabled} - /// - [PacketHeader("gp")] - public class GpPacket : PacketBase - { - [PacketIndex(0)] - public short PositionX { get; set; } - - [PacketIndex(1)] - public short PositionY { get; set; } - - [PacketIndex(2)] - public long DestinationMapId { get; set; } - - [PacketIndex(3)] - public PortalType PortalType { get; set; } - - [PacketIndex(4)] - public long PortalId { get; set; } - - [PacketIndex(5)] - public bool IsDisabled { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs b/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs deleted file mode 100644 index 78fc1606..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Raids/RlPacket.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Raids -{ - [PacketHeader("rl")] - public class RlPacket - { - [PacketIndex(0)] - public RlPacketType Type { get; set; } - - [PacketIndex(1, SeparatorNestedElements = " ")] - public List Raids { get; set; } - - [PacketHeader("rl_packet_details")] - public class RaidListPacketDetail : PacketBase - { - [PacketIndex(0)] - public long RaidId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = ".")] - public long LevelMinimum { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = ".")] - public long LevelMaximum { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = ".")] - public string LeaderName { get; set; } - - [PacketIndex(4, SeparatorBeforeProperty = ".")] - public long LeaderLevel { get; set; } - - [PacketIndex(5, SeparatorBeforeProperty = ".")] - public long LeaderMorphId { get; set; } - - [PacketIndex(6, SeparatorBeforeProperty = ".")] - public CharacterClassType LeaderClass { get; set; } - - [PacketIndex(7, SeparatorBeforeProperty = ".")] - public GenderType LeaderGender { get; set; } - - [PacketIndex(8, SeparatorBeforeProperty = ".")] - public long PlayerCountInGroup { get; set; } - - [PacketIndex(9, SeparatorBeforeProperty = ".")] - public long LeaderHeroLevel { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs deleted file mode 100644 index 01ad086c..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Relations/BlInitPacket.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Relations -{ - [PacketHeader("blinit")] - public class BlInitPacket : PacketBase - { - [PacketIndex(0, SeparatorNestedElements = " ")] - public List SubPackets { get; set; } - - [PacketHeader("blinit_subpacket")] - public class BlInitSubPacket - { - [PacketIndex(0)] - public long CharacterId { get; set; } - - [PacketIndex(1)] - public string CharacterName { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs b/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs deleted file mode 100644 index f46681bf..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Relations/FInitPacket.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Collections.Generic; -using ChickenAPI.Enums.Game.Relations; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Relations -{ - [PacketHeader("finit")] - public class FInitPacket : PacketBase - { - [PacketIndex(0, SeparatorNestedElements = " ")] - public List Packets { get; set; } - - [PacketHeader("finit_subpacket")] - public class FInitSubPacket : PacketBase - { - [PacketIndex(0)] - public long RelationId { get; set; } - - [PacketIndex(1, SeparatorBeforeProperty = "|")] - public CharacterRelationType RelationType { get; set; } - - [PacketIndex(2, SeparatorBeforeProperty = "|")] - public bool IsOnline { get; set; } - - [PacketIndex(3, SeparatorBeforeProperty = "|")] - public string CharacterName { get; set; } - } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs b/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs deleted file mode 100644 index 46e62d78..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Relations/FInsPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Relations -{ - [PacketHeader("fins")] - public class FInsPacket : PacketBase - { - [PacketIndex(0)] - public FInsPacketType Type { get; set; } - - [PacketIndex(1)] - public long CharacterId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs deleted file mode 100644 index ce19743a..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Shop/IShopPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Shop -{ - [PacketHeader("ishop")] - public class IShopPacket : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs deleted file mode 100644 index ed0f9c5a..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Shop/PFlagPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Shop -{ - [PacketHeader("pflag")] - public class PFlagPacket : PacketBase - { - [PacketIndex(0)] - public VisualType EntityType { get; set; } - - [PacketIndex(1)] - public long EntityId { get; set; } - - [PacketIndex(2)] - public long ShopId { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs deleted file mode 100644 index 2e93c652..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Shop/SMemoPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Shop -{ - [PacketHeader("s_memo")] - public class SMemoPacket : PacketBase - { - [PacketIndex(0)] - public SMemoPacketType SMemoPacketType { get; set; } - - [PacketIndex(1)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs b/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs deleted file mode 100644 index e3815382..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Shop/ShopEndPacket.cs +++ /dev/null @@ -1,12 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Shop -{ - [PacketHeader("shop_end")] - public class ShopEndPacket : PacketBase - { - [PacketIndex(0)] - public ShopEndPacketType Type { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs b/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs deleted file mode 100644 index a40c6abb..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Specialist/SdPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Specialist -{ - [PacketHeader("sd")] - public class SdPacket : PacketBase - { - [PacketIndex(0)] - public int CoolDown { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs deleted file mode 100644 index e149da91..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/Act6Packet.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("act6")] - public class Act6Packet : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs deleted file mode 100644 index 670b42a3..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/BSInfoPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("bsinfo")] - public class BSInfoPacket : PacketBase - { - [PacketIndex(0)] - public byte Mode { get; set; } - - [PacketIndex(1)] - public short Title { get; set; } - - [PacketIndex(2)] - public short Time { get; set; } - - [PacketIndex(3)] - public short Text { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs deleted file mode 100644 index d272ea7d..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/ChdmPacket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("ch_dm")] - public class ChDMPacket : PacketBase - { - [PacketIndex(0)] - public int Maxhp { get; set; } - - [PacketIndex(1)] - public int AngelDMG { get; set; } - - [PacketIndex(2)] - public int DemonDMG { get; set; } - - [PacketIndex(3)] - public int Time { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs deleted file mode 100644 index f29c2cc6..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/DelayPacket.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("delay")] - public class DelayPacket : PacketBase - { - [PacketIndex(0)] - public int Delay { get; set; } - - [PacketIndex(1)] - public DelayPacketType Type { get; set; } - - [PacketIndex(2)] - public string Argument { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs deleted file mode 100644 index 5dddb42a..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/DialogPacket.cs +++ /dev/null @@ -1,17 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("dlg")] - public class DialogPacket : PacketBase - { - [PacketIndex(0, IsReturnPacket = true)] - public PacketBase AcceptPacket { get; set; } - - [PacketIndex(1, IsReturnPacket = true)] - public PacketBase RefusePacket { get; set; } - - [PacketIndex(2, SerializeToEnd = true)] - public string Question { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs deleted file mode 100644 index 149c4966..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/GuriPacket.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("guri")] - public class GuriPacket : PacketBase - { - [PacketIndex(0)] - public GuriPacketType Type { get; set; } - - [PacketIndex(1)] - public uint Unknown { get; set; } // seems to be a visual type or something - - [PacketIndex(2)] - public long EntityId { get; set; } - - [PacketIndex(3)] - public uint Value { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs deleted file mode 100644 index 858b21fd..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/InfoPacket.cs +++ /dev/null @@ -1,11 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("info")] - public class InfoPacket : PacketBase - { - [PacketIndex(0)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs deleted file mode 100644 index bf183850..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/ModalPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("modal")] - public class ModalPacket : PacketBase - { - [PacketIndex(0)] - public ModalPacketType Type { get; set; } // TODO : Create An enum - - [PacketIndex(1)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs deleted file mode 100644 index a4783cb7..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/MsgPacket.cs +++ /dev/null @@ -1,15 +0,0 @@ -using ChickenAPI.Enums.Packets; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("msg")] - public class MsgPacket : PacketBase - { - [PacketIndex(0)] - public MsgPacketType Type { get; set; } - - [PacketIndex(1, SerializeToEnd = true)] - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs deleted file mode 100644 index 1ad85637..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/PClearPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("p_clear")] - public class PClearPacket : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs deleted file mode 100644 index 2e34329c..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/QnaPacket.cs +++ /dev/null @@ -1,14 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("qna")] - public class QnaPacket : PacketBase - { - [PacketIndex(0, IsReturnPacket = true)] - public PacketBase AcceptPacket { get; set; } - - [PacketIndex(1, SerializeToEnd = true)] - public string Question { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs b/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs deleted file mode 100644 index d9823634..00000000 --- a/src/ChickenAPI.Packets/Game/Server/UserInterface/ZzimPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.UserInterface -{ - [PacketHeader("zzim")] - public class ZzimPacket : PacketBase - { - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs deleted file mode 100644 index ffb8d6b0..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InAliveSubPacketBase.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_alive_subpacket")] - public class InAliveSubPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public byte HpPercentage { get; set; } - - [PacketIndex(1)] - public byte MpPercentage { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs deleted file mode 100644 index 6ad3ae31..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InCharacterSubPacketBase.cs +++ /dev/null @@ -1,107 +0,0 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Old.Attributes; -using ChickenAPI.Packets.Old.Game.Server.Inventory; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_character_subpacket")] - public class InCharacterSubPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public CharacterNameAppearance NameAppearance { get; set; } - - [PacketIndex(1)] - public GenderType Gender { get; set; } - - [PacketIndex(2)] - public HairStyleType HairStyle { get; set; } - - [PacketIndex(3)] - public HairColorType HairColor { get; set; } - - [PacketIndex(4)] - public CharacterClassType Class { get; set; } - - [PacketIndex(5, IsOptional = true)] - public InventoryWearSubPacket Equipment { get; set; } - - [PacketIndex(6)] - public byte HpPercentage { get; set; } - - [PacketIndex(7)] - public byte MpPercentage { get; set; } - - [PacketIndex(8)] - public bool IsSitting { get; set; } - - [PacketIndex(9)] - public long GroupId { get; set; } - - [PacketIndex(10)] - public byte FairyId { get; set; } - - [PacketIndex(11)] - public byte FairyElement { get; set; } - - [PacketIndex(12)] - public byte IsBoostedFairy { get; set; } - - [PacketIndex(13)] - public short FairyMorph { get; set; } - - [PacketIndex(14)] - public byte EntryType { get; set; } - - [PacketIndex(15)] - public long Morph { get; set; } - - [PacketIndex(16)] - public string WeaponRareAndUpgradeInfo { get; set; } - - [PacketIndex(17)] - public string ArmorRareAndUpgradeInfo { get; set; } - - [PacketIndex(18)] - public long FamilyId { get; set; } - - [PacketIndex(19)] - public string FamilyName { get; set; } - - [PacketIndex(20)] - public CharacterRep ReputationIcon { get; set; } - - [PacketIndex(21)] - public bool Invisible { get; set; } - - [PacketIndex(22)] - public long SpUpgrade { get; set; } - - [PacketIndex(23)] - public FactionType Faction { get; set; } - - [PacketIndex(24)] - public long SpDesign { get; set; } - - [PacketIndex(25)] - public byte Level { get; set; } - - [PacketIndex(26)] - public byte FamilyLevel { get; set; } - - [PacketIndex(27)] - public bool ArenaWinner { get; set; } - - [PacketIndex(28)] - public int Compliment { get; set; } - - [PacketIndex(29)] - public short Size { get; set; } - - [PacketIndex(30)] - public short HeroLevel { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs deleted file mode 100644 index 98cbd41f..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InItemSubPacketBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_item_subpacket")] - public class InItemSubPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short Unknown { get; set; } - - [PacketIndex(1)] - public short Unknown1 { get; set; } - - [PacketIndex(2)] - public short Unknown2 { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs deleted file mode 100644 index 0bb8a7e9..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InMateSubPacket.cs +++ /dev/null @@ -1,69 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_mate_subpacket")] - public class InMateSubPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public int HpPercentage { get; set; } - - [PacketIndex(1)] - public int MpPercentage { get; set; } - - [PacketIndex(2)] - public int Unknow { get; set; } - - [PacketIndex(3)] - public int Faction { get; set; } - - [PacketIndex(4)] - public int Unknow2 { get; set; } - - [PacketIndex(5)] - public long OwnerId { get; set; } - - [PacketIndex(6)] - public int Unknow3 { get; set; } - - [PacketIndex(7)] - public int Unknow4 { get; set; } - - [PacketIndex(8)] - public int Morph { get; set; } - - [PacketIndex(9)] - public string Name { get; set; } - - [PacketIndex(10)] - public byte MateType { get; set; } - - [PacketIndex(11)] - public byte Unknow5 { get; set; } - - [PacketIndex(12)] - public byte Unknow6 { get; set; } - - [PacketIndex(13)] - public long SPSkill1 { get; set; } - - [PacketIndex(14)] - public long SPSkill2 { get; set; } - - [PacketIndex(15)] - public long SPSkill3 { get; set; } - - [PacketIndex(16)] - public long SPRank1 { get; set; } - - [PacketIndex(17)] - public long SPRank2 { get; set; } - - [PacketIndex(18)] - public long SPRank3 { get; set; } - - #endregion Properties - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs deleted file mode 100644 index c6294b81..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InMonsterSubPacket.cs +++ /dev/null @@ -1,68 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_monster_subpacket")] - public class InMonsterSubPacket : PacketBase - { - [PacketIndex(0)] - public byte HpPercentage { get; set; } - - [PacketIndex(1)] - public byte MpPercentage { get; set; } - - [PacketIndex(2)] - public int Unknown1 { get; set; } - - [PacketIndex(3)] - public int Unknown2 { get; set; } - - [PacketIndex(4)] - public int Unknown3 { get; set; } - - [PacketIndex(5)] - public int Unknown4 { get; set; } - - [PacketIndex(6)] - public bool NoAggressiveIcon { get; set; } - - [PacketIndex(7)] - public int Unknown5 { get; set; } - - [PacketIndex(8)] - public int Unknown6 { get; set; } - - [PacketIndex(9)] - public string Unknown7 { get; set; } - - [PacketIndex(10)] - public int Unknown8 { get; set; } - - [PacketIndex(11)] - public int Unknown9 { get; set; } - - [PacketIndex(12)] - public int Unknown10 { get; set; } - - [PacketIndex(13)] - public int Unknown11 { get; set; } - - [PacketIndex(14)] - public int Unknown12 { get; set; } - - [PacketIndex(15)] - public int Unknown13 { get; set; } - - [PacketIndex(16)] - public int Unknown14 { get; set; } - - [PacketIndex(17)] - public int Unknown15 { get; set; } - - [PacketIndex(18)] - public int Unknown16 { get; set; } - - [PacketIndex(19)] - public int Unknown17 { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs deleted file mode 100644 index 7f6949af..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InNonPlayerSubPacketBase.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_non_player_subpacket")] - public class InNonPlayerSubPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short Dialog { get; set; } - - [PacketIndex(1)] - public byte Unknown { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs deleted file mode 100644 index 90bb908b..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InNpcSubPacket.cs +++ /dev/null @@ -1,68 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_npc_subpacket")] - public class InNpcSubPacket : PacketBase - { - [PacketIndex(0)] - public byte HpPercentage { get; set; } - - [PacketIndex(1)] - public byte MpPercentage { get; set; } - - [PacketIndex(2)] - public int Dialog { get; set; } - - [PacketIndex(3)] - public int Unknown1 { get; set; } - - [PacketIndex(4)] - public int Unknown2 { get; set; } - - [PacketIndex(5)] - public int Unknown3 { get; set; } - - [PacketIndex(6)] - public int Unknown4 { get; set; } - - [PacketIndex(7)] - public bool IsSitting { get; set; } - - [PacketIndex(8)] - public int Unknown5 { get; set; } - - [PacketIndex(9)] - public string Unknown6 { get; set; } - - [PacketIndex(10)] - public int Unknown7 { get; set; } - - [PacketIndex(11)] - public int Unknown8 { get; set; } - - [PacketIndex(12)] - public int Unknown9 { get; set; } - - [PacketIndex(13)] - public int Unknown10 { get; set; } - - [PacketIndex(14)] - public int Unknown11 { get; set; } - - [PacketIndex(15)] - public int Unknown12 { get; set; } - - [PacketIndex(16)] - public int Unknown13 { get; set; } - - [PacketIndex(17)] - public int Unknown14 { get; set; } - - [PacketIndex(18)] - public int Unknown15 { get; set; } - - [PacketIndex(19)] - public int Unknown16 { get; set; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs deleted file mode 100644 index 0fe96344..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InOwnableSubPacketBase.cs +++ /dev/null @@ -1,18 +0,0 @@ -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in_ownable_subpacket")] - public class InOwnableSubPacketBase : PacketBase - { - #region Properties - - [PacketIndex(0)] - public short? Unknown { get; set; } - - [PacketIndex(1)] - public long Owner { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs b/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs deleted file mode 100644 index a958e1f0..00000000 --- a/src/ChickenAPI.Packets/Game/Server/Visibility/InPacket.cs +++ /dev/null @@ -1,52 +0,0 @@ -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Packets.Old.Attributes; - -namespace ChickenAPI.Packets.Old.Game.Server.Visibility -{ - [PacketHeader("in")] - public class InPacket : PacketBase - { - #region Properties - - [PacketIndex(0)] - public VisualType VisualType { get; set; } - - [PacketIndex(1, IsOptional = true)] - public string Name { get; set; } - - [PacketIndex(2)] - public string TransportId { get; set; } - - [PacketIndex(3, IsOptional = true)] - public long? VNum { get; set; } - - [PacketIndex(4)] - public short PositionX { get; set; } - - [PacketIndex(5)] - public short PositionY { get; set; } - - [PacketIndex(6, IsOptional = true)] - public DirectionType DirectionType { get; set; } - - [PacketIndex(7, IsOptional = true)] - public long? Amount { get; set; } - - [PacketIndex(8, IsOptional = true, RemoveSeparator = true)] - public InMonsterSubPacket InMonsterSubPacket { get; set; } - - [PacketIndex(9, IsOptional = true, RemoveSeparator = true)] - public InCharacterSubPacketBase InCharacterSubPacket { get; set; } - - [PacketIndex(10, IsOptional = true, RemoveSeparator = true)] - public InNpcSubPacket InNpcSubPacket { get; set; } - - [PacketIndex(10, IsOptional = true, RemoveSeparator = true)] - public InItemSubPacketBase InDropSubPacket { get; set; } - - [PacketIndex(10, IsOptional = true, RemoveSeparator = true)] - public InMateSubPacket InMateSubPacket { get; set; } - - #endregion Properties - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/IPacket.cs b/src/ChickenAPI.Packets/IPacket.cs deleted file mode 100644 index c84c4d95..00000000 --- a/src/ChickenAPI.Packets/IPacket.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old -{ - public interface IPacket - { - /// - /// Packet's sent date - /// always set UTC time - /// - DateTime SentDateUtc { get; } - - Type PacketType { get; } - - /// - /// Packet's header - /// - string Header { get; } - - /// - /// Packet's content without its header - /// - string Content { get; } - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/IPacketFactory.cs b/src/ChickenAPI.Packets/IPacketFactory.cs deleted file mode 100644 index df80d445..00000000 --- a/src/ChickenAPI.Packets/IPacketFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old -{ - public interface IPacketFactory - { - string Serialize(IPacket packet); - - string Serialize(TPacket packet) where TPacket : IPacket; - - IPacket Deserialize(string packetContent, Type packetType, bool includesKeepAliveIdentity); - } -} \ No newline at end of file diff --git a/src/ChickenAPI.Packets/PacketBase.cs b/src/ChickenAPI.Packets/PacketBase.cs deleted file mode 100644 index 8c0cf995..00000000 --- a/src/ChickenAPI.Packets/PacketBase.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace ChickenAPI.Packets.Old -{ - public abstract class PacketBase : IPacket - { - #region Properties - - public DateTime SentDateUtc { get; set; } - public Type PacketType { get; set; } - public string Header { get; set; } - - // get the packet without the sessionId - public string Content => OriginalContent.Substring(OriginalContent.IndexOf(' ')); - - /// - /// - public string OriginalContent { get; set; } - - #endregion - } -} \ No newline at end of file diff --git a/src/Login/Network/ClientSession.cs b/src/Login/Network/ClientSession.cs index ac565477..25bb6c28 100644 --- a/src/Login/Network/ClientSession.cs +++ b/src/Login/Network/ClientSession.cs @@ -5,9 +5,9 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums; +using ChickenAPI.Data.Enums.Game; using ChickenAPI.Data.Server; -using ChickenAPI.Enums; -using ChickenAPI.Enums.Game; using DotNetty.Transport.Channels; using DotNetty.Transport.Channels.Groups; using DotNetty.Transport.Channels.Sockets; diff --git a/src/Plugins/Essentials/Character/CharacterModule.cs b/src/Plugins/Essentials/Character/CharacterModule.cs index e4644657..fe558587 100644 --- a/src/Plugins/Essentials/Character/CharacterModule.cs +++ b/src/Plugins/Essentials/Character/CharacterModule.cs @@ -3,9 +3,8 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums; using ChickenAPI.Data.Item; -using ChickenAPI.Enums; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Helpers; @@ -14,7 +13,7 @@ using Qmmands; using SaltyEmu.Commands.Checks; using SaltyEmu.Commands.Entities; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace Essentials.Character { diff --git a/src/Plugins/Essentials/Item/ItemModule.cs b/src/Plugins/Essentials/Item/ItemModule.cs index e1e46bf2..806ea5a9 100644 --- a/src/Plugins/Essentials/Item/ItemModule.cs +++ b/src/Plugins/Essentials/Item/ItemModule.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; using Autofac; using ChickenAPI.Core.IoC; +using ChickenAPI.Data.Enums; using ChickenAPI.Data.Item; -using ChickenAPI.Enums; using ChickenAPI.Game.Inventory.Events; using Qmmands; using SaltyEmu.Commands.Checks; diff --git a/src/Plugins/Essentials/MapManagement/ButcherModule.cs b/src/Plugins/Essentials/MapManagement/ButcherModule.cs index ed059fd6..b98a5c89 100644 --- a/src/Plugins/Essentials/MapManagement/ButcherModule.cs +++ b/src/Plugins/Essentials/MapManagement/ButcherModule.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using ChickenAPI.Data.Enums; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Hitting; using ChickenAPI.Game.Battle.Interfaces; diff --git a/src/Plugins/Essentials/Teleport/TeleportModule.cs b/src/Plugins/Essentials/Teleport/TeleportModule.cs index 1b8ec8b1..6bab729b 100644 --- a/src/Plugins/Essentials/Teleport/TeleportModule.cs +++ b/src/Plugins/Essentials/Teleport/TeleportModule.cs @@ -1,10 +1,10 @@ -using ChickenAPI.Enums; -using ChickenAPI.Game.Entities.Player; +using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using Qmmands; using SaltyEmu.Commands.Checks; using SaltyEmu.Commands.Entities; using System.Threading.Tasks; +using ChickenAPI.Data.Enums; using ChickenAPI.Game._ECS.Entities; namespace Essentials.Teleport diff --git a/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs b/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs index 1e41baff..d5439796 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/AlgorithmService.cs @@ -1,5 +1,4 @@ using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; using SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms; using SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Close; diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs index 0d9da070..8e93bfb9 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Close/CloseDefenceAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Close { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs index d4bd5562..eeccd36c 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs index f16f8e99..f04844e2 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalDistRateAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs index 6e369a19..519d88e6 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitAlgortihmcs.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs index 2c748d56..d9032fca 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/CriticalHitRateAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs index bb761af1..4cc7234f 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/HitRateAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs index 66b98430..41a331af 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxDistanceAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs index 652e6c82..01eb0385 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MaxHitAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs index 35324e54..7def543a 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinDistanceAlgorithm.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs index 4ad0558f..b983d0ce 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Damage/MinHitAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Damage { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs index dadcf34b..88ff9a35 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDefenceAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Distance { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs index 6e76ca5e..39e04e15 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Distance/RangedDodgeAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Distance { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs index bf64d87a..2c52b287 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpMax.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs index 05ce3aad..c0f12e1a 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegen.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs index 47d3daf0..03f6d3fc 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/HpRegenSitting.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs index a07849d2..d3712703 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpMax.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs index 7e0b8394..20b9e767 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/HpMp/MpRegenSitting.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.HpMp diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs index 7722afa6..2214a7fb 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/ICharacterStatAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs index 65fc0ab3..22134d46 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDefenceAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Magical { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs index 4d1bfbd8..7d36532f 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/Magical/MagicDodgeAlgorithm.cs @@ -1,5 +1,4 @@ -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Packets.Enumerations; +using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms.Magical { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs index 977474b2..d56ecb98 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/CharacterAlgorithms/SpeedAlgorithm.cs @@ -1,5 +1,4 @@ using System; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; namespace SaltyEmu.BasicAlgorithmPlugin.CharacterAlgorithms diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithmService.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithmService.cs index fd037849..42f72b99 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithmService.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithmService.cs @@ -1,5 +1,5 @@ -using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.NpcMonster; using SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms; namespace SaltyEmu.BasicAlgorithmPlugin diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HeroXp.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HeroXp.cs index 18b6385a..131302b6 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HeroXp.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HeroXp.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HpMax.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HpMax.cs index 04fc8f94..a4949b8b 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HpMax.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/HpMax.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/IMonsterRaceStatAlgorithm.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/IMonsterRaceStatAlgorithm.cs index 40da702d..f94ce6a0 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/IMonsterRaceStatAlgorithm.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/IMonsterRaceStatAlgorithm.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/JobXp.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/JobXp.cs index fb503dff..c0b73cd0 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/JobXp.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/JobXp.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/MpMax.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/MpMax.cs index 0f7b7430..1143e73a 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/MpMax.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/MpMax.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms { diff --git a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/Xp.cs b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/Xp.cs index ab0624ce..e0a7a021 100644 --- a/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/Xp.cs +++ b/src/Plugins/NosSharp.BasicAlgorithm/NpcMonsterAlgorithms/Xp.cs @@ -1,4 +1,4 @@ -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; namespace SaltyEmu.BasicAlgorithmPlugin.NpcMonsterAlgorithms { diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Cards/CardModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Cards/CardModel.cs index d67330b0..7ccbbe5f 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Cards/CardModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Cards/CardModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using ChickenAPI.Enums.Game.Buffs; +using ChickenAPI.Data.Enums.Game.Buffs; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.BCard; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/AccountModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/AccountModel.cs index 42cafe2a..cbb8764a 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/AccountModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/AccountModel.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Core.i18n; -using ChickenAPI.Enums; +using ChickenAPI.Data.Enums; using SaltyEmu.Database; namespace SaltyEmu.DatabasePlugin.Models.Character diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs index 36ce524a..f31a4708 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterFamilyModel.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using ChickenAPI.Enums.Game.Families; +using ChickenAPI.Data.Enums.Game.Families; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Families; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs index fb75d7f6..f0b036f8 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterItemModel.cs @@ -3,8 +3,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Item; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterMateModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterMateModel.cs index 7594afaa..55ae0bf0 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterMateModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterMateModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.NpcMonster; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs index a669b763..f7479d4f 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Character/CharacterModel.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs index 55df694e..4530023c 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Families/FamilyModel.cs @@ -1,8 +1,6 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Families; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Character; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs index 273fd74f..fb3a42aa 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Item/ItemModel.cs @@ -2,13 +2,13 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.BCard; using SaltyEmu.DatabasePlugin.Models.Character; using SaltyEmu.DatabasePlugin.Models.Shop; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.DatabasePlugin.Models.Item { diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapMonsterModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapMonsterModel.cs index d56df22b..cd4d41ec 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapMonsterModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapMonsterModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.NpcMonster; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapNpcModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapNpcModel.cs index 2293d848..52a9359c 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapNpcModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/Map/MapNpcModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.NpcMonster; using SaltyEmu.DatabasePlugin.Models.Shop; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs b/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs index 1a2e033c..c7fe401f 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Models/NpcMonster/NpcMonsterModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using ChickenAPI.Data; -using ChickenAPI.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.BCard; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs index 4e27c5b0..95f43a3f 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/BCard/BCardDao.cs @@ -5,7 +5,7 @@ using AutoMapper; using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Context; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs index 5f03d887..c80df13b 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterDao.cs @@ -5,7 +5,7 @@ using AutoMapper; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; using SaltyEmu.DatabasePlugin.Models.Character; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs index f84a66bb..a14fce3e 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Services/Character/CharacterItemDao.cs @@ -4,9 +4,8 @@ using System.Threading.Tasks; using AutoMapper; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums; using ChickenAPI.Data.Item; -using ChickenAPI.Enums; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Packets.Enumerations; using Microsoft.EntityFrameworkCore; using SaltyEmu.Database; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Utils/NosSharpDatabasePluginMapper.cs b/src/Plugins/NosSharp.DatabasePlugin/Utils/NosSharpDatabasePluginMapper.cs index 821ea789..a6baec5e 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Utils/NosSharpDatabasePluginMapper.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Utils/NosSharpDatabasePluginMapper.cs @@ -6,14 +6,14 @@ using ChickenAPI.Data.BCard; using ChickenAPI.Data.Character; using ChickenAPI.Data.Drop; +using ChickenAPI.Data.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.Drop; using ChickenAPI.Data.Families; using ChickenAPI.Data.Item; using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Shop; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.BCard; -using ChickenAPI.Enums.Game.Drop; using SaltyEmu.DatabasePlugin.Models.BCard; using SaltyEmu.DatabasePlugin.Models.Cards; using SaltyEmu.DatabasePlugin.Models.Character; diff --git a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs index 1fbf51cb..85563cb4 100644 --- a/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs +++ b/src/Plugins/NosSharp.DatabasePlugin/Utils/PluginDependencyInjector.cs @@ -7,13 +7,13 @@ using ChickenAPI.Data.BCard; using ChickenAPI.Data.Character; using ChickenAPI.Data.Drop; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Data.Families; using ChickenAPI.Data.Item; using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Shop; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Packets.Enumerations; using Microsoft.EntityFrameworkCore; using SaltyEmu.DatabasePlugin.Context; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs index 95ecc99d..de7e3683 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CharacterScreenLoadHandler.cs @@ -5,10 +5,10 @@ using ChickenAPI.Core.Utils; using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums.Game; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; using ChickenAPI.Data.Server; -using ChickenAPI.Enums.Game; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game._Network; using ChickenAPI.Packets.ClientPackets.Login; using ChickenAPI.Packets.Interfaces; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs index 44cfb992..91d7b238 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterHandler.cs @@ -3,7 +3,7 @@ using ChickenAPI.Core.i18n; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Game._i18n; using ChickenAPI.Game._Network; using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs index fcf3763a..e29afc1a 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/CreateCharacterWrestlerHandler.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Game._Network; using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; using ChickenAPI.Packets.Enumerations; diff --git a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs index d8ba7f28..8a8b3844 100644 --- a/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs +++ b/src/Plugins/NosSharp.PacketHandler/CharacterScreen/DeleteCharacterHandler.cs @@ -4,7 +4,7 @@ using ChickenAPI.Core.Utils; using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; -using ChickenAPI.Enums.Game.Character; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Game._Network; using ChickenAPI.Packets.ClientPackets.CharacterSelectionScreen; using ChickenAPI.Packets.ServerPackets.UI; diff --git a/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs index a132a831..3de68751 100644 --- a/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Inventory/WearPacketHandling.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Packets.ClientPackets.Inventory; diff --git a/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs index eea116c3..0289a7c4 100644 --- a/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Relations/FInsPacketHandling.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Relations; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Relations.Events; using ChickenAPI.Packets.ClientPackets.Relations; diff --git a/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs index 3c020a47..58300ce3 100644 --- a/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Shops/ShoppingPacketHandling.cs @@ -1,6 +1,5 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Shops.Events; diff --git a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs index ad4aede1..12cf8d5b 100644 --- a/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Skill/UseSkillPacketHandling.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.Entities.Monster; diff --git a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs index ae81dc79..0013e1cd 100644 --- a/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs +++ b/src/Plugins/NosSharp.PacketHandler/Specialists/SlPacketHandling.cs @@ -1,7 +1,7 @@ using System.Linq; using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums; +using ChickenAPI.Data.Enums; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Specialists.Args; using ChickenAPI.Packets.ClientPackets.Specialists; diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/Redis/SessionService.cs b/src/Plugins/NosSharp.RedisSessionPlugin/Redis/SessionService.cs index c9307640..c1867bc4 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/Redis/SessionService.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/Redis/SessionService.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using ChickenAPI.Data.Enums.Game; using ChickenAPI.Data.Server; -using ChickenAPI.Enums.Game; using Foundatio.Caching; using SaltyEmu.Redis; using StackExchange.Redis; diff --git a/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs b/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs index 2c961d0b..a9245f88 100644 --- a/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs +++ b/src/Plugins/NosSharp.RedisSessionPlugin/RedisSessionService.cs @@ -1,8 +1,8 @@ using System; using System.Linq; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game; using ChickenAPI.Data.Server; -using ChickenAPI.Enums.Game; using SaltyEmu.Redis; using ServiceStack.Redis; using ServiceStack.Redis.Generic; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs index 87720d4c..25f72e79 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BCardBuffHandler.cs @@ -3,8 +3,8 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; using ChickenAPI.Data.BCard; +using ChickenAPI.Data.Enums.Game.BCard; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.BCard; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.BCards; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs index 72b1175e..88548566 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/BCardHandlers/BasicBCardHandlerContainer.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; -using ChickenAPI.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.BCard; using ChickenAPI.Game.Battle.Interfaces; using ChickenAPI.Game.BCards; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs index 3b094307..1d5282e4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Creation_Handler.cs @@ -4,7 +4,6 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; using ChickenAPI.Data.Families; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Families.Events; using ChickenAPI.Game.Families.Extensions; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Join_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Join_Handler.cs index d0e8733c..bd42a6ff 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Join_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Family/Family_Join_Handler.cs @@ -3,8 +3,8 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums.Game.Families; using ChickenAPI.Data.Families; -using ChickenAPI.Enums.Game.Families; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Families.Events; using ChickenAPI.Game.Families.Extensions; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs index b1c3af13..b6354eec 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_ItemInfo_Handler.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs index ecaba21a..50f0e2c3 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_LoadInventory_Handler.cs @@ -5,7 +5,6 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory; using ChickenAPI.Game.Inventory.Events; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs index dc2ca5ec..2298c8ea 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_MoveItem_Handler.cs @@ -3,7 +3,6 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs index c949fdd2..bd20e709 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_SendDetails_Handler.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs index 95e12277..7e63a3fc 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Inventory/Inventory_WearItem_Handler.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities; using ChickenAPI.Game.Entities.Player; @@ -12,7 +12,7 @@ using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers.Inventory { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs index b7a816c9..8ca34442 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Shops/Shop_Buy_Event.cs @@ -11,8 +11,6 @@ using ChickenAPI.Data.Character; using ChickenAPI.Data.Item; using ChickenAPI.Data.Shop; -using ChickenAPI.Enums.Game.Character; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Entities.Npc; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs index 86db0096..55802936 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_AddSkill_Handler.cs @@ -4,7 +4,6 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.Skills; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs index e05460b1..322369f7 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Skills/Skill_UseSkill_Handler.cs @@ -4,9 +4,8 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Skill; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Skill; using ChickenAPI.Game.Battle.Events; using ChickenAPI.Game.Battle.Extensions; using ChickenAPI.Game.Battle.Hitting; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs index b8219ca3..20ba9eba 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Specialists/Specialist_Transform_Handler.cs @@ -10,8 +10,6 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Game.Effects; using ChickenAPI.Game.Entities.Extensions; using ChickenAPI.Game.Entities.Player; @@ -24,7 +22,7 @@ using ChickenAPI.Game.Specialists.Extensions; using ChickenAPI.Packets.ClientPackets.Specialists; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers.Specialists { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs index 6c76e09d..23f908e4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_Rarify_Handler.cs @@ -7,8 +7,9 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; +using ChickenAPI.Data.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -19,7 +20,7 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Extension; using ChickenAPI.Game.Shops.Extensions; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs index 8af6b878..75b196f9 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeEquipment_Handler.cs @@ -3,8 +3,8 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Effects; @@ -15,7 +15,7 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Shops.Extensions; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.EventHandlers.Upgrading { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs index 2f548a15..cef531d0 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Upgrading/Upgrading_UpgradeSp_Handler.cs @@ -3,8 +3,8 @@ using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; using ChickenAPI.Core.Maths; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Effects; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Invisible_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Invisible_Handler.cs index d400019a..620401ce 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Invisible_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Invisible_Handler.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Visibility; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Visibility; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs index f18f0c41..99e0515e 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/EventHandlers/Visibility/Visibility_Visible_Handler.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using ChickenAPI.Core.Events; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Visibility; +using ChickenAPI.Data.Enums.Game.Visibility; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Visibility; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/EmoticonGuriHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/EmoticonGuriHandler.cs index a718c1b6..bff65ccb 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/EmoticonGuriHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/EmoticonGuriHandler.cs @@ -1,5 +1,5 @@ using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Effects; +using ChickenAPI.Data.Enums.Game.Effects; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.GuriHandling.Events; using ChickenAPI.Game.GuriHandling.Handling; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs index 94dd8c27..2ce371b4 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/GuriHandlers/ReleasePetsHandler.cs @@ -1,6 +1,5 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.GuriHandling.Events; using ChickenAPI.Game.GuriHandling.Handling; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs index 8fec8c80..13cb5abd 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/PerfectSpCard.cs @@ -10,7 +10,7 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs index 8bc0f518..93b48b4a 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/RarifyItemHandler.cs @@ -1,5 +1,5 @@ using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Extensions; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; @@ -7,7 +7,7 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Game.Shops.Extensions; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs index f10e0117..d9f9f649 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/SumItem.cs @@ -9,7 +9,7 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs index e4172295..b616a68c 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeItemHandler.cs @@ -1,8 +1,8 @@ using System; using Autofac; using ChickenAPI.Core.IoC; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Game; using ChickenAPI.Game.Configuration; using ChickenAPI.Game.Entities.Player; @@ -11,7 +11,7 @@ using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs index a2cbf230..14c58236 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUpgradeHandlers/UpgradeSpCard.cs @@ -1,11 +1,11 @@ -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items.Upgrade; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.ItemUpgrade.Events; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers; using ChickenAPI.Game.Inventory.ItemUpgrade.Handlers.Handling; using ChickenAPI.Packets.Enumerations; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace SaltyEmu.BasicPlugin.ItemUpgradeHandlers { diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs index db599da8..1b2ad5e8 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/BoxItem/PearlPetsReleaseHandler.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Entity; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Events; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs index 642cf12f..5e6381ad 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/LocomotionHandler.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Events; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs index 0eb06117..adb75413 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/Handler/WingsSpCard.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Entity; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Helpers; using ChickenAPI.Game.Inventory.Events; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs index d85445dd..eb4e9fe6 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/ItemUsageHandlers/UseItemHandlerAsync.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Items; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Inventory.Events; using ChickenAPI.Game.Inventory.ItemUsage; diff --git a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs index ca6c2e81..e67f3d98 100644 --- a/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs +++ b/src/Plugins/NosSharp.TemporaryMapPlugins/NpcDialogHandlers/DialogHandler.cs @@ -1,5 +1,4 @@ using ChickenAPI.Core.Logging; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game.Entities.Player; using ChickenAPI.Game.Entities.Player.Extensions; using ChickenAPI.Game.NpcDialog.Events; diff --git a/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj b/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj index cb44d490..8494324c 100644 --- a/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj +++ b/src/Plugins/SaltyEmu.FamilyPlugin/SaltyEmu.FamilyPlugin.csproj @@ -6,7 +6,6 @@ - diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/Protocol/ProcessInvitation.cs b/src/Plugins/SaltyEmu.FriendsPlugin/Protocol/ProcessInvitation.cs index 268efeef..771b3dfe 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/Protocol/ProcessInvitation.cs +++ b/src/Plugins/SaltyEmu.FriendsPlugin/Protocol/ProcessInvitation.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Data.Relations; -using ChickenAPI.Enums.Game.Relations; using SaltyEmu.Communication.Protocol; namespace SaltyEmu.FriendsPlugin.Protocol diff --git a/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs b/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs index 9fdca73e..762f709a 100644 --- a/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs +++ b/src/Plugins/SaltyEmu.FriendsPlugin/Services/RelationServiceClient.cs @@ -4,8 +4,8 @@ using ChickenAPI.Core.IPC; using ChickenAPI.Core.IPC.Protocol; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Data.Relations; -using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Communication.Communicators; using SaltyEmu.Communication.Configs; diff --git a/src/Toolkit/Commands/ParseCommand.cs b/src/Toolkit/Commands/ParseCommand.cs index 9444171c..412300fc 100644 --- a/src/Toolkit/Commands/ParseCommand.cs +++ b/src/Toolkit/Commands/ParseCommand.cs @@ -7,7 +7,7 @@ using ChickenAPI.Core.Utils; using ChickenAPI.Data.Account; using ChickenAPI.Data.Character; -using ChickenAPI.Enums; +using ChickenAPI.Data.Enums; using CommandLine; using SaltyEmu.BasicAlgorithmPlugin; using SaltyEmu.Core.Logging; diff --git a/src/Toolkit/Converter/CardDatConverter.cs b/src/Toolkit/Converter/CardDatConverter.cs index 29c695fc..ca4719d1 100644 --- a/src/Toolkit/Converter/CardDatConverter.cs +++ b/src/Toolkit/Converter/CardDatConverter.cs @@ -6,9 +6,9 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; +using ChickenAPI.Data.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.Buffs; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.BCard; -using ChickenAPI.Enums.Game.Buffs; using SaltyEmu.Core.Logging; namespace Toolkit.Converter diff --git a/src/Toolkit/Converter/ItemDatConverter.cs b/src/Toolkit/Converter/ItemDatConverter.cs index a40b0900..b939db57 100644 --- a/src/Toolkit/Converter/ItemDatConverter.cs +++ b/src/Toolkit/Converter/ItemDatConverter.cs @@ -7,12 +7,12 @@ using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; using ChickenAPI.Data.BCard; +using ChickenAPI.Data.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.Items; using ChickenAPI.Data.Item; -using ChickenAPI.Enums.Game.BCard; -using ChickenAPI.Enums.Game.Items; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Core.Logging; -using EquipmentType = ChickenAPI.Enums.Game.Items.EquipmentType; +using EquipmentType = ChickenAPI.Data.Enums.Game.Items.EquipmentType; namespace Toolkit.Converter { diff --git a/src/Toolkit/Converter/MonsterDatConverter.cs b/src/Toolkit/Converter/MonsterDatConverter.cs index 12bd24d9..05ed8e62 100644 --- a/src/Toolkit/Converter/MonsterDatConverter.cs +++ b/src/Toolkit/Converter/MonsterDatConverter.cs @@ -9,11 +9,11 @@ using ChickenAPI.Data; using ChickenAPI.Data.BCard; using ChickenAPI.Data.Drop; +using ChickenAPI.Data.Enums.Game.BCard; +using ChickenAPI.Data.Enums.Game.Drop; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Data.NpcMonster; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.BCard; -using ChickenAPI.Enums.Game.Drop; -using ChickenAPI.Enums.Game.Entity; using ChickenAPI.Packets.Enumerations; using SaltyEmu.Core.Logging; diff --git a/src/Toolkit/Converter/SkillDatConverter.cs b/src/Toolkit/Converter/SkillDatConverter.cs index 8bacd473..fc904c23 100644 --- a/src/Toolkit/Converter/SkillDatConverter.cs +++ b/src/Toolkit/Converter/SkillDatConverter.cs @@ -8,8 +8,8 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data; using ChickenAPI.Data.BCard; +using ChickenAPI.Data.Enums.Game.BCard; using ChickenAPI.Data.Skills; -using ChickenAPI.Enums.Game.BCard; using SaltyEmu.Core.Logging; namespace Toolkit.Converter diff --git a/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs b/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs index 05559c7b..95515a35 100644 --- a/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/MapMonsterGenerator.cs @@ -6,9 +6,9 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Data.Map; using ChickenAPI.Data.NpcMonster; -using ChickenAPI.Enums.Game.Entity; using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets diff --git a/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs b/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs index c813070e..c511fca0 100644 --- a/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs +++ b/src/Toolkit/Generators/FromPackets/MapNpcGenerator.cs @@ -6,8 +6,8 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Entity; using ChickenAPI.Data.Map; -using ChickenAPI.Enums.Game.Entity; using SaltyEmu.Core.Logging; namespace Toolkit.Generators.FromPackets diff --git a/src/World/Network/Server.cs b/src/World/Network/Server.cs index ca8320e5..f13f2dd1 100644 --- a/src/World/Network/Server.cs +++ b/src/World/Network/Server.cs @@ -4,8 +4,8 @@ using Autofac; using ChickenAPI.Core.IoC; using ChickenAPI.Core.Logging; +using ChickenAPI.Data.Enums.Game.Character; using ChickenAPI.Data.Server; -using ChickenAPI.Enums.Game.Character; using ChickenAPI.Game._ECS; using ChickenAPI.Game._ECS.Entities; using DotNetty.Common.Concurrency; diff --git a/src/libs/SaltyEmu.Commands/Checks/RequireAuthorityAttribute.cs b/src/libs/SaltyEmu.Commands/Checks/RequireAuthorityAttribute.cs index a01959f9..abbe0d68 100644 --- a/src/libs/SaltyEmu.Commands/Checks/RequireAuthorityAttribute.cs +++ b/src/libs/SaltyEmu.Commands/Checks/RequireAuthorityAttribute.cs @@ -1,6 +1,6 @@ using System; using System.Threading.Tasks; -using ChickenAPI.Enums; +using ChickenAPI.Data.Enums; using ChickenAPI.Game.Entities.Player; using Qmmands; using SaltyEmu.Commands.Entities; diff --git a/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj b/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj index c339412e..aab5f7cc 100644 --- a/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj +++ b/src/services/SaltyEmu.FamilyService/SaltyEmu.FamilyService.csproj @@ -12,7 +12,6 @@ - diff --git a/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs b/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs index 320bd267..ad1f8560 100644 --- a/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs +++ b/src/services/SaltyEmu.RelationService/Handling/ProcessInvitationHandler.cs @@ -6,8 +6,8 @@ using ChickenAPI.Core.Logging; using ChickenAPI.Data; using ChickenAPI.Data.Character; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Data.Relations; -using ChickenAPI.Enums.Game.Relations; using SaltyEmu.Communication.Utils; using SaltyEmu.FriendsPlugin.Protocol; diff --git a/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj b/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj index fd0a1180..0a7d6d9b 100644 --- a/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj +++ b/src/services/SaltyEmu.RelationService/SaltyEmu.RelationService.csproj @@ -12,7 +12,6 @@ - diff --git a/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs b/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs index b5a7ffad..6f8be862 100644 --- a/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs +++ b/test/SaltyEmu.RelationService.Tests/RelationInvitationProcessing.cs @@ -4,8 +4,8 @@ using System.Threading.Tasks; using Autofac; using ChickenAPI.Core.IoC; +using ChickenAPI.Data.Enums.Game.Relations; using ChickenAPI.Data.Relations; -using ChickenAPI.Enums.Game.Relations; using ChickenAPI.Packets.Enumerations; using NUnit.Framework; using SaltyEmu.Communication.Configs;