~ruther/NosSmooth

784037c865418c0ffae6e316d4e3ac6166350b92 — Rutherther 2 years ago 8d2f86c
fix(game): make effects vnum short instead of long
3 files changed, 11 insertions(+), 3 deletions(-)

M Core/NosSmooth.Game/Data/Entities/LivingEntity.cs
M Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs
R Extensions/NosSmooth.Extensions.Combat/Responders/{SuResponder.cs => SkillUseResponder.cs}
M Core/NosSmooth.Game/Data/Entities/LivingEntity.cs => Core/NosSmooth.Game/Data/Entities/LivingEntity.cs +1 -1
@@ 57,7 57,7 @@ public interface ILivingEntity : IEntity
    /// <summary>
    /// Gets the VNums of the effects the entity has.
    /// </summary>
    public IReadOnlyList<long>? EffectsVNums { get; set; }
    public IReadOnlyList<short>? EffectsVNums { get; set; }

    /// <summary>
    /// Gets the name of the entity. May be null if unknown.

M Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs => Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs +1 -1
@@ 45,7 45,7 @@ public class StPacketResponder : IPacketResponder<StPacket>
            return Task.FromResult(Result.FromSuccess());
        }

        entity.EffectsVNums = packet.BuffVNums?.Select(x => x.CardId).Cast<long>().ToList();
        entity.EffectsVNums = packet.BuffVNums?.Select(x => x.CardId).ToList();
        entity.Level = packet.Level;
        if (entity is Player player)
        {

R Extensions/NosSmooth.Extensions.Combat/Responders/SuResponder.cs => Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs +9 -1
@@ 5,6 5,7 @@
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using NosSmooth.Core.Packets;
using NosSmooth.Packets;
using NosSmooth.Packets.Server.Battle;
using Remora.Results;



@@ 13,7 14,7 @@ namespace NosSmooth.Extensions.Combat.Responders;
/// <summary>
/// Responds to su packet.
/// </summary>
public class SuResponder : IPacketResponder<SuPacket>
public class SuResponder : IPacketResponder<SuPacket>, IPacketResponder<BsPacket>
{
    private readonly CombatManager _combatManager;



@@ 32,4 33,11 @@ public class SuResponder : IPacketResponder<SuPacket>
        _combatManager.CancelSkillTokensAsync(ct);
        return Task.FromResult(Result.FromSuccess());
    }

    /// <inheritdoc />
    public Task<Result> Respond(PacketEventArgs<BsPacket> packetArgs, CancellationToken ct = default)
    {
        _combatManager.CancelSkillTokensAsync(ct);
        return Task.FromResult(Result.FromSuccess());
    }
}
\ No newline at end of file

Do not follow this link