From c26ff7cb0780a7fc4fec86a94675cbf14c13b8ff Mon Sep 17 00:00:00 2001 From: djdron Date: Wed, 24 Nov 2021 16:36:24 +0200 Subject: [PATCH] Able to send messages with any SteamNetworkingIdentity type --- .../clientlib/csteamnetworkingmessages.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/steamnetworkingsockets/clientlib/csteamnetworkingmessages.cpp b/src/steamnetworkingsockets/clientlib/csteamnetworkingmessages.cpp index f25df809..3b51e184 100644 --- a/src/steamnetworkingsockets/clientlib/csteamnetworkingmessages.cpp +++ b/src/steamnetworkingsockets/clientlib/csteamnetworkingmessages.cpp @@ -416,16 +416,10 @@ CSteamNetworkingMessages::~CSteamNetworkingMessages() EResult CSteamNetworkingMessages::SendMessageToUser( const SteamNetworkingIdentity &identityRemote, const void *pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ) { - // FIXME SteamNetworkingIdentity - if ( identityRemote.GetSteamID64() == 0 ) + if ( identityRemote.IsInvalid() ) { - AssertMsg1( false, "Identity %s isn't valid for Messages sessions. (Only SteamIDs currently supported).", SteamNetworkingIdentityRender( identityRemote ).c_str() ); - return k_EResultInvalidSteamID; - } - if ( !IsValidSteamIDForIdentity( identityRemote.GetSteamID() ) ) - { - AssertMsg1( false, "%s isn't valid SteamID for identity.", identityRemote.GetSteamID().Render() ); - return k_EResultInvalidSteamID; + AssertMsg( false, "Identity isn't valid for Messages sessions." ); + return k_EResultFail; } SteamNetworkingGlobalLock scopeLock( "SendMessageToUser" ); // !SPEED! Can we avoid this?