From 74207eeaf34e152fce3d21726085777bc39de63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Straubmeier?= Date: Tue, 1 Sep 2020 10:30:42 +0200 Subject: [PATCH] Added SteamNetworkingSockets.Identity --- .../SteamNetworkingSockets.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Facepunch.Steamworks/SteamNetworkingSockets.cs b/Facepunch.Steamworks/SteamNetworkingSockets.cs index ea5e983..9e98882 100644 --- a/Facepunch.Steamworks/SteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/SteamNetworkingSockets.cs @@ -12,6 +12,25 @@ public class SteamNetworkingSockets : SteamSharedClass { internal static ISteamNetworkingSockets Internal => Interface as ISteamNetworkingSockets; + /// + /// Get the identity assigned to this interface. + /// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned + /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know + /// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID + /// even if they are not signed into Steam.) + /// + public static NetIdentity Identity + { + get + { + NetIdentity identity = default; + + Internal.GetIdentity( ref identity ); + + return identity; + } + } + internal override void InitializeInterface( bool server ) { SetInterface( server, new ISteamNetworkingSockets( server ) );