From ecb4ceb20b0dbc5fc4a342415c109ccbb00996ca Mon Sep 17 00:00:00 2001 From: Rutherther Date: Wed, 4 Jan 2023 22:55:30 +0100 Subject: [PATCH] chore: make updates to get rid of warnings --- .../Control/TakeControlCommandHandler.cs | 2 +- .../Apis/NostaleChatPacketApi.cs | 2 +- .../Apis/NostaleSkillsPacketApi.cs | 18 +++++++++--------- .../Data/Characters/Character.cs | 2 -- Core/NosSmooth.Game/Data/Characters/Skill.cs | 1 + Core/NosSmooth.Game/Data/Chat/Friend.cs | 6 +++--- Core/NosSmooth.Game/Data/Dialogs/Dialog.cs | 5 ++--- .../NosSmooth.Game/Data/Entities/GroundItem.cs | 2 +- Core/NosSmooth.Game/Data/Entities/IEntity.cs | 2 +- .../Data/Entities/LivingEntity.cs | 2 +- Core/NosSmooth.Game/Data/Entities/Monster.cs | 2 +- Core/NosSmooth.Game/Data/Entities/Npc.cs | 2 +- Core/NosSmooth.Game/Data/Entities/Player.cs | 2 +- Core/NosSmooth.Game/Data/Items/Equipment.cs | 13 +++++++++++++ Core/NosSmooth.Game/Data/Items/Fairy.cs | 6 ++++++ Core/NosSmooth.Game/Data/Maps/Map.cs | 5 +++++ Core/NosSmooth.Game/Data/Maps/MapEntities.cs | 1 - Core/NosSmooth.Game/Data/Maps/Miniland.cs | 7 ++++++- .../NosSmooth.Game/Data/Maps/MinilandObject.cs | 3 +++ Core/NosSmooth.Game/Data/Maps/Portal.cs | 2 ++ Core/NosSmooth.Game/Data/Maps/Timespace.cs | 3 +++ Core/NosSmooth.Game/Data/Social/Family.cs | 2 ++ .../Events/Battle/AoESkillUsedEvent.cs | 1 - .../Events/Battle/SkillUsedEvent.cs | 1 - .../Events/Entities/EntityDiedEvent.cs | 2 +- .../Events/Entities/EntityLeftMapEvent.cs | 2 ++ Core/NosSmooth.Game/Game.cs | 1 - .../NosSmooth.Game/Helpers/EquipmentHelpers.cs | 2 -- .../PacketHandlers/Characters/WalkResponder.cs | 2 -- .../PacketHandlers/Entities/EqResponder.cs | 3 +-- .../PacketHandlers/Map/AtResponder.cs | 9 +++++---- .../PacketHandlers/Map/CMapResponder.cs | 2 -- .../PacketHandlers/Map/DropResponder.cs | 1 - .../PacketHandlers/Map/MoveResponder.cs | 7 +++---- .../PacketHandlers/Map/OutResponder.cs | 3 +-- .../DatabaseMigrator.cs | 4 ++-- .../CombatManager.cs | 2 +- .../Errors/TargetNotSetError.cs | 3 +++ .../Operations/UseItemOperation.cs | 5 ++++- .../Responders/CancelResponder.cs | 2 +- .../Responders/SkillUseResponder.cs | 4 ++-- .../NosSmooth.Extensions.Pathfinding.csproj | 1 + 42 files changed, 90 insertions(+), 57 deletions(-) diff --git a/Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs b/Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs index 7b0f5f644940e4f798f4a14e6cdb9aae23c8fdef..561b1389ec960097104616c837b0f809b83da573 100644 --- a/Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs +++ b/Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs @@ -57,7 +57,7 @@ internal class TakeControlCommandHandler : ICommandHandler { source.Cancel(); } - catch (Exception e) + catch (Exception) { // ignored } diff --git a/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs b/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs index 2bc5763b4dc69b6ec1e0a6b4fb5a759c83507153..a560c2643d384b30a67cd36e83880c3fa3c35517 100644 --- a/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs +++ b/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs @@ -5,8 +5,8 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Core.Client; -using NosSmooth.Packets.Enums; using NosSmooth.Packets.Enums.Chat; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Server.Chat; using Remora.Results; diff --git a/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs b/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs index dd31fe39253c244a4af8e6b51ff5270ec780e3e7..aa349ce6c26d02fe02b95ce04d61ee8185eb23e5 100644 --- a/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs +++ b/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs @@ -9,7 +9,7 @@ using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Errors; using NosSmooth.Packets.Client.Battle; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using Remora.Results; namespace NosSmooth.Game.Apis; @@ -35,7 +35,7 @@ public class NostaleSkillsPacketApi /// /// /// For skills that can be used only on self, use of the character. - /// For skills that cannot be targeted on an entity, proceed to . + /// For skills that cannot be targeted on an entity, proceed to UseSkillAt. /// /// The cast id of the skill. /// The id of the entity to use the skill on. @@ -72,8 +72,8 @@ public class NostaleSkillsPacketApi /// Use the given (targetable) skill on specified entity. /// /// - /// For skills that can be used only on self, use of the character. - /// For skills that cannot be targeted on an entity, proceed to . + /// For skills that can be used only on self, use of the character. + /// For skills that cannot be targeted on an entity, proceed to UseSkillAt. /// /// The cast id of the skill. /// The entity to use the skill on. @@ -109,8 +109,8 @@ public class NostaleSkillsPacketApi /// /// /// The skill won't be used if it is on cooldown. - /// For skills that can be used only on self, use of the character. - /// For skills that cannot be targeted on an entity, proceed to . + /// For skills that can be used only on self, use of the character. + /// For skills that cannot be targeted on an entity, proceed to UseSkillAt. /// /// The skill to use. /// The entity to use the skill on. @@ -156,7 +156,7 @@ public class NostaleSkillsPacketApi /// /// /// For skills that can be used only on self, use of the character. - /// For skills that cannot be targeted on an entity, proceed to . + /// For skills that cannot be targeted on an entity, proceed to UseSkillAt. /// /// The skill to use. /// The id of the entity to use the skill on. @@ -203,7 +203,7 @@ public class NostaleSkillsPacketApi /// Use the given (aoe) skill on the specified place. /// /// - /// For skills that can have targets, proceed to . + /// For skills that can have targets, proceed to UseSkillOn. /// /// The id of the skill. /// The x coordinate to use the skill at. @@ -229,7 +229,7 @@ public class NostaleSkillsPacketApi /// Use the given (aoe) skill on the specified place. /// /// - /// For skills that can have targets, proceed to . + /// For skills that can have targets, proceed to UseSkillOn. /// /// The skill to use. /// The x coordinate to use the skill at. diff --git a/Core/NosSmooth.Game/Data/Characters/Character.cs b/Core/NosSmooth.Game/Data/Characters/Character.cs index 9b692d6aefc2f7f110e66505f293f9d9b7f5f3da..682a94230a062cd9b1484d8dd6a4035a0d2c5eb3 100644 --- a/Core/NosSmooth.Game/Data/Characters/Character.cs +++ b/Core/NosSmooth.Game/Data/Characters/Character.cs @@ -8,8 +8,6 @@ using NosSmooth.Game.Data.Chat; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; using NosSmooth.Game.Data.Social; -using NosSmooth.Packets.Enums; -using NosSmooth.Packets.Enums.Players; namespace NosSmooth.Game.Data.Characters; diff --git a/Core/NosSmooth.Game/Data/Characters/Skill.cs b/Core/NosSmooth.Game/Data/Characters/Skill.cs index c329909365049b7f387218f4b06dca6d1433f131..a9a55c55feb0a1946a16faace9dbb06318644113 100644 --- a/Core/NosSmooth.Game/Data/Characters/Skill.cs +++ b/Core/NosSmooth.Game/Data/Characters/Skill.cs @@ -13,6 +13,7 @@ namespace NosSmooth.Game.Data.Characters; /// /// The vnum of the skill. /// The level of the skill. Unknown feature. +/// The information obtained from Data assembly. public record Skill(int SkillVNum, int? Level = default, ISkillInfo? Info = default) { /// diff --git a/Core/NosSmooth.Game/Data/Chat/Friend.cs b/Core/NosSmooth.Game/Data/Chat/Friend.cs index 6bd06f5df4fd8cf09480a33d437d83971e1fe69c..aae785aa64f9cb96ade542aabc8a2ba8637785dd 100644 --- a/Core/NosSmooth.Game/Data/Chat/Friend.cs +++ b/Core/NosSmooth.Game/Data/Chat/Friend.cs @@ -16,9 +16,9 @@ public class Friend /// public long CharacterId { get; internal set; } - /// - /// The type of the relation. - /// + // + // The type of the relation. + // // public CharacterRelationType RelationType { get; internal set; } /// diff --git a/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs b/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs index 7fafc2b8cc9e4160bb232f70d331c7af56d853ca..9b3d6e2ef320ebdaae0c2f5af026e98ab8ffba7f 100644 --- a/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs +++ b/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs @@ -9,9 +9,8 @@ namespace NosSmooth.Game.Data.Dialogs; /// /// Represents dialog sent by the server /// -/// -/// -/// +/// The accept command sent upon accept. +/// The parameters of the dialog. public record Dialog ( string AcceptCommand, diff --git a/Core/NosSmooth.Game/Data/Entities/GroundItem.cs b/Core/NosSmooth.Game/Data/Entities/GroundItem.cs index c03b5d24fc6cbd7ebf2329769ea0cbe0379430f4..60369262a80520adcea5ef300a64e503c1eef79f 100644 --- a/Core/NosSmooth.Game/Data/Entities/GroundItem.cs +++ b/Core/NosSmooth.Game/Data/Entities/GroundItem.cs @@ -6,7 +6,7 @@ using NosSmooth.Data.Abstractions.Infos; using NosSmooth.Game.Data.Info; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Entities/IEntity.cs b/Core/NosSmooth.Game/Data/Entities/IEntity.cs index a8273831a71147e1f373de52d6e3d6dd5e61bdb4..11dce0ef6b7de52d119c8f24612525d4dae6cd66 100644 --- a/Core/NosSmooth.Game/Data/Entities/IEntity.cs +++ b/Core/NosSmooth.Game/Data/Entities/IEntity.cs @@ -5,7 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Game.Data.Info; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs b/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs index 7033db0117c353c807422f2cf4bcc7b514ca4fbf..40be692a9b1021aabb693e747ce2324bdf3486b0 100644 --- a/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs +++ b/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs @@ -5,7 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Game.Data.Info; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Entities/Monster.cs b/Core/NosSmooth.Game/Data/Entities/Monster.cs index 5dee0dfff7e8238bc2287d08ca1a9a7254920fe9..e86c981f4c52f532cb5f54e521fe6cc59920d88f 100644 --- a/Core/NosSmooth.Game/Data/Entities/Monster.cs +++ b/Core/NosSmooth.Game/Data/Entities/Monster.cs @@ -6,7 +6,7 @@ using NosSmooth.Data.Abstractions.Infos; using NosSmooth.Game.Data.Info; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Entities/Npc.cs b/Core/NosSmooth.Game/Data/Entities/Npc.cs index 0994287794ef95a310410e55e7ad32d7f3b1432d..2e677a298fa8a437d7a6a8c63230ba1cd2b8da25 100644 --- a/Core/NosSmooth.Game/Data/Entities/Npc.cs +++ b/Core/NosSmooth.Game/Data/Entities/Npc.cs @@ -6,7 +6,7 @@ using NosSmooth.Data.Abstractions.Infos; using NosSmooth.Game.Data.Info; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Entities/Player.cs b/Core/NosSmooth.Game/Data/Entities/Player.cs index c7c227ff62dfa8b7c3b396e09e7279a95eafcfe1..0abd7ee51d6062806219762ec1ab31eb410c0e43 100644 --- a/Core/NosSmooth.Game/Data/Entities/Player.cs +++ b/Core/NosSmooth.Game/Data/Entities/Player.cs @@ -7,7 +7,7 @@ using NosSmooth.Game.Data.Info; using NosSmooth.Game.Data.Items; using NosSmooth.Game.Data.Social; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Enums.Players; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Items/Equipment.cs b/Core/NosSmooth.Game/Data/Items/Equipment.cs index 12e55d51917d95686ba8691c8d1ef30ef20fe176..dac1a52670a2ce22157d1c8740cef0933c8966d9 100644 --- a/Core/NosSmooth.Game/Data/Items/Equipment.cs +++ b/Core/NosSmooth.Game/Data/Items/Equipment.cs @@ -6,6 +6,19 @@ namespace NosSmooth.Game.Data.Items; +/// +/// Information about character's equipment. +/// +/// The hat. +/// The armor. +/// The main weapon. +/// The secondary weapon. +/// The mask. +/// The fairy. +/// The costume suit. +/// The costume hat. +/// The weapon skin. +/// The wing skin. public record Equipment ( Item? Hat, diff --git a/Core/NosSmooth.Game/Data/Items/Fairy.cs b/Core/NosSmooth.Game/Data/Items/Fairy.cs index ab4e3b14d623b87611bb1ed69c86bd98e645e382..32a5e79bae164b476cc295b610d26861f1c568f4 100644 --- a/Core/NosSmooth.Game/Data/Items/Fairy.cs +++ b/Core/NosSmooth.Game/Data/Items/Fairy.cs @@ -9,4 +9,10 @@ using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Items; +/// +/// Information about a fairy. +/// +/// The fairy vnum. +/// The element of the fairy. +/// The item information from data assembly. public record Fairy(int ItemVNum, Element Element, IItemInfo? Info) : Item(ItemVNum, Info); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Maps/Map.cs b/Core/NosSmooth.Game/Data/Maps/Map.cs index 12e53f93e45bad482b4b0db5c2c95208beb667ec..4336c08d251b637b4da31ed14480124a32fcbc55 100644 --- a/Core/NosSmooth.Game/Data/Maps/Map.cs +++ b/Core/NosSmooth.Game/Data/Maps/Map.cs @@ -13,6 +13,11 @@ namespace NosSmooth.Game.Data.Maps; /// /// Represents nostale map. /// +/// The id of the map. +/// The type of the map. +/// The information about the map obtained from data assembly. +/// The entities on the map. +/// The portals on the map. public record Map ( long Id, diff --git a/Core/NosSmooth.Game/Data/Maps/MapEntities.cs b/Core/NosSmooth.Game/Data/Maps/MapEntities.cs index b65dac9737bc614b505dc6730eb873704d0ab603..cbfa308fb758a6c59b8029b9e97d14c8f7397956 100644 --- a/Core/NosSmooth.Game/Data/Maps/MapEntities.cs +++ b/Core/NosSmooth.Game/Data/Maps/MapEntities.cs @@ -7,7 +7,6 @@ using System.Collections.Concurrent; using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Entities; -using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Maps; diff --git a/Core/NosSmooth.Game/Data/Maps/Miniland.cs b/Core/NosSmooth.Game/Data/Maps/Miniland.cs index 6acfb981ae85cfc2fe0ee87828332604388ad0f2..0a988dc3895de2836e9cbe598c1b5ad23ba55cee 100644 --- a/Core/NosSmooth.Game/Data/Maps/Miniland.cs +++ b/Core/NosSmooth.Game/Data/Maps/Miniland.cs @@ -11,7 +11,12 @@ namespace NosSmooth.Game.Data.Maps; /// /// Represents Miniland map that can contain miniland objects. /// -/// The objects in the miniland. +/// The id of the miniland map. +/// The type of the miniland map. +/// The information about the map obtained from data assembly. +/// The entities on the map. +/// The portals on the map. +/// The miniland objects on the map. public record Miniland ( long Id, diff --git a/Core/NosSmooth.Game/Data/Maps/MinilandObject.cs b/Core/NosSmooth.Game/Data/Maps/MinilandObject.cs index 83983c706c28222d5c52fa21abf4777efe85ef2b..05f00bda3aa7966343cfac824feda3ecb0f91c91 100644 --- a/Core/NosSmooth.Game/Data/Maps/MinilandObject.cs +++ b/Core/NosSmooth.Game/Data/Maps/MinilandObject.cs @@ -6,4 +6,7 @@ namespace NosSmooth.Game.Data.Maps; +/// +/// An object in miniland. +/// public record MinilandObject(); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Maps/Portal.cs b/Core/NosSmooth.Game/Data/Maps/Portal.cs index ca92509a97a0510916ffd4ca1bef91fdc5ddea59..165d7139bf7e56c76e55a69b0b98dd521de3103a 100644 --- a/Core/NosSmooth.Game/Data/Maps/Portal.cs +++ b/Core/NosSmooth.Game/Data/Maps/Portal.cs @@ -15,6 +15,8 @@ namespace NosSmooth.Game.Data.Maps; /// The portal id. /// The position of the portal. /// The id of the target map. +/// The visual type of the portal. +/// Whether the portal is disabled (locked) and thus cannot be used. public record Portal ( long PortalId, diff --git a/Core/NosSmooth.Game/Data/Maps/Timespace.cs b/Core/NosSmooth.Game/Data/Maps/Timespace.cs index 41ab68eacf9335800378aca7ad93dc968e87c262..908ec1db8f5672d106c9681300bd91c0a0cb7a61 100644 --- a/Core/NosSmooth.Game/Data/Maps/Timespace.cs +++ b/Core/NosSmooth.Game/Data/Maps/Timespace.cs @@ -6,4 +6,7 @@ namespace NosSmooth.Game.Data.Maps; +/// +/// Information about a TimeSpace. +/// public record Timespace(); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Social/Family.cs b/Core/NosSmooth.Game/Data/Social/Family.cs index 448cc0f7600b3fb341ad2a8ca8a86260822493be..cf643c4dc6b8f203ae40b714f23ea832850f8abc 100644 --- a/Core/NosSmooth.Game/Data/Social/Family.cs +++ b/Core/NosSmooth.Game/Data/Social/Family.cs @@ -10,8 +10,10 @@ namespace NosSmooth.Game.Data.Social; /// Represents nostale family entity. /// /// The id of the family. +/// The family's title. /// The name of the family. /// The level of the entity. +/// What icons the family has activated. public record Family ( string? Id, diff --git a/Core/NosSmooth.Game/Events/Battle/AoESkillUsedEvent.cs b/Core/NosSmooth.Game/Events/Battle/AoESkillUsedEvent.cs index 4c3a34793b0bb12cfe4024071fa356ac74c8dafc..53e5312e952ae6e96a99750a7a0df61db14e162a 100644 --- a/Core/NosSmooth.Game/Events/Battle/AoESkillUsedEvent.cs +++ b/Core/NosSmooth.Game/Events/Battle/AoESkillUsedEvent.cs @@ -7,7 +7,6 @@ using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; -using NosSmooth.Packets.Enums.Battle; namespace NosSmooth.Game.Events.Battle; diff --git a/Core/NosSmooth.Game/Events/Battle/SkillUsedEvent.cs b/Core/NosSmooth.Game/Events/Battle/SkillUsedEvent.cs index 580eccc434b312c052a44f1e1b7cf90152c31964..ac592c3148d8f87e2c4caefe29b37eeae58f568d 100644 --- a/Core/NosSmooth.Game/Events/Battle/SkillUsedEvent.cs +++ b/Core/NosSmooth.Game/Events/Battle/SkillUsedEvent.cs @@ -17,7 +17,6 @@ namespace NosSmooth.Game.Events.Battle; /// The caster entity of the skill. /// The target entity of the skill. /// The skill that has been used with the information about the skill. -/// The vnum of the skill. /// The position of the target. /// /// diff --git a/Core/NosSmooth.Game/Events/Entities/EntityDiedEvent.cs b/Core/NosSmooth.Game/Events/Entities/EntityDiedEvent.cs index e9270d362af4328b62bd9c14b18320f17dcdb5bd..812ca333eac57cb3fb10e2af8624659c980d66e1 100644 --- a/Core/NosSmooth.Game/Events/Entities/EntityDiedEvent.cs +++ b/Core/NosSmooth.Game/Events/Entities/EntityDiedEvent.cs @@ -6,7 +6,6 @@ using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Entities; -using NosSmooth.Game.Events.Characters; namespace NosSmooth.Game.Events.Entities; @@ -15,6 +14,7 @@ namespace NosSmooth.Game.Events.Entities; /// /// /// Is not emitted for the character, see . +/// TODO figure CharacterDiedEvent out. /// /// The entity that has died. /// The skill that was used to kill the entity, if known. diff --git a/Core/NosSmooth.Game/Events/Entities/EntityLeftMapEvent.cs b/Core/NosSmooth.Game/Events/Entities/EntityLeftMapEvent.cs index cb0965556cfa1aef2212e8c8f3ef9f412aa8fc46..9b190938e4eec79689e448969315d2bc1e69971a 100644 --- a/Core/NosSmooth.Game/Events/Entities/EntityLeftMapEvent.cs +++ b/Core/NosSmooth.Game/Events/Entities/EntityLeftMapEvent.cs @@ -13,6 +13,8 @@ namespace NosSmooth.Game.Events.Entities; /// An entity has left the map. /// /// The entity that has left. +/// The portal that was probably used to leave the map. (This may not be accurate, the character may as well have left or ) +/// Whether the entity has died. (This may not be accurate.) public record EntityLeftMapEvent ( IEntity Entity, diff --git a/Core/NosSmooth.Game/Game.cs b/Core/NosSmooth.Game/Game.cs index 4161de1eeac0fbd9fd28f3efba72c6e693a2df7b..d93e37aaf05af775c0f3e8db90f91034d6090634 100644 --- a/Core/NosSmooth.Game/Game.cs +++ b/Core/NosSmooth.Game/Game.cs @@ -5,7 +5,6 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.Options; -using NosSmooth.Core.Client; using NosSmooth.Core.Stateful; using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Maps; diff --git a/Core/NosSmooth.Game/Helpers/EquipmentHelpers.cs b/Core/NosSmooth.Game/Helpers/EquipmentHelpers.cs index 1661ae97d390793bbcddef2d9e08abafee115f47..4d6a7af74c99cfa64fb1f6ca09a7807329505ceb 100644 --- a/Core/NosSmooth.Game/Helpers/EquipmentHelpers.cs +++ b/Core/NosSmooth.Game/Helpers/EquipmentHelpers.cs @@ -4,12 +4,10 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System.Reflection; using NosSmooth.Data.Abstractions; using NosSmooth.Game.Data.Items; using NosSmooth.Packets.Server.Maps; using NosSmooth.Packets.Server.Weapons; -using Remora.Results; namespace NosSmooth.Game.Helpers; diff --git a/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs index e0e4c80671c58f8de8579387bce1ffc83b84059d..ce5dd79e807b5bdaf9521d77ce76b8cbbebb5f9c 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs @@ -60,7 +60,5 @@ public class WalkResponder : IPacketResponder new EntityMovedEvent(character, oldPosition, character.Position!.Value), ct ); - - return Result.FromSuccess(); } } \ No newline at end of file diff --git a/Core/NosSmooth.Game/PacketHandlers/Entities/EqResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Entities/EqResponder.cs index fab5a79f9a00296af7b7bad56c87d6c098bd456e..e8962e8efc1ca9336e52fc2d46322b8d56b5076c 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Entities/EqResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Entities/EqResponder.cs @@ -7,9 +7,8 @@ using NosSmooth.Core.Packets; using NosSmooth.Data.Abstractions; using NosSmooth.Game.Data.Entities; -using NosSmooth.Game.Data.Items; using NosSmooth.Game.Helpers; -using NosSmooth.Packets.Server.Entities; +using NosSmooth.Packets.Server.Inventory; using Remora.Results; namespace NosSmooth.Game.PacketHandlers.Entities; diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/AtResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/AtResponder.cs index 9c6925eb8c03547041b90159904ab72b9a59cd3e..dec9fc2eb7576c026ce02fddc91a8e8099fda2a4 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/AtResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/AtResponder.cs @@ -30,11 +30,11 @@ public class AtResponder : IPacketResponder } /// - public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) + public async Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) { var packet = packetArgs.Packet; - _game.CreateOrUpdateCharacterAsync + await _game.CreateOrUpdateCharacterAsync ( () => new Character() { @@ -45,9 +45,10 @@ public class AtResponder : IPacketResponder { c.Position = new Position(packet.X, packet.Y); return c; - } + }, + ct: ct ); - return Task.FromResult(Result.FromSuccess()); + return Result.FromSuccess(); } } \ No newline at end of file diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/CMapResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/CMapResponder.cs index cc72594e55de2fd802708328604fd74dc18c7c03..5ae8267393dc7bdb101cdc5f56646e01a2e8a6c4 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/CMapResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/CMapResponder.cs @@ -4,12 +4,10 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System.Collections.Concurrent; using Microsoft.Extensions.Logging; using NosSmooth.Core.Extensions; using NosSmooth.Core.Packets; using NosSmooth.Data.Abstractions; -using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Maps; using NosSmooth.Packets.Server.Maps; using Remora.Results; diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/DropResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/DropResponder.cs index a508f9e8256b247b189751a6277e655a05434016..533417dd416e981ceb530fdc411336079826373b 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/DropResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/DropResponder.cs @@ -12,7 +12,6 @@ using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; using NosSmooth.Game.Events.Core; using NosSmooth.Game.Events.Entities; -using NosSmooth.Packets.Server.Entities; using NosSmooth.Packets.Server.Maps; using Remora.Results; diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/MoveResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/MoveResponder.cs index 67d2fa6956efb5a468602d9cd67c1d2b7985781a..c44ab0440d16981008a68e5e08d5dc47c9e5e0e4 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/MoveResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/MoveResponder.cs @@ -4,7 +4,6 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System.Collections.Concurrent; using NosSmooth.Core.Packets; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; @@ -30,7 +29,7 @@ public class MoveResponder : IPacketResponder } /// - public async Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) + public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) { var packet = packetArgs.Packet; var map = _game.CurrentMap; @@ -38,7 +37,7 @@ public class MoveResponder : IPacketResponder // TODO: store entities somewhere else so we can store them even if the map is still null? if (map is null) { - return Result.FromSuccess(); + return Task.FromResult(Result.FromSuccess()); } var entity = map.Entities.GetEntity(packet.EntityId); @@ -48,6 +47,6 @@ public class MoveResponder : IPacketResponder entity.Speed = packet.Speed; } - return Result.FromSuccess(); + return Task.FromResult(Result.FromSuccess()); } } \ No newline at end of file diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/OutResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/OutResponder.cs index 653b2f928eb282d45e79f1113501312882e7abb9..882e110c2712f23315ca1cd1546a1659ba415731 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/OutResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/OutResponder.cs @@ -10,7 +10,6 @@ using NosSmooth.Game.Data.Maps; using NosSmooth.Game.Events.Core; using NosSmooth.Game.Events.Entities; using NosSmooth.Game.Helpers; -using NosSmooth.Packets.Enums; using NosSmooth.Packets.Server.Maps; using Remora.Results; @@ -51,7 +50,7 @@ public class OutResponder : IPacketResponder (packet.EntityType, packet.EntityId); var position = entity.Position; - if (position is not null) + if (entity is Player && position is not null) { map.IsOnPortal(position.Value, out portal); } diff --git a/Data/NosSmooth.Data.Database/DatabaseMigrator.cs b/Data/NosSmooth.Data.Database/DatabaseMigrator.cs index f8ffcc7216c4e29c49ff00dcc10a32eddd1adcf5..170fe18f1a8c8c9e83156b59f812011d406cdbf7 100644 --- a/Data/NosSmooth.Data.Database/DatabaseMigrator.cs +++ b/Data/NosSmooth.Data.Database/DatabaseMigrator.cs @@ -82,7 +82,7 @@ public class DatabaseMigrator return Result.FromSuccess(); } - private async Task MigrateTranslations(NostaleDataContext context, NostaleData data) + private Task MigrateTranslations(NostaleDataContext context, NostaleData data) { foreach (var languageTranslation in data.Translations) { @@ -102,7 +102,7 @@ public class DatabaseMigrator } } - return Result.FromSuccess(); + return Task.FromResult(Result.FromSuccess()); } private Task MigrateItems(NostaleDataContext dbContext, NostaleData data) diff --git a/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs b/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs index 1a64fe177691c597c2314bea6af4db90981e54ef..84c2cca5a947b867e4aa38df2979de5e206ccbf2 100644 --- a/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs +++ b/Extensions/NosSmooth.Extensions.Combat/CombatManager.cs @@ -158,7 +158,7 @@ public class CombatManager : IStatefulEntity } /// - /// Unregister the given cancellation token registered using . + /// Unregister the given cancellation token registered using RegisterSkillCancellationToken. /// /// The token source to unregister. /// The cancellation token for cancelling the operation. diff --git a/Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs b/Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs index e59243ba053e842611492e156b1ccf528b598f04..2e76c4277f961b87ee8306be61c28bc77385ec0f 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs @@ -8,4 +8,7 @@ using Remora.Results; namespace NosSmooth.Extensions.Combat.Errors; +/// +/// The combat technique set target to null, the combat cannot continue. +/// public record TargetNotSetError() : ResultError("The current target is not set, the operation cannot complete."); \ No newline at end of file diff --git a/Extensions/NosSmooth.Extensions.Combat/Operations/UseItemOperation.cs b/Extensions/NosSmooth.Extensions.Combat/Operations/UseItemOperation.cs index f307e9c48f3968332833991905a64d8be42ae777..9d3fefedfea41a1468a7e5a276138d4f8b03b712 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Operations/UseItemOperation.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Operations/UseItemOperation.cs @@ -9,7 +9,10 @@ using Remora.Results; namespace NosSmooth.Extensions.Combat.Operations; -// TODO: first inventory has to be made +/// +/// A combat operation to use an item. +/// +/// The item to use. public record UseItemOperation(Item Item) : ICombatOperation { /// diff --git a/Extensions/NosSmooth.Extensions.Combat/Responders/CancelResponder.cs b/Extensions/NosSmooth.Extensions.Combat/Responders/CancelResponder.cs index 582a58d4f22bf973a7949482ecc6531d0ef97823..210932dc8a95cd6c0a7bb855ed4b23facf6e6168 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Responders/CancelResponder.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Responders/CancelResponder.cs @@ -29,7 +29,7 @@ public class CancelResponder : IPacketResponder /// public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) { - _combatManager.CancelSkillTokensAsync(ct); + Task.Run(() => _combatManager.CancelSkillTokensAsync(default)); return Task.FromResult(Result.FromSuccess()); } } \ No newline at end of file diff --git a/Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs b/Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs index f24c9272f57a56aa4b0bc7e3f2f8c6a6984320e0..85a5bae1225f3b7179eeb9cf3c4609e03bd54fe9 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs @@ -35,7 +35,7 @@ public class SuResponder : IPacketResponder, IPacketResponder _combatManager.CancelSkillTokensAsync(default)); } return Task.FromResult(Result.FromSuccess()); } @@ -45,7 +45,7 @@ public class SuResponder : IPacketResponder, IPacketResponder _combatManager.CancelSkillTokensAsync(default)); } return Task.FromResult(Result.FromSuccess()); } diff --git a/Extensions/NosSmooth.Extensions.Pathfinding/NosSmooth.Extensions.Pathfinding.csproj b/Extensions/NosSmooth.Extensions.Pathfinding/NosSmooth.Extensions.Pathfinding.csproj index 529c750d260d1658323de6ce2e01349cdac3f257..7e40aadf028b9728ad380d862772819c03f01f0a 100644 --- a/Extensions/NosSmooth.Extensions.Pathfinding/NosSmooth.Extensions.Pathfinding.csproj +++ b/Extensions/NosSmooth.Extensions.Pathfinding/NosSmooth.Extensions.Pathfinding.csproj @@ -23,6 +23,7 @@ +