M Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs => Core/NosSmooth.Core/Commands/Control/TakeControlCommandHandler.cs +1 -1
@@ 57,7 57,7 @@ internal class TakeControlCommandHandler : ICommandHandler<TakeControlCommand>
{
source.Cancel();
}
- catch (Exception e)
+ catch (Exception)
{
// ignored
}
M Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs => Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs => Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs +9 -9
@@ 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
/// </summary>
/// <remarks>
/// For skills that can be used only on self, use <paramref name="entityId"/> of the character.
- /// For skills that cannot be targeted on an entity, proceed to <see cref="UseSkillAt"/>.
+ /// For skills that cannot be targeted on an entity, proceed to UseSkillAt.
/// </remarks>
/// <param name="castId">The cast id of the skill.</param>
/// <param name="entityId">The id of the entity to use the skill on.</param>
@@ 72,8 72,8 @@ public class NostaleSkillsPacketApi
/// Use the given (targetable) skill on specified entity.
/// </summary>
/// <remarks>
- /// For skills that can be used only on self, use <paramref name="entityId"/> of the character.
- /// For skills that cannot be targeted on an entity, proceed to <see cref="UseSkillAt"/>.
+ /// For skills that can be used only on self, use <paramref name="entity"/> of the character.
+ /// For skills that cannot be targeted on an entity, proceed to UseSkillAt.
/// </remarks>
/// <param name="castId">The cast id of the skill.</param>
/// <param name="entity">The entity to use the skill on.</param>
@@ 109,8 109,8 @@ public class NostaleSkillsPacketApi
/// </summary>
/// <remarks>
/// The skill won't be used if it is on cooldown.
- /// For skills that can be used only on self, use <paramref name="entityId"/> of the character.
- /// For skills that cannot be targeted on an entity, proceed to <see cref="UseSkillAt"/>.
+ /// For skills that can be used only on self, use <paramref name="entity"/> of the character.
+ /// For skills that cannot be targeted on an entity, proceed to UseSkillAt.
/// </remarks>
/// <param name="skill">The skill to use.</param>
/// <param name="entity">The entity to use the skill on.</param>
@@ 156,7 156,7 @@ public class NostaleSkillsPacketApi
/// </summary>
/// <remarks>
/// For skills that can be used only on self, use <paramref name="entityId"/> of the character.
- /// For skills that cannot be targeted on an entity, proceed to <see cref="UseSkillAt"/>.
+ /// For skills that cannot be targeted on an entity, proceed to UseSkillAt.
/// </remarks>
/// <param name="skill">The skill to use.</param>
/// <param name="entityId">The id of the entity to use the skill on.</param>
@@ 203,7 203,7 @@ public class NostaleSkillsPacketApi
/// Use the given (aoe) skill on the specified place.
/// </summary>
/// <remarks>
- /// For skills that can have targets, proceed to <see cref="UseSkillOn"/>.
+ /// For skills that can have targets, proceed to UseSkillOn.
/// </remarks>
/// <param name="skillVNum">The id of the skill.</param>
/// <param name="mapX">The x coordinate to use the skill at.</param>
@@ 229,7 229,7 @@ public class NostaleSkillsPacketApi
/// Use the given (aoe) skill on the specified place.
/// </summary>
/// <remarks>
- /// For skills that can have targets, proceed to <see cref="UseSkillOn"/>.
+ /// For skills that can have targets, proceed to UseSkillOn.
/// </remarks>
/// <param name="skill">The skill to use.</param>
/// <param name="mapX">The x coordinate to use the skill at.</param>
M Core/NosSmooth.Game/Data/Characters/Character.cs => Core/NosSmooth.Game/Data/Characters/Character.cs +0 -2
@@ 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;
M Core/NosSmooth.Game/Data/Characters/Skill.cs => Core/NosSmooth.Game/Data/Characters/Skill.cs +1 -0
@@ 13,6 13,7 @@ namespace NosSmooth.Game.Data.Characters;
/// </summary>
/// <param name="SkillVNum">The vnum of the skill.</param>
/// <param name="Level">The level of the skill. Unknown feature.</param>
+/// <param name="Info">The information obtained from Data assembly.</param>
public record Skill(int SkillVNum, int? Level = default, ISkillInfo? Info = default)
{
/// <summary>
M Core/NosSmooth.Game/Data/Chat/Friend.cs => Core/NosSmooth.Game/Data/Chat/Friend.cs +3 -3
@@ 16,9 16,9 @@ public class Friend
/// </summary>
public long CharacterId { get; internal set; }
- /// <summary>
- /// The type of the relation.
- /// </summary>
+ // <summary>
+ // The type of the relation.
+ // </summary>
// public CharacterRelationType RelationType { get; internal set; }
/// <summary>
M Core/NosSmooth.Game/Data/Dialogs/Dialog.cs => Core/NosSmooth.Game/Data/Dialogs/Dialog.cs +2 -3
@@ 9,9 9,8 @@ namespace NosSmooth.Game.Data.Dialogs;
/// <summary>
/// Represents dialog sent by the server
/// </summary>
-/// <param name="AcceptCommand"></param>
-/// <param name="Message"></param>
-/// <param name="Parameters"></param>
+/// <param name="AcceptCommand">The accept command sent upon accept.</param>
+/// <param name="Parameters">The parameters of the dialog.</param>
public record Dialog
(
string AcceptCommand,
M Core/NosSmooth.Game/Data/Entities/GroundItem.cs => Core/NosSmooth.Game/Data/Entities/GroundItem.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Data/Entities/IEntity.cs => Core/NosSmooth.Game/Data/Entities/IEntity.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Data/Entities/LivingEntity.cs => Core/NosSmooth.Game/Data/Entities/LivingEntity.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Data/Entities/Monster.cs => Core/NosSmooth.Game/Data/Entities/Monster.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Data/Entities/Npc.cs => Core/NosSmooth.Game/Data/Entities/Npc.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Data/Entities/Player.cs => Core/NosSmooth.Game/Data/Entities/Player.cs +1 -1
@@ 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;
M Core/NosSmooth.Game/Data/Items/Equipment.cs => Core/NosSmooth.Game/Data/Items/Equipment.cs +13 -0
@@ 6,6 6,19 @@
namespace NosSmooth.Game.Data.Items;
+/// <summary>
+/// Information about character's equipment.
+/// </summary>
+/// <param name="Hat">The hat.</param>
+/// <param name="Armor">The armor.</param>
+/// <param name="MainWeapon">The main weapon.</param>
+/// <param name="SecondaryWeapon">The secondary weapon.</param>
+/// <param name="Mask">The mask.</param>
+/// <param name="Fairy">The fairy.</param>
+/// <param name="CostumeSuit">The costume suit.</param>
+/// <param name="CostumeHat">The costume hat.</param>
+/// <param name="WeaponSkin">The weapon skin.</param>
+/// <param name="WingSkin">The wing skin.</param>
public record Equipment
(
Item? Hat,
M Core/NosSmooth.Game/Data/Items/Fairy.cs => Core/NosSmooth.Game/Data/Items/Fairy.cs +6 -0
@@ 9,4 9,10 @@ using NosSmooth.Packets.Enums;
namespace NosSmooth.Game.Data.Items;
+/// <summary>
+/// Information about a fairy.
+/// </summary>
+/// <param name="ItemVNum">The fairy vnum.</param>
+/// <param name="Element">The element of the fairy.</param>
+/// <param name="Info">The item information from data assembly.</param>
public record Fairy(int ItemVNum, Element Element, IItemInfo? Info) : Item(ItemVNum, Info);=
\ No newline at end of file
M Core/NosSmooth.Game/Data/Maps/Map.cs => Core/NosSmooth.Game/Data/Maps/Map.cs +5 -0
@@ 13,6 13,11 @@ namespace NosSmooth.Game.Data.Maps;
/// <summary>
/// Represents nostale map.
/// </summary>
+/// <param name="Id">The id of the map.</param>
+/// <param name="Type">The type of the map.</param>
+/// <param name="Info">The information about the map obtained from data assembly.</param>
+/// <param name="Entities">The entities on the map.</param>
+/// <param name="Portals">The portals on the map.</param>
public record Map
(
long Id,
M Core/NosSmooth.Game/Data/Maps/MapEntities.cs => Core/NosSmooth.Game/Data/Maps/MapEntities.cs +0 -1
@@ 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;
M Core/NosSmooth.Game/Data/Maps/Miniland.cs => Core/NosSmooth.Game/Data/Maps/Miniland.cs +6 -1
@@ 11,7 11,12 @@ namespace NosSmooth.Game.Data.Maps;
/// <summary>
/// Represents Miniland map that can contain miniland objects.
/// </summary>
-/// <param name="Objects">The objects in the miniland.</param>
+/// <param name="Id">The id of the miniland map.</param>
+/// <param name="Type">The type of the miniland map.</param>
+/// <param name="Info">The information about the map obtained from data assembly.</param>
+/// <param name="Entities">The entities on the map.</param>
+/// <param name="Portals">The portals on the map.</param>
+/// <param name="Objects">The miniland objects on the map.</param>
public record Miniland
(
long Id,
M Core/NosSmooth.Game/Data/Maps/MinilandObject.cs => Core/NosSmooth.Game/Data/Maps/MinilandObject.cs +3 -0
@@ 6,4 6,7 @@
namespace NosSmooth.Game.Data.Maps;
+/// <summary>
+/// An object in miniland.
+/// </summary>
public record MinilandObject();=
\ No newline at end of file
M Core/NosSmooth.Game/Data/Maps/Portal.cs => Core/NosSmooth.Game/Data/Maps/Portal.cs +2 -0
@@ 15,6 15,8 @@ namespace NosSmooth.Game.Data.Maps;
/// <param name="PortalId">The portal id.</param>
/// <param name="Position">The position of the portal.</param>
/// <param name="TargetMapId">The id of the target map.</param>
+/// <param name="PortalType">The visual type of the portal.</param>
+/// <param name="IsDisabled">Whether the portal is disabled (locked) and thus cannot be used.</param>
public record Portal
(
long PortalId,
M Core/NosSmooth.Game/Data/Maps/Timespace.cs => Core/NosSmooth.Game/Data/Maps/Timespace.cs +3 -0
@@ 6,4 6,7 @@
namespace NosSmooth.Game.Data.Maps;
+/// <summary>
+/// Information about a TimeSpace.
+/// </summary>
public record Timespace();=
\ No newline at end of file
M Core/NosSmooth.Game/Data/Social/Family.cs => Core/NosSmooth.Game/Data/Social/Family.cs +2 -0
@@ 10,8 10,10 @@ namespace NosSmooth.Game.Data.Social;
/// Represents nostale family entity.
/// </summary>
/// <param name="Id">The id of the family.</param>
+/// <param name="Title">The family's title.</param>
/// <param name="Name">The name of the family.</param>
/// <param name="Level">The level of the entity.</param>
+/// <param name="Icons">What icons the family has activated.</param>
public record Family
(
string? Id,
M Core/NosSmooth.Game/Events/Battle/AoESkillUsedEvent.cs => Core/NosSmooth.Game/Events/Battle/AoESkillUsedEvent.cs +0 -1
@@ 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;
M Core/NosSmooth.Game/Events/Battle/SkillUsedEvent.cs => Core/NosSmooth.Game/Events/Battle/SkillUsedEvent.cs +0 -1
@@ 17,7 17,6 @@ namespace NosSmooth.Game.Events.Battle;
/// <param name="Caster">The caster entity of the skill.</param>
/// <param name="Target">The target entity of the skill.</param>
/// <param name="Skill">The skill that has been used with the information about the skill.</param>
-/// <param name="SkillVNum">The vnum of the skill.</param>
/// <param name="TargetPosition">The position of the target.</param>
/// <param name="Hit"></param>
/// <param name="Damage"></param>
M Core/NosSmooth.Game/Events/Entities/EntityDiedEvent.cs => Core/NosSmooth.Game/Events/Entities/EntityDiedEvent.cs +1 -1
@@ 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;
/// </summary>
/// <remarks>
/// Is not emitted for the character, see <see cref="CharacterDiedEvent"/>.
+/// TODO figure CharacterDiedEvent out.
/// </remarks>
/// <param name="Entity">The entity that has died.</param>
/// <param name="KillSkill">The skill that was used to kill the entity, if known.</param>
M Core/NosSmooth.Game/Events/Entities/EntityLeftMapEvent.cs => Core/NosSmooth.Game/Events/Entities/EntityLeftMapEvent.cs +2 -0
@@ 13,6 13,8 @@ namespace NosSmooth.Game.Events.Entities;
/// An entity has left the map.
/// </summary>
/// <param name="Entity">The entity that has left.</param>
+/// <param name="Portal">The portal that was probably used to leave the map. (This may not be accurate, the character may as well have left or )</param>
+/// <param name="Died">Whether the entity has died. (This may not be accurate.)</param>
public record EntityLeftMapEvent
(
IEntity Entity,
M Core/NosSmooth.Game/Game.cs => Core/NosSmooth.Game/Game.cs +0 -1
@@ 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;
M Core/NosSmooth.Game/Helpers/EquipmentHelpers.cs => Core/NosSmooth.Game/Helpers/EquipmentHelpers.cs +0 -2
@@ 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;
M Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs => Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs +0 -2
@@ 60,7 60,5 @@ public class WalkResponder : IPacketResponder<WalkPacket>
new EntityMovedEvent(character, oldPosition, character.Position!.Value),
ct
);
-
- return Result.FromSuccess();
}
}=
\ No newline at end of file
M Core/NosSmooth.Game/PacketHandlers/Entities/EqResponder.cs => Core/NosSmooth.Game/PacketHandlers/Entities/EqResponder.cs +1 -2
@@ 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;
M Core/NosSmooth.Game/PacketHandlers/Map/AtResponder.cs => Core/NosSmooth.Game/PacketHandlers/Map/AtResponder.cs +5 -4
@@ 30,11 30,11 @@ public class AtResponder : IPacketResponder<AtPacket>
}
/// <inheritdoc />
- public Task<Result> Respond(PacketEventArgs<AtPacket> packetArgs, CancellationToken ct = default)
+ public async Task<Result> Respond(PacketEventArgs<AtPacket> packetArgs, CancellationToken ct = default)
{
var packet = packetArgs.Packet;
- _game.CreateOrUpdateCharacterAsync
+ await _game.CreateOrUpdateCharacterAsync
(
() => new Character()
{
@@ 45,9 45,10 @@ public class AtResponder : IPacketResponder<AtPacket>
{
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
M Core/NosSmooth.Game/PacketHandlers/Map/CMapResponder.cs => Core/NosSmooth.Game/PacketHandlers/Map/CMapResponder.cs +0 -2
@@ 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;
M Core/NosSmooth.Game/PacketHandlers/Map/DropResponder.cs => Core/NosSmooth.Game/PacketHandlers/Map/DropResponder.cs +0 -1
@@ 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;
M Core/NosSmooth.Game/PacketHandlers/Map/MoveResponder.cs => Core/NosSmooth.Game/PacketHandlers/Map/MoveResponder.cs +3 -4
@@ 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<MovePacket>
}
/// <inheritdoc />
- public async Task<Result> Respond(PacketEventArgs<MovePacket> packetArgs, CancellationToken ct = default)
+ public Task<Result> Respond(PacketEventArgs<MovePacket> packetArgs, CancellationToken ct = default)
{
var packet = packetArgs.Packet;
var map = _game.CurrentMap;
@@ 38,7 37,7 @@ public class MoveResponder : IPacketResponder<MovePacket>
// 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<ILivingEntity>(packet.EntityId);
@@ 48,6 47,6 @@ public class MoveResponder : IPacketResponder<MovePacket>
entity.Speed = packet.Speed;
}
- return Result.FromSuccess();
+ return Task.FromResult(Result.FromSuccess());
}
}=
\ No newline at end of file
M Core/NosSmooth.Game/PacketHandlers/Map/OutResponder.cs => Core/NosSmooth.Game/PacketHandlers/Map/OutResponder.cs +1 -2
@@ 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<OutPacket>
(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);
}
M Data/NosSmooth.Data.Database/DatabaseMigrator.cs => Data/NosSmooth.Data.Database/DatabaseMigrator.cs +2 -2
@@ 82,7 82,7 @@ public class DatabaseMigrator
return Result.FromSuccess();
}
- private async Task<Result> MigrateTranslations(NostaleDataContext context, NostaleData data)
+ private Task<Result> 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<Result> MigrateItems(NostaleDataContext dbContext, NostaleData data)
M Extensions/NosSmooth.Extensions.Combat/CombatManager.cs => Extensions/NosSmooth.Extensions.Combat/CombatManager.cs +1 -1
@@ 158,7 158,7 @@ public class CombatManager : IStatefulEntity
}
/// <summary>
- /// Unregister the given cancellation token registered using <see cref="RegisterSkillCancellationToken"/>.
+ /// Unregister the given cancellation token registered using RegisterSkillCancellationToken.
/// </summary>
/// <param name="tokenSource">The token source to unregister.</param>
/// <param name="ct">The cancellation token for cancelling the operation.</param>
M Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs +3 -0
@@ 8,4 8,7 @@ using Remora.Results;
namespace NosSmooth.Extensions.Combat.Errors;
+/// <summary>
+/// The combat technique set target to null, the combat cannot continue.
+/// </summary>
public record TargetNotSetError() : ResultError("The current target is not set, the operation cannot complete.");=
\ No newline at end of file
M Extensions/NosSmooth.Extensions.Combat/Operations/UseItemOperation.cs => Extensions/NosSmooth.Extensions.Combat/Operations/UseItemOperation.cs +4 -1
@@ 9,7 9,10 @@ using Remora.Results;
namespace NosSmooth.Extensions.Combat.Operations;
-// TODO: first inventory has to be made
+/// <summary>
+/// A combat operation to use an item.
+/// </summary>
+/// <param name="Item">The item to use.</param>
public record UseItemOperation(Item Item) : ICombatOperation
{
/// <inheritdoc />
M Extensions/NosSmooth.Extensions.Combat/Responders/CancelResponder.cs => Extensions/NosSmooth.Extensions.Combat/Responders/CancelResponder.cs +1 -1
@@ 29,7 29,7 @@ public class CancelResponder : IPacketResponder<CancelPacket>
/// <inheritdoc />
public Task<Result> Respond(PacketEventArgs<CancelPacket> packetArgs, CancellationToken ct = default)
{
- _combatManager.CancelSkillTokensAsync(ct);
+ Task.Run(() => _combatManager.CancelSkillTokensAsync(default));
return Task.FromResult(Result.FromSuccess());
}
}=
\ No newline at end of file
M Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs => Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs +2 -2
@@ 35,7 35,7 @@ public class SuResponder : IPacketResponder<SuPacket>, IPacketResponder<BsPacket
{
if (packetArgs.Packet.CasterEntityId == _game.Character?.Id)
{
- _combatManager.CancelSkillTokensAsync(ct);
+ Task.Run(() => _combatManager.CancelSkillTokensAsync(default));
}
return Task.FromResult(Result.FromSuccess());
}
@@ 45,7 45,7 @@ public class SuResponder : IPacketResponder<SuPacket>, IPacketResponder<BsPacket
{
if (packetArgs.Packet.CasterEntityId == _game.Character?.Id)
{
- _combatManager.CancelSkillTokensAsync(ct);
+ Task.Run(() => _combatManager.CancelSkillTokensAsync(default));
}
return Task.FromResult(Result.FromSuccess());
}
M Extensions/NosSmooth.Extensions.Pathfinding/NosSmooth.Extensions.Pathfinding.csproj => Extensions/NosSmooth.Extensions.Pathfinding/NosSmooth.Extensions.Pathfinding.csproj +1 -0
@@ 23,6 23,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Core\NosSmooth.Core\NosSmooth.Core.csproj" />
+ <ProjectReference Include="..\..\Data\NosSmooth.Data.Abstractions\NosSmooth.Data.Abstractions.csproj" />
</ItemGroup>
</Project>