From 2550f597a95fbabc8710d3faa09a56d77efd7cc8 Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Fri, 27 Oct 2023 18:17:26 +0200 Subject: [PATCH] refactor: use specific method instead of string --- Server/Services/PacketDistributorService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/Services/PacketDistributorService.cs b/Server/Services/PacketDistributorService.cs index ab5699d..65b3b51 100644 --- a/Server/Services/PacketDistributorService.cs +++ b/Server/Services/PacketDistributorService.cs @@ -137,7 +137,7 @@ public class PacketDistributorService : IHostedService var packet = this.deserializationMap[item.OperationCode](item.MessageBody); this.logger.PacketData(JsonConvert.SerializeObject(packet)); - this.packetHandlersInstantiation[item.OperationCode].GetType().GetMethod("HandleAsync") + this.packetHandlersInstantiation[item.OperationCode].GetType().GetMethod(nameof(IPacketHandler.HandleAsync)) ?.Invoke(this.packetHandlersInstantiation[item.OperationCode], new object[] { packet, item.Session }); this.logger.PacketFinished(item.Session.Id, item.OperationCode);