From dbbd989e19b1a26ae9dce135ad45892e916682f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 7 Jan 2023 14:21:07 +0100 Subject: [PATCH] feat(packets): update packets to not use nullable if not needed --- .../PacketHandlers/Relations/FriendInitResponder.cs | 2 +- Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs | 2 +- Packets/NosSmooth.Packets/Server/Portals/GpPacket.cs | 2 +- Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/NosSmooth.Game/PacketHandlers/Relations/FriendInitResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Relations/FriendInitResponder.cs index f069c08..25004c7 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Relations/FriendInitResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Relations/FriendInitResponder.cs @@ -63,7 +63,7 @@ public class FriendInitResponder : IPacketResponder, IPacketRespond var friends = packet.FriendSubPackets .Select ( - x => new Friend(x.PlayerId, x.RelationType ?? CharacterRelationType.Blocked) + x => new Friend(x.PlayerId, x.RelationType) { PlayerId = x.PlayerId, CharacterName = x.Name, diff --git a/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs b/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs index 3a10b42..56eea9c 100644 --- a/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs @@ -42,5 +42,5 @@ public record AscrPacket [PacketIndex(7)] int DieGroup, [PacketIndex(8)] - AscrPacketType? Type + AscrPacketType Type ) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Portals/GpPacket.cs b/Packets/NosSmooth.Packets/Server/Portals/GpPacket.cs index 410c571..830c44e 100644 --- a/Packets/NosSmooth.Packets/Server/Portals/GpPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Portals/GpPacket.cs @@ -29,7 +29,7 @@ public record GpPacket [PacketIndex(2)] int TargetMapId, [PacketIndex(3)] - PortalType? PortalType, + PortalType PortalType, [PacketIndex(4)] long PortalId, [PacketIndex(5)] diff --git a/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs b/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs index 8ba4dee..72b67a6 100644 --- a/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs @@ -25,7 +25,7 @@ public record FInitSubPacket [PacketIndex(0)] long PlayerId, [PacketIndex(1)] - CharacterRelationType? RelationType, + CharacterRelationType RelationType, [PacketIndex(2)] bool IsConnected, [PacketIndex(3)] -- 2.49.0