From d86721afcbd73dd03b143081f9c80b49c848263c Mon Sep 17 00:00:00 2001 From: Nemirtingas Date: Mon, 13 Jul 2020 23:22:36 +0200 Subject: [PATCH] Implement SteamNetworkingIdentity_ToString for volcanoids --- dll/steam_networking_utils.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dll/steam_networking_utils.h b/dll/steam_networking_utils.h index 533d0a8..ed7022b 100644 --- a/dll/steam_networking_utils.h +++ b/dll/steam_networking_utils.h @@ -349,6 +349,23 @@ bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) { PRINT_DEBUG("Steam_Networking_Utils::SteamNetworkingIdentity_ToString\n"); + if (identity.m_eType == k_ESteamNetworkingIdentityType_SteamID) + { + if (buf != nullptr) + { + std::string str("steamid:"); + str += std::move(std::to_string(identity.GetSteamID64())); + strncpy(buf, str.c_str(), cbBuf); + buf[cbBuf - 1] = '\0'; + } + } + else + { + if (cbBuf != 0 && buf != nullptr) + { + *buf = '\0'; + } + } } bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr )