Fix nullable warning in FReceivedPacketView

This commit is contained in:
AeonLucid
2022-01-09 20:33:10 +01:00
parent d657ca8f23
commit 29bd62cc9e
3 changed files with 13 additions and 8 deletions
@@ -33,13 +33,11 @@ public class FReceiveThreadRunnable : IAsyncDisposable
{ {
if (_receiveQueue.TryDequeue(out var packet)) if (_receiveQueue.TryDequeue(out var packet))
{ {
result = new FReceivedPacketView result = new FReceivedPacketView(
{ new FPacketDataView(packet.Buffer, packet.Buffer.Length),
DataView = new FPacketDataView(packet.Buffer, packet.Buffer.Length), packet.Address,
Address = packet.Address, new FInPacketTraits());
Traits = new FInPacketTraits()
};
return true; return true;
} }
+7
View File
@@ -37,6 +37,13 @@ public class FPacketDataView
public class FReceivedPacketView public class FReceivedPacketView
{ {
public FReceivedPacketView(FPacketDataView dataView, IPEndPoint address, FInPacketTraits traits)
{
DataView = dataView;
Address = address;
Traits = traits;
}
public FPacketDataView DataView { get; set; } public FPacketDataView DataView { get; set; }
public IPEndPoint Address { get; set; } public IPEndPoint Address { get; set; }
public FInPacketTraits Traits { get; set; } public FInPacketTraits Traits { get; set; }
+1 -1
View File
@@ -39,7 +39,7 @@ public class UIpNetDriver : UNetDriver
while (ReceiveThread.TryReceive(out var packet)) while (ReceiveThread.TryReceive(out var packet))
{ {
Logger.Information("Received {Buffer} from {Adress}", packet.DataView.GetData(), packet.Address); Logger.Information("Received from {Adress} data {Buffer}", packet.Address, packet.DataView.GetData());
UNetConnection? connection = null; UNetConnection? connection = null;