From 3a1c26d97569e35c45d98ad5764f948885b75e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 1 Jan 2022 21:31:55 +0100 Subject: [PATCH] fix: use nos smooth packets in game --- .../Apis/NostaleChatPacketApi.cs | 28 +-- .../Apis/NostaleSkillsPacketApi.cs | 162 ++++++++++++------ Core/NosSmooth.Game/Data/Act4/Act4Status.cs | 2 +- .../Data/Characters/Character.cs | 12 +- Core/NosSmooth.Game/Data/Chat/Friend.cs | 4 +- Core/NosSmooth.Game/Data/Dialogs/Dialog.cs | 4 +- .../Data/Entities/GroundItem.cs | 4 +- Core/NosSmooth.Game/Data/Entities/IEntity.cs | 4 +- .../Data/Entities/LivingEntity.cs | 2 +- Core/NosSmooth.Game/Data/Entities/Monster.cs | 5 +- Core/NosSmooth.Game/Data/Entities/Player.cs | 15 +- .../Extensions/ServiceCollectionExtensions.cs | 2 - .../Characters/CharacterInitResponder.cs | 11 +- .../Characters/SkillResponder.cs | 14 +- .../Characters/WalkResponder.cs | 6 +- .../Entities/SkillUsedResponder.cs | 10 +- .../Login/CListPacketResponder.cs | 2 - 17 files changed, 164 insertions(+), 123 deletions(-) diff --git a/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs b/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs index 467f643..a2bcb33 100644 --- a/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs +++ b/Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs @@ -4,10 +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 NosCore.Packets.Enumerations; -using NosCore.Packets.ServerPackets.Chats; using NosSmooth.Core.Client; -using NosSmooth.Game.Data.Entities; +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Chat; +using NosSmooth.Packets.Packets.Server.Chat; using Remora.Results; namespace NosSmooth.Game.Apis; @@ -39,16 +39,8 @@ public class NostaleChatPacketApi /// The color of the message. /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task ReceiveSystemMessageAsync(string content, SayColorType color = SayColorType.Yellow, CancellationToken ct = default) - { - return _client.ReceivePacketAsync( - new SayPacket - { - Message = content, Type = color - }, - ct - ); - } + public Task ReceiveSystemMessageAsync(string content, SayColor color = SayColor.Yellow, CancellationToken ct = default) + => _client.ReceivePacketAsync(new SayPacket(EntityType.Map, 0, color, content), ct); /// /// Sends the given message to the public chat. @@ -57,15 +49,7 @@ public class NostaleChatPacketApi /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. public Task SendMessageAsync(string content, CancellationToken ct = default) - { - return _client.SendPacketAsync( - new SayPacket - { - Message = content - }, - ct - ); - } + => _client.SendPacketAsync(new Packets.Packets.Client.Chat.SayPacket(content), ct); /// /// Sends the given message to the family chat. diff --git a/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs b/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs index 46aa443..3e76a03 100644 --- a/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs +++ b/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs @@ -4,12 +4,12 @@ // 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 NosCore.Packets.ClientPackets.Battle; -using NosCore.Shared.Enumerations; using NosSmooth.Core.Client; using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Errors; +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Packets.Client.Battle; using Remora.Results; namespace NosSmooth.Game.Apis; @@ -42,17 +42,30 @@ public class NostaleSkillsPacketApi /// The type of the supplied entity. /// The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) /// The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) + /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task UseSkillOn(long skillVNum, long entityId, VisualType entityType, short? mapX = default, short? mapY = default) + public Task UseSkillOn + ( + long skillVNum, + long entityId, + EntityType entityType, + short? mapX = default, + short? mapY = default, + CancellationToken ct = default + ) { - return _client.SendPacketAsync(new UseSkillPacket - { - CastId = skillVNum, - MapX = mapX, - MapY = mapY, - TargetId = entityId, - TargetVisualType = entityType - }); + return _client.SendPacketAsync + ( + new UseSkillPacket + ( + skillVNum, + entityType, + entityId, + mapX, + mapY + ), + ct + ); } /// @@ -66,17 +79,29 @@ public class NostaleSkillsPacketApi /// The entity to use the skill on. /// The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) /// The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) + /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task UseSkillOn(long skillVNum, ILivingEntity entity, short? mapX = default, short? mapY = default) + public Task UseSkillOn + ( + long skillVNum, + ILivingEntity entity, + short? mapX = default, + short? mapY = default, + CancellationToken ct = default + ) { - return _client.SendPacketAsync(new UseSkillPacket - { - CastId = skillVNum, - MapX = mapX, - MapY = mapY, - TargetId = entity.Id, - TargetVisualType = entity.Type - }); + return _client.SendPacketAsync + ( + new UseSkillPacket + ( + skillVNum, + entity.Type, + entity.Id, + mapX, + mapY + ), + ct + ); } /// @@ -91,22 +116,34 @@ public class NostaleSkillsPacketApi /// The entity to use the skill on. /// The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) /// The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) + /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task UseSkillOn(Skill skill, ILivingEntity entity, short? mapX = default, short? mapY = default) + public Task UseSkillOn + ( + Skill skill, + ILivingEntity entity, + short? mapX = default, + short? mapY = default, + CancellationToken ct = default + ) { if (skill.IsOnCooldown) { return Task.FromResult(new SkillOnCooldownError(skill)); } - return _client.SendPacketAsync(new UseSkillPacket - { - CastId = skill.SkillVNum, - MapX = mapX, - MapY = mapY, - TargetId = entity.Id, - TargetVisualType = entity.Type - }); + return _client.SendPacketAsync + ( + new UseSkillPacket + ( + skill.SkillVNum, + entity.Type, + entity.Id, + mapX, + mapY + ), + ct + ); } /// @@ -121,22 +158,35 @@ public class NostaleSkillsPacketApi /// The type of the supplied entity. /// The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) /// The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.) + /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task UseSkillOn(Skill skill, long entityId, VisualType entityType, short? mapX = default, short? mapY = default) + public Task UseSkillOn + ( + Skill skill, + long entityId, + EntityType entityType, + short? mapX = default, + short? mapY = default, + CancellationToken ct = default + ) { if (skill.IsOnCooldown) { return Task.FromResult(new SkillOnCooldownError(skill)); } - return _client.SendPacketAsync(new UseSkillPacket - { - CastId = skill.SkillVNum, - MapX = mapX, - MapY = mapY, - TargetId = entityId, - TargetVisualType = entityType - }); + return _client.SendPacketAsync + ( + new UseSkillPacket + ( + skill.SkillVNum, + entityType, + entityId, + mapX, + mapY + ), + ct + ); } /// @@ -148,13 +198,21 @@ public class NostaleSkillsPacketApi /// The id of the skill. /// The x coordinate to use the skill at. /// The y coordinate to use the skill at. + /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task UseSkillAt(long skillVNum, short mapX, short mapY) + public Task UseSkillAt + ( + long skillVNum, + short mapX, + short mapY, + CancellationToken ct = default + ) { - return _client.SendPacketAsync(new UseAoeSkillPacket - { - CastId = skillVNum, MapX = mapX, MapY = mapY - }); + return _client.SendPacketAsync + ( + new UseAOESkillPacket(skillVNum, mapX, mapY), + ct + ); } /// @@ -166,17 +224,25 @@ public class NostaleSkillsPacketApi /// The skill to use. /// The x coordinate to use the skill at. /// The y coordinate to use the skill at. + /// The cancellation token for cancelling the operation. /// A result that may or may not have succeeded. - public Task UseSkillAt(Skill skill, short mapX, short mapY) + public Task UseSkillAt + ( + Skill skill, + short mapX, + short mapY, + CancellationToken ct = default + ) { if (skill.IsOnCooldown) { return Task.FromResult(new SkillOnCooldownError(skill)); } - return _client.SendPacketAsync(new UseAoeSkillPacket - { - CastId = skill.SkillVNum, MapX = mapX, MapY = mapY - }); + return _client.SendPacketAsync + ( + new UseAOESkillPacket(skill.SkillVNum, mapX, mapY), + ct + ); } } \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Act4/Act4Status.cs b/Core/NosSmooth.Game/Data/Act4/Act4Status.cs index 8506b2c..a193d1c 100644 --- a/Core/NosSmooth.Game/Data/Act4/Act4Status.cs +++ b/Core/NosSmooth.Game/Data/Act4/Act4Status.cs @@ -4,7 +4,7 @@ // 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 NosCore.Packets.Enumerations; +using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Act4; diff --git a/Core/NosSmooth.Game/Data/Characters/Character.cs b/Core/NosSmooth.Game/Data/Characters/Character.cs index 3dd7aaf..02fd2c2 100644 --- a/Core/NosSmooth.Game/Data/Characters/Character.cs +++ b/Core/NosSmooth.Game/Data/Characters/Character.cs @@ -4,12 +4,12 @@ // 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 NosCore.Packets.Enumerations; -using NosCore.Shared.Enumerations; 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; @@ -66,10 +66,10 @@ public record Character FactionType? Faction = default, short Size = default, AuthorityType AuthorityType = default, - GenderType Gender = default, - HairStyleType HairStyle = default, - HairColorType HairColor = default, - CharacterClassType Class = default, + SexType Gender = default, + HairStyle HairStyle = default, + HairColor HairColor = default, + PlayerClass Class = default, byte? Icon = default, short? Compliment = default, Morph? Morph = default, diff --git a/Core/NosSmooth.Game/Data/Chat/Friend.cs b/Core/NosSmooth.Game/Data/Chat/Friend.cs index 2371658..6bd06f5 100644 --- a/Core/NosSmooth.Game/Data/Chat/Friend.cs +++ b/Core/NosSmooth.Game/Data/Chat/Friend.cs @@ -4,8 +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 NosCore.Packets.Enumerations; - namespace NosSmooth.Game.Data.Chat; /// @@ -21,7 +19,7 @@ public class Friend /// /// The type of the relation. /// - public CharacterRelationType RelationType { get; internal set; } + // public CharacterRelationType RelationType { get; internal set; } /// /// The name of the character. diff --git a/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs b/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs index f63a0de..7a03833 100644 --- a/Core/NosSmooth.Game/Data/Dialogs/Dialog.cs +++ b/Core/NosSmooth.Game/Data/Dialogs/Dialog.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 NosCore.Packets.Enumerations; using OneOf; namespace NosSmooth.Game.Data.Dialogs; @@ -18,6 +17,7 @@ namespace NosSmooth.Game.Data.Dialogs; public record Dialog ( string AcceptCommand, - OneOf Message, + + // OneOf Message, IReadOnlyList Parameters ); \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Entities/GroundItem.cs b/Core/NosSmooth.Game/Data/Entities/GroundItem.cs index 1cabd0f..023cd5e 100644 --- a/Core/NosSmooth.Game/Data/Entities/GroundItem.cs +++ b/Core/NosSmooth.Game/Data/Entities/GroundItem.cs @@ -4,8 +4,8 @@ // 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 NosCore.Shared.Enumerations; using NosSmooth.Game.Data.Info; +using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Entities; @@ -21,5 +21,5 @@ public record GroundItem(long Id, long ItemVNum, Position? Position) : IEntity public string? Name => null; /// - public VisualType Type => VisualType.Object; + public EntityType Type => EntityType.Object; } \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Entities/IEntity.cs b/Core/NosSmooth.Game/Data/Entities/IEntity.cs index 7a75c50..a11821a 100644 --- a/Core/NosSmooth.Game/Data/Entities/IEntity.cs +++ b/Core/NosSmooth.Game/Data/Entities/IEntity.cs @@ -4,8 +4,8 @@ // 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 NosCore.Shared.Enumerations; using NosSmooth.Game.Data.Info; +using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Entities; @@ -32,5 +32,5 @@ public interface IEntity /// /// Gets the type of the entity. /// - public VisualType Type { get; } + public EntityType Type { get; } } \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs b/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs index f15ea3c..a59eff0 100644 --- a/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs +++ b/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs @@ -4,8 +4,8 @@ // 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 NosCore.Packets.Enumerations; using NosSmooth.Game.Data.Info; +using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Entities; diff --git a/Core/NosSmooth.Game/Data/Entities/Monster.cs b/Core/NosSmooth.Game/Data/Entities/Monster.cs index 7112530..b4517a2 100644 --- a/Core/NosSmooth.Game/Data/Entities/Monster.cs +++ b/Core/NosSmooth.Game/Data/Entities/Monster.cs @@ -4,9 +4,8 @@ // 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 NosCore.Packets.Enumerations; -using NosCore.Shared.Enumerations; using NosSmooth.Game.Data.Info; +using NosSmooth.Packets.Enums; namespace NosSmooth.Game.Data.Entities; @@ -40,5 +39,5 @@ public record Monster ) : ILivingEntity { /// - public VisualType Type => VisualType.Monster; + public EntityType Type => EntityType.Monster; } \ No newline at end of file diff --git a/Core/NosSmooth.Game/Data/Entities/Player.cs b/Core/NosSmooth.Game/Data/Entities/Player.cs index 5a9f12d..f7b27d4 100644 --- a/Core/NosSmooth.Game/Data/Entities/Player.cs +++ b/Core/NosSmooth.Game/Data/Entities/Player.cs @@ -4,10 +4,9 @@ // 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 NosCore.Packets.Enumerations; -using NosCore.Shared.Enumerations; -using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Info; +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Players; namespace NosSmooth.Game.Data.Entities; @@ -48,10 +47,10 @@ public record Player FactionType? Faction = default, short Size = default, AuthorityType AuthorityType = default, - GenderType Gender = default, - HairStyleType HairStyle = default, - HairColorType HairColor = default, - CharacterClassType Class = default, + SexType Gender = default, + HairStyle HairStyle = default, + HairColor HairColor = default, + PlayerClass Class = default, byte? Icon = default, short? Compliment = default, Morph? Morph = default, @@ -64,5 +63,5 @@ public record Player ushort? ILivingEntity.Level => Level?.Lvl; /// - public VisualType Type => VisualType.Player; + public EntityType Type => EntityType.Player; } \ No newline at end of file diff --git a/Core/NosSmooth.Game/Extensions/ServiceCollectionExtensions.cs b/Core/NosSmooth.Game/Extensions/ServiceCollectionExtensions.cs index e8c2427..5a2903a 100644 --- a/Core/NosSmooth.Game/Extensions/ServiceCollectionExtensions.cs +++ b/Core/NosSmooth.Game/Extensions/ServiceCollectionExtensions.cs @@ -6,11 +6,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using NosSmooth.Core.Commands; using NosSmooth.Core.Extensions; using NosSmooth.Game.Apis; using NosSmooth.Game.Events.Core; -using NosSmooth.Game.Events.Players; using NosSmooth.Game.PacketHandlers.Characters; using NosSmooth.Game.PacketHandlers.Entities; using NosSmooth.Game.PacketHandlers.Login; diff --git a/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs index 64d5b16..05fa252 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs @@ -4,13 +4,12 @@ // 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 NosCore.Packets.ServerPackets.Player; using NosSmooth.Core.Packets; -using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Info; using NosSmooth.Game.Data.Social; using NosSmooth.Game.Events.Characters; using NosSmooth.Game.Events.Core; +using NosSmooth.Packets.Packets.Server.Players; using Remora.Results; namespace NosSmooth.Game.PacketHandlers.Characters; @@ -45,7 +44,7 @@ public class CharacterInitResponder : IPacketResponder, IPacketResp { _game.Character = character = character with { - Id = packet.CharacterId, + /*Id = packet.CharacterId, AuthorityType = packet.Authority, Gender = packet.Gender, HairStyle = packet.HairStyle, @@ -59,7 +58,7 @@ public class CharacterInitResponder : IPacketResponder, IPacketResp }, ArenaWinner = packet.ArenaWinner, Invisible = packet.Invisible, - Family = new Family(packet.FamilyId, packet.FamilyName, packet.FamilyLevel) + Family = new Family(packet.FamilyId, packet.FamilyName, packet.FamilyLevel)*/ }; } @@ -108,7 +107,7 @@ public class CharacterInitResponder : IPacketResponder, IPacketResp var oldCharacter = _game.Character; var character = oldCharacter; - if (character is null || character.Id != packetArgs.Packet.VisualId) + if (character is null || character.Id != packetArgs.Packet.EntityId) { // Not the current character. return Result.FromSuccess(); } @@ -118,7 +117,7 @@ public class CharacterInitResponder : IPacketResponder, IPacketResp { Morph = new Morph ( - packet.Morph, + packet.MorphVNum, packet.MorphUpgrade, packet.MorphDesign, packet.MorphBonus, diff --git a/Core/NosSmooth.Game/PacketHandlers/Characters/SkillResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Characters/SkillResponder.cs index 7c6e1ee..6954eec 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Characters/SkillResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Characters/SkillResponder.cs @@ -4,11 +4,11 @@ // 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 NosCore.Packets.ServerPackets.Battle; using NosSmooth.Core.Packets; using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Events.Characters; using NosSmooth.Game.Events.Core; +using NosSmooth.Packets.Packets.Server.Skills; using Remora.Results; namespace NosSmooth.Game.PacketHandlers.Characters; @@ -41,29 +41,29 @@ public class SkillResponder : IPacketResponder var character = await _game.EnsureCharacterCreatedAsync(false, ct); - if (packet.PrimarySkill == character.Skills?.PrimarySkill.SkillVNum) + if (packet.PrimarySkillId == character.Skills?.PrimarySkill.SkillVNum) { primarySkill = character.Skills.PrimarySkill; } else { - primarySkill = new Skill(packet.PrimarySkill); + primarySkill = new Skill(packet.PrimarySkillId); } - if (packet.PrimarySkill == packet.SecondarySkill) + if (packet.PrimarySkillId == packet.SecondarySkillId) { secondarySkill = primarySkill; } - else if (packet.SecondarySkill == character.Skills?.SecondarySkill.SkillVNum) + else if (packet.SecondarySkillId == character.Skills?.SecondarySkill.SkillVNum) { secondarySkill = character.Skills.SecondarySkill; } else { - secondarySkill = new Skill(packet.SecondarySkill); + secondarySkill = new Skill(packet.SecondarySkillId); } - var skillsFromPacket = packet.SkiSubPackets?.Select(x => x.SkillVNum).ToList() ?? new List(); + var skillsFromPacket = packet.SkillSubPackets?.Select(x => x.SkillId).ToList() ?? new List(); var skillsFromCharacter = character.Skills is null ? new List() : character.Skills.OtherSkills.Select(x => x.SkillVNum).ToList(); var newSkills = skillsFromPacket.Except(skillsFromCharacter); var oldSkills = skillsFromCharacter.Except(skillsFromPacket); diff --git a/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs index b6bca57..f776a38 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs @@ -4,11 +4,11 @@ // 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 NosCore.Packets.ClientPackets.Movement; using NosSmooth.Core.Packets; using NosSmooth.Game.Data.Info; using NosSmooth.Game.Events.Core; using NosSmooth.Game.Events.Entities; +using NosSmooth.Packets.Packets.Client.Movement; using Remora.Results; namespace NosSmooth.Game.PacketHandlers.Characters; @@ -44,8 +44,8 @@ public class WalkResponder : IPacketResponder Y = character.Position.Y }; - character.Position.X = packetArgs.Packet.XCoordinate; - character.Position.Y = packetArgs.Packet.YCoordinate; + character.Position.X = packetArgs.Packet.PositionX; + character.Position.Y = packetArgs.Packet.PositionY; return await _eventDispatcher.DispatchEvent ( diff --git a/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs index 7109333..5b78561 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs @@ -4,14 +4,14 @@ // 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 NosCore.Packets.ServerPackets.Battle; -using NosCore.Shared.Enumerations; using NosSmooth.Core.Packets; using NosSmooth.Game.Data.Info; using NosSmooth.Game.Events.Characters; using NosSmooth.Game.Events.Core; using NosSmooth.Game.Events.Players; using NosSmooth.Game.Extensions; +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Packets.Server.Skills; using Remora.Results; namespace NosSmooth.Game.PacketHandlers.Entities; @@ -41,7 +41,7 @@ public class SkillUsedResponder : IPacketResponder, IPacketResponder, IPacketResponder, IPacketResponder