what’s the “right” way to leave a previously joined session? I’ve always thought that a simple “open level” node would disconnect the client completely from the actual session but if I use this method I have the problem that I can not join a new session anymore until I restart the complete executable of my game.
If I use the “open level” node in conjunction with “destroy session” (on the client side!) it works… this seems very weird to me.
So what’s the right way to do this?
Hi, you need to call Destroy Session using some in game menu with a Quit/Leave Game button or similar. We tied the OnClick event of the Leave Game Button to call a custom event called DestroySessCaller in GameInstance wich call “Destroy Session” function, this function is from engine Online Subsystem.
Edit: Notice that the Leave Game should open a “MainMenu” level and after it does you call Destroy Session
You can take a look at Multiplayer Shooter game example that epic provides for free, we based on that.
In any case my thoughts are that as you use Leave Game logic for both (Server/Hosting Player and Client Player) then the Open MainMenu map and the Destroy Session works for both cases using same logic. Server player will load mainmenu map while also destroying his session (wich will kick the clients) and for the client open a new map forces to leave the sessioned map and maybe the destroy session just fails but who cares if it allows client to join other or the same session again… is not his session he just join to it…
That is far to be technichal but is the way I think of it… hehe