mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-27 05:58:07 +03:00
Connection lanes implementation
This commit is contained in:
parent
2088f14c05
commit
f3ee5bec4e
@ -254,12 +254,12 @@ namespace Steamworks
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes", CallingConvention = Platform.CC)]
|
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes", CallingConvention = Platform.CC)]
|
||||||
private static extern Result _ConfigureConnectionLanes( IntPtr self, Connection hConn, int nNumLanes, ref int pLanePriorities, ref ushort pLaneWeights );
|
private static extern Result _ConfigureConnectionLanes( IntPtr self, Connection hConn, int nNumLanes, [In,Out] int[] pLanePriorities, [In,Out] ushort[] pLaneWeights );
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
internal Result ConfigureConnectionLanes( Connection hConn, int nNumLanes, ref int pLanePriorities, ref ushort pLaneWeights )
|
internal Result ConfigureConnectionLanes( Connection hConn, int nNumLanes, [In,Out] int[] pLanePriorities, [In,Out] ushort[] pLaneWeights )
|
||||||
{
|
{
|
||||||
var returnValue = _ConfigureConnectionLanes( Self, hConn, nNumLanes, ref pLanePriorities, ref pLaneWeights );
|
var returnValue = _ConfigureConnectionLanes( Self, hConn, nNumLanes, pLanePriorities, pLaneWeights );
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ namespace Steamworks.Data
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is the best version to use.
|
/// This is the best version to use.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public unsafe Result SendMessage( IntPtr ptr, int size, SendType sendType = SendType.Reliable )
|
public unsafe Result SendMessage( IntPtr ptr, int size, SendType sendType = SendType.Reliable, ushort laneIndex = 0 )
|
||||||
{
|
{
|
||||||
if ( ptr == IntPtr.Zero )
|
if ( ptr == IntPtr.Zero )
|
||||||
throw new ArgumentNullException( nameof( ptr ) );
|
throw new ArgumentNullException( nameof( ptr ) );
|
||||||
@ -85,6 +85,7 @@ namespace Steamworks.Data
|
|||||||
message->DataPtr = copyPtr;
|
message->DataPtr = copyPtr;
|
||||||
message->DataSize = size;
|
message->DataSize = size;
|
||||||
message->FreeDataPtr = BufferManager.FreeFunctionPointer;
|
message->FreeDataPtr = BufferManager.FreeFunctionPointer;
|
||||||
|
message->IdxLane = laneIndex;
|
||||||
|
|
||||||
long messageNumber = 0;
|
long messageNumber = 0;
|
||||||
SteamNetworkingSockets.Internal.SendMessages( 1, &message, &messageNumber );
|
SteamNetworkingSockets.Internal.SendMessages( 1, &message, &messageNumber );
|
||||||
@ -157,5 +158,14 @@ namespace Steamworks.Data
|
|||||||
|
|
||||||
return connectionStatus;
|
return connectionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Configure multiple outbound messages streams ("lanes") on a connection, and
|
||||||
|
/// control head-of-line blocking between them.
|
||||||
|
/// </summary>
|
||||||
|
public Result ConfigureConnectionLanes( int[] lanePriorities, ushort[] laneWeights )
|
||||||
|
{
|
||||||
|
return SteamNetworkingSockets.Internal.ConfigureConnectionLanes( this, lanePriorities.Length, lanePriorities, laneWeights );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,5 +18,7 @@ namespace Steamworks.Data
|
|||||||
internal int Channel;
|
internal int Channel;
|
||||||
internal SendType Flags;
|
internal SendType Flags;
|
||||||
internal long UserData;
|
internal long UserData;
|
||||||
|
internal ushort IdxLane;
|
||||||
|
internal ushort _pad1__;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,8 @@ internal class BaseType
|
|||||||
if ( VarName == "pOutMessageNumber" ) return false;
|
if ( VarName == "pOutMessageNumber" ) return false;
|
||||||
if ( VarName == "pOptions" ) return true;
|
if ( VarName == "pOptions" ) return true;
|
||||||
if ( VarName == "pLanes" ) return true;
|
if ( VarName == "pLanes" ) return true;
|
||||||
|
if ( VarName == "pLanePriorities" ) return true;
|
||||||
|
if ( VarName == "pLaneWeights" ) return true;
|
||||||
|
|
||||||
if ( VarName == "pOut" ) return false;
|
if ( VarName == "pOut" ) return false;
|
||||||
if ( VarName == "pOutBuffer" ) return false;
|
if ( VarName == "pOutBuffer" ) return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user