Modified SteamNetworkingSockets.CreateRelaySocketFakeIP, so that it can be passed a send buffer size

Fixed SteamNetworkingMessages that was missing some static keywords
This commit is contained in:
SeaFood 2023-07-22 12:38:01 +02:00
parent 15a9f334e4
commit a3124e504e
2 changed files with 9 additions and 6 deletions

View File

@ -42,10 +42,10 @@ namespace Steamworks
public static Action<ConnectionInfo> OnSessionFailed;
public bool AcceptSessionWithUser( ref NetIdentity identity ) => Internal.AcceptSessionWithUser( ref identity );
public bool CloseSessionWithUser( ref NetIdentity identity ) => Internal.CloseSessionWithUser( ref identity );
public bool CloseChannelWithUser( ref NetIdentity identity, int channel ) => Internal.CloseChannelWithUser( ref identity, channel );
public ConnectionState GetSessionConnectionInfo( ref NetIdentity identity, ref ConnectionInfo info, ref ConnectionStatus status ) => Internal.GetSessionConnectionInfo( ref identity, ref info, ref status );
public static bool AcceptSessionWithUser( ref NetIdentity identity ) => Internal.AcceptSessionWithUser( ref identity );
public static bool CloseSessionWithUser( ref NetIdentity identity ) => Internal.CloseSessionWithUser( ref identity );
public static bool CloseChannelWithUser( ref NetIdentity identity, int channel ) => Internal.CloseChannelWithUser( ref identity, channel );
public static ConnectionState GetSessionConnectionInfo( ref NetIdentity identity, ref ConnectionInfo info, ref ConnectionStatus status ) => Internal.GetSessionConnectionInfo( ref identity, ref info, ref status );
public static unsafe Result SendMessageToUser( ref NetIdentity identity, byte[] data, SteamNetworkingOptions flags, int channel)
{

View File

@ -311,10 +311,13 @@ namespace Steamworks
/// To use this derive a class from <see cref="SocketManager"/> and override as much as you want.
///
/// </summary>
public static T CreateRelaySocketFakeIP<T>( int fakePortIndex = 0 ) where T : SocketManager, new()
public static T CreateRelaySocketFakeIP<T>( int fakePortIndex = 0, int sendBufferSize = 524288 ) where T : SocketManager, new()
{
var t = new T();
var options = Array.Empty<NetKeyValue>();
var options = new NetKeyValue[1];
options[0].DataType = NetConfigType.Int32;
options[0].Value = NetConfig.SendBufferSize;
options[0].Int32Value = sendBufferSize;
t.Socket = Internal.CreateListenSocketP2PFakeIP( 0, options.Length, options );
t.Initialize();
SetSocketManager( t.Socket.Id, t );