mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 20:38:07 +01:00
Small improvements to last commit.
This commit is contained in:
parent
b034ee8781
commit
aa9e3c0c46
1 changed files with 8 additions and 3 deletions
|
@ -776,6 +776,10 @@ void RequestFriendRichPresence( CSteamID steamIDFriend )
|
||||||
bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString )
|
bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString )
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Friends::InviteUserToGame\n");
|
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;
|
Common_Message msg;
|
||||||
Friend_Messages *friend_messages = new Friend_Messages();
|
Friend_Messages *friend_messages = new Friend_Messages();
|
||||||
friend_messages->set_type(Friend_Messages::GAME_INVITE);
|
friend_messages->set_type(Friend_Messages::GAME_INVITE);
|
||||||
|
@ -1031,10 +1035,11 @@ void Callback(Common_Message *msg)
|
||||||
|
|
||||||
if (msg->friend_messages().type() == Friend_Messages::GAME_INVITE) {
|
if (msg->friend_messages().type() == Friend_Messages::GAME_INVITE) {
|
||||||
PRINT_DEBUG("Steam_Friends Got Game Invite\n");
|
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();
|
std::string const& connect_str = msg->friend_messages().connect_str();
|
||||||
GameRichPresenceJoinRequested_t data;
|
GameRichPresenceJoinRequested_t data = {};
|
||||||
data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
|
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));
|
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue