mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 03:34:52 +01:00
Update to sdk 1.47
This commit is contained in:
parent
82eaf4f684
commit
262ee1d18f
42 changed files with 2581 additions and 175 deletions
10
dll/base.cpp
10
dll/base.cpp
|
|
@ -126,27 +126,27 @@ static unsigned generate_account_id()
|
|||
|
||||
CSteamID generate_steam_id_user()
|
||||
{
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDesktopInstance, k_EUniversePublic, k_EAccountTypeIndividual);
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance, k_EUniversePublic, k_EAccountTypeIndividual);
|
||||
}
|
||||
|
||||
static CSteamID generate_steam_anon_user()
|
||||
{
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDesktopInstance, k_EUniversePublic, k_EAccountTypeAnonUser);
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance, k_EUniversePublic, k_EAccountTypeAnonUser);
|
||||
}
|
||||
|
||||
CSteamID generate_steam_id_server()
|
||||
{
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDesktopInstance, k_EUniversePublic, k_EAccountTypeGameServer);
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance, k_EUniversePublic, k_EAccountTypeGameServer);
|
||||
}
|
||||
|
||||
CSteamID generate_steam_id_anonserver()
|
||||
{
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDesktopInstance, k_EUniversePublic, k_EAccountTypeAnonGameServer);
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance, k_EUniversePublic, k_EAccountTypeAnonGameServer);
|
||||
}
|
||||
|
||||
CSteamID generate_steam_id_lobby()
|
||||
{
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDesktopInstance | k_EChatInstanceFlagLobby, k_EUniversePublic, k_EAccountTypeChat);
|
||||
return CSteamID(generate_account_id(), k_unSteamUserDefaultInstance | k_EChatInstanceFlagLobby, k_EUniversePublic, k_EAccountTypeChat);
|
||||
}
|
||||
|
||||
#ifndef STEAM_WIN32
|
||||
|
|
|
|||
|
|
@ -162,6 +162,8 @@ static void *create_client_interface(const char *ver)
|
|||
steam_client = (ISteamClient017 *)get_steam_client();
|
||||
} else if (strcmp(ver, "SteamClient018") == 0) {
|
||||
steam_client = (ISteamClient018 *)get_steam_client();
|
||||
} else if (strcmp(ver, "SteamClient019") == 0) {
|
||||
steam_client = (ISteamClient019 *)get_steam_client();
|
||||
} else if (strcmp(ver, STEAMCLIENT_INTERFACE_VERSION) == 0) {
|
||||
steam_client = (ISteamClient *)get_steam_client();
|
||||
} else {
|
||||
|
|
|
|||
54
dll/flat.cpp
54
dll/flat.cpp
|
|
@ -54,6 +54,8 @@ STEAMAPI_API class ISteamGameServer * SteamAPI_ISteamClient_GetISteamGameServer(
|
|||
|
||||
STEAMAPI_API void SteamAPI_ISteamClient_SetLocalIPBinding(intptr_t instancePtr, uint32 unIP, uint16 usPort)
|
||||
{
|
||||
//Note: this function was updated but currently doesn't do anything so I'm just leaving it like this for now.
|
||||
//void SteamAPI_ISteamClient_SetLocalIPBinding(intptr_t instancePtr, const struct SteamIPAddress_t & unIP, uint16 usPort)
|
||||
return get_steam_client()->SetLocalIPBinding(unIP, usPort);
|
||||
}
|
||||
|
||||
|
|
@ -1106,6 +1108,18 @@ STEAMAPI_API int SteamAPI_ISteamUtils_FilterText(intptr_t instancePtr, char * pc
|
|||
return (ptr)->FilterText(pchOutFilteredText, nByteSizeOutFilteredText, pchInputMessage, bLegalOnly);
|
||||
}
|
||||
|
||||
STEAMAPI_API ESteamIPv6ConnectivityState SteamAPI_ISteamUtils_GetIPv6ConnectivityState(intptr_t instancePtr, ESteamIPv6ConnectivityProtocol eProtocol)
|
||||
{
|
||||
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_utils);
|
||||
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_utils);
|
||||
auto ptr = get_steam_client()->steam_gameserver_utils;
|
||||
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
|
||||
ptr = get_steam_client()->steam_utils;
|
||||
}
|
||||
|
||||
return (ptr)->GetIPv6ConnectivityState(eProtocol);
|
||||
}
|
||||
|
||||
STEAMAPI_API int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(intptr_t instancePtr)
|
||||
{
|
||||
return (get_steam_client()->steam_matchmaking)->GetFavoriteGameCount();
|
||||
|
|
@ -2236,7 +2250,7 @@ STEAMAPI_API bool SteamAPI_ISteamNetworking_AllowP2PPacketRelay(intptr_t instanc
|
|||
return ((ISteamNetworking *)instancePtr)->AllowP2PPacketRelay(bAllow);
|
||||
}
|
||||
|
||||
STEAMAPI_API SNetListenSocket_t SteamAPI_ISteamNetworking_CreateListenSocket(intptr_t instancePtr, int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay)
|
||||
STEAMAPI_API SNetListenSocket_t SteamAPI_ISteamNetworking_CreateListenSocket(intptr_t instancePtr, int nVirtualP2PPort, struct SteamIPAddress_t nIP, uint16 nPort, bool bAllowUseOfPacketRelay)
|
||||
{
|
||||
return ((ISteamNetworking *)instancePtr)->CreateListenSocket(nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
|
@ -2246,7 +2260,7 @@ STEAMAPI_API SNetSocket_t SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(in
|
|||
return ((ISteamNetworking *)instancePtr)->CreateP2PConnectionSocket(steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
||||
STEAMAPI_API SNetSocket_t SteamAPI_ISteamNetworking_CreateConnectionSocket(intptr_t instancePtr, uint32 nIP, uint16 nPort, int nTimeoutSec)
|
||||
STEAMAPI_API SNetSocket_t SteamAPI_ISteamNetworking_CreateConnectionSocket(intptr_t instancePtr, struct SteamIPAddress_t nIP, uint16 nPort, int nTimeoutSec)
|
||||
{
|
||||
return ((ISteamNetworking *)instancePtr)->CreateConnectionSocket(nIP, nPort, nTimeoutSec);
|
||||
}
|
||||
|
|
@ -2286,12 +2300,12 @@ STEAMAPI_API bool SteamAPI_ISteamNetworking_RetrieveData(intptr_t instancePtr, S
|
|||
return ((ISteamNetworking *)instancePtr)->RetrieveData(hListenSocket, pubDest, cubDest, pcubMsgSize, phSocket);
|
||||
}
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamNetworking_GetSocketInfo(intptr_t instancePtr, SNetSocket_t hSocket, class CSteamID * pSteamIDRemote, int * peSocketStatus, uint32 * punIPRemote, uint16 * punPortRemote)
|
||||
STEAMAPI_API bool SteamAPI_ISteamNetworking_GetSocketInfo(intptr_t instancePtr, SNetSocket_t hSocket, class CSteamID * pSteamIDRemote, int * peSocketStatus, struct SteamIPAddress_t * punIPRemote, uint16 * punPortRemote)
|
||||
{
|
||||
return ((ISteamNetworking *)instancePtr)->GetSocketInfo(hSocket, pSteamIDRemote, peSocketStatus, punIPRemote, punPortRemote);
|
||||
}
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamNetworking_GetListenSocketInfo(intptr_t instancePtr, SNetListenSocket_t hListenSocket, uint32 * pnIP, uint16 * pnPort)
|
||||
STEAMAPI_API bool SteamAPI_ISteamNetworking_GetListenSocketInfo(intptr_t instancePtr, SNetListenSocket_t hListenSocket, struct SteamIPAddress_t * pnIP, uint16 * pnPort)
|
||||
{
|
||||
return ((ISteamNetworking *)instancePtr)->GetListenSocketInfo(hListenSocket, pnIP, pnPort);
|
||||
}
|
||||
|
|
@ -2306,6 +2320,7 @@ STEAMAPI_API int SteamAPI_ISteamNetworking_GetMaxPacketSize(intptr_t instancePtr
|
|||
return ((ISteamNetworking *)instancePtr)->GetMaxPacketSize(hSocket);
|
||||
}
|
||||
|
||||
|
||||
STEAMAPI_API ScreenshotHandle SteamAPI_ISteamScreenshots_WriteScreenshot(intptr_t instancePtr, void * pubRGB, uint32 cubRGB, int nWidth, int nHeight)
|
||||
{
|
||||
return (get_steam_client()->steam_screenshots)->WriteScreenshot(pubRGB, cubRGB, nWidth, nHeight);
|
||||
|
|
@ -3230,6 +3245,19 @@ STEAMAPI_API bool SteamAPI_ISteamUGC_AddRequiredTag(intptr_t instancePtr, UGCQue
|
|||
return (ptr)->AddRequiredTag(handle, pTagName);
|
||||
}
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamUGC_AddRequiredTagGroup(intptr_t instancePtr, UGCQueryHandle_t handle, const struct SteamParamStringArray_t * pTagGroups)
|
||||
{
|
||||
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
|
||||
int test2 = ((char *)instancePtr - (char*)get_steam_client()->steam_gameserver_ugc);
|
||||
auto ptr = get_steam_client()->steam_gameserver_ugc;
|
||||
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
|
||||
ptr = get_steam_client()->steam_ugc;
|
||||
}
|
||||
|
||||
return (ptr)->AddRequiredTagGroup(handle, pTagGroups);
|
||||
}
|
||||
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamUGC_AddExcludedTag(intptr_t instancePtr, UGCQueryHandle_t handle, const char * pTagName)
|
||||
{
|
||||
int test1 = ((char *)instancePtr - (char*)get_steam_client()->steam_ugc);
|
||||
|
|
@ -4671,31 +4699,36 @@ STEAMAPI_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount(intptr_t instanceP
|
|||
return ((ISteamRemotePlay *)instancePtr)->GetSessionCount();
|
||||
}
|
||||
|
||||
STEAMAPI_API uint32 SteamAPI_ISteamRemotePlay_GetSessionID(intptr_t instancePtr, int iSessionIndex)
|
||||
STEAMAPI_API RemotePlaySessionID_t SteamAPI_ISteamRemotePlay_GetSessionID(intptr_t instancePtr, int iSessionIndex)
|
||||
{
|
||||
return ((ISteamRemotePlay *)instancePtr)->GetSessionID(iSessionIndex);
|
||||
}
|
||||
|
||||
STEAMAPI_API uint64 SteamAPI_ISteamRemotePlay_GetSessionSteamID(intptr_t instancePtr, uint32 unSessionID)
|
||||
STEAMAPI_API uint64 SteamAPI_ISteamRemotePlay_GetSessionSteamID(intptr_t instancePtr, RemotePlaySessionID_t unSessionID)
|
||||
{
|
||||
return ((ISteamRemotePlay *)instancePtr)->GetSessionSteamID(unSessionID).ConvertToUint64();
|
||||
}
|
||||
|
||||
STEAMAPI_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName(intptr_t instancePtr, uint32 unSessionID)
|
||||
STEAMAPI_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName(intptr_t instancePtr, RemotePlaySessionID_t unSessionID)
|
||||
{
|
||||
return ((ISteamRemotePlay *)instancePtr)->GetSessionClientName(unSessionID);
|
||||
}
|
||||
|
||||
STEAMAPI_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor(intptr_t instancePtr, uint32 unSessionID)
|
||||
STEAMAPI_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor(intptr_t instancePtr, RemotePlaySessionID_t unSessionID)
|
||||
{
|
||||
return ((ISteamRemotePlay *)instancePtr)->GetSessionClientFormFactor(unSessionID);
|
||||
}
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution(intptr_t instancePtr, uint32 unSessionID, int * pnResolutionX, int * pnResolutionY)
|
||||
STEAMAPI_API bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution(intptr_t instancePtr, RemotePlaySessionID_t unSessionID, int * pnResolutionX, int * pnResolutionY)
|
||||
{
|
||||
return ((ISteamRemotePlay *)instancePtr)->BGetSessionClientResolution(unSessionID, pnResolutionX, pnResolutionY);
|
||||
}
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite(intptr_t instancePtr, class CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamRemotePlay *)instancePtr)->BSendRemotePlayTogetherInvite(steamIDFriend);
|
||||
}
|
||||
|
||||
STEAMAPI_API bool SteamAPI_ISteamGameServer_InitGameServer(intptr_t instancePtr, uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char * pchVersionString)
|
||||
{
|
||||
return ((ISteamGameServer *)instancePtr)->InitGameServer(unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString);
|
||||
|
|
@ -4876,8 +4909,9 @@ STEAMAPI_API SteamAPICall_t SteamAPI_ISteamGameServer_GetServerReputation(intptr
|
|||
return ((ISteamGameServer *)instancePtr)->GetServerReputation();
|
||||
}
|
||||
|
||||
STEAMAPI_API uint32 SteamAPI_ISteamGameServer_GetPublicIP(intptr_t instancePtr)
|
||||
STEAMAPI_API struct SteamIPAddress_t SteamAPI_ISteamGameServer_GetPublicIP(intptr_t instancePtr)
|
||||
{
|
||||
//TODO: check if this actually works (ret value changed from uint32 to struct)
|
||||
return ((ISteamGameServer *)instancePtr)->GetPublicIP();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -256,6 +256,8 @@ ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSte
|
|||
return (ISteamGameServer *)(void *)(ISteamGameServer010 *)steam_gameserver;
|
||||
} else if (strcmp(pchVersion, "SteamGameServer011") == 0) {
|
||||
return (ISteamGameServer *)(void *)(ISteamGameServer011 *)steam_gameserver;
|
||||
} else if (strcmp(pchVersion, "SteamGameServer012") == 0) {
|
||||
return (ISteamGameServer *)(void *)(ISteamGameServer012 *)steam_gameserver;
|
||||
} else if (strcmp(pchVersion, STEAMGAMESERVER_INTERFACE_VERSION) == 0) {
|
||||
return (ISteamGameServer *)(void *)(ISteamGameServer *)steam_gameserver;
|
||||
} else {
|
||||
|
|
@ -269,7 +271,12 @@ ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSte
|
|||
// this must be set before CreateLocalUser()
|
||||
void Steam_Client::SetLocalIPBinding( uint32 unIP, uint16 usPort )
|
||||
{
|
||||
PRINT_DEBUG("SetLocalIPBinding %u %hu\n", unIP, usPort);
|
||||
PRINT_DEBUG("SetLocalIPBinding old %u %hu\n", unIP, usPort);
|
||||
}
|
||||
|
||||
void Steam_Client::SetLocalIPBinding( const SteamIPAddress_t &unIP, uint16 usPort )
|
||||
{
|
||||
PRINT_DEBUG("SetLocalIPBinding %i %u %hu\n", unIP.m_eType, unIP.m_unIPv4, usPort);
|
||||
}
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
|
|
@ -437,6 +444,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
|
|||
return (void *)(ISteamNetworkingSockets001 *) steam_networking_sockets_temp;
|
||||
} else if (strcmp(pchVersion, "SteamNetworkingSockets002") == 0) {
|
||||
return (void *)(ISteamNetworkingSockets002 *) steam_networking_sockets_temp;
|
||||
} else if (strcmp(pchVersion, "SteamNetworkingSockets003") == 0) {
|
||||
return (void *)(ISteamNetworkingSockets003 *) steam_networking_sockets_temp;
|
||||
} else {
|
||||
return (void *)(ISteamNetworkingSockets *) steam_networking_sockets_temp;
|
||||
}
|
||||
|
|
@ -452,6 +461,8 @@ void *Steam_Client::GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe
|
|||
} else if (strstr(pchVersion, "SteamNetworkingUtils") == pchVersion) {
|
||||
if (strcmp(pchVersion, "SteamNetworkingUtils001") == 0) {
|
||||
return (void *)(ISteamNetworkingUtils001 *)steam_networking_utils;
|
||||
} else if (strcmp(pchVersion, "SteamNetworkingUtils002") == 0) {
|
||||
return (void *)(ISteamNetworkingUtils002 *)steam_networking_utils;
|
||||
} else if (strcmp(pchVersion, STEAMNETWORKINGUTILS_INTERFACE_VERSION) == 0) {
|
||||
return (void *)(ISteamNetworkingUtils *)steam_networking_utils;
|
||||
} else {
|
||||
|
|
@ -599,6 +610,8 @@ ISteamNetworking *Steam_Client::GetISteamNetworking( HSteamUser hSteamUser, HSte
|
|||
return (ISteamNetworking *)(void *)(ISteamNetworking003 *)steam_networking_temp;
|
||||
} else if (strcmp(pchVersion, "SteamNetworking004") == 0) {
|
||||
return (ISteamNetworking *)(void *)(ISteamNetworking004 *)steam_networking_temp;
|
||||
} else if (strcmp(pchVersion, "SteamNetworking005") == 0) {
|
||||
return (ISteamNetworking *)(void *)(ISteamNetworking005 *)steam_networking_temp;
|
||||
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
|
||||
return (ISteamNetworking *)(void *)(ISteamNetworking *)steam_networking_temp;
|
||||
} else {
|
||||
|
|
@ -786,6 +799,8 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP
|
|||
return (ISteamUGC *)(void *)(ISteamUGC012 *)steam_ugc_temp;
|
||||
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION012") == 0) {
|
||||
return (ISteamUGC *)(void *)(ISteamUGC012 *)steam_ugc_temp;
|
||||
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION013") == 0) {
|
||||
return (ISteamUGC *)(void *)(ISteamUGC013 *)steam_ugc_temp;
|
||||
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
|
||||
return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp;
|
||||
} else {
|
||||
|
|
@ -1455,3 +1470,8 @@ void Steam_Client::RunCallbacks(bool runClientCB, bool runGameserverCB)
|
|||
PRINT_DEBUG("Steam_Client::RunCallbacks done\n");
|
||||
|
||||
}
|
||||
|
||||
void Steam_Client::DestroyAllInterfaces()
|
||||
{
|
||||
PRINT_DEBUG("Steam_Client::DestroyAllInterfaces\n");
|
||||
}
|
||||
|
|
@ -157,6 +157,7 @@ public:
|
|||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
void SetLocalIPBinding( uint32 unIP, uint16 usPort );
|
||||
void SetLocalIPBinding( const SteamIPAddress_t &unIP, uint16 usPort );
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion );
|
||||
|
|
@ -281,4 +282,6 @@ public:
|
|||
void clientShutdown();
|
||||
bool IsServerInit();
|
||||
bool IsUserLogIn();
|
||||
|
||||
void DestroyAllInterfaces();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -541,15 +541,22 @@ SteamAPICall_t Steam_GameServer::GetServerReputation()
|
|||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
uint32 Steam_GameServer::GetPublicIP()
|
||||
uint32 Steam_GameServer::GetPublicIP_old()
|
||||
{
|
||||
PRINT_DEBUG("GetPublicIP\n");
|
||||
PRINT_DEBUG("GetPublicIP_old\n");
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
uint32 ip = network->getOwnIP();
|
||||
PRINT_DEBUG("%X\n", ip);
|
||||
return ip;
|
||||
}
|
||||
|
||||
SteamIPAddress_t Steam_GameServer::GetPublicIP()
|
||||
{
|
||||
PRINT_DEBUG("GetPublicIP\n");
|
||||
SteamIPAddress_t ip = SteamIPAddress_t::IPv4Any();
|
||||
ip.m_unIPv4 = GetPublicIP_old();
|
||||
return ip;
|
||||
}
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
|
|
|
|||
|
|
@ -275,7 +275,8 @@ public:
|
|||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
uint32 GetPublicIP();
|
||||
uint32 GetPublicIP_old();
|
||||
SteamIPAddress_t GetPublicIP();
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ SNetListenSocket_t socket_number = 0;
|
|||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::CreateListenSocket %i %u %hu %u\n", nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay);
|
||||
PRINT_DEBUG("Steam_Networking::CreateListenSocket old %i %u %hu %u\n", nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
for (auto & c : listen_sockets) {
|
||||
if (c.nVirtualP2PPort == nVirtualP2PPort || c.nPort == nPort)
|
||||
|
|
@ -499,6 +499,13 @@ SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 n
|
|||
return socket.id;
|
||||
}
|
||||
|
||||
SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, SteamIPAddress_t nIP, uint16 nPort, bool bAllowUseOfPacketRelay )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::CreateListenSocket %i %i %u %hu %u\n", nVirtualP2PPort, nIP.m_eType, nIP.m_unIPv4, nPort, bAllowUseOfPacketRelay);
|
||||
//TODO: ipv6
|
||||
return CreateListenSocket(nVirtualP2PPort, nIP.m_unIPv4, nPort, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
||||
SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::CreateListenSocket old\n");
|
||||
|
|
@ -525,12 +532,18 @@ SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort
|
|||
|
||||
SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::CreateConnectionSocket %u %hu %i\n", nIP, nPort, nTimeoutSec);
|
||||
PRINT_DEBUG("Steam_Networking::CreateConnectionSocket_old %u %hu %i\n", nIP, nPort, nTimeoutSec);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
//TODO: nTimeoutSec
|
||||
return create_connection_socket((uint64)0, 0, nIP, nPort);
|
||||
}
|
||||
|
||||
SNetSocket_t CreateConnectionSocket( SteamIPAddress_t nIP, uint16 nPort, int nTimeoutSec )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::CreateConnectionSocket %i %u %hu %i\n", nIP.m_eType, nIP.m_unIPv4, nPort, nTimeoutSec);
|
||||
//TODO: ipv6
|
||||
return CreateConnectionSocket(nIP.m_unIPv4, nPort, nTimeoutSec);
|
||||
}
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
|
|
@ -692,7 +705,7 @@ bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDe
|
|||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::GetSocketInfo\n");
|
||||
PRINT_DEBUG("Steam_Networking::GetSocketInfo_old\n");
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
struct steam_connection_socket *socket = get_connection_socket(hSocket);
|
||||
if (!socket) return false;
|
||||
|
|
@ -717,12 +730,28 @@ bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocke
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, SteamIPAddress_t *punIPRemote, uint16 *punPortRemote )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::GetSocketInfo\n");
|
||||
//TODO: ipv6
|
||||
uint32 *ip_remote = NULL;
|
||||
if (punIPRemote) {
|
||||
ip_remote = &(punIPRemote->m_unIPv4);
|
||||
}
|
||||
|
||||
bool ret = GetSocketInfo(hSocket, pSteamIDRemote, peSocketStatus, ip_remote, punPortRemote );
|
||||
if (punIPRemote && ret) {
|
||||
punIPRemote->m_eType = k_ESteamIPTypeIPv4;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::GetListenSocketInfo\n");
|
||||
PRINT_DEBUG("Steam_Networking::GetListenSocketInfo_old\n");
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
auto conn = std::find_if(listen_sockets.begin(), listen_sockets.end(), [&hListenSocket](struct steam_listen_socket const& conn) { return conn.id == hListenSocket;});
|
||||
if (conn == listen_sockets.end()) return false;
|
||||
|
|
@ -731,6 +760,22 @@ bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16
|
|||
return true;
|
||||
}
|
||||
|
||||
bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, SteamIPAddress_t *pnIP, uint16 *pnPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking::GetListenSocketInfo\n");
|
||||
//TODO: ipv6
|
||||
uint32 *ip = NULL;
|
||||
if (pnIP) {
|
||||
ip = &(pnIP->m_unIPv4);
|
||||
}
|
||||
|
||||
bool ret = GetListenSocketInfo(hListenSocket, ip, pnPort );
|
||||
if (pnIP && ret) {
|
||||
pnIP->m_eType = k_ESteamIPTypeIPv4;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// returns true to describe how the socket ended up connecting
|
||||
ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket )
|
||||
|
|
|
|||
|
|
@ -238,6 +238,11 @@ HSteamListenSocket CreateListenSocket( int nSteamConnectVirtualPort, uint32 nIP,
|
|||
/// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t
|
||||
/// will be posted. The connection will be in the connecting state.
|
||||
HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateListenSocketIP old\n");
|
||||
}
|
||||
|
||||
HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateListenSocketIP\n");
|
||||
}
|
||||
|
|
@ -261,6 +266,11 @@ HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddre
|
|||
/// way of knowing who is actually on the other end, and thus are vulnerable to
|
||||
/// man-in-the-middle attacks.
|
||||
HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectByIPAddress old\n");
|
||||
}
|
||||
|
||||
HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectByIPAddress\n");
|
||||
}
|
||||
|
|
@ -277,7 +287,15 @@ HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address )
|
|||
/// when your app initializes
|
||||
HSteamListenSocket CreateListenSocketP2P( int nVirtualPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateListenSocketP2P %i\n", nVirtualPort);
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateListenSocketP2P old %i\n", nVirtualPort);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
return new_listen_socket(nVirtualPort);
|
||||
}
|
||||
|
||||
HSteamListenSocket CreateListenSocketP2P( int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateListenSocketP2P old %i\n", nVirtualPort);
|
||||
//TODO config options
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
return new_listen_socket(nVirtualPort);
|
||||
}
|
||||
|
|
@ -295,7 +313,7 @@ HSteamListenSocket CreateListenSocketP2P( int nVirtualPort )
|
|||
/// when your app initializes
|
||||
HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectP2P %u\n", nVirtualPort);
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectP2P old %i\n", nVirtualPort);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
||||
const SteamNetworkingIPAddr *ip = identityRemote.GetIPAddr();
|
||||
|
|
@ -315,6 +333,13 @@ HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, i
|
|||
return socket;
|
||||
}
|
||||
|
||||
HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectP2P %i\n", nVirtualPort);
|
||||
//TODO config options
|
||||
return ConnectP2P(identityRemote, nVirtualPort);
|
||||
}
|
||||
|
||||
/// Creates a connection and begins talking to a remote destination. The remote host
|
||||
/// must be listening with a matching call to CreateListenSocket.
|
||||
///
|
||||
|
|
@ -567,6 +592,9 @@ EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, u
|
|||
/// 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)
|
||||
|
|
@ -576,7 +604,7 @@ EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, u
|
|||
/// 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 )
|
||||
EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags, int64 *pOutMessageNumber )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::SendMessageToConnection %u, len %u, flags %i\n", hConn, cbData, nSendFlags);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
|
@ -603,6 +631,50 @@ virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *
|
|||
return k_EResultFail;
|
||||
}
|
||||
|
||||
EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::SendMessageToConnection old %u, len %u, flags %i\n", hConn, cbData, nSendFlags);
|
||||
return SendMessageToConnection(hConn, pData, cbData, nSendFlags, NULL);
|
||||
}
|
||||
|
||||
/// 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.
|
||||
void SendMessages( int nMessages, SteamNetworkingMessage_t *const *pMessages, int64 *pOutMessageNumberOrResult )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::SendMessages\n");
|
||||
}
|
||||
|
||||
|
||||
/// If Nagle is enabled (its on by default) then when calling
|
||||
/// SendMessageToConnection the message will be queued up the Nagle time
|
||||
/// before being sent to merge small messages into the same packet.
|
||||
|
|
@ -637,7 +709,7 @@ SteamNetworkingMessage_t *get_steam_message_connection(HSteamNetConnection hConn
|
|||
pMsg->m_cbSize = size;
|
||||
memcpy(pMsg->m_pData, connect_socket->second.data.front().data(), size);
|
||||
pMsg->m_conn = hConn;
|
||||
pMsg->m_sender = connect_socket->second.remote_identity;
|
||||
pMsg->m_identityPeer = connect_socket->second.remote_identity;
|
||||
pMsg->m_nConnUserData = connect_socket->second.user_data;
|
||||
//TODO
|
||||
//pMsg->m_usecTimeReceived =
|
||||
|
|
@ -957,7 +1029,7 @@ int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameSer
|
|||
/// when your app initializes
|
||||
HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectToHostedDedicatedServer\n");
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectToHostedDedicatedServer old\n");
|
||||
}
|
||||
|
||||
/// Client call to connect to a server hosted in a Valve data center, on the specified virtual
|
||||
|
|
@ -968,9 +1040,13 @@ HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentit
|
|||
/// connection to Steam or the central backend, or the app is restarted or crashes, etc.
|
||||
HSteamNetConnection ConnectToHostedDedicatedServer( CSteamID steamIDTarget, int nVirtualPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectToHostedDedicatedServer old\n");
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectToHostedDedicatedServer older\n");
|
||||
}
|
||||
|
||||
HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectToHostedDedicatedServer\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Servers hosted in Valve data centers
|
||||
|
|
@ -1058,7 +1134,24 @@ virtual EResult GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRo
|
|||
/// Note that this call MUST be made through the SteamNetworkingSocketsGameServer() interface
|
||||
HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateHostedDedicatedServerListenSocket %i\n", nVirtualPort);
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateHostedDedicatedServerListenSocket old %i\n", nVirtualPort);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
return new_listen_socket(nVirtualPort);
|
||||
}
|
||||
|
||||
/// 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.
|
||||
HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::CreateHostedDedicatedServerListenSocket old %i\n", nVirtualPort);
|
||||
//TODO config options
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
return new_listen_socket(nVirtualPort);
|
||||
}
|
||||
|
|
@ -1172,6 +1265,85 @@ EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin *
|
|||
PRINT_DEBUG("Steam_Networking_Sockets::GetGameCoordinatorServerLogin\n");
|
||||
}
|
||||
|
||||
//
|
||||
// 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.
|
||||
HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nOptions, const SteamNetworkingConfigValue_t *pOptions )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ConnectP2PCustomSignaling\n");
|
||||
}
|
||||
|
||||
/// 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
|
||||
bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Sockets::ReceivedP2PCustomSignal\n");
|
||||
}
|
||||
|
||||
// TEMP KLUDGE Call to invoke all queued 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
|
||||
|
|
|
|||
|
|
@ -65,6 +65,32 @@ Steam_Networking_Utils(class Settings *settings, class Networking *network, clas
|
|||
this->run_every_runcb->remove(&Steam_Networking_Utils::steam_run_every_runcb, this);
|
||||
}
|
||||
|
||||
/// Allocate and initialize a message object. Usually the reason
|
||||
/// you call this is to pass it to ISteamNetworkingSockets::SendMessages.
|
||||
/// The returned object will have all of the relevant fields cleared to zero.
|
||||
///
|
||||
/// Optionally you can also request that this system allocate space to
|
||||
/// hold the payload itself. If cbAllocateBuffer is nonzero, the system
|
||||
/// will allocate memory to hold a payload of at least cbAllocateBuffer bytes.
|
||||
/// m_pData will point to the allocated buffer, m_cbSize will be set to the
|
||||
/// size, and m_pfnFreeData will be set to the proper function to free up
|
||||
/// the buffer.
|
||||
///
|
||||
/// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL,
|
||||
/// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to
|
||||
/// set each of these.
|
||||
///
|
||||
/// You can use SteamNetworkingMessage_t::Release to free up the message
|
||||
/// bookkeeping object and any associated buffer. See
|
||||
/// ISteamNetworkingSockets::SendMessages for details on reference
|
||||
/// counting and ownership.
|
||||
SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer )
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Utils::AllocateMessage\n");
|
||||
//TODO
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool InitializeRelayAccess()
|
||||
{
|
||||
PRINT_DEBUG("Steam_Networking_Utils::InitializeRelayAccess\n");
|
||||
|
|
|
|||
|
|
@ -105,6 +105,14 @@ bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *p
|
|||
return false;
|
||||
}
|
||||
|
||||
// Invite a friend to Remote Play Together
|
||||
// This returns false if the invite can't be sent
|
||||
bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend )
|
||||
{
|
||||
PRINT_DEBUG("Steam_RemotePlay::BSendRemotePlayTogetherInvite\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
void RunCallbacks()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,11 @@ bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool AddRequiredTagGroup( UGCQueryHandle_t handle, const SteamParamStringArray_t *pTagGroups )
|
||||
{
|
||||
PRINT_DEBUG("Steam_UGC::AddRequiredTagGroup\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -370,4 +370,12 @@ int FilterText( char* pchOutFilteredText, uint32 nByteSizeOutFilteredText, const
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Return what we believe your current ipv6 connectivity to "the internet" is on the specified protocol.
|
||||
// This does NOT tell you if the Steam client is currently connected to Steam via ipv6.
|
||||
ESteamIPv6ConnectivityState GetIPv6ConnectivityState( ESteamIPv6ConnectivityProtocol eProtocol )
|
||||
{
|
||||
PRINT_DEBUG("GetIPv6ConnectivityState\n");
|
||||
return k_ESteamIPv6ConnectivityState_Unknown;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue