fix: duplicate packet ids
This commit is contained in:
parent
293b65a856
commit
7fec462a1d
1 changed files with 1 additions and 0 deletions
|
@ -76,6 +76,7 @@ public class PacketDistributorService : IHostedService
|
|||
// ! : We are filtering if types that don't have an instance of the required Attribute
|
||||
var packetsWithId = executingAssembly.GetTypes().AsParallel()
|
||||
.Where(type => type.HasInterface(typeof(IPacket)) && type is { IsInterface: false, IsAbstract: false })
|
||||
.Where(type => type.Namespace?.Contains("Incoming") ?? false)
|
||||
.Select(type => new { Type = type, Attribute = type.GetCustomAttribute<PacketIdAttribute>() })
|
||||
.Where(item => item.Attribute is not null)
|
||||
.ToDictionary(item => item.Attribute!.Code, item => item.Type);
|
||||
|
|
Loading…
Reference in a new issue