mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-09 22:28:38 +01:00
Call lobby invite callback when friend is invited.
This commit is contained in:
parent
b4205535fb
commit
40b9b0ef3d
1 changed files with 20 additions and 11 deletions
|
@ -1073,18 +1073,27 @@ void Callback(Common_Message *msg)
|
||||||
if (msg->has_friend_messages()) {
|
if (msg->has_friend_messages()) {
|
||||||
if (msg->friend_messages().type() == Friend_Messages::LOBBY_INVITE) {
|
if (msg->friend_messages().type() == Friend_Messages::LOBBY_INVITE) {
|
||||||
PRINT_DEBUG("Steam_Friends Got Lobby Invite\n");
|
PRINT_DEBUG("Steam_Friends Got Lobby Invite\n");
|
||||||
if (overlay->Ready())
|
Friend *f = find_friend(msg->source_id());
|
||||||
{
|
if (f) {
|
||||||
//TODO: the user should accept the invite first but we auto accept it because there's no gui yet
|
LobbyInvite_t data;
|
||||||
// Then we will handle it !
|
data.m_ulSteamIDUser = msg->source_id();
|
||||||
overlay->SetLobbyInvite(*find_friend(static_cast<uint64>(msg->source_id())), msg->friend_messages().lobby_id());
|
data.m_ulSteamIDLobby = msg->friend_messages().lobby_id();
|
||||||
}
|
data.m_ulGameID = f->appid();
|
||||||
else
|
|
||||||
{
|
|
||||||
GameLobbyJoinRequested_t data;
|
|
||||||
data.m_steamIDLobby = CSteamID((uint64)msg->friend_messages().lobby_id());
|
|
||||||
data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
|
|
||||||
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
|
||||||
|
if (overlay->Ready())
|
||||||
|
{
|
||||||
|
//TODO: the user should accept the invite first but we auto accept it because there's no gui yet
|
||||||
|
// Then we will handle it !
|
||||||
|
overlay->SetLobbyInvite(*find_friend(static_cast<uint64>(msg->source_id())), msg->friend_messages().lobby_id());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameLobbyJoinRequested_t data;
|
||||||
|
data.m_steamIDLobby = CSteamID((uint64)msg->friend_messages().lobby_id());
|
||||||
|
data.m_steamIDFriend = CSteamID((uint64)msg->source_id());
|
||||||
|
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue