1
0
Fork 0
mirror of https://gitlab.com/Mr_Goldberg/goldberg_emulator.git synced 2024-11-14 10:50:13 +01:00

Small improvements to last commit.

This commit is contained in:
Mr_Goldberg 2019-07-10 08:03:40 -04:00
parent b034ee8781
commit aa9e3c0c46
No known key found for this signature in database
GPG key ID: 8597D87419DEF278

View file

@ -776,6 +776,10 @@ void RequestFriendRichPresence( CSteamID steamIDFriend )
bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString )
{
PRINT_DEBUG("Steam_Friends::InviteUserToGame\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Friend *f = find_friend(steamIDFriend);
if (!f) return false;
Common_Message msg;
Friend_Messages *friend_messages = new Friend_Messages();
friend_messages->set_type(Friend_Messages::GAME_INVITE);
@ -1028,13 +1032,14 @@ void Callback(Common_Message *msg)
data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
if (msg->friend_messages().type() == Friend_Messages::GAME_INVITE) {
PRINT_DEBUG("Steam_Friends Got Game Invite\n");
//TODO: I'm pretty sure that the user should accept the invite before this is posted but we do like above
std::string const& connect_str = msg->friend_messages().connect_str();
GameRichPresenceJoinRequested_t data;
GameRichPresenceJoinRequested_t data = {};
data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
strncpy(data.m_rgchConnect, connect_str.c_str(), k_cchMaxRichPresenceValueLength);
strncpy(data.m_rgchConnect, connect_str.c_str(), k_cchMaxRichPresenceValueLength - 1);
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
}
}