Hello,
I want to ask if there is any option to get a notification/callback about the Online status of my following friend.
{Usecase}
First, we get the friendlist:
Client->GetFriends(Session, Limit, FriendshipState, Cursor, GetFriendsSuccessDelegate, GetFriendsErrorDelegate);
where we get Online status:
FNakamaFriendList->NakamaUsers->NakamaUser->Online // Indicates whether the user is currently online
This is fine, we know if there friend is online or offline.
We also use the Following. We follow all our friends:
RealtimeClient->FollowUsers({ Friends.NakamaUsers[i].NakamaUser.Id }, FollowUsersSuccessDelegate, FollowUsersErrorDelegate);
Now, we can get notifications when my friend change the status. We are using
void SetStatusPresenceCallback(const TFunction<void(const FNakamaStatusPresenceEvent&)>& Callback) { OnStatusPresenceEvent = Callback; }
But it is only about the Presence and switching to Online state.
But we need to catch cases when our friend has connection problems or his game crashes.
In this case, the RealTimeClient knows that the friend was disconnected, right?
We can call GetFriends again and check the FNakamaFriendList->NakamaUsers->NakamaUser->Online, but it’s not nice. We need to have timer and call GetFriends in the cycle.
We need a notification/callback if the following friend is disconnected. Does there exist any option how to do this? Or is it possible to add a similar callback for this feature?
{Details}
- Versions: Nakama Unreal 2.9.4
- Nakama Server 3.18.0