This commit is contained in:
Riley Labrecque
2020-02-23 08:56:31 -08:00
parent aadc619a55
commit 85a8420e52
51 changed files with 14471 additions and 23957 deletions
+25
View File
@@ -8,6 +8,31 @@ Copyright
Welcome to the Steamworks SDK. For documentation please see our partner
website at: http://partner.steamgames.com
----------------------------------------------------------------
v1.48 12th February 2020
----------------------------------------------------------------
ISteamNetworkingSockets
* Added the concept of a "poll group", which is a way to receive messages from many connections at once, efficiently.
* ReceiveMessagesOnListenSocket was deleted. To get the same functionality, create a poll group, and then add connections to this poll group when accepting the connection.
Flat interface redesign
* Fixed many missing interfaces and types.
* All versions of overloaded functions are now available, using distinct names.
* There are now simple, global versioned functions to fetch the interfaces. No more need to mess with HSteamPipes or HSteamUsers directly.
* The json file now has much more detailed information and several errors have been fixed.
* steam_api_interop.cs has been removed and will no longer be supported.
* There is a new manual dispatch API for callbacks, which works similarly to a windows event loop. This is a replacement for the existing callback registeration and dispatch mechanisms, which which are nice in C++ but awkward to use outside of C++.
----------------------------------------------------------------
v1.47a 14th February 2020
----------------------------------------------------------------
macOS
* Fixed notarization issues caused by code signature of libsteam_api.dylib
----------------------------------------------------------------
v1.47 3rd December 2019
----------------------------------------------------------------
+2 -2
View File
@@ -61,7 +61,7 @@ struct MsgServerSendInfo_t
void SetSecure( bool bSecure ) { m_bIsVACSecure = bSecure; }
bool GetSecure() { return m_bIsVACSecure; }
void SetServerName( const char *pchName ) { strncpy( m_rgchServerName, pchName, sizeof( m_rgchServerName ) ); }
void SetServerName( const char *pchName ) { strncpy_safe( m_rgchServerName, pchName, sizeof( m_rgchServerName ) ); }
const char *GetServerName() { return m_rgchServerName; }
private:
@@ -243,4 +243,4 @@ private:
#pragma pack( pop )
#endif // MESSAGES_H
#endif // MESSAGES_H
+9 -9
View File
@@ -18,15 +18,15 @@ CGameServer::CGameServer( gameserveritem_t *pGameServerItem )
m_unIPAddress = pGameServerItem->m_NetAdr.GetIP();
m_nConnectionPort = pGameServerItem->m_NetAdr.GetConnectionPort();
m_nPing = pGameServerItem->m_nPing;
strncpy( m_szMap, pGameServerItem->m_szMap, ARRAYSIZE( m_szMap ) );
strncpy( m_szGameDescription, pGameServerItem->m_szGameDescription, ARRAYSIZE( m_szGameDescription ) );
strncpy_safe( m_szMap, pGameServerItem->m_szMap, ARRAYSIZE( m_szMap ) );
strncpy_safe( m_szGameDescription, pGameServerItem->m_szGameDescription, ARRAYSIZE( m_szGameDescription ) );
m_nPlayers = pGameServerItem->m_nPlayers;
m_nMaxPlayers = pGameServerItem->m_nMaxPlayers;
m_nBotPlayers = pGameServerItem->m_nBotPlayers;
m_bPassword = pGameServerItem->m_bPassword;
m_bSecure = pGameServerItem->m_bSecure;
m_nServerVersion = pGameServerItem->m_nServerVersion;
strncpy( m_szServerName, pGameServerItem->GetName(), ARRAYSIZE( m_szServerName ) );
strncpy_safe( m_szServerName, pGameServerItem->GetName(), ARRAYSIZE( m_szServerName ) );
sprintf_safe( m_szServerString, "%s (%i/%i) at %s ping(%d)", pGameServerItem->GetName(), pGameServerItem->m_nPlayers, pGameServerItem->m_nMaxPlayers, pGameServerItem->m_NetAdr.GetConnectionAddressString(), pGameServerItem->m_nPing );
m_steamID = pGameServerItem->m_steamID;
}
@@ -100,14 +100,14 @@ void CServerBrowser::RefreshInternetServers()
MatchMakingKeyValuePair_t pFilters[2];
MatchMakingKeyValuePair_t *pFilter = pFilters;
strncpy( pFilters[ 0 ].m_szKey, "gamedir", sizeof(pFilters[ 0 ].m_szKey) );
strncpy( pFilters[ 0 ].m_szValue, "spacewar", sizeof(pFilters[ 0 ].m_szValue) );
strncpy_safe( pFilters[ 0 ].m_szKey, "gamedir", sizeof(pFilters[ 0 ].m_szKey) );
strncpy_safe( pFilters[ 0 ].m_szValue, "spacewar", sizeof(pFilters[ 0 ].m_szValue) );
strncpy( pFilters[ 1 ].m_szKey, "secure", sizeof(pFilters[ 1 ].m_szKey) );
strncpy( pFilters[ 1 ].m_szValue, "1", sizeof(pFilters[ 1 ].m_szValue) );
strncpy_safe( pFilters[ 1 ].m_szKey, "secure", sizeof(pFilters[ 1 ].m_szKey) );
strncpy_safe( pFilters[ 1 ].m_szValue, "1", sizeof(pFilters[ 1 ].m_szValue) );
//strncpy( pFilters[ 2 ].m_szKey, "gametype", sizeof(pFilters[ 1 ].m_szValue) );
//strncpy( pFilters[ 2 ].m_szValue, "dm", sizeof(pFilters[ 1 ].m_szValue) );
//strncpy_safe( pFilters[ 2 ].m_szKey, "gametype", sizeof(pFilters[ 1 ].m_szValue) );
//strncpy_safe( pFilters[ 2 ].m_szValue, "dm", sizeof(pFilters[ 1 ].m_szValue) );
// bugbug jmccaskey - passing just the appid without filters results in getting all servers rather than
// servers filtered by appid alone. So, we'll use the filters to filter the results better.
+4 -4
View File
@@ -94,7 +94,7 @@ inline T DWordSwap( T dw )
{
uint32 temp;
temp = *((uint32 *)&dw) >> 24;
temp = *((uint32 *)&dw) >> 24;
temp |= ((*((uint32 *)&dw) & 0x00FF0000) >> 8);
temp |= ((*((uint32 *)&dw) & 0x0000FF00) << 8);
temp |= ((*((uint32 *)&dw) & 0x000000FF) << 24);
@@ -107,7 +107,7 @@ inline T QWordSwap( T dw )
{
uint64 temp;
temp = *((uint64 *)&dw) >> 56;
temp = *((uint64 *)&dw) >> 56;
temp |= ((*((uint64 *)&dw) & 0x00FF000000000000ull) >> 40);
temp |= ((*((uint64 *)&dw) & 0x0000FF0000000000ull) >> 24);
temp |= ((*((uint64 *)&dw) & 0x000000FF00000000ull) >> 8);
@@ -396,7 +396,7 @@ private:
// This is the data that gets sent from each client to the server for each update
struct ClientSpaceWarUpdateData_t
{
void SetPlayerName( const char *pchName ) { strncpy( m_rgchPlayerName, pchName, sizeof( m_rgchPlayerName ) ); }
void SetPlayerName( const char *pchName ) { strncpy_safe( m_rgchPlayerName, pchName, sizeof( m_rgchPlayerName ) ); }
const char *GetPlayerName() { return m_rgchPlayerName; }
void SetFirePressed( bool bIsPressed ) { m_bFirePressed = bIsPressed; }
@@ -462,4 +462,4 @@ private:
#pragma pack( pop )
#endif // SPACEWAR_H
#endif // SPACEWAR_H
+14 -4
View File
@@ -2204,10 +2204,18 @@ void CSpaceWarClient::OnRequestEncryptedAppTicket( EncryptedAppTicketResponse_t
if ( pEncryptedAppTicketResponse->m_eResult == k_EResultOK )
{
uint8 rgubTicket[1024];
uint32 cubTicket;
SteamUser()->GetEncryptedAppTicket( rgubTicket, sizeof( rgubTicket), &cubTicket );
// first determine what size the buffer should be:
uint32 cubTicket = 0;
SteamUser()->GetEncryptedAppTicket( nullptr, 0, &cubTicket );
uint32 bufSize = cubTicket;
uint8 *pTicket = new uint8[ bufSize ];
if ( !SteamUser()->GetEncryptedAppTicket( pTicket, bufSize, &cubTicket ) )
{
OutputDebugString( "App ticket not available\n" );
delete[] pTicket;
return;
}
#ifdef _WIN32
// normally at this point you transmit the encrypted ticket to the service that knows the decryption key
@@ -2218,7 +2226,9 @@ void CSpaceWarClient::OnRequestEncryptedAppTicket( EncryptedAppTicketResponse_t
uint8 rgubDecrypted[1024];
uint32 cubDecrypted = sizeof( rgubDecrypted );
if ( !SteamEncryptedAppTicket_BDecryptTicket( rgubTicket, cubTicket, rgubDecrypted, &cubDecrypted, rgubKey, sizeof( rgubKey ) ) )
bool bDecrypted = SteamEncryptedAppTicket_BDecryptTicket( pTicket, cubTicket, rgubDecrypted, &cubDecrypted, rgubKey, sizeof( rgubKey ) );
delete[] pTicket;
if ( !bDecrypted )
{
OutputDebugString( "Ticket failed to decrypt\n" );
return;
@@ -433,6 +433,10 @@
RelativePath=".\QuitMenu.cpp"
>
</File>
<File
RelativePath=".\RemotePlay.cpp"
>
</File>
<File
RelativePath=".\RemoteStorage.cpp"
>
@@ -559,6 +563,10 @@
RelativePath=".\QuitMenu.h"
>
</File>
<File
RelativePath=".\RemotePlay.h"
>
</File>
<File
RelativePath=".\RemoteStorage.h"
>
+13
View File
@@ -220,6 +220,19 @@ template <size_t maxLenInChars> void sprintf_safe(OUT_Z_ARRAY char (&pDest)[maxL
va_end( params );
}
inline void strncpy_safe( char *pDest, char const *pSrc, size_t maxLen )
{
size_t nCount = maxLen;
char *pstrDest = pDest;
const char *pstrSource = pSrc;
while ( 0 < nCount && 0 != ( *pstrDest++ = *pstrSource++ ) )
nCount--;
if ( maxLen > 0 )
pstrDest[-1] = 0;
}
#ifdef STEAM_CEG
// Steam DRM header file
#include "cegclient.h"
+1 -1
View File
@@ -168,7 +168,7 @@ public:
// Global ISteamClient interface accessor
inline ISteamClient *SteamClient();
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ) );
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ), "global", STEAMCLIENT_INTERFACE_VERSION );
// The internal ISteamClient used for the gameserver interface.
// (This is actually the same thing. You really shouldn't need to access any of this stuff directly.)
-43
View File
@@ -43,49 +43,6 @@ enum ESteamControllerPad
};
#endif
enum EControllerSource
{
k_EControllerSource_None,
k_EControllerSource_LeftTrackpad,
k_EControllerSource_RightTrackpad,
k_EControllerSource_Joystick,
k_EControllerSource_ABXY,
k_EControllerSource_Switch,
k_EControllerSource_LeftTrigger,
k_EControllerSource_RightTrigger,
k_EControllerSource_LeftBumper,
k_EControllerSource_RightBumper,
k_EControllerSource_Gyro,
k_EControllerSource_CenterTrackpad, // PS4
k_EControllerSource_RightJoystick, // Traditional Controllers
k_EControllerSource_DPad, // Traditional Controllers
k_EControllerSource_Key, // Keyboards with scan codes - Unused
k_EControllerSource_Mouse, // Traditional mouse - Unused
k_EControllerSource_LeftGyro, // Secondary Gyro - Switch - Unused
k_EControllerSource_Count
};
enum EControllerSourceMode
{
k_EControllerSourceMode_None,
k_EControllerSourceMode_Dpad,
k_EControllerSourceMode_Buttons,
k_EControllerSourceMode_FourButtons,
k_EControllerSourceMode_AbsoluteMouse,
k_EControllerSourceMode_RelativeMouse,
k_EControllerSourceMode_JoystickMove,
k_EControllerSourceMode_JoystickMouse,
k_EControllerSourceMode_JoystickCamera,
k_EControllerSourceMode_ScrollWheel,
k_EControllerSourceMode_Trigger,
k_EControllerSourceMode_TouchMenu,
k_EControllerSourceMode_MouseJoystick,
k_EControllerSourceMode_MouseRegion,
k_EControllerSourceMode_RadialMenu,
k_EControllerSourceMode_SingleButton,
k_EControllerSourceMode_Switches
};
// Note: Please do not use action origins as a way to identify controller types. There is no
// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead
// Versions of Steam that add new controller types in the future will extend this enum if you're
+5
View File
@@ -254,7 +254,9 @@ public:
virtual const char *GetClanTag( CSteamID steamIDClan ) = 0;
// returns the most recent information we have about what's happening in a clan
virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0;
// for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest
STEAM_CALL_RESULT( DownloadClanActivityCountsResult_t )
virtual SteamAPICall_t DownloadClanActivityCounts( STEAM_ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0;
// iterators for getting users in a chat room, lobby, game server or clan
@@ -420,6 +422,9 @@ public:
/// You can register for UnreadChatMessagesChanged_t callbacks to know when this
/// has potentially changed.
virtual int GetNumChatsWithUnreadPriorityMessages() = 0;
// activates game overlay to open the remote play together invite dialog. Invitations will be sent for remote play together
virtual void ActivateGameOverlayRemotePlayTogetherInviteDialog( CSteamID steamIDLobby ) = 0;
};
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends017"
+1 -1
View File
@@ -27,7 +27,7 @@ public:
//
/// This is called by SteamGameServer_Init, and you will usually not need to call it directly
virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0;
STEAM_PRIVATE_API( virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0; )
/// Game product identifier. This is currently used by the master server for version checking purposes.
/// It's a required field, but will eventually will go away, and the AppID will be used for this purpose.
+9
View File
@@ -27,16 +27,25 @@ public:
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
// requests stat information for a user, usable after a successful call to RequestUserStats()
STEAM_FLAT_NAME( GetUserStatInt32 )
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
STEAM_FLAT_NAME( GetUserStatFloat )
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
// Set / update stats and achievements.
// Note: These updates will work only on stats game servers are allowed to edit and only for
// game servers that have been declared as officially controlled by the game creators.
// Set the IP range of your official servers on the Steamworks page
STEAM_FLAT_NAME( SetUserStatInt32 )
virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0;
STEAM_FLAT_NAME( SetUserStatFloat )
virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0;
virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0;
-22
View File
@@ -31,28 +31,6 @@
#define STEAM_INPUT_MIN_ANALOG_ACTION_DATA -1.0f
#define STEAM_INPUT_MAX_ANALOG_ACTION_DATA 1.0f
enum EInputSource
{
k_EInputSource_None,
k_EInputSource_LeftTrackpad,
k_EInputSource_RightTrackpad,
k_EInputSource_Joystick,
k_EInputSource_ABXY,
k_EInputSource_Switch,
k_EInputSource_LeftTrigger,
k_EInputSource_RightTrigger,
k_EInputSource_LeftBumper,
k_EInputSource_RightBumper,
k_EInputSource_Gyro,
k_EInputSource_CenterTrackpad, // PS4
k_EInputSource_RightJoystick, // Traditional Controllers
k_EInputSource_DPad, // Traditional Controllers
k_EInputSource_Key, // Keyboards with scan codes - Unused
k_EInputSource_Mouse, // Traditional mouse - Unused
k_EInputSource_LeftGyro, // Secondary Gyro - Switch - Unused
k_EInputSource_Count
};
enum EInputSourceMode
{
k_EInputSourceMode_None,
+9
View File
@@ -350,10 +350,19 @@ public:
// Remove the property on the item
virtual bool RemoveProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName ) = 0;
// Accessor methods to set properties on items
STEAM_FLAT_NAME( SetPropertyString )
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, const char *pchPropertyValue ) = 0;
STEAM_FLAT_NAME( SetPropertyBool )
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, bool bValue ) = 0;
STEAM_FLAT_NAME( SetPropertyInt64 )
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, int64 nValue ) = 0;
STEAM_FLAT_NAME( SetPropertyFloat )
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, float flValue ) = 0;
// Submit the update request by handle
virtual bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, SteamInventoryResult_t * pResultHandle ) = 0;
-1
View File
@@ -256,7 +256,6 @@ public:
// after completion, the local user will no longer be the owner
virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0;
#endif
STEAM_CALL_BACK( LobbyChatUpdate_t )
};
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009"
+59 -21
View File
@@ -271,7 +271,7 @@ public:
/// pOutMessageNumberOrResult is an optional array that will receive,
/// for each message, the message number that was assigned to the message
/// if sending was successful. If sending failed, then a negative EResult
/// valid is placed into the array. For example, the array will hold
/// value is placed into the array. For example, the array will hold
/// -k_EResultInvalidState if the connection was in an invalid state.
/// See ISteamNetworkingSockets::SendMessageToConnection for possible
/// failure codes.
@@ -300,7 +300,7 @@ public:
/// Reliable messages will be received in the order they were sent (and with the
/// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket).
///
/// Unreliable messages may be dropped, or delivered out of order withrespect to
/// Unreliable messages may be dropped, or delivered out of order with respect to
/// each other or with respect to reliable messages. The same unreliable message
/// may be received multiple times.
///
@@ -309,16 +309,6 @@ public:
/// a little while (put it into some queue, etc), and you may call Release() from any thread.
virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
/// Same as ReceiveMessagesOnConnection, but will return the next message available
/// on any connection that was accepted through the specified listen socket. Examine
/// SteamNetworkingMessage_t::m_conn to know which client connection.
///
/// Delivery order of messages among different clients is not defined. They may
/// be returned in an order different from what they were actually received. (Delivery
/// order of messages from the same client is well defined, and thus the order of the
/// messages is relevant!)
virtual int ReceiveMessagesOnListenSocket( HSteamListenSocket hSocket, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
/// Returns basic information about the high-level state of the connection.
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
@@ -405,6 +395,57 @@ public:
/// details, pass non-NULL to receive them.
virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0;
//
// Poll groups. A poll group is a set of connections that can be polled efficiently.
// (In our API, to "poll" a connection means to retrieve all pending messages. We
// actually don't have an API to "poll" the connection *state*, like BSD sockets.)
//
/// Create a new poll group.
///
/// You should destroy the poll group when you are done using DestroyPollGroup
virtual HSteamNetPollGroup CreatePollGroup() = 0;
/// Destroy a poll group created with CreatePollGroup().
///
/// If there are any connections in the poll group, they are removed from the group,
/// and left in a state where they are not part of any poll group.
/// Returns false if passed an invalid poll group handle.
virtual bool DestroyPollGroup( HSteamNetPollGroup hPollGroup ) = 0;
/// Assign a connection to a poll group. Note that a connection may only belong to a
/// single poll group. Adding a connection to a poll group implicitly removes it from
/// any other poll group it is in.
///
/// You can pass k_HSteamNetPollGroup_Invalid to remove a connection from its current
/// poll group without adding it to a new poll group.
///
/// If there are received messages currently pending on the connection, an attempt
/// is made to add them to the queue of messages for the poll group in approximately
/// the order that would have applied if the connection was already part of the poll
/// group at the time that the messages were received.
///
/// Returns false if the connection handle is invalid, or if the poll group handle
/// is invalid (and not k_HSteamNetPollGroup_Invalid).
virtual bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup ) = 0;
/// Same as ReceiveMessagesOnConnection, but will return the next messages available
/// on any connection in the poll group. Examine SteamNetworkingMessage_t::m_conn
/// to know which connection. (SteamNetworkingMessage_t::m_nConnUserData might also
/// be useful.)
///
/// Delivery order of messages among different connections will usually match the
/// order that the last packet was received which completed the message. But this
/// is not a strong guarantee, especially for packets received right as a connection
/// is being assigned to poll group.
///
/// Delivery order of messages on the same connection is well defined and the
/// same guarantees are present as mentioned in ReceiveMessagesOnConnection.
/// (But the messages are not grouped by connection, so they will not necessarily
/// appear consecutively in the list; they may be interleaved with messages for
/// other connections.)
virtual int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
//
@@ -455,7 +496,7 @@ public:
virtual uint16 GetHostedDedicatedServerPort() = 0;
/// Returns 0 if SDR_LISTEN_PORT is not set. Otherwise, returns the data center the server
/// is running in. This will be k_SteamDatagramPOPID_dev in non-production envirionment.
/// is running in. This will be k_SteamDatagramPOPID_dev in non-production environment.
virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0;
/// Return info about the hosted server. This contains the PoPID of the server,
@@ -604,8 +645,10 @@ public:
virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0;
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
/// Certificate provision by the application. (On Steam, Steam will handle all this automatically)
#ifndef STEAMNETWORKINGSOCKETS_STEAM
//
// Certificate provision by the application. On Steam, we normally handle all this automatically
// and you will not need to use these advanced functions.
//
/// Get blob that describes a certificate request. You can send this to your game coordinator.
/// Upon entry, *pcbBlob should contain the size of the buffer. On successful exit, it will
@@ -618,7 +661,6 @@ public:
/// Set the certificate. The certificate blob should be the output of
/// SteamDatagram_CreateCert.
virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0;
#endif
// Invoke all callbacks queued for this interface.
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
@@ -630,7 +672,7 @@ public:
protected:
~ISteamNetworkingSockets(); // Silence some warnings
};
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets006"
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets008"
/// Interface used to send signaling messages for a particular connection.
/// You will need to construct one of these per connection.
@@ -709,8 +751,6 @@ public:
};
extern "C" {
// Global accessor.
#if defined( STEAMNETWORKINGSOCKETS_PARTNER )
@@ -815,6 +855,4 @@ struct SteamNetAuthenticationStatus_t
#pragma pack( pop )
}
#endif // ISTEAMNETWORKINGSOCKETS
+14 -11
View File
@@ -40,11 +40,6 @@ public:
/// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL,
/// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to
/// set each of these.
///
/// You can use SteamNetworkingMessage_t::Release to free up the message
/// bookkeeping object and any associated buffer. See
/// ISteamNetworkingSockets::SendMessages for details on reference
/// counting and ownership.
virtual SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer ) = 0;
//
@@ -57,11 +52,17 @@ public:
// Initialization and status check
//
/// If you know that you are going to be using the relay network, call
/// this to initialize the relay network or check if that initialization
/// has completed. If you do not call this, the initialization will
/// happen the first time you use a feature that requires access to the
/// relay network, and that use will be delayed.
/// If you know that you are going to be using the relay network (for example,
/// because you anticipate making P2P connections), call this to initialize the
/// relay network. If you do not call this, the initialization will
/// be delayed until the first time you use a feature that requires access
/// to the relay network, which will delay that first access.
///
/// You can also call this to force a retry if the previous attempt has failed.
/// Performing any action that requires access to the relay network will also
/// trigger a retry, and so calling this function is never strictly necessary,
/// but it can be useful to call it a program launch time, if access to the
/// relay network is anticipated.
///
/// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
/// callbacks to know when initialization has completed.
@@ -322,7 +323,9 @@ protected:
gameserver one. Yes, this is a completely terrible hack */
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ?
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) :
SteamInternal_FindOrCreateGameServerInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION )
SteamInternal_FindOrCreateGameServerInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ),
"global",
STEAMNETWORKINGUTILS_INTERFACE_VERSION
)
#endif
+1
View File
@@ -28,6 +28,7 @@ enum EParentalFeature
k_EFeatureParentalSetup = 10,
k_EFeatureLibrary = 11,
k_EFeatureTest = 12,
k_EFeatureSiteLicense = 13,
k_EFeatureMax
};
+1
View File
@@ -78,6 +78,7 @@ enum ERemoteStoragePublishedFileVisibility
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
k_ERemoteStoragePublishedFileVisibilityUnlisted = 3,
};
+6
View File
@@ -204,9 +204,11 @@ public:
virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
// Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
STEAM_FLAT_NAME( CreateQueryAllUGCRequestPage )
virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
// Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set.
STEAM_FLAT_NAME( CreateQueryAllUGCRequestCursor )
virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0;
// Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this)
@@ -225,8 +227,11 @@ public:
virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0;
virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0;
virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0;
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
// Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found.
STEAM_FLAT_NAME( GetQueryFirstUGCKeyValueTag )
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
// Release the request to free up memory, after retrieving results
@@ -257,6 +262,7 @@ public:
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
// Steam Workshop Creator API
-19
View File
@@ -12,25 +12,6 @@
#include "steam_api_common.h"
// structure that contains client callback data
// see callbacks documentation for more details
#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
#elif defined( VALVE_CALLBACK_PACK_LARGE )
#pragma pack( push, 8 )
#else
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
struct CallbackMsg_t
{
HSteamUser m_hSteamUser;
int m_iCallback;
uint8 *m_pubParam;
int m_cubParam;
};
#pragma pack( pop )
//-----------------------------------------------------------------------------
// Purpose: Functions for accessing and manipulating a steam account
// associated with one client instance
+18
View File
@@ -93,12 +93,19 @@ public:
virtual bool RequestCurrentStats() = 0;
// Data accessors
STEAM_FLAT_NAME( GetStatInt32 )
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
STEAM_FLAT_NAME( GetStatFloat )
virtual bool GetStat( const char *pchName, float *pData ) = 0;
// Set / update data
STEAM_FLAT_NAME( SetStatInt32 )
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
STEAM_FLAT_NAME( SetStatFloat )
virtual bool SetStat( const char *pchName, float fData ) = 0;
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
// Achievement flag accessors
@@ -153,8 +160,12 @@ public:
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
// requests stat information for a user, usable after a successful call to RequestUserStats()
STEAM_FLAT_NAME( GetUserStatInt32 )
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
STEAM_FLAT_NAME( GetUserStatFloat )
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
// See notes for GetAchievementAndUnlockTime above
virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
@@ -265,14 +276,21 @@ public:
virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0;
// Gets the lifetime totals for an aggregated stat
STEAM_FLAT_NAME( GetGlobalStatInt64 )
virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
STEAM_FLAT_NAME( GetGlobalStatDouble )
virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0;
// Gets history for an aggregated stat. pData will be filled with daily values, starting with today.
// So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago,
// etc. cubData is the size in bytes of the pubData buffer. Returns the number of
// elements actually set.
STEAM_FLAT_NAME( GetGlobalStatHistoryInt64 )
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0;
STEAM_FLAT_NAME( GetGlobalStatHistoryDouble )
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0;
#ifdef _PS3
+2 -2
View File
@@ -193,11 +193,11 @@ public:
// Global interface accessor
inline ISteamUtils *SteamUtils();
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ) );
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "user", STEAMUTILS_INTERFACE_VERSION );
// Global accessor for the gameserver client
inline ISteamUtils *SteamGameServerUtils();
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ) );
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "gameserver", STEAMUTILS_INTERFACE_VERSION );
// callbacks
#if defined( VALVE_CALLBACK_PACK_SMALL )
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -82,7 +82,7 @@ public:
// Access the IP
uint32 GetIP() const;
void SetIP( uint32 );
void SetIP( uint32 unIP );
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
const char *GetConnectionAddressString() const;
+67 -17
View File
@@ -43,6 +43,8 @@
#include "isteamparentalsettings.h"
#include "isteaminput.h"
#include "isteamremoteplay.h"
#include "isteamnetworkingsockets.h"
#include "isteamnetworkingutils.h"
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
@@ -92,28 +94,14 @@ S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg );
// SteamAPI_IsSteamRunning() returns true if Steam is currently running
S_API bool S_CALLTYPE SteamAPI_IsSteamRunning();
// Pumps out all the steam messages, calling registered callbacks.
// NOT THREADSAFE - do not call from multiple threads simultaneously.
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
// register the callback funcs to use to interact with the steam dll
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
// returns the HSteamUser of the last user to dispatch a callback
S_API HSteamUser Steam_GetHSteamUserCurrent();
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name.
// DEPRECATED - implementation is Windows only, and the path returned is a UTF-8 string which must be converted to UTF-16 for use with Win32 APIs
S_API const char *SteamAPI_GetSteamInstallPath();
// sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks
// This is ignored if you are using the manual callback dispatch method
S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
// backwards compat export, passes through to SteamAPI_ variants
S_API HSteamPipe GetHSteamPipe();
S_API HSteamUser GetHSteamUser();
#if defined( VERSION_SAFE_STEAM_API_INTERFACES )
// exists only for backwards compat with code written against older SDKs
S_API bool S_CALLTYPE SteamAPI_InitSafe();
@@ -130,16 +118,78 @@ S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion,
S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID );
#endif
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
//
// Manual callback loop
//
// An alternative method for dispatching callbacks. Similar to a windows message loop.
//
// If you use the manual callback dispatch, you must NOT use:
//
// - SteamAPI_RunCallbacks or SteamGameServer_RunCallbacks
// - STEAM_CALLBACK, CCallResult, CCallback, or CCallbackManual
//
// Here is the basic template for replacing SteamAPI_RunCallbacks() with manual dispatch
/*
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe(); // See also SteamGameServer_GetHSteamPipe()
SteamAPI_ManualDispatch_RunFrame( hSteamPipe )
CallbackMsg_t callback;
while ( SteamAPI_ManualDispatch_GetNextCallback( hSteamPipe, &callback ) )
{
// Check for dispatching API call results
if ( callback.m_iCallback == SteamAPICallCompleted_t::k_iCallback )
{
SteamAPICallCompleted_t *pCallCompleted = (SteamAPICallCompleted_t *)callback.
void *pTmpCallResult = malloc( pCallback->m_cubParam );
bool bFailed;
if ( SteamAPI_ManualDispatch_GetAPICallResult( hSteamPipe, pCallCompleted->m_hAsyncCall, pTmpCallResult, pCallback->m_cubParam, pCallback->m_iCallback, &bFailed ) )
{
// Dispatch the call result to the registered handler(s) for the
// call identified by pCallCompleted->m_hAsyncCall
}
free( pTmpCallResult );
}
else
{
// Look at callback.m_iCallback to see what kind of callback it is,
// and dispatch to appropriate handler(s)
}
SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe );
}
*/
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
/// Inform the API that you wish to use manual event dispatch. This must be called after SteamAPI_Init, but before
/// you use any of the other manual dispatch functions below.
S_API void S_CALLTYPE SteamAPI_ManualDispatch_Init();
/// Perform certain periodic actions that need to be performed.
S_API void S_CALLTYPE SteamAPI_ManualDispatch_RunFrame( HSteamPipe hSteamPipe );
/// Fetch the next pending callback on the given pipe, if any. If a callback is available, true is returned
/// and the structure is populated. In this case, you MUST call SteamAPI_ManualDispatch_FreeLastCallback
/// (after dispatching the callback) before calling SteamAPI_ManualDispatch_GetNextCallback again.
S_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetNextCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg );
/// You must call this after dispatching the callback, if SteamAPI_ManualDispatch_GetNextCallback returns true.
S_API void S_CALLTYPE SteamAPI_ManualDispatch_FreeLastCallback( HSteamPipe hSteamPipe );
/// Return the call result for the specified call on the specified pipe. You really should
/// only call this in a handler for SteamAPICallCompleted_t callback.
S_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed );
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
//
// CSteamAPIContext
// CSteamAPIContext
//
// Deprecated! This is not necessary any more. Please use the global accessors directly
//
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef STEAM_API_EXPORTS
// Deprecated! Use the global accessors directly
inline bool CSteamAPIContext::Init()
{
m_pSteamClient = ::SteamClient();
+13076 -9509
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -81,6 +81,9 @@ extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallback
//
// Callbacks and call-results are queued automatically and are only
// delivered/executed when your application calls SteamAPI_RunCallbacks().
//
// Note that there is an alternative, lower level callback dispatch mechanism.
// See SteamAPI_ManualDispatch_Init
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
// Dispatch all queued Steamworks callbacks.
@@ -150,6 +153,7 @@ public:
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
protected:
friend class CCallbackMgr;
virtual void Run( void *pvParam ) = 0;
virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); }
virtual int GetCallbackSizeBytes() { return sizeof_P; }
File diff suppressed because it is too large Load Diff
+57 -40
View File
@@ -13,13 +13,7 @@
#include <string.h>
// Internal functions used by the utility CCallback objects to receive callbacks
S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
// Internal functions used by the utility CCallResult objects to receive async call results
S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
// Internal functions used to locate/create interfaces
S_API HSteamPipe S_CALLTYPE SteamAPI_GetHSteamPipe();
S_API HSteamUser S_CALLTYPE SteamAPI_GetHSteamUser();
S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe();
@@ -29,6 +23,37 @@ S_API void *S_CALLTYPE SteamInternal_CreateInterface( const char *ver );
S_API void *S_CALLTYPE SteamInternal_FindOrCreateUserInterface( HSteamUser hSteamUser, const char *pszVersion );
S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser hSteamUser, const char *pszVersion );
// Macro used to define a type-safe accessor that will always return the version
// of the interface of the *header file* you are compiling with! We also bounce
// through a safety function that checks for interfaces being created or destroyed.
//
// SteamInternal_ContextInit takes a base pointer for the equivalent of
// struct { void (*pFn)(void* pCtx); uintptr_t counter; void *ptr; }
// Do not change layout or add non-pointer aligned data!
#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr, kind, version ) \
inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \
STEAM_CLANG_ATTR( "interface_accessor_kind:" kind ";interface_accessor_version:" version ";" ) \
inline type name() { \
static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \
return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \
}
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ), "user", version )
#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ), "gameserver", version )
//
// Internal stuff used for the standard, higher-level callback mechanism
//
// Internal functions used by the utility CCallback objects to receive callbacks
S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
// Internal functions used by the utility CCallResult objects to receive async call results
S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
// disable this warning; this pattern need for steam callback registration
#ifdef _MSVC_VER
#pragma warning( push )
@@ -53,6 +78,8 @@ S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser
#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \
CCallback< thisclass, param, true > var; void func( param *pParam )
#ifndef API_GEN
template< class T, class P >
inline CCallResult<T, P>::CCallResult()
{
@@ -154,10 +181,29 @@ inline void CCallback< T, P, bGameserver >::Run( void *pvParam )
(m_pObj->*m_Func)((P *)pvParam);
}
//-----------------------------------------------------------------------------
// Macros to define steam callback structures. Used internally for debugging
//-----------------------------------------------------------------------------
#endif // #ifndef API_GEN
// structure that contains client callback data
// see callbacks documentation for more details
#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
#elif defined( VALVE_CALLBACK_PACK_LARGE )
#pragma pack( push, 8 )
#else
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
#endif
/// Internal structure used in manual callback dispatch
struct CallbackMsg_t
{
HSteamUser m_hSteamUser; // Specific user to whom this callback applies.
int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.)
uint8 *m_pubParam; // Points to the callback structure
int m_cubParam; // Size of the data pointed to by m_pubParam
};
#pragma pack( pop )
// Macros to define steam callback structures. Used internally for debugging
#ifdef STEAM_CALLBACK_INSPECTION_ENABLED
#include "../../clientdll/steam_api_callback_inspection.h"
#else
@@ -263,36 +309,7 @@ enum { k_iClientPartiesCallbacks = 5400 };
enum { k_iSteamSTARCallbacks = 5500 };
enum { k_iClientSTARCallbacks = 5600 };
enum { k_iSteamRemotePlayCallbacks = 5700 };
// Macro used to define a type-safe accessor that will always return the version
// of the interface of the *header file* you are compiling with! We also bounce
// through a safety function that checks for interfaces being created or destroyed.
#ifndef STEAM_API_EXPORTS
// SteamInternal_ContextInit takes a base pointer for the equivalent of
// struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; }
// Do not change layout of 2 + sizeof... or add non-pointer aligned data!
// NOTE: declaring "static CSteamAPIConext" creates a large function
// which queries the initialization status of the object. We know that
// it is pointer-aligned and fully memset with zeros, so just alias a
// static buffer of the appropriate size and call it a CSteamAPIContext.
#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr ) \
inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \
inline type name() { \
static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \
return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \
}
#else
// Stub when we're compiling steam_api.dll itself. These are inline
// functions defined when the header is included. not functions exported
// by the lib!
#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr )
#endif
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ) )
#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ) )
enum { k_iClientCompatCallbacks = 5800 };
#ifdef _MSVC_VER
#pragma warning( pop )
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -139,6 +139,8 @@ enum EResult
k_EResultAccountNotFriends = 111, // the user is not mutually friends
k_EResultLimitedUserAccount = 112, // the user is limited
k_EResultCantRemoveItem = 113, // item can't be removed
k_EResultAccountDeleted = 114, // account has been deleted
k_EResultExistingUserCancelledLicense = 115, // A license for this already exists, but cancelled
};
// Error codes for use with the voice functions
@@ -524,6 +526,7 @@ enum EVRHMDType
k_eEVRHMDType_Oculus_DK2 = 22, // Oculus DK2
k_eEVRHMDType_Oculus_Rift = 23, // Oculus Rift
k_eEVRHMDType_Oculus_RiftS = 24, // Oculus Rift S
k_eEVRHMDType_Oculus_Quest = 25, // Oculus Quest
k_eEVRHMDType_Oculus_Unknown = 40, // // Oculus unknown HMD
@@ -563,7 +566,7 @@ enum EVRHMDType
//-----------------------------------------------------------------------------
static inline bool BIsOculusHMD( EVRHMDType eType )
{
return eType == k_eEVRHMDType_Oculus_DK1 || eType == k_eEVRHMDType_Oculus_DK2 || eType == k_eEVRHMDType_Oculus_Rift || eType == k_eEVRHMDType_Oculus_RiftS || eType == k_eEVRHMDType_Oculus_Unknown;
return eType == k_eEVRHMDType_Oculus_DK1 || eType == k_eEVRHMDType_Oculus_DK2 || eType == k_eEVRHMDType_Oculus_Rift || eType == k_eEVRHMDType_Oculus_RiftS || eType == k_eEVRHMDType_Oculus_Quest || eType == k_eEVRHMDType_Oculus_Unknown;
}
-113
View File
@@ -1,113 +0,0 @@
//====== Copyright Valve Corporation, All rights reserved. ====================
//
// Kludge adapter that's used for the transition standalone library.
// This is not the opensource code, or the one in the Steamworks SDK.
//
//=============================================================================
#ifndef STEAMNETWORKINGSOCKETS
#define STEAMNETWORKINGSOCKETS
#ifdef _WIN32
#pragma once
#endif
#include "isteamnetworkingsockets.h"
struct SteamRelayNetworkStatus_t;
struct P2PSessionRequest_t;
struct P2PSessionConnectFail_t;
#if !defined( STEAMNETWORKINGSOCKETS_PARTNER ) && !defined( STEAMNETWORKINGSOCKETS_STREAMINGCLIENT )
#error "Shouldn't be including this!"
#endif
#ifdef STEAMNETWORKINGSOCKETS_STEAM
// #KLUDGE! So we don't have to link with steam_api.lib
#include <steam/steam_api.h>
#include <steam/steam_gameserver.h>
/////////////////////////////////////////////////////////////////////////////
// Temp internal gross stuff you should ignore
typedef void * ( S_CALLTYPE *FSteamInternal_CreateInterface )( const char *);
typedef void ( S_CALLTYPE *FSteamAPI_RegisterCallback)( class CCallbackBase *pCallback, int iCallback );
typedef void ( S_CALLTYPE *FSteamAPI_UnregisterCallback)( class CCallbackBase *pCallback );
typedef void ( S_CALLTYPE *FSteamAPI_RegisterCallResult)( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
typedef void ( S_CALLTYPE *FSteamAPI_UnregisterCallResult)( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
STEAMNETWORKINGSOCKETS_INTERFACE void SteamDatagramClient_SetLauncher( const char *pszLauncher ); // Call this before SteamDatagramClient_Init
STEAMNETWORKINGSOCKETS_INTERFACE void SteamDatagramClient_SetUniverse( EUniverse eUniverse ); // Call this before SteamDatagramClient_Init, to run without steam support
STEAMNETWORKINGSOCKETS_INTERFACE void SteamDatagramClient_Internal_SteamAPIKludge( FSteamAPI_RegisterCallback fnRegisterCallback, FSteamAPI_UnregisterCallback fnUnregisterCallback, FSteamAPI_RegisterCallResult fnRegisterCallResult, FSteamAPI_UnregisterCallResult fnUnregisterCallResult );
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamDatagramClient_Init_InternalV9( bool bNoSteamSupport, SteamNetworkingErrMsg &errMsg, FSteamInternal_CreateInterface fnCreateInterface, HSteamUser hSteamUser, HSteamPipe hSteamPipe );
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamDatagramServer_Init_InternalV2( bool bNoSteamSupport, SteamNetworkingErrMsg &errMsg, FSteamInternal_CreateInterface fnCreateInterface, HSteamUser hSteamUser, HSteamPipe hSteamPipe );
/////////////////////////////////////////////////////////////////////////////
/// Initialize the user interface.
inline bool SteamDatagramClient_Init( bool bNoSteamSupport, SteamNetworkingErrMsg &errMsg )
{
SteamDatagramClient_Internal_SteamAPIKludge( &::SteamAPI_RegisterCallback, &::SteamAPI_UnregisterCallback, &::SteamAPI_RegisterCallResult, &::SteamAPI_UnregisterCallResult );
return SteamDatagramClient_Init_InternalV9( bNoSteamSupport, errMsg, ::SteamInternal_CreateInterface, ::SteamAPI_GetHSteamUser(), ::SteamAPI_GetHSteamPipe() );
}
/// Initialize the game server interface
inline bool SteamDatagramServer_Init( bool bNoSteamSupport, SteamNetworkingErrMsg &errMsg )
{
SteamDatagramClient_Internal_SteamAPIKludge( &::SteamAPI_RegisterCallback, &::SteamAPI_UnregisterCallback, &::SteamAPI_RegisterCallResult, &::SteamAPI_UnregisterCallResult );
return SteamDatagramServer_Init_InternalV2( bNoSteamSupport, errMsg, &SteamInternal_CreateInterface, ::SteamGameServer_GetHSteamUser(), ::SteamGameServer_GetHSteamPipe() );
}
#else // #ifdef STEAMNETWORKINGSOCKETS_STEAM
/// Initialize client interface
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamDatagramClient_Init( bool /* ignored */, SteamNetworkingErrMsg &errMsg );
/// Initialize gameserver interface
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamDatagramServer_Init( bool /* ignored */, SteamNetworkingErrMsg &errMsg );
#endif
/// Shutdown the client interface
STEAMNETWORKINGSOCKETS_INTERFACE void SteamDatagramClient_Kill();
/// Shutdown the game server interface
STEAMNETWORKINGSOCKETS_INTERFACE void SteamDatagramServer_Kill();
/// Call before initializing the library, to set the AppID. This is only needed
/// when running without Steam support. (Either on other platforms, or when
/// intentionally not using steam client.)
STEAMNETWORKINGSOCKETS_INTERFACE void SteamDatagramClient_SetAppID( AppId_t nAppID );
/// Manual polling mode. You should call this before initialize the lib.
/// This will prevent the library from opening up its own service thread,
/// allowing you to pump sockets and stuff from your own thread.
STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_SetManualPollMode( bool bFlag );
/// If you call SteamNetworkingSockets_SetManualPollMode, then you need to
/// call this frequently. Any time spent between calls is essentially
/// guaranteed to delay time-sensitive processing, so whatever you are
/// doing, make it quick. If you pass a nonzero wait time, then this
/// function will sleep efficiently, waiting for incoming packets,
/// up to the maximum time you specify. It may return prematurely
/// if packets arrive earlier than your timeout.
STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingSockets_Poll( int msMaxWaitTime );
/// TEMP callback dispatch mechanism.
/// You'll override this guy and hook any callbacks you are interested in,
/// and then use ISteamNetworkingSockets::RunCallbacks. Eventually this will go away,
/// and you will register for the callbacks you want using the normal SteamWorks callback
/// mechanisms, and they will get dispatched along with other Steamworks callbacks
/// when you call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks.
class ISteamNetworkingSocketsCallbacks
{
public:
inline ISteamNetworkingSocketsCallbacks() {}
virtual void OnSteamNetConnectionStatusChanged( SteamNetConnectionStatusChangedCallback_t * ) {}
virtual void OnP2PSessionRequest( P2PSessionRequest_t * ) {}
virtual void OnP2PSessionConnectFail( P2PSessionConnectFail_t * ) {}
virtual void OnAuthenticationStatusChanged( SteamNetAuthenticationStatus_t * ) {}
virtual void OnRelayNetworkStatusChanged( SteamRelayNetworkStatus_t * ) {}
protected:
inline ~ISteamNetworkingSocketsCallbacks() {}
};
#endif // ISTEAMNETWORKINGSOCKETS
+16 -2
View File
@@ -47,10 +47,17 @@ struct SteamRelayNetworkStatus_t;
typedef uint32 HSteamNetConnection;
const HSteamNetConnection k_HSteamNetConnection_Invalid = 0;
/// Handle used to identify a "listen socket".
/// Handle used to identify a "listen socket". Unlike traditional
/// Berkeley sockets, a listen socket and a connection are two
/// different abstractions.
typedef uint32 HSteamListenSocket;
const HSteamListenSocket k_HSteamListenSocket_Invalid = 0;
/// Handle used to identify a poll group, used to query many
/// connections at once efficiently.
typedef uint32 HSteamNetPollGroup;
const HSteamNetPollGroup k_HSteamNetPollGroup_Invalid = 0;
/// Max length of diagnostic error message
const int k_cchMaxSteamNetworkingErrMsg = 1024;
@@ -66,7 +73,7 @@ typedef uint32 SteamNetworkingPOPID;
/// microseconds. This is guaranteed to increase over time during the lifetime
/// of a process, but not globally across runs. You don't need to worry about
/// the value wrapping around. Note that the underlying clock might not actually have
/// microsecond *resolution*.
/// microsecond resolution.
typedef int64 SteamNetworkingMicroseconds;
/// Describe the status of a particular network resource
@@ -182,6 +189,7 @@ struct SteamNetworkingIPAddr
union
{
uint8 m_ipv6[ 16 ];
#ifndef API_GEN // API generator doesn't understand this. The bindings will just use the accessors
struct // IPv4 "mapped address" (rfc4038 section 4.2)
{
uint64 m_8zeros;
@@ -189,6 +197,7 @@ struct SteamNetworkingIPAddr
uint16 m_ffff;
uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order
} m_ipv4;
#endif
};
uint16 m_port; // Host byte order
@@ -761,6 +770,7 @@ struct SteamNetworkingMessage_t
inline void Release();
// For code compatibility, some accessors
#ifndef API_GEN
inline uint32 GetSize() const { return m_cbSize; }
inline const void *GetData() const { return m_pData; }
inline int GetChannel() const { return m_nChannel; }
@@ -768,6 +778,7 @@ struct SteamNetworkingMessage_t
inline int64 GetConnectionUserData() const { return m_nConnUserData; }
inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; }
inline int64 GetMessageNumber() const { return m_nMessageNumber; }
#endif
protected:
// Declare destructor protected. You should never need to declare a message
// object on the stack or create one yourself.
@@ -1220,6 +1231,7 @@ const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | (
///////////////////////////////////////////////////////////////////////////////
//
// Internal stuff
#ifndef API_GEN
// For code compatibility
typedef SteamNetworkingMessage_t ISteamNetworkingMessage;
@@ -1266,4 +1278,6 @@ inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const {
inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); }
#endif
#endif // #ifndef API_GEN
#endif // #ifndef STEAMNETWORKINGTYPES
+1
View File
@@ -104,6 +104,7 @@ typedef unsigned int uintp;
#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";")
#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";")
#define STEAM_CALL_BACK(RESULT_TYPE) STEAM_CLANG_ATTR("callback:" #RESULT_TYPE ";")
#define STEAM_FLAT_NAME(NAME) STEAM_CLANG_ATTR("flat_name:" #NAME ";")
const int k_cubSaltSize = 8;
typedef uint8 Salt_t[ k_cubSaltSize ];
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.