Notify server when a player leave a session

Hello,

I’m actually using “Advanced Session” & “Advanced Steam Session”.

I’m trying to find an efficient way to notify the server, or directly cast to GameInstance, each time a (client) player leave a session.

Thanks a lot everyone for your time & your help.
Please have a good day !

Hey, there is an event you could use called “Event OnLogout” it’s in the GameMode.

Thank you for your answer…however what if the player just “Alt+F4” for exemple in order to leave a party ?

What I did was to have an “Event OnSwapPlayerControllers”, Save that to an array of type “Player Controller”.

Then once you have the number of connected players, you could put an EventLogout in your Gamemode that finds the player thats leaving the game using a For Each Loop with Break, then remove that index from the array, send it to the server, and finally Destroy Session on the Game Instance.

I also recommend this tutorial series.