Skip to content

Commit 89f4425

Browse files
authored
SteamConnection: write an error on send error (#742)
1 parent 6332e3c commit 89f4425

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Client/Networking/NetworkingSteam.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ protected override void SendRaw(byte[] raw, bool reliable = true)
2626

2727
public void SendRawSteam(byte[] raw, bool reliable)
2828
{
29-
SteamNetworking.SendP2PPacket(
29+
var sent = SteamNetworking.SendP2PPacket(
3030
remoteId,
3131
raw,
3232
(uint)raw.Length,
3333
reliable ? EP2PSend.k_EP2PSendReliable : EP2PSend.k_EP2PSendUnreliable,
3434
sendChannel
3535
);
36+
if (sent) return;
37+
var hex = raw.SubArray(0, Math.Min(raw.Length, 128)).ToHexString();
38+
ServerLog.Error($"Failed to send packet (len: {raw.Length}): {hex}");
3639
}
3740

3841
public override void Close(MpDisconnectReason reason, byte[] data = null)

0 commit comments

Comments
 (0)