mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 20:38:07 +01:00
Update to sdk 1.48
This commit is contained in:
parent
a0b66407bf
commit
5c41ba020c
32 changed files with 4617 additions and 2410 deletions
237
dll/dll.cpp
237
dll/dll.cpp
|
@ -709,12 +709,161 @@ STEAMAPI_API uint32 SteamGameServer_GetIPCCallCount()
|
||||||
|
|
||||||
STEAMAPI_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback )
|
STEAMAPI_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback )
|
||||||
{
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAMAPI_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID )
|
STEAMAPI_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID )
|
||||||
{
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct cb_data {
|
||||||
|
int cb_id;
|
||||||
|
std::vector<char> result;
|
||||||
|
};
|
||||||
|
static std::queue<struct cb_data> client_cb;
|
||||||
|
static std::queue<struct cb_data> server_cb;
|
||||||
|
|
||||||
|
static void cb_add_queue_server(std::vector<char> result, int callback)
|
||||||
|
{
|
||||||
|
struct cb_data cb;
|
||||||
|
cb.cb_id = callback;
|
||||||
|
cb.result = result;
|
||||||
|
server_cb.push(cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cb_add_queue_client(std::vector<char> result, int callback)
|
||||||
|
{
|
||||||
|
struct cb_data cb;
|
||||||
|
cb.cb_id = callback;
|
||||||
|
cb.result = result;
|
||||||
|
client_cb.push(cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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.
|
||||||
|
STEAMAPI_API void S_CALLTYPE SteamAPI_ManualDispatch_Init()
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
Steam_Client *steam_client = get_steam_client();
|
||||||
|
steam_client->callback_results_server->setCbAll(&cb_add_queue_server);
|
||||||
|
steam_client->callback_results_client->setCbAll(&cb_add_queue_client);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Perform certain periodic actions that need to be performed.
|
||||||
|
STEAMAPI_API void S_CALLTYPE SteamAPI_ManualDispatch_RunFrame( HSteamPipe hSteamPipe )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe);
|
||||||
|
Steam_Client *steam_client = get_steam_client();
|
||||||
|
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
||||||
|
steam_client->RunCallbacks(false, true);
|
||||||
|
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
||||||
|
steam_client->RunCallbacks(true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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.
|
||||||
|
STEAMAPI_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetNextCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
std::queue<struct cb_data> *q = NULL;
|
||||||
|
HSteamUser m_hSteamUser = 0;
|
||||||
|
Steam_Client *steam_client = get_steam_client();
|
||||||
|
if (!steam_client->steamclient_server_inited) {
|
||||||
|
while(!server_cb.empty()) server_cb.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
||||||
|
q = &server_cb;
|
||||||
|
m_hSteamUser = SERVER_HSTEAMUSER;
|
||||||
|
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
||||||
|
q = &client_cb;
|
||||||
|
m_hSteamUser = CLIENT_HSTEAMUSER;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (q->empty()) return false;
|
||||||
|
if (pCallbackMsg) {
|
||||||
|
pCallbackMsg->m_hSteamUser = m_hSteamUser;
|
||||||
|
pCallbackMsg->m_iCallback = q->front().cb_id;
|
||||||
|
pCallbackMsg->m_pubParam = (uint8 *)&(q->front().result[0]);
|
||||||
|
pCallbackMsg->m_cubParam = q->front().result.size();
|
||||||
|
PRINT_DEBUG("Steam_BGetCallback cb number %i\n", q->front().cb_id);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// You must call this after dispatching the callback, if SteamAPI_ManualDispatch_GetNextCallback returns true.
|
||||||
|
STEAMAPI_API void S_CALLTYPE SteamAPI_ManualDispatch_FreeLastCallback( HSteamPipe hSteamPipe )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe);
|
||||||
|
std::queue<struct cb_data> *q = NULL;
|
||||||
|
Steam_Client *steam_client = get_steam_client();
|
||||||
|
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
||||||
|
q = &server_cb;
|
||||||
|
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
||||||
|
q = &client_cb;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!q->empty()) q->pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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.
|
||||||
|
STEAMAPI_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("SteamAPI_ManualDispatch_GetAPICallResult %i %llu %i %i\n", hSteamPipe, hSteamAPICall, cubCallback, iCallbackExpected);
|
||||||
|
Steam_Client *steam_client = get_steam_client();
|
||||||
|
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
||||||
|
return get_steam_client()->steam_gameserver_utils->GetAPICallResult(hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
|
||||||
|
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
||||||
|
return get_steam_client()->steam_utils->GetAPICallResult(hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HSteamUser flat_hsteamuser()
|
||||||
|
{
|
||||||
|
return SteamAPI_GetHSteamUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
HSteamPipe flat_hsteampipe()
|
||||||
|
{
|
||||||
|
return SteamAPI_GetHSteamPipe();
|
||||||
|
}
|
||||||
|
|
||||||
|
HSteamUser flat_gs_hsteamuser()
|
||||||
|
{
|
||||||
|
return SteamGameServer_GetHSteamUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
HSteamPipe flat_gs_hsteampipe()
|
||||||
|
{
|
||||||
|
return SteamGameServer_GetHSteamPipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
//VR stuff
|
//VR stuff
|
||||||
|
@ -811,104 +960,26 @@ SteamMasterServerUpdater
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct cb_data {
|
|
||||||
int cb_id;
|
|
||||||
std::vector<char> result;
|
|
||||||
};
|
|
||||||
static std::queue<struct cb_data> client_cb;
|
|
||||||
static std::queue<struct cb_data> server_cb;
|
|
||||||
|
|
||||||
static void cb_add_queue_server(std::vector<char> result, int callback)
|
|
||||||
{
|
|
||||||
struct cb_data cb;
|
|
||||||
cb.cb_id = callback;
|
|
||||||
cb.result = result;
|
|
||||||
server_cb.push(cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void cb_add_queue_client(std::vector<char> result, int callback)
|
|
||||||
{
|
|
||||||
struct cb_data cb;
|
|
||||||
cb.cb_id = callback;
|
|
||||||
cb.result = result;
|
|
||||||
client_cb.push(cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
STEAMCLIENT_API bool Steam_BGetCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg )
|
STEAMCLIENT_API bool Steam_BGetCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe);
|
PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe);
|
||||||
std::queue<struct cb_data> *q = NULL;
|
SteamAPI_ManualDispatch_Init();
|
||||||
HSteamUser m_hSteamUser = 0;
|
|
||||||
Steam_Client *steam_client = get_steam_client();
|
Steam_Client *steam_client = get_steam_client();
|
||||||
steam_client->callback_results_server->setCbAll(&cb_add_queue_server);
|
|
||||||
steam_client->callback_results_client->setCbAll(&cb_add_queue_client);
|
|
||||||
steam_client->RunCallbacks(true, true);
|
steam_client->RunCallbacks(true, true);
|
||||||
if (!steam_client->steamclient_server_inited) {
|
return SteamAPI_ManualDispatch_GetNextCallback( hSteamPipe, pCallbackMsg );
|
||||||
while(!server_cb.empty()) server_cb.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
|
||||||
q = &server_cb;
|
|
||||||
m_hSteamUser = SERVER_HSTEAMUSER;
|
|
||||||
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
|
||||||
q = &client_cb;
|
|
||||||
m_hSteamUser = CLIENT_HSTEAMUSER;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (q->empty()) return false;
|
|
||||||
if (pCallbackMsg) {
|
|
||||||
pCallbackMsg->m_hSteamUser = m_hSteamUser;
|
|
||||||
pCallbackMsg->m_iCallback = q->front().cb_id;
|
|
||||||
pCallbackMsg->m_pubParam = (uint8 *)&(q->front().result[0]);
|
|
||||||
pCallbackMsg->m_cubParam = q->front().result.size();
|
|
||||||
PRINT_DEBUG("Steam_BGetCallback cb number %i\n", q->front().cb_id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAMCLIENT_API void Steam_FreeLastCallback( HSteamPipe hSteamPipe )
|
STEAMCLIENT_API void Steam_FreeLastCallback( HSteamPipe hSteamPipe )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe);
|
PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe);
|
||||||
std::queue<struct cb_data> *q = NULL;
|
SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe );
|
||||||
Steam_Client *steam_client = get_steam_client();
|
|
||||||
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
|
||||||
q = &server_cb;
|
|
||||||
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
|
||||||
q = &client_cb;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!q->empty()) q->pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAMCLIENT_API bool Steam_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void* pCallback, int cubCallback, int iCallbackExpected, bool* pbFailed )
|
STEAMCLIENT_API bool Steam_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void* pCallback, int cubCallback, int iCallbackExpected, bool* pbFailed )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_GetAPICallResult %i %llu %i %i\n", hSteamPipe, hSteamAPICall, cubCallback, iCallbackExpected);
|
PRINT_DEBUG("Steam_GetAPICallResult %i %llu %i %i\n", hSteamPipe, hSteamAPICall, cubCallback, iCallbackExpected);
|
||||||
Steam_Client *steam_client = get_steam_client();
|
return SteamAPI_ManualDispatch_GetAPICallResult(hSteamPipe, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
|
||||||
if (!steam_client->steam_pipes.count(hSteamPipe)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::SERVER) {
|
|
||||||
return get_steam_client()->steam_gameserver_utils->GetAPICallResult(hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
|
|
||||||
} else if (steam_client->steam_pipes[hSteamPipe] == Steam_Pipe::CLIENT) {
|
|
||||||
return get_steam_client()->steam_utils->GetAPICallResult(hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STEAMCLIENT_API void *CreateInterface( const char *pName, int *pReturnCode )
|
STEAMCLIENT_API void *CreateInterface( const char *pName, int *pReturnCode )
|
||||||
|
|
|
@ -27,3 +27,8 @@
|
||||||
|
|
||||||
Steam_Client *get_steam_client();
|
Steam_Client *get_steam_client();
|
||||||
bool steamclient_has_ipv6_functions();
|
bool steamclient_has_ipv6_functions();
|
||||||
|
|
||||||
|
HSteamUser flat_hsteamuser();
|
||||||
|
HSteamPipe flat_hsteampipe();
|
||||||
|
HSteamUser flat_gs_hsteamuser();
|
||||||
|
HSteamPipe flat_gs_hsteampipe();
|
||||||
|
|
3550
dll/flat.cpp
3550
dll/flat.cpp
File diff suppressed because it is too large
Load diff
|
@ -93,6 +93,7 @@ Steam_Client::Steam_Client()
|
||||||
steam_game_search = new Steam_Game_Search(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
steam_game_search = new Steam_Game_Search(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
||||||
steam_parties = new Steam_Parties(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
steam_parties = new Steam_Parties(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
||||||
steam_remoteplay = new Steam_RemotePlay(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
steam_remoteplay = new Steam_RemotePlay(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
||||||
|
steam_tv = new Steam_TV(settings_client, network, callback_results_client, callbacks_client, run_every_runcb);
|
||||||
|
|
||||||
PRINT_DEBUG("client init gameserver\n");
|
PRINT_DEBUG("client init gameserver\n");
|
||||||
steam_gameserver = new Steam_GameServer(settings_server, network, callbacks_server);
|
steam_gameserver = new Steam_GameServer(settings_server, network, callbacks_server);
|
||||||
|
@ -487,6 +488,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
|
||||||
return (void *)(ISteamNetworkingSockets002 *) steam_networking_sockets_temp;
|
return (void *)(ISteamNetworkingSockets002 *) steam_networking_sockets_temp;
|
||||||
} else if (strcmp(pchVersion, "SteamNetworkingSockets003") == 0) {
|
} else if (strcmp(pchVersion, "SteamNetworkingSockets003") == 0) {
|
||||||
return (void *)(ISteamNetworkingSockets003 *) steam_networking_sockets_temp;
|
return (void *)(ISteamNetworkingSockets003 *) steam_networking_sockets_temp;
|
||||||
|
} else if (strcmp(pchVersion, "SteamNetworkingSockets006") == 0) {
|
||||||
|
return (void *)(ISteamNetworkingSockets006 *) steam_networking_sockets_temp;
|
||||||
} else {
|
} else {
|
||||||
return (void *)(ISteamNetworkingSockets *) steam_networking_sockets_temp;
|
return (void *)(ISteamNetworkingSockets *) steam_networking_sockets_temp;
|
||||||
}
|
}
|
||||||
|
@ -499,6 +502,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
|
||||||
}
|
}
|
||||||
|
|
||||||
return (void *)(ISteamGameCoordinator *)steam_game_coordinator_temp;
|
return (void *)(ISteamGameCoordinator *)steam_game_coordinator_temp;
|
||||||
|
} else if (strstr(pchVersion, STEAMTV_INTERFACE_VERSION) == pchVersion) {
|
||||||
|
return (void *)(ISteamTV *)steam_tv;
|
||||||
} else if (strstr(pchVersion, "SteamNetworkingUtils") == pchVersion) {
|
} else if (strstr(pchVersion, "SteamNetworkingUtils") == pchVersion) {
|
||||||
if (strcmp(pchVersion, "SteamNetworkingUtils001") == 0) {
|
if (strcmp(pchVersion, "SteamNetworkingUtils001") == 0) {
|
||||||
return (void *)(ISteamNetworkingUtils001 *)steam_networking_utils;
|
return (void *)(ISteamNetworkingUtils001 *)steam_networking_utils;
|
||||||
|
@ -675,7 +680,7 @@ ISteamNetworking *Steam_Client::GetISteamNetworking( HSteamUser hSteamUser, HSte
|
||||||
return (ISteamNetworking *)(void *)(ISteamNetworking004 *)steam_networking_temp;
|
return (ISteamNetworking *)(void *)(ISteamNetworking004 *)steam_networking_temp;
|
||||||
} else if (strcmp(pchVersion, "SteamNetworking005") == 0) {
|
} else if (strcmp(pchVersion, "SteamNetworking005") == 0) {
|
||||||
return (ISteamNetworking *)(void *)(ISteamNetworking005 *)steam_networking_temp;
|
return (ISteamNetworking *)(void *)(ISteamNetworking005 *)steam_networking_temp;
|
||||||
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
|
} else if (strcmp(pchVersion, STEAMNETWORKING_INTERFACE_VERSION) == 0) {
|
||||||
return (ISteamNetworking *)(void *)(ISteamNetworking *)steam_networking_temp;
|
return (ISteamNetworking *)(void *)(ISteamNetworking *)steam_networking_temp;
|
||||||
} else {
|
} else {
|
||||||
return (ISteamNetworking *)(void *)(ISteamNetworking *)steam_networking_temp;
|
return (ISteamNetworking *)(void *)(ISteamNetworking *)steam_networking_temp;
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "steam_gamesearch.h"
|
#include "steam_gamesearch.h"
|
||||||
#include "steam_parties.h"
|
#include "steam_parties.h"
|
||||||
#include "steam_remoteplay.h"
|
#include "steam_remoteplay.h"
|
||||||
|
#include "steam_tv.h"
|
||||||
|
|
||||||
#include "steam_gameserver.h"
|
#include "steam_gameserver.h"
|
||||||
#include "steam_gameserverstats.h"
|
#include "steam_gameserverstats.h"
|
||||||
|
@ -115,6 +116,7 @@ public:
|
||||||
Steam_Game_Search *steam_game_search;
|
Steam_Game_Search *steam_game_search;
|
||||||
Steam_Parties *steam_parties;
|
Steam_Parties *steam_parties;
|
||||||
Steam_RemotePlay *steam_remoteplay;
|
Steam_RemotePlay *steam_remoteplay;
|
||||||
|
Steam_TV *steam_tv;
|
||||||
|
|
||||||
Steam_GameServer *steam_gameserver;
|
Steam_GameServer *steam_gameserver;
|
||||||
Steam_Utils *steam_gameserver_utils;
|
Steam_Utils *steam_gameserver_utils;
|
||||||
|
|
|
@ -994,6 +994,11 @@ int GetNumChatsWithUnreadPriorityMessages()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActivateGameOverlayRemotePlayTogetherInviteDialog( CSteamID steamIDLobby )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Friends::ActivateGameOverlayRemotePlayTogetherInviteDialog\n");
|
||||||
|
}
|
||||||
|
|
||||||
void RunCallbacks()
|
void RunCallbacks()
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Friends::RunCallbacks\n");
|
PRINT_DEBUG("Steam_Friends::RunCallbacks\n");
|
||||||
|
|
|
@ -50,6 +50,7 @@ class Steam_Networking_Sockets :
|
||||||
public ISteamNetworkingSockets001,
|
public ISteamNetworkingSockets001,
|
||||||
public ISteamNetworkingSockets002,
|
public ISteamNetworkingSockets002,
|
||||||
public ISteamNetworkingSockets003,
|
public ISteamNetworkingSockets003,
|
||||||
|
public ISteamNetworkingSockets006,
|
||||||
public ISteamNetworkingSockets
|
public ISteamNetworkingSockets
|
||||||
{
|
{
|
||||||
class Settings *settings;
|
class Settings *settings;
|
||||||
|
@ -980,6 +981,64 @@ ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStat
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets::GetAuthenticationStatus\n");
|
PRINT_DEBUG("Steam_Networking_Sockets::GetAuthenticationStatus\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create a new poll group.
|
||||||
|
///
|
||||||
|
/// You should destroy the poll group when you are done using DestroyPollGroup
|
||||||
|
HSteamNetPollGroup CreatePollGroup()
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Networking_Sockets::CreatePollGroup\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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.
|
||||||
|
bool DestroyPollGroup( HSteamNetPollGroup hPollGroup )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Networking_Sockets::DestroyPollGroup\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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).
|
||||||
|
bool SetConnectionPollGroup( HSteamNetConnection hConn, HSteamNetPollGroup hPollGroup )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Networking_Sockets::SetConnectionPollGroup\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 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.)
|
||||||
|
int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Networking_Sockets::ReceiveMessagesOnPollGroup\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//#ifndef STEAMNETWORKINGSOCKETS_OPENSOURCE
|
//#ifndef STEAMNETWORKINGSOCKETS_OPENSOURCE
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1345,6 +1404,29 @@ bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCusto
|
||||||
PRINT_DEBUG("Steam_Networking_Sockets::ReceivedP2PCustomSignal\n");
|
PRINT_DEBUG("Steam_Networking_Sockets::ReceivedP2PCustomSignal\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
/// return the number of bytes that were populated. You can pass pBlob=NULL to query for the required
|
||||||
|
/// size. (256 bytes is a very conservative estimate.)
|
||||||
|
///
|
||||||
|
/// Pass this blob to your game coordinator and call SteamDatagram_CreateCert.
|
||||||
|
bool GetCertificateRequest( int *pcbBlob, void *pBlob, SteamNetworkingErrMsg &errMsg )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Networking_Sockets::GetCertificateRequest\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Set the certificate. The certificate blob should be the output of
|
||||||
|
/// SteamDatagram_CreateCert.
|
||||||
|
bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg )
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("Steam_Networking_Sockets::SetCertificate\n");
|
||||||
|
}
|
||||||
|
|
||||||
// TEMP KLUDGE Call to invoke all queued callbacks.
|
// TEMP KLUDGE Call to invoke all queued callbacks.
|
||||||
// Eventually this function will go away, and callwacks will be ordinary Steamworks callbacks.
|
// Eventually this function will go away, and callwacks will be ordinary Steamworks callbacks.
|
||||||
// You should call this at the same time you call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks
|
// You should call this at the same time you call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks
|
||||||
|
|
124
dll/steam_tv.h
Normal file
124
dll/steam_tv.h
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
/* Copyright (C) 2019 Mr Goldberg
|
||||||
|
This file is part of the Goldberg Emulator
|
||||||
|
|
||||||
|
The Goldberg Emulator is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Goldberg Emulator is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with the Goldberg Emulator; if not, see
|
||||||
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include "base.h"
|
||||||
|
|
||||||
|
class Steam_TV :
|
||||||
|
public ISteamTV
|
||||||
|
{
|
||||||
|
class Settings *settings;
|
||||||
|
class Networking *network;
|
||||||
|
class SteamCallResults *callback_results;
|
||||||
|
class SteamCallBacks *callbacks;
|
||||||
|
class RunEveryRunCB *run_every_runcb;
|
||||||
|
std::chrono::time_point<std::chrono::steady_clock> initialized_time = std::chrono::steady_clock::now();
|
||||||
|
FSteamNetworkingSocketsDebugOutput debug_function;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void steam_callback(void *object, Common_Message *msg)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("steam_tv_callback\n");
|
||||||
|
|
||||||
|
Steam_TV *steam_parties = (Steam_TV *)object;
|
||||||
|
steam_parties->Callback(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void steam_run_every_runcb(void *object)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("steam_tv_run_every_runcb\n");
|
||||||
|
|
||||||
|
Steam_TV *steam_parties = (Steam_TV *)object;
|
||||||
|
steam_parties->RunCallbacks();
|
||||||
|
}
|
||||||
|
|
||||||
|
Steam_TV(class Settings *settings, class Networking *network, class SteamCallResults *callback_results, class SteamCallBacks *callbacks, class RunEveryRunCB *run_every_runcb)
|
||||||
|
{
|
||||||
|
this->settings = settings;
|
||||||
|
this->network = network;
|
||||||
|
this->run_every_runcb = run_every_runcb;
|
||||||
|
//this->network->setCallback(CALLBACK_ID_USER_STATUS, settings->get_local_steam_id(), &Steam_TV::steam_callback, this);
|
||||||
|
// this->run_every_runcb->add(&Steam_TV::steam_run_every_runcb, this);
|
||||||
|
|
||||||
|
this->callback_results = callback_results;
|
||||||
|
this->callbacks = callbacks;
|
||||||
|
}
|
||||||
|
|
||||||
|
~Steam_TV()
|
||||||
|
{
|
||||||
|
//TODO rm network callbacks
|
||||||
|
//this->run_every_runcb->remove(&Steam_TV::steam_run_every_runcb, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsBroadcasting(int *pnNumViewers)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddBroadcastGameData(const char * pchKey, const char * pchValue)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveBroadcastGameData(const char * pchKey)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddTimelineMarker(const char * pchTemplateName, bool bPersistent, uint8 nColorR, uint8 nColorG, uint8 nColorB)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveTimelineMarker()
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 AddRegion(const char * pchElementName, const char * pchTimelineDataSection, const SteamTVRegion_t * pSteamTVRegion, ESteamTVRegionBehavior eSteamTVRegionBehavior)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveRegion(uint32 unRegionHandle)
|
||||||
|
{
|
||||||
|
PRINT_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunCallbacks()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Callback(Common_Message *msg)
|
||||||
|
{
|
||||||
|
if (msg->has_low_level()) {
|
||||||
|
if (msg->low_level().type() == Low_Level::CONNECT) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msg->low_level().type() == Low_Level::DISCONNECT) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msg->has_networking_sockets()) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
|
@ -168,7 +168,7 @@ public:
|
||||||
|
|
||||||
// Global ISteamClient interface accessor
|
// Global ISteamClient interface accessor
|
||||||
inline ISteamClient *SteamClient();
|
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.
|
// 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.)
|
// (This is actually the same thing. You really shouldn't need to access any of this stuff directly.)
|
||||||
|
|
|
@ -254,7 +254,9 @@ public:
|
||||||
virtual const char *GetClanTag( CSteamID steamIDClan ) = 0;
|
virtual const char *GetClanTag( CSteamID steamIDClan ) = 0;
|
||||||
// returns the most recent information we have about what's happening in a clan
|
// 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;
|
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
|
// 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;
|
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
|
// 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
|
/// You can register for UnreadChatMessagesChanged_t callbacks to know when this
|
||||||
/// has potentially changed.
|
/// has potentially changed.
|
||||||
virtual int GetNumChatsWithUnreadPriorityMessages() = 0;
|
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"
|
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends017"
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
//
|
//
|
||||||
|
|
||||||
/// This is called by SteamGameServer_Init, and you will usually not need to call it directly
|
/// 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.
|
/// 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.
|
/// It's a required field, but will eventually will go away, and the AppID will be used for this purpose.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//====== Copyright � Valve Corporation, All rights reserved. =======
|
//====== Copyright © Valve Corporation, All rights reserved. =======
|
||||||
//
|
//
|
||||||
// Purpose: interface for game servers to steam stats and achievements
|
// Purpose: interface for game servers to steam stats and achievements
|
||||||
//
|
//
|
||||||
|
@ -27,16 +27,25 @@ public:
|
||||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||||
|
|
||||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
// 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;
|
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 GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||||
|
|
||||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||||
|
|
||||||
// Set / update stats and achievements.
|
// Set / update stats and achievements.
|
||||||
// Note: These updates will work only on stats game servers are allowed to edit and only for
|
// 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.
|
// 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
|
// 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;
|
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 SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0;
|
||||||
|
|
||||||
virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||||
|
|
||||||
virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0;
|
virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//====== Copyright � 1996-2014 Valve Corporation, All rights reserved. =======
|
//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. =======
|
||||||
//
|
//
|
||||||
// Purpose: interface to Steam Inventory
|
// Purpose: interface to Steam Inventory
|
||||||
//
|
//
|
||||||
|
@ -350,10 +350,19 @@ public:
|
||||||
// Remove the property on the item
|
// Remove the property on the item
|
||||||
virtual bool RemoveProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName ) = 0;
|
virtual bool RemoveProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName ) = 0;
|
||||||
// Accessor methods to set properties on items
|
// 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;
|
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;
|
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;
|
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;
|
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, float flValue ) = 0;
|
||||||
|
|
||||||
// Submit the update request by handle
|
// Submit the update request by handle
|
||||||
virtual bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, SteamInventoryResult_t * pResultHandle ) = 0;
|
virtual bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, SteamInventoryResult_t * pResultHandle ) = 0;
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,6 @@ public:
|
||||||
// after completion, the local user will no longer be the owner
|
// after completion, the local user will no longer be the owner
|
||||||
virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0;
|
virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0;
|
||||||
#endif
|
#endif
|
||||||
STEAM_CALL_BACK( LobbyChatUpdate_t )
|
|
||||||
};
|
};
|
||||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009"
|
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009"
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,7 @@ public:
|
||||||
/// pOutMessageNumberOrResult is an optional array that will receive,
|
/// pOutMessageNumberOrResult is an optional array that will receive,
|
||||||
/// for each message, the message number that was assigned to the message
|
/// for each message, the message number that was assigned to the message
|
||||||
/// if sending was successful. If sending failed, then a negative EResult
|
/// 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.
|
/// -k_EResultInvalidState if the connection was in an invalid state.
|
||||||
/// See ISteamNetworkingSockets::SendMessageToConnection for possible
|
/// See ISteamNetworkingSockets::SendMessageToConnection for possible
|
||||||
/// failure codes.
|
/// failure codes.
|
||||||
|
@ -300,7 +300,7 @@ public:
|
||||||
/// Reliable messages will be received in the order they were sent (and with the
|
/// 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).
|
/// 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
|
/// each other or with respect to reliable messages. The same unreliable message
|
||||||
/// may be received multiple times.
|
/// 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.
|
/// 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;
|
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.
|
/// Returns basic information about the high-level state of the connection.
|
||||||
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
|
virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0;
|
||||||
|
|
||||||
|
@ -405,6 +395,57 @@ public:
|
||||||
/// details, pass non-NULL to receive them.
|
/// details, pass non-NULL to receive them.
|
||||||
virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0;
|
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
|
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -455,7 +496,7 @@ public:
|
||||||
virtual uint16 GetHostedDedicatedServerPort() = 0;
|
virtual uint16 GetHostedDedicatedServerPort() = 0;
|
||||||
|
|
||||||
/// Returns 0 if SDR_LISTEN_PORT is not set. Otherwise, returns the data center the server
|
/// 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;
|
virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0;
|
||||||
|
|
||||||
/// Return info about the hosted server. This contains the PoPID of the server,
|
/// 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;
|
virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0;
|
||||||
#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR
|
#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.
|
/// 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
|
/// 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
|
/// Set the certificate. The certificate blob should be the output of
|
||||||
/// SteamDatagram_CreateCert.
|
/// SteamDatagram_CreateCert.
|
||||||
virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0;
|
virtual bool SetCertificate( const void *pCertificate, int cbCertificate, SteamNetworkingErrMsg &errMsg ) = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Invoke all callbacks queued for this interface.
|
// Invoke all callbacks queued for this interface.
|
||||||
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
|
// On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism.
|
||||||
|
@ -630,7 +672,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
// ~ISteamNetworkingSockets(); // Silence some warnings
|
// ~ISteamNetworkingSockets(); // Silence some warnings
|
||||||
};
|
};
|
||||||
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets006"
|
#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets008"
|
||||||
|
|
||||||
/// Interface used to send signaling messages for a particular connection.
|
/// Interface used to send signaling messages for a particular connection.
|
||||||
/// You will need to construct one of these per connection.
|
/// You will need to construct one of these per connection.
|
||||||
|
@ -709,8 +751,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
|
|
||||||
// Global accessor.
|
// Global accessor.
|
||||||
#if defined( STEAMNETWORKINGSOCKETS_PARTNER )
|
#if defined( STEAMNETWORKINGSOCKETS_PARTNER )
|
||||||
|
|
||||||
|
@ -816,6 +856,4 @@ struct SteamNetAuthenticationStatus_t
|
||||||
|
|
||||||
#pragma pack( pop )
|
#pragma pack( pop )
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // ISTEAMNETWORKINGSOCKETS
|
#endif // ISTEAMNETWORKINGSOCKETS
|
||||||
|
|
599
sdk_includes/isteamnetworkingsockets006.h
Normal file
599
sdk_includes/isteamnetworkingsockets006.h
Normal file
|
@ -0,0 +1,599 @@
|
||||||
|
|
||||||
|
#ifndef ISTEAMNETWORKINGSOCKETS006
|
||||||
|
#define ISTEAMNETWORKINGSOCKETS006
|
||||||
|
|
||||||
|
|
||||||
|
class ISteamNetworkingSockets006
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// Creates a "server" socket that listens for clients to connect to by
|
||||||
|
/// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6)
|
||||||
|
///
|
||||||
|
/// You must select a specific local port to listen on and set it
|
||||||
|
/// the port field of the local address.
|
||||||
|
///
|
||||||
|
/// Usually you will set the IP portion of the address to zero (SteamNetworkingIPAddr::Clear()).
|
||||||
|
/// This means that you will not bind to any particular local interface (i.e. the same
|
||||||
|
/// as INADDR_ANY in plain socket code). Furthermore, if possible the socket will be bound
|
||||||
|
/// in "dual stack" mode, which means that it can accept both IPv4 and IPv6 client connections.
|
||||||
|
/// If you really do wish to bind a particular interface, then set the local address to the
|
||||||
|
/// appropriate IPv4 or IPv6 IP.
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
///
|
||||||
|
/// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t
|
||||||
|
/// will be posted. The connection will be in the connecting state.
|
||||||
|
virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Creates a connection and begins talking to a "server" over UDP at the
|
||||||
|
/// given IPv4 or IPv6 address. The remote host must be listening with a
|
||||||
|
/// matching call to CreateListenSocketIP on the specified port.
|
||||||
|
///
|
||||||
|
/// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start
|
||||||
|
/// connecting, and then another one on either timeout or successful connection.
|
||||||
|
///
|
||||||
|
/// If the server does not have any identity configured, then their network address
|
||||||
|
/// will be the only identity in use. Or, the network host may provide a platform-specific
|
||||||
|
/// identity with or without a valid certificate to authenticate that identity. (These
|
||||||
|
/// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's
|
||||||
|
/// up to your application to decide whether to allow the connection.
|
||||||
|
///
|
||||||
|
/// By default, all connections will get basic encryption sufficient to prevent
|
||||||
|
/// casual eavesdropping. But note that without certificates (or a shared secret
|
||||||
|
/// distributed through some other out-of-band mechanism), you don't have any
|
||||||
|
/// way of knowing who is actually on the other end, and thus are vulnerable to
|
||||||
|
/// man-in-the-middle attacks.
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
|
||||||
|
/// Like CreateListenSocketIP, but clients will connect using ConnectP2P
|
||||||
|
///
|
||||||
|
/// nVirtualPort specifies how clients can connect to this socket using
|
||||||
|
/// ConnectP2P. It's very common for applications to only have one listening socket;
|
||||||
|
/// in that case, use zero. If you need to open multiple listen sockets and have clients
|
||||||
|
/// be able to connect to one or the other, then nVirtualPort should be a small integer (<1000)
|
||||||
|
/// unique to each listen socket you create.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamListenSocket CreateListenSocketP2P( int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Begin connecting to a server that is identified using a platform-specific identifier.
|
||||||
|
/// This uses the default rendezvous service, which depends on the platform and library
|
||||||
|
/// configuration. (E.g. on Steam, it goes through the steam backend.) The traffic is relayed
|
||||||
|
/// over the Steam Datagram Relay network.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// Accept an incoming connection that has been received on a listen socket.
|
||||||
|
///
|
||||||
|
/// When a connection attempt is received (perhaps after a few basic handshake
|
||||||
|
/// packets have been exchanged to prevent trivial spoofing), a connection interface
|
||||||
|
/// object is created in the k_ESteamNetworkingConnectionState_Connecting state
|
||||||
|
/// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your
|
||||||
|
/// application MUST either accept or close the connection. (It may not ignore it.)
|
||||||
|
/// Accepting the connection will transition it either into the connected state,
|
||||||
|
/// or the finding route state, depending on the connection type.
|
||||||
|
///
|
||||||
|
/// You should take action within a second or two, because accepting the connection is
|
||||||
|
/// what actually sends the reply notifying the client that they are connected. If you
|
||||||
|
/// delay taking action, from the client's perspective it is the same as the network
|
||||||
|
/// being unresponsive, and the client may timeout the connection attempt. In other
|
||||||
|
/// words, the client cannot distinguish between a delay caused by network problems
|
||||||
|
/// and a delay caused by the application.
|
||||||
|
///
|
||||||
|
/// This means that if your application goes for more than a few seconds without
|
||||||
|
/// processing callbacks (for example, while loading a map), then there is a chance
|
||||||
|
/// that a client may attempt to connect in that interval and fail due to timeout.
|
||||||
|
///
|
||||||
|
/// If the application does not respond to the connection attempt in a timely manner,
|
||||||
|
/// and we stop receiving communication from the client, the connection attempt will
|
||||||
|
/// be timed out locally, transitioning the connection to the
|
||||||
|
/// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also
|
||||||
|
/// close the connection before it is accepted, and a transition to the
|
||||||
|
/// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact
|
||||||
|
/// sequence of events.
|
||||||
|
///
|
||||||
|
/// Returns k_EResultInvalidParam if the handle is invalid.
|
||||||
|
/// Returns k_EResultInvalidState if the connection is not in the appropriate state.
|
||||||
|
/// (Remember that the connection state could change in between the time that the
|
||||||
|
/// notification being posted to the queue and when it is received by the application.)
|
||||||
|
///
|
||||||
|
/// A note about connection configuration options. If you need to set any configuration
|
||||||
|
/// options that are common to all connections accepted through a particular listen
|
||||||
|
/// socket, consider setting the options on the listen socket, since such options are
|
||||||
|
/// inherited automatically. If you really do need to set options that are connection
|
||||||
|
/// specific, it is safe to set them on the connection before accepting the connection.
|
||||||
|
virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0;
|
||||||
|
|
||||||
|
/// Disconnects from the remote host and invalidates the connection handle.
|
||||||
|
/// Any unread data on the connection is discarded.
|
||||||
|
///
|
||||||
|
/// nReason is an application defined code that will be received on the other
|
||||||
|
/// end and recorded (when possible) in backend analytics. The value should
|
||||||
|
/// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need
|
||||||
|
/// to communicate any information to the remote host, and do not want analytics to
|
||||||
|
/// be able to distinguish "normal" connection terminations from "exceptional" ones,
|
||||||
|
/// You may pass zero, in which case the generic value of
|
||||||
|
/// k_ESteamNetConnectionEnd_App_Generic will be used.
|
||||||
|
///
|
||||||
|
/// pszDebug is an optional human-readable diagnostic string that will be received
|
||||||
|
/// by the remote host and recorded (when possible) in backend analytics.
|
||||||
|
///
|
||||||
|
/// If you wish to put the socket into a "linger" state, where an attempt is made to
|
||||||
|
/// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data
|
||||||
|
/// is not flushed.
|
||||||
|
///
|
||||||
|
/// If the connection has already ended and you are just freeing up the
|
||||||
|
/// connection interface, the reason code, debug string, and linger flag are
|
||||||
|
/// ignored.
|
||||||
|
virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0;
|
||||||
|
|
||||||
|
/// Destroy a listen socket. All the connections that were accepting on the listen
|
||||||
|
/// socket are closed ungracefully.
|
||||||
|
virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0;
|
||||||
|
|
||||||
|
/// Set connection user data. the data is returned in the following places
|
||||||
|
/// - You can query it using GetConnectionUserData.
|
||||||
|
/// - The SteamNetworkingmessage_t structure.
|
||||||
|
/// - The SteamNetConnectionInfo_t structure. (Which is a member of SteamNetConnectionStatusChangedCallback_t.)
|
||||||
|
///
|
||||||
|
/// Returns false if the handle is invalid.
|
||||||
|
virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0;
|
||||||
|
|
||||||
|
/// Fetch connection user data. Returns -1 if handle is invalid
|
||||||
|
/// or if you haven't set any userdata on the connection.
|
||||||
|
virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0;
|
||||||
|
|
||||||
|
/// Set a name for the connection, used mostly for debugging
|
||||||
|
virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0;
|
||||||
|
|
||||||
|
/// Fetch connection name. Returns false if handle is invalid
|
||||||
|
virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0;
|
||||||
|
|
||||||
|
/// Send a message to the remote host on the specified connection.
|
||||||
|
///
|
||||||
|
/// nSendFlags determines the delivery guarantees that will be provided,
|
||||||
|
/// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable
|
||||||
|
///
|
||||||
|
/// Note that the semantics we use for messages are not precisely
|
||||||
|
/// the same as the semantics of a standard "stream" socket.
|
||||||
|
/// (SOCK_STREAM) For an ordinary stream socket, the boundaries
|
||||||
|
/// between chunks are not considered relevant, and the sizes of
|
||||||
|
/// the chunks of data written will not necessarily match up to
|
||||||
|
/// the sizes of the chunks that are returned by the reads on
|
||||||
|
/// the other end. The remote host might read a partial chunk,
|
||||||
|
/// or chunks might be coalesced. For the message semantics
|
||||||
|
/// used here, however, the sizes WILL match. Each send call
|
||||||
|
/// will match a successful read call on the remote host
|
||||||
|
/// one-for-one. If you are porting existing stream-oriented
|
||||||
|
/// code to the semantics of reliable messages, your code should
|
||||||
|
/// work the same, since reliable message semantics are more
|
||||||
|
/// strict than stream semantics. The only caveat is related to
|
||||||
|
/// performance: there is per-message overhead to retain the
|
||||||
|
/// message sizes, and so if your code sends many small chunks
|
||||||
|
/// of data, performance will suffer. Any code based on stream
|
||||||
|
/// sockets that does not write excessively small chunks will
|
||||||
|
/// work without any changes.
|
||||||
|
///
|
||||||
|
/// The pOutMessageNumber is an optional pointer to receive the
|
||||||
|
/// message number assigned to the message, if sending was successful.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big.
|
||||||
|
/// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend)
|
||||||
|
/// - k_EResultInvalidState: connection is in an invalid state
|
||||||
|
/// - k_EResultNoConnection: connection has ended
|
||||||
|
/// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because
|
||||||
|
/// we were not ready to send it.
|
||||||
|
/// - k_EResultLimitExceeded: there was already too much data queued to be sent.
|
||||||
|
/// (See k_ESteamNetworkingConfig_SendBufferSize)
|
||||||
|
virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags, int64 *pOutMessageNumber ) = 0;
|
||||||
|
|
||||||
|
/// Send one or more messages without copying the message payload.
|
||||||
|
/// This is the most efficient way to send messages. To use this
|
||||||
|
/// function, you must first allocate a message object using
|
||||||
|
/// ISteamNetworkingUtils::AllocateMessage. (Do not declare one
|
||||||
|
/// on the stack or allocate your own.)
|
||||||
|
///
|
||||||
|
/// You should fill in the message payload. You can either let
|
||||||
|
/// it allocate the buffer for you and then fill in the payload,
|
||||||
|
/// or if you already have a buffer allocated, you can just point
|
||||||
|
/// m_pData at your buffer and set the callback to the appropriate function
|
||||||
|
/// to free it. Note that if you use your own buffer, it MUST remain valid
|
||||||
|
/// until the callback is executed. And also note that your callback can be
|
||||||
|
/// invoked at ant time from any thread (perhaps even before SendMessages
|
||||||
|
/// returns!), so it MUST be fast and threadsafe.
|
||||||
|
///
|
||||||
|
/// You MUST also fill in:
|
||||||
|
/// - m_conn - the handle of the connection to send the message to
|
||||||
|
/// - m_nFlags - bitmask of k_nSteamNetworkingSend_xxx flags.
|
||||||
|
///
|
||||||
|
/// All other fields are currently reserved and should not be modified.
|
||||||
|
///
|
||||||
|
/// The library will take ownership of the message structures. They may
|
||||||
|
/// be modified or become invalid at any time, so you must not read them
|
||||||
|
/// after passing them to this function.
|
||||||
|
///
|
||||||
|
/// 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
|
||||||
|
/// -k_EResultInvalidState if the connection was in an invalid state.
|
||||||
|
/// See ISteamNetworkingSockets::SendMessageToConnection for possible
|
||||||
|
/// failure codes.
|
||||||
|
virtual void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult ) = 0;
|
||||||
|
|
||||||
|
/// Flush any messages waiting on the Nagle timer and send them
|
||||||
|
/// at the next transmission opportunity (often that means right now).
|
||||||
|
///
|
||||||
|
/// If Nagle is enabled (it's on by default) then when calling
|
||||||
|
/// SendMessageToConnection the message will be buffered, up to the Nagle time
|
||||||
|
/// before being sent, to merge small messages into the same packet.
|
||||||
|
/// (See k_ESteamNetworkingConfig_NagleTime)
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// k_EResultInvalidParam: invalid connection handle
|
||||||
|
/// k_EResultInvalidState: connection is in an invalid state
|
||||||
|
/// k_EResultNoConnection: connection has ended
|
||||||
|
/// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect.
|
||||||
|
virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0;
|
||||||
|
|
||||||
|
/// Fetch the next available message(s) from the connection, if any.
|
||||||
|
/// Returns the number of messages returned into your array, up to nMaxMessages.
|
||||||
|
/// If the connection handle is invalid, -1 is returned.
|
||||||
|
///
|
||||||
|
/// The order of the messages returned in the array is relevant.
|
||||||
|
/// 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
|
||||||
|
/// each other or with respect to reliable messages. The same unreliable message
|
||||||
|
/// may be received multiple times.
|
||||||
|
///
|
||||||
|
/// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each
|
||||||
|
/// of them free up resources after you are done. It is safe to keep the object alive for
|
||||||
|
/// 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;
|
||||||
|
|
||||||
|
/// Returns a small set of information about the real-time state of the connection
|
||||||
|
/// Returns false if the connection handle is invalid, or the connection has ended.
|
||||||
|
virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0;
|
||||||
|
|
||||||
|
/// Returns detailed connection stats in text format. Useful
|
||||||
|
/// for dumping to a log, etc.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// -1 failure (bad connection handle)
|
||||||
|
/// 0 OK, your buffer was filled in and '\0'-terminated
|
||||||
|
/// >0 Your buffer was either nullptr, or it was too small and the text got truncated.
|
||||||
|
/// Try again with a buffer of at least N bytes.
|
||||||
|
virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0;
|
||||||
|
|
||||||
|
/// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to.
|
||||||
|
///
|
||||||
|
/// An IPv6 address of ::0 means "any IPv4 or IPv6"
|
||||||
|
/// An IPv6 address of ::ffff:0000:0000 means "any IPv4"
|
||||||
|
virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0;
|
||||||
|
|
||||||
|
/// Create a pair of connections that are talking to each other, e.g. a loopback connection.
|
||||||
|
/// This is very useful for testing, or so that your client/server code can work the same
|
||||||
|
/// even when you are running a local "server".
|
||||||
|
///
|
||||||
|
/// The two connections will immediately be placed into the connected state, and no callbacks
|
||||||
|
/// will be posted immediately. After this, if you close either connection, the other connection
|
||||||
|
/// will receive a callback, exactly as if they were communicating over the network. You must
|
||||||
|
/// close *both* sides in order to fully clean up the resources!
|
||||||
|
///
|
||||||
|
/// By default, internal buffers are used, completely bypassing the network, the chopping up of
|
||||||
|
/// messages into packets, encryption, copying the payload, etc. This means that loopback
|
||||||
|
/// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will
|
||||||
|
/// cause the socket pair to send packets through the local network loopback device (127.0.0.1)
|
||||||
|
/// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended
|
||||||
|
/// to encrypt and decrypt.
|
||||||
|
///
|
||||||
|
/// If you wish to assign a specific identity to either connection, you may pass a particular
|
||||||
|
/// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic
|
||||||
|
/// "localhost" identity. If you use real network loopback, this might be translated to the
|
||||||
|
/// actual bound loopback port. Otherwise, the port will be zero.
|
||||||
|
virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0;
|
||||||
|
|
||||||
|
/// 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.)
|
||||||
|
virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0;
|
||||||
|
|
||||||
|
/// Indicate our desire to be ready participate in authenticated communications.
|
||||||
|
/// If we are currently not ready, then steps will be taken to obtain the necessary
|
||||||
|
/// certificates. (This includes a certificate for us, as well as any CA certificates
|
||||||
|
/// needed to authenticate peers.)
|
||||||
|
///
|
||||||
|
/// You can call this at program init time if you know that you are going to
|
||||||
|
/// be making authenticated connections, so that we will be ready immediately when
|
||||||
|
/// those connections are attempted. (Note that essentially all connections require
|
||||||
|
/// authentication, with the exception of ordinary UDP connections with authentication
|
||||||
|
/// disabled using k_ESteamNetworkingConfig_IP_AllowWithoutAuth.) If you don't call
|
||||||
|
/// this function, we will wait until a feature is utilized that that necessitates
|
||||||
|
/// these resources.
|
||||||
|
///
|
||||||
|
/// You can also call this function to force a retry, if failure has occurred.
|
||||||
|
/// Once we make an attempt and fail, we will not automatically retry.
|
||||||
|
/// In this respect, the behavior of the system after trying and failing is the same
|
||||||
|
/// as before the first attempt: attempting authenticated communication or calling
|
||||||
|
/// this function will call the system to attempt to acquire the necessary resources.
|
||||||
|
///
|
||||||
|
/// You can use GetAuthenticationStatus or listen for SteamNetAuthenticationStatus_t
|
||||||
|
/// to monitor the status.
|
||||||
|
///
|
||||||
|
/// Returns the current value that would be returned from GetAuthenticationStatus.
|
||||||
|
virtual ESteamNetworkingAvailability InitAuthentication() = 0;
|
||||||
|
|
||||||
|
/// Query our readiness to participate in authenticated communications. A
|
||||||
|
/// SteamNetAuthenticationStatus_t callback is posted any time this status changes,
|
||||||
|
/// but you can use this function to query it at any time.
|
||||||
|
///
|
||||||
|
/// The value of SteamNetAuthenticationStatus_t::m_eAvail is returned. If you only
|
||||||
|
/// want this high level status, you can pass NULL for pDetails. If you want further
|
||||||
|
/// details, pass non-NULL to receive them.
|
||||||
|
virtual ESteamNetworkingAvailability GetAuthenticationStatus( SteamNetAuthenticationStatus_t *pDetails ) = 0;
|
||||||
|
|
||||||
|
#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR
|
||||||
|
|
||||||
|
//
|
||||||
|
// Clients connecting to dedicated servers hosted in a data center,
|
||||||
|
// using central-authority-granted tickets.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Call this when you receive a ticket from your backend / matchmaking system. Puts the
|
||||||
|
/// ticket into a persistent cache, and optionally returns the parsed ticket.
|
||||||
|
///
|
||||||
|
/// See stamdatagram_ticketgen.h for more details.
|
||||||
|
virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0;
|
||||||
|
|
||||||
|
/// Search cache for a ticket to talk to the server on the specified virtual port.
|
||||||
|
/// If found, returns the number of seconds until the ticket expires, and optionally
|
||||||
|
/// the complete cracked ticket. Returns 0 if we don't have a ticket.
|
||||||
|
///
|
||||||
|
/// Typically this is useful just to confirm that you have a ticket, before you
|
||||||
|
/// call ConnectToHostedDedicatedServer to connect to the server.
|
||||||
|
virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0;
|
||||||
|
|
||||||
|
/// Client call to connect to a server hosted in a Valve data center, on the specified virtual
|
||||||
|
/// port. You must have placed a ticket for this server into the cache, or else this connect attempt will fail!
|
||||||
|
///
|
||||||
|
/// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument
|
||||||
|
/// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses
|
||||||
|
/// connection to Steam or the central backend, or the app is restarted or crashes, etc.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Servers hosted in data centers known to the Valve relay network
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Returns the value of the SDR_LISTEN_PORT environment variable. This
|
||||||
|
/// is the UDP server your server will be listening on. This will
|
||||||
|
/// configured automatically for you in production environments.
|
||||||
|
///
|
||||||
|
/// In development, you'll need to set it yourself. See
|
||||||
|
/// https://partner.steamgames.com/doc/api/ISteamNetworkingSockets
|
||||||
|
/// for more information on how to configure dev environments.
|
||||||
|
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.
|
||||||
|
virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0;
|
||||||
|
|
||||||
|
/// Return info about the hosted server. This contains the PoPID of the server,
|
||||||
|
/// and opaque routing information that can be used by the relays to send traffic
|
||||||
|
/// to your server.
|
||||||
|
///
|
||||||
|
/// You will need to send this information to your backend, and put it in tickets,
|
||||||
|
/// so that the relays will know how to forward traffic from
|
||||||
|
/// clients to your server. See SteamDatagramRelayAuthTicket for more info.
|
||||||
|
///
|
||||||
|
/// Also, note that the routing information is contained in SteamDatagramGameCoordinatorServerLogin,
|
||||||
|
/// so if possible, it's preferred to use GetGameCoordinatorServerLogin to send this info
|
||||||
|
/// to your game coordinator service, and also login securely at the same time.
|
||||||
|
///
|
||||||
|
/// On a successful exit, k_EResultOK is returned
|
||||||
|
///
|
||||||
|
/// Unsuccessful exit:
|
||||||
|
/// - Something other than k_EResultOK is returned.
|
||||||
|
/// - k_EResultInvalidState: We are not configured to listen for SDR (SDR_LISTEN_SOCKET
|
||||||
|
/// is not set.)
|
||||||
|
/// - k_EResultPending: we do not (yet) have the authentication information needed.
|
||||||
|
/// (See GetAuthenticationStatus.) If you use environment variables to pre-fetch
|
||||||
|
/// the network config, this data should always be available immediately.
|
||||||
|
/// - A non-localized diagnostic debug message will be placed in m_data that describes
|
||||||
|
/// the cause of the failure.
|
||||||
|
///
|
||||||
|
/// NOTE: The returned blob is not encrypted. Send it to your backend, but don't
|
||||||
|
/// directly share it with clients.
|
||||||
|
virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0;
|
||||||
|
|
||||||
|
/// Create a listen socket on the specified virtual port. The physical UDP port to use
|
||||||
|
/// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not
|
||||||
|
/// configured, this call will fail.
|
||||||
|
///
|
||||||
|
/// Note that this call MUST be made through the SteamGameServerNetworkingSockets() interface
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Generate an authentication blob that can be used to securely login with
|
||||||
|
/// your backend, using SteamDatagram_ParseHostedServerLogin. (See
|
||||||
|
/// steamdatagram_gamecoordinator.h)
|
||||||
|
///
|
||||||
|
/// Before calling the function:
|
||||||
|
/// - Populate the app data in pLoginInfo (m_cbAppData and m_appData). You can leave
|
||||||
|
/// all other fields uninitialized.
|
||||||
|
/// - *pcbSignedBlob contains the size of the buffer at pBlob. (It should be
|
||||||
|
/// at least k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized.)
|
||||||
|
///
|
||||||
|
/// On a successful exit:
|
||||||
|
/// - k_EResultOK is returned
|
||||||
|
/// - All of the remaining fields of pLoginInfo will be filled out.
|
||||||
|
/// - *pcbSignedBlob contains the size of the serialized blob that has been
|
||||||
|
/// placed into pBlob.
|
||||||
|
///
|
||||||
|
/// Unsuccessful exit:
|
||||||
|
/// - Something other than k_EResultOK is returned.
|
||||||
|
/// - k_EResultNotLoggedOn: you are not logged in (yet)
|
||||||
|
/// - See GetHostedDedicatedServerAddress for more potential failure return values.
|
||||||
|
/// - A non-localized diagnostic debug message will be placed in pBlob that describes
|
||||||
|
/// the cause of the failure.
|
||||||
|
///
|
||||||
|
/// This works by signing the contents of the SteamDatagramGameCoordinatorServerLogin
|
||||||
|
/// with the cert that is issued to this server. In dev environments, it's OK if you do
|
||||||
|
/// not have a cert. (You will need to enable insecure dev login in SteamDatagram_ParseHostedServerLogin.)
|
||||||
|
/// Otherwise, you will need a signed cert.
|
||||||
|
///
|
||||||
|
/// NOTE: The routing blob returned here is not encrypted. Send it to your backend
|
||||||
|
/// and don't share it directly with clients.
|
||||||
|
virtual EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *pLoginInfo, int *pcbSignedBlob, void *pBlob ) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Relayed connections using custom signaling protocol
|
||||||
|
//
|
||||||
|
// This is used if you have your own method of sending out-of-band
|
||||||
|
// signaling / rendezvous messages through a mutually trusted channel.
|
||||||
|
//
|
||||||
|
|
||||||
|
/// Create a P2P "client" connection that does signaling over a custom
|
||||||
|
/// rendezvous/signaling channel.
|
||||||
|
///
|
||||||
|
/// pSignaling points to a new object that you create just for this connection.
|
||||||
|
/// It must stay valid until Release() is called. Once you pass the
|
||||||
|
/// object to this function, it assumes ownership. Release() will be called
|
||||||
|
/// from within the function call if the call fails. Furthermore, until Release()
|
||||||
|
/// is called, you should be prepared for methods to be invoked on your
|
||||||
|
/// object from any thread! You need to make sure your object is threadsafe!
|
||||||
|
/// Furthermore, you should make sure that dispatching the methods is done
|
||||||
|
/// as quickly as possible.
|
||||||
|
///
|
||||||
|
/// This function will immediately construct a connection in the "connecting"
|
||||||
|
/// state. Soon after (perhaps before this function returns, perhaps in another thread),
|
||||||
|
/// the connection will begin sending signaling messages by calling
|
||||||
|
/// ISteamNetworkingConnectionCustomSignaling::SendSignal.
|
||||||
|
///
|
||||||
|
/// When the remote peer accepts the connection (See
|
||||||
|
/// ISteamNetworkingCustomSignalingRecvContext::OnConnectRequest),
|
||||||
|
/// it will begin sending signaling messages. When these messages are received,
|
||||||
|
/// you can pass them to the connection using ReceivedP2PCustomSignal.
|
||||||
|
///
|
||||||
|
/// If you know the identity of the peer that you expect to be on the other end,
|
||||||
|
/// you can pass their identity to improve debug output or just detect bugs.
|
||||||
|
/// If you don't know their identity yet, you can pass NULL, and their
|
||||||
|
/// identity will be established in the connection handshake.
|
||||||
|
///
|
||||||
|
/// If you use this, you probably want to call ISteamNetworkingUtils::InitRelayNetworkAccess()
|
||||||
|
/// when your app initializes
|
||||||
|
///
|
||||||
|
/// If you need to set any initial config options, pass them here. See
|
||||||
|
/// SteamNetworkingConfigValue_t for more about why this is preferable to
|
||||||
|
/// setting the options "immediately" after creation.
|
||||||
|
virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0;
|
||||||
|
|
||||||
|
/// Called when custom signaling has received a message. When your
|
||||||
|
/// signaling channel receives a message, it should save off whatever
|
||||||
|
/// routing information was in the envelope into the context object,
|
||||||
|
/// and then pass the payload to this function.
|
||||||
|
///
|
||||||
|
/// A few different things can happen next, depending on the message:
|
||||||
|
///
|
||||||
|
/// - If the signal is associated with existing connection, it is dealt
|
||||||
|
/// with immediately. If any replies need to be sent, they will be
|
||||||
|
/// dispatched using the ISteamNetworkingConnectionCustomSignaling
|
||||||
|
/// associated with the connection.
|
||||||
|
/// - If the message represents a connection request (and the request
|
||||||
|
/// is not redundant for an existing connection), a new connection
|
||||||
|
/// will be created, and ReceivedConnectRequest will be called on your
|
||||||
|
/// context object to determine how to proceed.
|
||||||
|
/// - Otherwise, the message is for a connection that does not
|
||||||
|
/// exist (anymore). In this case, we *may* call SendRejectionReply
|
||||||
|
/// on your context object.
|
||||||
|
///
|
||||||
|
/// In any case, we will not save off pContext or access it after this
|
||||||
|
/// function returns.
|
||||||
|
///
|
||||||
|
/// Returns true if the message was parsed and dispatched without anything
|
||||||
|
/// unusual or suspicious happening. Returns false if there was some problem
|
||||||
|
/// with the message that prevented ordinary handling. (Debug output will
|
||||||
|
/// usually have more information.)
|
||||||
|
///
|
||||||
|
/// If you expect to be using relayed connections, then you probably want
|
||||||
|
/// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes
|
||||||
|
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
|
||||||
|
|
||||||
|
/// 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
|
||||||
|
/// return the number of bytes that were populated. You can pass pBlob=NULL to query for the required
|
||||||
|
/// size. (256 bytes is a very conservative estimate.)
|
||||||
|
///
|
||||||
|
/// Pass this blob to your game coordinator and call SteamDatagram_CreateCert.
|
||||||
|
virtual bool GetCertificateRequest( int *pcbBlob, void *pBlob, SteamNetworkingErrMsg &errMsg ) = 0;
|
||||||
|
|
||||||
|
/// 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.
|
||||||
|
// So if you have code that is also targeting Steam, you should call this at about the
|
||||||
|
// same time you would call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks.
|
||||||
|
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
|
||||||
|
virtual void RunCallbacks( ISteamNetworkingSocketsCallbacks *pCallbacks ) = 0;
|
||||||
|
#endif
|
||||||
|
protected:
|
||||||
|
// ~ISteamNetworkingSockets(); // Silence some warnings
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ISTEAMNETWORKINGSOCKETS006
|
|
@ -40,11 +40,6 @@ public:
|
||||||
/// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL,
|
/// 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
|
/// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to
|
||||||
/// set each of these.
|
/// 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;
|
virtual SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer ) = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -57,11 +52,17 @@ public:
|
||||||
// Initialization and status check
|
// Initialization and status check
|
||||||
//
|
//
|
||||||
|
|
||||||
/// If you know that you are going to be using the relay network, call
|
/// If you know that you are going to be using the relay network (for example,
|
||||||
/// this to initialize the relay network or check if that initialization
|
/// because you anticipate making P2P connections), call this to initialize the
|
||||||
/// has completed. If you do not call this, the initialization will
|
/// relay network. If you do not call this, the initialization will
|
||||||
/// happen the first time you use a feature that requires access to the
|
/// be delayed until the first time you use a feature that requires access
|
||||||
/// relay network, and that use will be delayed.
|
/// 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
|
/// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
|
||||||
/// callbacks to know when initialization has completed.
|
/// callbacks to know when initialization has completed.
|
||||||
|
@ -317,7 +318,6 @@ protected:
|
||||||
#ifdef NETWORKSOCKETS_DLL
|
#ifdef NETWORKSOCKETS_DLL
|
||||||
#define SteamNetworkingUtils() SteamNetworkingUtilsX()
|
#define SteamNetworkingUtils() SteamNetworkingUtilsX()
|
||||||
#endif
|
#endif
|
||||||
#ifndef STEAM_API_EXPORTS
|
|
||||||
// Steamworks SDK
|
// Steamworks SDK
|
||||||
inline ISteamNetworkingUtils *SteamNetworkingUtils();
|
inline ISteamNetworkingUtils *SteamNetworkingUtils();
|
||||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils,
|
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils,
|
||||||
|
@ -325,11 +325,10 @@ protected:
|
||||||
gameserver one. Yes, this is a completely terrible hack */
|
gameserver one. Yes, this is a completely terrible hack */
|
||||||
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ?
|
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ?
|
||||||
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
|
||||||
)
|
)
|
||||||
#else
|
|
||||||
inline ISteamNetworkingUtils *SteamNetworkingUtils() { return (ISteamNetworkingUtils *)SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION );}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// A struct used to describe our readiness to use the relay network.
|
/// A struct used to describe our readiness to use the relay network.
|
||||||
|
|
|
@ -28,6 +28,7 @@ enum EParentalFeature
|
||||||
k_EFeatureParentalSetup = 10,
|
k_EFeatureParentalSetup = 10,
|
||||||
k_EFeatureLibrary = 11,
|
k_EFeatureLibrary = 11,
|
||||||
k_EFeatureTest = 12,
|
k_EFeatureTest = 12,
|
||||||
|
k_EFeatureSiteLicense = 13,
|
||||||
k_EFeatureMax
|
k_EFeatureMax
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ enum ERemoteStoragePublishedFileVisibility
|
||||||
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
|
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
|
||||||
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
|
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
|
||||||
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
|
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
|
||||||
|
k_ERemoteStoragePublishedFileVisibilityUnlisted = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
34
sdk_includes/isteamtv.h
Normal file
34
sdk_includes/isteamtv.h
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
#ifndef ISTEAMTV_H
|
||||||
|
#define ISTEAMTV_H
|
||||||
|
#ifdef STEAM_WIN32
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "steam_api_common.h"
|
||||||
|
#include "steamhttpenums.h"
|
||||||
|
|
||||||
|
struct SteamTVRegion_t {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ESteamTVRegionBehavior
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class ISteamTV
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool IsBroadcasting(int *pnNumViewers) = 0;
|
||||||
|
virtual void AddBroadcastGameData(const char * pchKey, const char * pchValue) = 0;
|
||||||
|
virtual void RemoveBroadcastGameData(const char * pchKey) = 0;
|
||||||
|
virtual void AddTimelineMarker(const char * pchTemplateName, bool bPersistent, uint8 nColorR, uint8 nColorG, uint8 nColorB) = 0;
|
||||||
|
virtual void RemoveTimelineMarker() = 0;
|
||||||
|
virtual uint32 AddRegion(const char * pchElementName, const char * pchTimelineDataSection, const SteamTVRegion_t * pSteamTVRegion, ESteamTVRegionBehavior eSteamTVRegionBehavior) = 0;
|
||||||
|
virtual void RemoveRegion(uint32 unRegionHandle) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define STEAMTV_INTERFACE_VERSION "STEAMTV_INTERFACE_V001"
|
||||||
|
|
||||||
|
#endif // ISTEAMTV_H
|
|
@ -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;
|
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.
|
// 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;
|
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.
|
// 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;
|
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)
|
// 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 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 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 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;
|
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.
|
// 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;
|
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
|
// 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;
|
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||||
|
|
||||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||||
|
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||||
|
|
||||||
// Steam Workshop Creator API
|
// Steam Workshop Creator API
|
||||||
|
|
|
@ -12,25 +12,6 @@
|
||||||
|
|
||||||
#include "steam_api_common.h"
|
#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
|
// Purpose: Functions for accessing and manipulating a steam account
|
||||||
// associated with one client instance
|
// associated with one client instance
|
||||||
|
|
|
@ -93,12 +93,19 @@ public:
|
||||||
virtual bool RequestCurrentStats() = 0;
|
virtual bool RequestCurrentStats() = 0;
|
||||||
|
|
||||||
// Data accessors
|
// Data accessors
|
||||||
|
STEAM_FLAT_NAME( GetStatInt32 )
|
||||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||||
|
|
||||||
|
STEAM_FLAT_NAME( GetStatFloat )
|
||||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||||
|
|
||||||
// Set / update data
|
// Set / update data
|
||||||
|
STEAM_FLAT_NAME( SetStatInt32 )
|
||||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||||
|
|
||||||
|
STEAM_FLAT_NAME( SetStatFloat )
|
||||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||||
|
|
||||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||||
|
|
||||||
// Achievement flag accessors
|
// Achievement flag accessors
|
||||||
|
@ -153,8 +160,12 @@ public:
|
||||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||||
|
|
||||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
// 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;
|
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 GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||||
|
|
||||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||||
// See notes for GetAchievementAndUnlockTime above
|
// See notes for GetAchievementAndUnlockTime above
|
||||||
virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
|
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;
|
virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0;
|
||||||
|
|
||||||
// Gets the lifetime totals for an aggregated stat
|
// Gets the lifetime totals for an aggregated stat
|
||||||
|
STEAM_FLAT_NAME( GetGlobalStatInt64 )
|
||||||
virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
|
virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
|
||||||
|
|
||||||
|
STEAM_FLAT_NAME( GetGlobalStatDouble )
|
||||||
virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0;
|
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.
|
// 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,
|
// 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
|
// etc. cubData is the size in bytes of the pubData buffer. Returns the number of
|
||||||
// elements actually set.
|
// elements actually set.
|
||||||
|
|
||||||
|
STEAM_FLAT_NAME( GetGlobalStatHistoryInt64 )
|
||||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0;
|
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;
|
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0;
|
||||||
|
|
||||||
#ifdef _PS3
|
#ifdef _PS3
|
||||||
|
|
|
@ -195,11 +195,11 @@ public:
|
||||||
#ifndef STEAM_API_EXPORTS
|
#ifndef STEAM_API_EXPORTS
|
||||||
// Global interface accessor
|
// Global interface accessor
|
||||||
inline ISteamUtils *SteamUtils();
|
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
|
// Global accessor for the gameserver client
|
||||||
inline ISteamUtils *SteamGameServerUtils();
|
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 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
|
|
||||||
// Access the IP
|
// Access the IP
|
||||||
uint32 GetIP() const;
|
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).
|
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||||
const char *GetConnectionAddressString() const;
|
const char *GetConnectionAddressString() const;
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
#include "isteamnetworkingsockets001.h"
|
#include "isteamnetworkingsockets001.h"
|
||||||
#include "isteamnetworkingsockets002.h"
|
#include "isteamnetworkingsockets002.h"
|
||||||
#include "isteamnetworkingsockets003.h"
|
#include "isteamnetworkingsockets003.h"
|
||||||
|
#include "isteamnetworkingsockets006.h"
|
||||||
#include "isteamremotestorage.h"
|
#include "isteamremotestorage.h"
|
||||||
#include "isteamremotestorage001.h"
|
#include "isteamremotestorage001.h"
|
||||||
#include "isteamremotestorage002.h"
|
#include "isteamremotestorage002.h"
|
||||||
|
@ -157,6 +158,9 @@
|
||||||
#include "isteamunifiedmessages.h"
|
#include "isteamunifiedmessages.h"
|
||||||
#include "isteaminput.h"
|
#include "isteaminput.h"
|
||||||
#include "isteamremoteplay.h"
|
#include "isteamremoteplay.h"
|
||||||
|
#include "isteamnetworkingsockets.h"
|
||||||
|
#include "isteamnetworkingutils.h"
|
||||||
|
#include "isteamtv.h"
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||||
|
@ -221,6 +225,7 @@ S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||||
S_API const char *SteamAPI_GetSteamInstallPath();
|
S_API const char *SteamAPI_GetSteamInstallPath();
|
||||||
|
|
||||||
// sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks
|
// 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 );
|
S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
|
||||||
|
|
||||||
// backwards compat export, passes through to SteamAPI_ variants
|
// backwards compat export, passes through to SteamAPI_ variants
|
||||||
|
@ -244,16 +249,78 @@ S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion,
|
||||||
S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID );
|
S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID );
|
||||||
#endif
|
#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
|
#ifndef STEAM_API_EXPORTS
|
||||||
|
|
||||||
// Deprecated! Use the global accessors directly
|
|
||||||
inline bool CSteamAPIContext::Init()
|
inline bool CSteamAPIContext::Init()
|
||||||
{
|
{
|
||||||
m_pSteamClient = ::SteamClient();
|
m_pSteamClient = ::SteamClient();
|
||||||
|
@ -280,9 +347,11 @@ inline bool CSteamAPIContext::Init()
|
||||||
if ( !m_pSteamGameSearch )
|
if ( !m_pSteamGameSearch )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#if !defined( IOSALL) // Not yet supported on iOS.
|
||||||
m_pSteamMatchmakingServers = ::SteamMatchmakingServers();
|
m_pSteamMatchmakingServers = ::SteamMatchmakingServers();
|
||||||
if ( !m_pSteamMatchmakingServers )
|
if ( !m_pSteamMatchmakingServers )
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_pSteamUserStats = ::SteamUserStats();
|
m_pSteamUserStats = ::SteamUserStats();
|
||||||
if ( !m_pSteamUserStats )
|
if ( !m_pSteamUserStats )
|
||||||
|
@ -328,7 +397,7 @@ inline bool CSteamAPIContext::Init()
|
||||||
if ( !m_pSteamMusicRemote )
|
if ( !m_pSteamMusicRemote )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifndef ANDROID // Not yet supported on Android
|
#if !defined( ANDROID ) && !defined( IOSALL) // Not yet supported on Android or ios.
|
||||||
m_pSteamHTMLSurface = ::SteamHTMLSurface();
|
m_pSteamHTMLSurface = ::SteamHTMLSurface();
|
||||||
if ( !m_pSteamHTMLSurface )
|
if ( !m_pSteamHTMLSurface )
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -95,6 +95,9 @@ extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallback
|
||||||
//
|
//
|
||||||
// Callbacks and call-results are queued automatically and are only
|
// Callbacks and call-results are queued automatically and are only
|
||||||
// delivered/executed when your application calls SteamAPI_RunCallbacks().
|
// 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.
|
// Dispatch all queued Steamworks callbacks.
|
||||||
|
@ -164,6 +167,7 @@ public:
|
||||||
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
|
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
friend class CCallbackMgr;
|
||||||
virtual void Run( void *pvParam ) = 0;
|
virtual void Run( void *pvParam ) = 0;
|
||||||
virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); }
|
virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); }
|
||||||
virtual int GetCallbackSizeBytes() { return sizeof_P; }
|
virtual int GetCallbackSizeBytes() { return sizeof_P; }
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -13,13 +13,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// Internal functions used by the utility CCallback objects to receive callbacks
|
// Internal functions used to locate/create interfaces
|
||||||
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 );
|
|
||||||
|
|
||||||
S_API HSteamPipe S_CALLTYPE SteamAPI_GetHSteamPipe();
|
S_API HSteamPipe S_CALLTYPE SteamAPI_GetHSteamPipe();
|
||||||
S_API HSteamUser S_CALLTYPE SteamAPI_GetHSteamUser();
|
S_API HSteamUser S_CALLTYPE SteamAPI_GetHSteamUser();
|
||||||
S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe();
|
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_FindOrCreateUserInterface( HSteamUser hSteamUser, const char *pszVersion );
|
||||||
S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( 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
|
// disable this warning; this pattern need for steam callback registration
|
||||||
#ifdef _MSVC_VER
|
#ifdef _MSVC_VER
|
||||||
#pragma warning( push )
|
#pragma warning( push )
|
||||||
|
@ -53,6 +78,8 @@ S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser
|
||||||
#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \
|
#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \
|
||||||
CCallback< thisclass, param, true > var; void func( param *pParam )
|
CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||||
|
|
||||||
|
#ifndef API_GEN
|
||||||
|
|
||||||
template< class T, class P >
|
template< class T, class P >
|
||||||
inline CCallResult<T, P>::CCallResult()
|
inline CCallResult<T, P>::CCallResult()
|
||||||
{
|
{
|
||||||
|
@ -154,10 +181,29 @@ inline void CCallback< T, P, bGameserver >::Run( void *pvParam )
|
||||||
(m_pObj->*m_Func)((P *)pvParam);
|
(m_pObj->*m_Func)((P *)pvParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#endif // #ifndef API_GEN
|
||||||
// Macros to define steam callback structures. Used internally for debugging
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
// 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
|
#ifdef STEAM_CALLBACK_INSPECTION_ENABLED
|
||||||
#include "../../clientdll/steam_api_callback_inspection.h"
|
#include "../../clientdll/steam_api_callback_inspection.h"
|
||||||
#else
|
#else
|
||||||
|
@ -263,36 +309,7 @@ enum { k_iClientPartiesCallbacks = 5400 };
|
||||||
enum { k_iSteamSTARCallbacks = 5500 };
|
enum { k_iSteamSTARCallbacks = 5500 };
|
||||||
enum { k_iClientSTARCallbacks = 5600 };
|
enum { k_iClientSTARCallbacks = 5600 };
|
||||||
enum { k_iSteamRemotePlayCallbacks = 5700 };
|
enum { k_iSteamRemotePlayCallbacks = 5700 };
|
||||||
|
enum { k_iClientCompatCallbacks = 5800 };
|
||||||
// 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 ) )
|
|
||||||
|
|
||||||
#ifdef _MSVC_VER
|
#ifdef _MSVC_VER
|
||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
|
|
|
@ -139,6 +139,8 @@ enum EResult
|
||||||
k_EResultAccountNotFriends = 111, // the user is not mutually friends
|
k_EResultAccountNotFriends = 111, // the user is not mutually friends
|
||||||
k_EResultLimitedUserAccount = 112, // the user is limited
|
k_EResultLimitedUserAccount = 112, // the user is limited
|
||||||
k_EResultCantRemoveItem = 113, // item can't be removed
|
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
|
// Error codes for use with the voice functions
|
||||||
|
@ -524,6 +526,7 @@ enum EVRHMDType
|
||||||
k_eEVRHMDType_Oculus_DK2 = 22, // Oculus DK2
|
k_eEVRHMDType_Oculus_DK2 = 22, // Oculus DK2
|
||||||
k_eEVRHMDType_Oculus_Rift = 23, // Oculus Rift
|
k_eEVRHMDType_Oculus_Rift = 23, // Oculus Rift
|
||||||
k_eEVRHMDType_Oculus_RiftS = 24, // Oculus Rift S
|
k_eEVRHMDType_Oculus_RiftS = 24, // Oculus Rift S
|
||||||
|
k_eEVRHMDType_Oculus_Quest = 25, // Oculus Quest
|
||||||
|
|
||||||
k_eEVRHMDType_Oculus_Unknown = 40, // // Oculus unknown HMD
|
k_eEVRHMDType_Oculus_Unknown = 40, // // Oculus unknown HMD
|
||||||
|
|
||||||
|
@ -563,7 +566,7 @@ enum EVRHMDType
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static inline bool BIsOculusHMD( EVRHMDType eType )
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,17 @@ struct SteamRelayNetworkStatus_t;
|
||||||
typedef uint32 HSteamNetConnection;
|
typedef uint32 HSteamNetConnection;
|
||||||
const HSteamNetConnection k_HSteamNetConnection_Invalid = 0;
|
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;
|
typedef uint32 HSteamListenSocket;
|
||||||
const HSteamListenSocket k_HSteamListenSocket_Invalid = 0;
|
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
|
/// Max length of diagnostic error message
|
||||||
const int k_cchMaxSteamNetworkingErrMsg = 1024;
|
const int k_cchMaxSteamNetworkingErrMsg = 1024;
|
||||||
|
|
||||||
|
@ -66,7 +73,7 @@ typedef uint32 SteamNetworkingPOPID;
|
||||||
/// microseconds. This is guaranteed to increase over time during the lifetime
|
/// 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
|
/// 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
|
/// the value wrapping around. Note that the underlying clock might not actually have
|
||||||
/// microsecond *resolution*.
|
/// microsecond resolution.
|
||||||
typedef int64 SteamNetworkingMicroseconds;
|
typedef int64 SteamNetworkingMicroseconds;
|
||||||
|
|
||||||
/// Describe the status of a particular network resource
|
/// Describe the status of a particular network resource
|
||||||
|
@ -182,6 +189,7 @@ struct SteamNetworkingIPAddr
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
uint8 m_ipv6[ 16 ];
|
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)
|
struct // IPv4 "mapped address" (rfc4038 section 4.2)
|
||||||
{
|
{
|
||||||
uint64 m_8zeros;
|
uint64 m_8zeros;
|
||||||
|
@ -189,6 +197,7 @@ struct SteamNetworkingIPAddr
|
||||||
uint16 m_ffff;
|
uint16 m_ffff;
|
||||||
uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order
|
uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order
|
||||||
} m_ipv4;
|
} m_ipv4;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
uint16 m_port; // Host byte order
|
uint16 m_port; // Host byte order
|
||||||
|
|
||||||
|
@ -761,6 +770,7 @@ struct SteamNetworkingMessage_t
|
||||||
inline void Release();
|
inline void Release();
|
||||||
|
|
||||||
// For code compatibility, some accessors
|
// For code compatibility, some accessors
|
||||||
|
#ifndef API_GEN
|
||||||
inline uint32 GetSize() const { return m_cbSize; }
|
inline uint32 GetSize() const { return m_cbSize; }
|
||||||
inline const void *GetData() const { return m_pData; }
|
inline const void *GetData() const { return m_pData; }
|
||||||
inline int GetChannel() const { return m_nChannel; }
|
inline int GetChannel() const { return m_nChannel; }
|
||||||
|
@ -768,6 +778,7 @@ struct SteamNetworkingMessage_t
|
||||||
inline int64 GetConnectionUserData() const { return m_nConnUserData; }
|
inline int64 GetConnectionUserData() const { return m_nConnUserData; }
|
||||||
inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; }
|
inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; }
|
||||||
inline int64 GetMessageNumber() const { return m_nMessageNumber; }
|
inline int64 GetMessageNumber() const { return m_nMessageNumber; }
|
||||||
|
#endif
|
||||||
protected:
|
protected:
|
||||||
// Declare destructor protected. You should never need to declare a message
|
// Declare destructor protected. You should never need to declare a message
|
||||||
// object on the stack or create one yourself.
|
// object on the stack or create one yourself.
|
||||||
|
@ -1220,6 +1231,7 @@ const SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( (uint32)'d' << 16U ) | (
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Internal stuff
|
// Internal stuff
|
||||||
|
#ifndef API_GEN
|
||||||
|
|
||||||
// For code compatibility
|
// For code compatibility
|
||||||
typedef SteamNetworkingMessage_t ISteamNetworkingMessage;
|
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 ); }
|
inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef API_GEN
|
||||||
|
|
||||||
#endif // #ifndef STEAMNETWORKINGTYPES
|
#endif // #ifndef STEAMNETWORKINGTYPES
|
||||||
|
|
|
@ -104,6 +104,7 @@ typedef unsigned int uintp;
|
||||||
#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";")
|
#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";")
|
||||||
#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";")
|
#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_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;
|
const int k_cubSaltSize = 8;
|
||||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||||
|
|
Loading…
Reference in a new issue