Worked great for us. We did add a parameter passed in, FString UserSteamID, where we collect all the steam ID’s of joined players as hexadecimal strings. When each player joins they send a message to the server to add their steam ID hex string to the Player State on the server.
Then we can convert back and forth…
CSteamID USteamBridge::SteamIDStringToCSteamID(FString s)
{
uint64 i64 = 0;
int convCount = sscanf_s( TCHAR_TO_ANSI(*s), "%llu", &i64 );
if (convCount == 0)
{
UE_LOG(DSS_STEAM, Log, TEXT("SteamIDStringToCSteamID - invalid input string %s"), *s);
return CSteamID((uint64)0);
}
return CSteamID(i64);
}
FString USteamBridge::CSteamIDToString(CSteamID i)
{
sprintf_s( steamidbuf, sizeof(steamidbuf), "%llu", i.ConvertToUint64() );
return FString(steamidbuf);
}
Then we can get the avatar of any player.
(top of the function)
UTexture2D * USteamBridge::GetSteamAvatar(FString PlayerSteamID) {
uint32 Width;
uint32 Height;
if (SteamAPI_IsSteamRunning())
{
CSteamID PlayerRawID = SteamIDStringToCSteamID(PlayerSteamID);
//Getting the PictureID from the SteamAPI and getting the Size with the ID
int Picture = SteamFriends()->GetMediumFriendAvatar(PlayerRawID);