Added NetConnection.DetailedStatus

This commit is contained in:
Garry Newman 2019-05-06 13:02:39 +01:00
parent cdeccc5afe
commit 16851f1228
2 changed files with 12 additions and 0 deletions

View File

@ -110,6 +110,8 @@ namespace Steamworks
break; break;
} }
} }
Console.WriteLine( Connection.DetailedStatus() );
} }
public override unsafe void OnMessage( IntPtr data, int size, long messageNum, SteamNetworkingMicroseconds recvTime, int channel ) public override unsafe void OnMessage( IntPtr data, int size, long messageNum, SteamNetworkingMicroseconds recvTime, int channel )

View File

@ -85,6 +85,16 @@ namespace Steamworks.Data
/// </summary> /// </summary>
public Result Flush() => SteamNetworkingSockets.Internal.FlushMessagesOnConnection( this ); public Result Flush() => SteamNetworkingSockets.Internal.FlushMessagesOnConnection( this );
public string DetailedStatus()
{
var sb = Helpers.TakeStringBuilder();
if ( SteamNetworkingSockets.Internal.GetDetailedConnectionStatus( this, sb, sb.Capacity ) != 0 )
return null;
return sb.ToString();
}
/* /*
[ThreadStatic] [ThreadStatic]
private static SteamNetworkingMessage_t[] messageBuffer; private static SteamNetworkingMessage_t[] messageBuffer;