From 2d2001f796f2753f13f4775e0a1c5688f617d70f Mon Sep 17 00:00:00 2001 From: Fletcher Dunn Date: Thu, 27 Feb 2020 08:50:46 -0800 Subject: [PATCH] Fix SteamNetworkingIPAdd flat inteface. Fixes issue #100. --- .../clientlib/steamnetworkingsockets_flat.cpp | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_flat.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_flat.cpp index 319df7d0..211bb90e 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_flat.cpp +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_flat.cpp @@ -312,21 +312,44 @@ STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingConfigValue SteamAPI_ISteamNetw { return self->GetFirstConfigValue( ); } -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIPAddr & addr, char * buf, uint32 cbBuf, bool bWithPort ) + +//--- SteamNetworkingIPAddr------------------------- + +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_Clear( SteamNetworkingIPAddr* self ) +{ + self->Clear( ); +} +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros( SteamNetworkingIPAddr* self ) +{ + return self->IsIPv6AllZeros( ); +} +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_SetIPv6( SteamNetworkingIPAddr* self, const uint8 * ipv6, uint16 nPort ) { - self->SteamNetworkingIPAddr_ToString( addr,buf,cbBuf,bWithPort ); + self->SetIPv6( ipv6,nPort ); } -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIPAddr * pAddr, const char * pszStr ) +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_SetIPv4( SteamNetworkingIPAddr* self, uint32 nIP, uint16 nPort ) { - return self->SteamNetworkingIPAddr_ParseString( pAddr,pszStr ); + self->SetIPv4( nIP,nPort ); } -STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString( ISteamNetworkingUtils* self, const SteamNetworkingIdentity & identity, char * buf, uint32 cbBuf ) +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsIPv4( SteamNetworkingIPAddr* self ) { - self->SteamNetworkingIdentity_ToString( identity,buf,cbBuf ); + return self->IsIPv4( ); } -STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString( ISteamNetworkingUtils* self, SteamNetworkingIdentity * pIdentity, const char * pszStr ) +STEAMNETWORKINGSOCKETS_INTERFACE uint32 SteamAPI_SteamNetworkingIPAddr_GetIPv4( SteamNetworkingIPAddr* self ) { - return self->SteamNetworkingIdentity_ParseString( pIdentity,pszStr ); + return self->GetIPv4( ); +} +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost( SteamNetworkingIPAddr* self, uint16 nPort ) +{ + self->SetIPv6LocalHost( nPort ); +} +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsLocalHost( SteamNetworkingIPAddr* self ) +{ + return self->IsLocalHost( ); +} +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_IsEqualTo( SteamNetworkingIPAddr* self, const SteamNetworkingIPAddr & x ) +{ + return self->operator==( x ); } //--- SteamNetworkingIdentity-------------------------