mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-04 01:30:30 +03:00
Fixed NetworkUtils.DebugOut on 32bit
This commit is contained in:
parent
d990b537a3
commit
403488dfcb
@ -96,7 +96,7 @@ namespace Steamworks
|
|||||||
|
|
||||||
await Task.Delay( 1000 );
|
await Task.Delay( 1000 );
|
||||||
|
|
||||||
Close();
|
//Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override unsafe void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
|
public override unsafe void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel )
|
||||||
|
@ -4,5 +4,6 @@ using System.Runtime.InteropServices;
|
|||||||
|
|
||||||
namespace Steamworks.Data
|
namespace Steamworks.Data
|
||||||
{
|
{
|
||||||
delegate void NetDebugFunc( NetDebugOutput nType, string pszMsg );
|
[UnmanagedFunctionPointer( Platform.CC )]
|
||||||
|
delegate void NetDebugFunc( [In] NetDebugOutput nType, [In] IntPtr pszMsg );
|
||||||
}
|
}
|
@ -178,7 +178,9 @@ namespace Steamworks
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
_debugLevel = value;
|
_debugLevel = value;
|
||||||
Internal.SetDebugOutputFunction( value, OnDebugMessage );
|
_debugFunc = new NetDebugFunc( OnDebugMessage );
|
||||||
|
|
||||||
|
Internal.SetDebugOutputFunction( value, _debugFunc );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +189,11 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static NetDebugOutput _debugLevel;
|
private static NetDebugOutput _debugLevel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// We need to keep the delegate around until it's not used anymore
|
||||||
|
/// </summary>
|
||||||
|
static NetDebugFunc _debugFunc;
|
||||||
|
|
||||||
struct DebugMessage
|
struct DebugMessage
|
||||||
{
|
{
|
||||||
public NetDebugOutput Type;
|
public NetDebugOutput Type;
|
||||||
@ -198,9 +205,9 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This can be called from other threads - so we're going to queue these up and process them in a safe place.
|
/// This can be called from other threads - so we're going to queue these up and process them in a safe place.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void OnDebugMessage( NetDebugOutput nType, string pszMsg )
|
private static void OnDebugMessage( NetDebugOutput nType, IntPtr str )
|
||||||
{
|
{
|
||||||
debugMessages.Enqueue( new DebugMessage { Type = nType, Msg = pszMsg } );
|
debugMessages.Enqueue( new DebugMessage { Type = nType, Msg = Helpers.MemoryToString( str ) } );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user