Skip to content

Commit 9ba30bd

Browse files
committed
Sync up flat interface with Steamworks SDK 1.48
1 parent c1df31b commit 9ba30bd

File tree

6 files changed

+387
-364
lines changed

6 files changed

+387
-364
lines changed

include/steam/steamnetworkingsockets_flat.h

Lines changed: 118 additions & 101 deletions
Large diffs are not rendered by default.

include/steam/steamnetworkingtypes.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,15 @@ struct SteamNetworkingIPAddr
209209
union
210210
{
211211
uint8 m_ipv6[ 16 ];
212+
#ifndef API_GEN // API generator doesn't understand this. The bindings will just use the accessors
212213
struct // IPv4 "mapped address" (rfc4038 section 4.2)
213214
{
214215
uint64 m_8zeros;
215216
uint16 m_0000;
216217
uint16 m_ffff;
217218
uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order
218219
} m_ipv4;
220+
#endif
219221
};
220222
uint16 m_port; // Host byte order
221223

@@ -270,7 +272,7 @@ struct SteamNetworkingIdentity
270272

271273
/// Parse back a string that was generated using ToString. If we don't understand the
272274
/// string, but it looks "reasonable" (it matches the pattern type:<type-data> and doesn't
273-
/// have any funcky characters, etc), then we will return true, and the type is set to
275+
/// have any funky characters, etc), then we will return true, and the type is set to
274276
/// k_ESteamNetworkingIdentityType_UnknownType. false will only be returned if the string
275277
/// looks invalid.
276278
bool ParseString( const char *pszStr );
@@ -788,13 +790,15 @@ struct SteamNetworkingMessage_t
788790
inline void Release();
789791

790792
// For code compatibility, some accessors
793+
#ifndef API_GEN
791794
inline uint32 GetSize() const { return m_cbSize; }
792795
inline const void *GetData() const { return m_pData; }
793796
inline int GetChannel() const { return m_nChannel; }
794797
inline HSteamNetConnection GetConnection() const { return m_conn; }
795798
inline int64 GetConnectionUserData() const { return m_nConnUserData; }
796799
inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; }
797800
inline int64 GetMessageNumber() const { return m_nMessageNumber; }
801+
#endif
798802
protected:
799803
// Declare destructor protected. You should never need to declare a message
800804
// object on the stack or create one yourself.
@@ -1247,6 +1251,7 @@ const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | (
12471251
///////////////////////////////////////////////////////////////////////////////
12481252
//
12491253
// Internal stuff
1254+
#ifndef API_GEN
12501255

12511256
// For code compatibility
12521257
typedef SteamNetworkingMessage_t ISteamNetworkingMessage;
@@ -1285,12 +1290,14 @@ inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)( this ); }
12851290
#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || !defined( STEAMNETWORKINGSOCKETS_STEAMCLIENT )
12861291
STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort );
12871292
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr );
1288-
STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf );
1293+
STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity *pIdentity, char *buf, size_t cbBuf );
12891294
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr );
12901295
inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamAPI_SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); }
12911296
inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIPAddr_ParseString( this, pszStr ); }
1292-
inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamAPI_SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); }
1297+
inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamAPI_SteamNetworkingIdentity_ToString( this, buf, cbBuf ); }
12931298
inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); }
12941299
#endif
12951300

1301+
#endif // #ifndef API_GEN
1302+
12961303
#endif // #ifndef STEAMNETWORKINGTYPES

src/steamnetworkingsockets/clientlib/csteamnetworkingsockets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ bool CSteamNetworkingUtils::SteamNetworkingIPAddr_ParseString( SteamNetworkingIP
15641564

15651565
void CSteamNetworkingUtils::SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf )
15661566
{
1567-
return SteamAPI_SteamNetworkingIdentity_ToString( identity, buf, cbBuf );
1567+
return SteamAPI_SteamNetworkingIdentity_ToString( &identity, buf, cbBuf );
15681568
}
15691569

15701570
bool CSteamNetworkingUtils::SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr )

0 commit comments

Comments
 (0)