I’m creating a lobby system for my game based on Online sybsystem, and in my game I use listing server. Now clients can connect to server and interact each other. The problem is: player can leave lobby (it means move back to main menu), but session still register this player as connected. For example, host creates a lobby (1 player connected), client connects session (2 players connected), but if client leave lobby, there would be 2 players connected despite in lobby only one player. Is where any way to disconnect player from server?
Just in case: amount of players in lobby is
FOnlineSessionSearchResult Data;
int PlayersNum = Data.Session.SessionSettings.NumPublicConnections-Data.Session.NumOpenPublicConnections;
and for removing player from lobby I use AGameSession::KickPlayer
(now the only way to leave lobby is to be kicked).