7#ifndef STEAMNETWORKINGTYPES
8#define STEAMNETWORKINGTYPES
18#if !defined(STEAMNETWORKINGSOCKETS_STANDALONELIB) && !defined(STEAMNETWORKINGSOCKETS_STEAMAPI)
19 #define STEAMNETWORKINGSOCKETS_STEAMAPI
24 #define STEAMNETWORKINGSOCKETS_STATIC_LINK
26#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK )
27 #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C"
28#elif defined( STEAMNETWORKINGSOCKETS_FOREXPORT )
29 #if defined( _WIN32 ) || defined( __ORBIS__ ) || defined( __PROSPERO__ )
30 #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllexport )
32 #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __attribute__((visibility("default")))
36 #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllimport )
38 #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C"
42#if defined( VALVE_CALLBACK_PACK_SMALL )
43#pragma pack( push, 4 )
44#elif defined( VALVE_CALLBACK_PACK_LARGE )
45#pragma pack( push, 8 )
47#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE"
50struct SteamDatagramRelayAuthTicket;
51struct SteamDatagramHostedAddress;
52struct SteamDatagramGameCoordinatorServerLogin;
220 inline void ToString(
char *buf,
size_t cbBuf,
bool bWithPort )
const;
308 void ToString(
char *buf,
size_t cbBuf )
const;
1767 m_val.m_int32 = data;
1773 m_val.m_int64 = data;
1779 m_val.m_float = data;
1791 m_val.m_string = data;
1849 if ( result && pszCode[1] )
1866 static_assert( N >= 5,
"Fixed-size buffer not big enough to hold SDR POP ID" );
1867 szCode[0] = char(
id >> 16U );
1868 szCode[1] = char(
id >> 8U );
1869 szCode[2] = char(
id );
1870 szCode[3] = char(
id >> 24U );
1906inline bool SteamNetworkingIPAddr::IsLocalHost()
const {
return ( m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12] == 0 && m_ipv6[13] == 0 && m_ipv6[14] == 0 && m_ipv6[15] == 1 ) || (
GetIPv4() == 0x7f000001 ); }
1933 cbLen =
m_cbSize;
return m_genericBytes; }
SCRIPT_CONTROL SCRIPT_STATE const void int
uint64 ConvertToUint64() const
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
typedef void(S_CALLTYPE *SteamAPIWarningMessageHook_t)(int
const int k_nSteamNetworkingPing_Unknown
SteamNetworkingErrMsg SteamDatagramErrMsg
ESteamNetworkingSocketsDebugOutputType
@ k_ESteamNetworkingSocketsDebugOutputType_Debug
@ k_ESteamNetworkingSocketsDebugOutputType_Everything
@ k_ESteamNetworkingSocketsDebugOutputType_Warning
@ k_ESteamNetworkingSocketsDebugOutputType_Error
@ k_ESteamNetworkingSocketsDebugOutputType__Force32Bit
@ k_ESteamNetworkingSocketsDebugOutputType_Bug
@ k_ESteamNetworkingSocketsDebugOutputType_Verbose
@ k_ESteamNetworkingSocketsDebugOutputType_Msg
@ k_ESteamNetworkingSocketsDebugOutputType_Important
@ k_ESteamNetworkingSocketsDebugOutputType_None
@ k_ESteamNetConnectionEnd_Local_OfflineMode
@ k_ESteamNetConnectionEnd_Misc_InternalError
@ k_ESteamNetConnectionEnd_Local_NetworkConfig
@ k_ESteamNetConnectionEnd_Remote_Timeout
@ k_ESteamNetConnectionEnd_AppException_Max
@ k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses
@ k_ESteamNetConnectionEnd_AppException_Generic
@ k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection
@ k_ESteamNetConnectionEnd_AppException_Min
@ k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity
@ k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay
@ k_ESteamNetConnectionEnd_Local_Rights
@ k_ESteamNetConnectionEnd_Remote_Min
@ k_ESteamNetConnectionEnd_App_Generic
@ k_ESteamNetConnectionEnd_Misc_Timeout
@ k_ESteamNetConnectionEnd_Misc_Min
@ k_ESteamNetConnectionEnd_Remote_BadCrypt
@ k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall
@ k_ESteamNetConnectionEnd__Force32Bit
@ k_ESteamNetConnectionEnd_App_Min
@ k_ESteamNetConnectionEnd_Local_Max
@ k_ESteamNetConnectionEnd_App_Max
@ k_ESteamNetConnectionEnd_Remote_BadProtocolVersion
@ k_ESteamNetConnectionEnd_Misc_SteamConnectivity
@ k_ESteamNetConnectionEnd_Remote_Max
@ k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous
@ k_ESteamNetConnectionEnd_Misc_Max
@ k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses
@ k_ESteamNetConnectionEnd_Remote_BadCert
@ k_ESteamNetConnectionEnd_Local_Min
@ k_ESteamNetConnectionEnd_Misc_Generic
@ k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient
@ k_ESteamNetConnectionEnd_Invalid
const HSteamNetPollGroup k_HSteamNetPollGroup_Invalid
void(*) FnSteamNetConnectionStatusChanged(SteamNetConnectionStatusChangedCallback_t *)
void(*) FnSteamNetworkingFakeIPResult(SteamNetworkingFakeIPResult_t *)
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Relay
const int k_nSteamNetworkConnectionInfoFlags_Fast
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_All
int64 SteamNetworkingMicroseconds
const int k_nSteamNetworkingSend_UnreliableNoDelay
const int k_cbMaxSteamNetworkingSocketsMessageSizeSend
const int k_nSteamNetworkingSend_UnreliableNoNagle
const int k_nSteamNetworkConnectionInfoFlags_LoopbackBuffers
const int k_nSteamNetworkingSend_ReliableNoNagle
ESteamNetworkingFakeIPType
@ k_ESteamNetworkingFakeIPType__Force32Bit
@ k_ESteamNetworkingFakeIPType_Invalid
@ k_ESteamNetworkingFakeIPType_GlobalIPv4
@ k_ESteamNetworkingFakeIPType_LocalIPv4
@ k_ESteamNetworkingFakeIPType_NotFake
SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString(const char *pszCode)
Convert 3- or 4-character ID to 32-bit int.
SteamNetworkingMessage_t ISteamNetworkingMessage
const int k_cchSteamNetworkingMaxConnectionAppName
Max length of the app's part of the description.
uint32 HSteamNetConnection
Handle used to identify a connection to a remote host.
const int k_nSteamNetworkConnectionInfoFlags_Relayed
const int k_cchSteamNetworkingMaxConnectionDescription
void(*) FnSteamNetAuthenticationStatusChanged(SteamNetAuthenticationStatus_t *)
ESteamNetworkingConfigScope
Configuration values can be applied to different types of objects.
@ k_ESteamNetworkingConfig_SocketsInterface
@ k_ESteamNetworkingConfig_Connection
Options for a specific connection.
@ k_ESteamNetworkingConfigScope__Force32Bit
@ k_ESteamNetworkingConfig_ListenSocket
@ k_ESteamNetworkingConfig_Global
const int k_nSteamNetworkConnectionInfoFlags_DualWifi
uint32 HSteamNetPollGroup
uint32 HSteamListenSocket
ESteamNetworkingConfigValue
Configuration options.
@ k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket
@ k_ESteamNetworkingConfig_SDRClient_DevTicket
@ k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate
@ k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty
@ k_ESteamNetworkingConfig_P2P_TURN_UserList
@ k_ESteamNetworkingConfig_EnableDiagnosticsUI
@ k_ESteamNetworkingConfig_LogLevel_PacketDecode
@ k_ESteamNetworkingConfig_RecvBufferMessages
@ k_ESteamNetworkingConfig_PacketTraceMaxBytes
@ k_ESteamNetworkingConfig_SendBufferSize
@ k_ESteamNetworkingConfig_ECN
@ k_ESteamNetworkingConfig_P2P_TURN_ServerList
@ k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged
@ k_ESteamNetworkingConfig_DualWifi_Enable
@ k_ESteamNetworkingConfig_TimeoutConnected
[connection int32] Timeout value (in ms) to use after connection is established
@ k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail
@ k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst
@ k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged
@ k_ESteamNetworkingConfig_SendRateMax
@ k_ESteamNetworkingConfig_FakePacketJitter_Recv_Avg
@ k_ESteamNetworkingConfig_SendTimeSincePreviousPacket
@ k_ESteamNetworkingConfig_Invalid
@ k_ESteamNetworkingConfig_Callback_MessagesSessionFailed
@ k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation
@ k_ESteamNetworkingConfig_DELETED_EnumerateDevVars
@ k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate
@ k_ESteamNetworkingConfig_FakePacketJitter_Send_Pct
@ k_ESteamNetworkingConfig_LogLevel_Message
@ k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling
@ k_ESteamNetworkingConfig_FakePacketJitter_Recv_Pct
@ k_ESteamNetworkingConfig_SDRClient_EnableTOSProbes
@ k_ESteamNetworkingConfig_P2P_TURN_PassList
@ k_ESteamNetworkingConfig_SDRClient_FakeClusterPing
@ k_ESteamNetworkingConfig_NagleTime
@ k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable
@ k_ESteamNetworkingConfig_FakePacketJitter_Recv_Max
@ k_ESteamNetworkingConfig_SymmetricConnect
@ k_ESteamNetworkingConfig_FakePacketReorder_Time
@ k_ESteamNetworkingConfig_LogLevel_SDRRelayPings
@ k_ESteamNetworkingConfig_RecvMaxMessageSize
@ k_ESteamNetworkingConfig_LogLevel_PacketGaps
@ k_ESteamNetworkingConfig_ConnectionUserData
@ k_ESteamNetworkingConfig_Unencrypted
@ k_ESteamNetworkingConfig_FakePacketReorder_Send
@ k_ESteamNetworkingConfig_FakePacketLoss_Recv
@ k_ESteamNetworkingConfig_FakePacketJitter_Send_Max
@ k_ESteamNetworkingConfig_RecvBufferSize
@ k_ESteamNetworkingConfig_Callback_MessagesSessionRequest
@ k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty
@ k_ESteamNetworkingConfig_FakePacketLoss_Send
@ k_ESteamNetworkingConfig_Callback_FakeIPResult
@ k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds
@ k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate
@ k_ESteamNetworkingConfig_FakePacketDup_TimeMax
@ k_ESteamNetworkingConfig_TimeoutInitial
[connection int32] Timeout value (in ms) to use when first connecting
@ k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst
@ k_ESteamNetworkingConfig_LocalVirtualPort
@ k_ESteamNetworkingConfig_FakePacketDup_Send
[global float 0–100] Globally duplicate some percentage of packets.
@ k_ESteamNetworkingConfig_IP_AllowWithoutAuth
@ k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr
@ k_ESteamNetworkingConfig_FakePacketLag_Recv
@ k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster
@ k_ESteamNetworkingConfig_LogLevel_AckRTT
@ k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN
@ k_ESteamNetworkingConfig_FakePacketLag_Send
[global int32]. Delay all outbound/inbound packets by N ms
@ k_ESteamNetworkingConfig_SDRClient_SingleSocket
@ k_ESteamNetworkingConfig_IPLocalHost_AllowWithoutAuth
@ k_ESteamNetworkingConfig_MTU_DataSize
@ k_ESteamNetworkingConfig_FakePacketDup_Recv
@ k_ESteamNetworkingConfig_FakePacketReorder_Recv
@ k_ESteamNetworkingConfig_SendRateMin
@ k_ESteamNetworkingConfig_LogLevel_P2PRendezvous
@ k_ESteamNetworkingConfig_MTU_PacketSize
@ k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial
@ k_ESteamNetworkingConfig_Callback_AuthStatusChanged
@ k_ESteamNetworkingConfigValue__Force32Bit
@ k_ESteamNetworkingConfig_FakePacketJitter_Send_Avg
@ k_ESteamNetworkingConfig_P2P_STUN_ServerList
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Default
void(*) FSteamNetworkingSocketsDebugOutput(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg)
Setup callback for debug output, and the desired verbosity you want.
const int k_nSteamNetworkConnectionInfoFlags_Unauthenticated
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Private
ESteamNetworkingAvailability
Describe the status of a particular network resource.
@ k_ESteamNetworkingAvailability_NeverTried
@ k_ESteamNetworkingAvailability_Previously
@ k_ESteamNetworkingAvailability_Unknown
@ k_ESteamNetworkingAvailability_Waiting
@ k_ESteamNetworkingAvailability_Current
@ k_ESteamNetworkingAvailability_Retrying
@ k_ESteamNetworkingAvailability_Failed
@ k_ESteamNetworkingAvailability_Attempting
@ k_ESteamNetworkingAvailability_CannotTry
@ k_ESteamNetworkingAvailability__Force32bit
const int k_cchMaxSteamNetworkingErrMsg
Max length of diagnostic error message.
void(*) FnSteamNetworkingMessagesSessionRequest(SteamNetworkingMessagesSessionRequest_t *)
ESteamNetworkingConnectionState
High level connection status.
@ k_ESteamNetworkingConnectionState_Connecting
@ k_ESteamNetworkingConnectionState_ProblemDetectedLocally
@ k_ESteamNetworkingConnectionState_Linger
@ k_ESteamNetworkingConnectionState__Force32Bit
@ k_ESteamNetworkingConnectionState_ClosedByPeer
@ k_ESteamNetworkingConnectionState_None
@ k_ESteamNetworkingConnectionState_FindingRoute
@ k_ESteamNetworkingConnectionState_Dead
Connection is completely inactive and ready to be destroyed.
@ k_ESteamNetworkingConnectionState_FinWait
@ k_ESteamNetworkingConnectionState_Connected
void(*) FnSteamNetworkingMessagesSessionFailed(SteamNetworkingMessagesSessionFailed_t *)
const int k_nSteamNetworkingSend_NoNagle
const int k_nSteamNetworkingSend_Unreliable
const SteamNetworkingPOPID k_SteamDatagramPOPID_dev
The POPID "dev" is used in non-production environments for testing.
const HSteamListenSocket k_HSteamListenSocket_Invalid
void GetSteamNetworkingLocationPOPStringFromID(SteamNetworkingPOPID id, char(&szCode)[N])
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Public
ESteamNetworkingGetConfigValueResult
Return value of ISteamNetworkintgUtils::GetConfigValue.
@ k_ESteamNetworkingGetConfigValue_BadValue
@ k_ESteamNetworkingGetConfigValue_BufferTooSmall
@ k_ESteamNetworkingGetConfigValue_BadScopeObj
@ k_ESteamNetworkingGetConfigValue_OKInherited
@ k_ESteamNetworkingGetConfigValueResult__Force32Bit
@ k_ESteamNetworkingGetConfigValue_OK
const HSteamNetConnection k_HSteamNetConnection_Invalid
const int k_cchSteamNetworkingMaxConnectionCloseReason
const int k_nSteamNetworkingSend_Reliable
const int k_nSteamNetworkingSend_AutoRestartBrokenSession
const int k_nSteamNetworkingPing_Failed
Special values that are returned by some functions that return a ping.
ESteamNetworkingIdentityType
Different methods of describing the identity of a network host.
@ k_ESteamNetworkingIdentityType_Invalid
@ k_ESteamNetworkingIdentityType_UnknownType
@ k_ESteamNetworkingIdentityType_IPAddress
@ k_ESteamNetworkingIdentityType_SteamID
@ k_ESteamNetworkingIdentityType_GenericString
@ k_ESteamNetworkingIdentityType_GenericBytes
@ k_ESteamNetworkingIdentityType_SonyPSN
@ k_ESteamNetworkingIdentityType__Force32bit
@ k_ESteamNetworkingIdentityType_XboxPairwiseID
const int k_nSteamNetworkingSend_UseCurrentThread
void(*) FnSteamRelayNetworkStatusChanged(SteamRelayNetworkStatus_t *)
const int k_cchMaxSteamNetworkingPingLocationString
const int k_nSteamNetworkConnectionInfoFlags_Unencrypted
uint32 SteamNetworkingPOPID
char SteamNetworkingErrMsg[k_cchMaxSteamNetworkingErrMsg]
const int k_nSteamNetworkingConfig_P2P_Transport_ICE_Enable_Disable
ESteamNetworkingConfigDataType
@ k_ESteamNetworkingConfig_String
@ k_ESteamNetworkingConfigDataType__Force32Bit
@ k_ESteamNetworkingConfig_Int32
@ k_ESteamNetworkingConfig_Ptr
@ k_ESteamNetworkingConfig_Float
@ k_ESteamNetworkingConfig_Int64
const int k_nSteamNetworkingSend_NoDelay
unsigned long long uint64
Describe the state of a connection.
SteamNetworkingPOPID m_idPOPRemote
What data center is the remote host in? (0 if we don't know.).
ESteamNetworkingConnectionState m_eState
High level state of the connection.
HSteamListenSocket m_hListenSocket
Handle to listen socket this was connected on, or k_HSteamListenSocket_Invalid if we initiated the co...
int64 m_nUserData
Arbitrary user data set by the local application code.
char m_szConnectionDescription[k_cchSteamNetworkingMaxConnectionDescription]
SteamNetworkingIdentity m_identityRemote
Who is on the other end? Depending on the connection type and phase of the connection,...
uint32 reserved[63]
Internal stuff, room to change API easily.
char m_szEndDebug[k_cchSteamNetworkingMaxConnectionCloseReason]
int m_nFlags
Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx.
SteamNetworkingPOPID m_idPOPRelay
SteamNetworkingIPAddr m_addrRemote
Quick status of a particular lane.
int m_cbSentUnackedReliable
int m_cbPendingUnreliable
SteamNetworkingMicroseconds m_usecQueueTime
float m_flInPacketsPerSec
int m_cbPendingUnreliable
float m_flOutPacketsPerSec
Current data rates from recent history.
float m_flConnectionQualityRemote
Packet delivery success rate as observed from remote host.
int m_nPing
Current ping (ms).
SteamNetworkingMicroseconds m_usecQueueTime
ESteamNetworkingConnectionState m_eState
High level state of the connection.
int m_cbSentUnackedReliable
int m_nSendRateBytesPerSecond
float m_flConnectionQualityLocal
Callback struct used to notify when a connection has changed state.
void SetString(ESteamNetworkingConfigValue eVal, const char *data)
ESteamNetworkingConfigValue m_eValue
Which option is being set.
union SteamNetworkingConfigValue_t::@226264230310136375067366131222017367032047164040 m_val
void SetInt64(ESteamNetworkingConfigValue eVal, int64_t data)
void SetFloat(ESteamNetworkingConfigValue eVal, float data)
void SetInt32(ESteamNetworkingConfigValue eVal, int32_t data)
ESteamNetworkingConfigDataType m_eDataType
Which field below did you fill in?
void SetPtr(ESteamNetworkingConfigValue eVal, void *data)
Callback struct used to notify when a connection has changed state.
bool ParseString(const char *pszStr)
void SetIPv6(const uint8 *ipv6, uint16 nPort)
bool IsFakeIP() const
Return true if we are a FakeIP.
bool operator==(const SteamNetworkingIPAddr &x) const
See if two addresses are identical.
bool IsIPv6AllZeros() const
void SetIPv6LocalHost(uint16 nPort=0)
ESteamNetworkingFakeIPType GetFakeIPType() const
void SetIPv4(uint32 nIP, uint16 nPort)
void ToString(char *buf, size_t cbBuf, bool bWithPort) const
bool ParseString(const char *pszStr)
void SetSteamID64(uint64 steamID)
bool SetXboxPairwiseID(const char *pszString)
void SetIPAddr(const SteamNetworkingIPAddr &addr)
bool operator==(const SteamNetworkingIdentity &x) const
See if two identities are identical.
const SteamNetworkingIPAddr * GetIPAddr() const
const char * GetGenericString() const
bool SetGenericString(const char *pszString)
ESteamNetworkingFakeIPType GetFakeIPType() const
uint64 GetSteamID64() const
void SetIPv4Addr(uint32 nIPv4, uint16 nPort)
ESteamNetworkingIdentityType m_eType
Type of identity.
bool SetGenericBytes(const void *data, size_t cbLen)
void ToString(char *buf, size_t cbBuf) const
const char * GetXboxPairwiseID() const
void SetSteamID(CSteamID steamID)
const uint8 * GetGenericBytes(int &cbLen) const
CSteamID GetSteamID() const
A message that has been received.
void * m_pData
Message payload.
SteamNetworkingIdentity m_identityPeer
int64 GetMessageNumber() const
SteamNetworkingMicroseconds m_usecTimeReceived
HSteamNetConnection GetConnection() const
int64 GetConnectionUserData() const
void(*) m_pfnRelease(SteamNetworkingMessage_t *pMsg)
void(*) m_pfnFreeData(SteamNetworkingMessage_t *pMsg)
const void * GetData() const
~SteamNetworkingMessage_t()
SteamNetworkingMicroseconds GetTimeReceived() const
int m_cbSize
Size of the payload.
HSteamNetConnection m_conn
Posted when a remote host is sending us a message, and we do not already have a session with them.
SteamNetworkingPOPIDRender(SteamNetworkingPOPID x)
const char * c_str() const
SteamNetworkingIPAddr m_ip
char m_szGenericString[k_cchMaxGenericString]
char m_szUnknownRawString[k_cchMaxString]
uint8 m_genericBytes[k_cbMaxGenericBytes]
char m_szXboxPairwiseID[k_cchMaxXboxPairwiseID]