All SendMessage overloads have optional laneIndex

This commit is contained in:
André Straubmeier 2021-11-22 17:53:48 +01:00
parent f3ee5bec4e
commit 214096e376

View File

@ -99,11 +99,11 @@ public unsafe Result SendMessage( IntPtr ptr, int size, SendType sendType = Send
/// Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and
/// you're not creating a new one every frame (like using .ToArray())
/// </summary>
public unsafe Result SendMessage( byte[] data, SendType sendType = SendType.Reliable )
public unsafe Result SendMessage( byte[] data, SendType sendType = SendType.Reliable, ushort laneIndex = 0 )
{
fixed ( byte* ptr = data )
{
return SendMessage( (IntPtr)ptr, data.Length, sendType );
return SendMessage( (IntPtr)ptr, data.Length, sendType, laneIndex );
}
}
@ -111,21 +111,21 @@ public unsafe Result SendMessage( byte[] data, SendType sendType = SendType.Reli
/// Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and
/// you're not creating a new one every frame (like using .ToArray())
/// </summary>
public unsafe Result SendMessage( byte[] data, int offset, int length, SendType sendType = SendType.Reliable )
public unsafe Result SendMessage( byte[] data, int offset, int length, SendType sendType = SendType.Reliable, ushort laneIndex = 0 )
{
fixed ( byte* ptr = data )
{
return SendMessage( (IntPtr)ptr + offset, length, sendType );
return SendMessage( (IntPtr)ptr + offset, length, sendType, laneIndex );
}
}
/// <summary>
/// This creates a ton of garbage - so don't do anything with this beyond testing!
/// </summary>
public unsafe Result SendMessage( string str, SendType sendType = SendType.Reliable )
public unsafe Result SendMessage( string str, SendType sendType = SendType.Reliable, ushort laneIndex = 0 )
{
var bytes = System.Text.Encoding.UTF8.GetBytes( str );
return SendMessage( bytes, sendType );
return SendMessage( bytes, sendType, laneIndex );
}
/// <summary>