Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit 1c7065f

Browse files
client-side packet flag params send
1 parent 91f2c84 commit 1c7065f

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

Scripts/Netcode/Client/ENetClient.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,10 @@ private void HandlePeerLeave(DisconnectOpcode opcode)
165165
CancelTokenSource.Cancel();
166166
}
167167

168-
/// <summary>
169-
/// Send a packet to the server
170-
/// </summary>
171-
/// <param name="opcode">The opcode of the packet</param>
172-
/// <param name="data">The data if any</param>
173-
/// <returns></returns>
174-
public static async Task Send(ClientPacketOpcode opcode, APacket data = null)
168+
public static async Task Send(ClientPacketOpcode opcode, APacket data = null, PacketFlags flags = PacketFlags.Reliable)
175169
{
176170
OutgoingId++;
177-
var success = Outgoing.TryAdd(OutgoingId, new ClientPacket((byte)opcode, data));
171+
var success = Outgoing.TryAdd(OutgoingId, new ClientPacket((byte)opcode, flags, data));
178172

179173
if (!success)
180174
Log($"Failed to add {opcode} to Outgoing queue because of duplicate key"); // this should never go off, however it's better to be safe then not safe at all

0 commit comments

Comments
 (0)