From 16851f1228f651785030356491d84a6f199cd6d1 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 6 May 2019 13:02:39 +0100 Subject: [PATCH] Added NetConnection.DetailedStatus --- Facepunch.Steamworks.Test/NetworkingSockets.cs | 2 ++ Facepunch.Steamworks/Structs/NetConnection.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Facepunch.Steamworks.Test/NetworkingSockets.cs b/Facepunch.Steamworks.Test/NetworkingSockets.cs index fe1ca64..43569e8 100644 --- a/Facepunch.Steamworks.Test/NetworkingSockets.cs +++ b/Facepunch.Steamworks.Test/NetworkingSockets.cs @@ -110,6 +110,8 @@ namespace Steamworks break; } } + + Console.WriteLine( Connection.DetailedStatus() ); } public override unsafe void OnMessage( IntPtr data, int size, long messageNum, SteamNetworkingMicroseconds recvTime, int channel ) diff --git a/Facepunch.Steamworks/Structs/NetConnection.cs b/Facepunch.Steamworks/Structs/NetConnection.cs index a01cf4a..5d1e534 100644 --- a/Facepunch.Steamworks/Structs/NetConnection.cs +++ b/Facepunch.Steamworks/Structs/NetConnection.cs @@ -85,6 +85,16 @@ namespace Steamworks.Data /// 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] private static SteamNetworkingMessage_t[] messageBuffer;