Dear valued Unreal Engine users,
Sessions can be thought of as a way for a host to advertise its status to other clients and a master server. As well as helping navigating any network topology such as NAT. It is not quite a party, lobby or game, as that required establishing a further connection for those specific protocols. It is basically the way to facilitate further connections between clients and a host, sometimes called a “Beacon”.
AGameSession
is basically a gameplay script wrapper around the lower level OnlineSession
. As the user undercover
mentioned it provides methods control the session, store which players are connected, as well as listen for specific events on the session, such as players joining, the session being destroyed or the session starting or ending. As all clients need to know what session they are connected to, as well who is connected to that session for presence, as well as other events, they also need their own AGameSession
.
It should also be noted that StartSession
is not route that creates and registers a session with an online service. This is done via calling CreateSession
first. For example in the case of ShooterGame
, CreateSession
is called from the GameInstance
. As undercover
indicates, StartSession
is usually used for games that either may have a lobby or a ready screen in game. So the game transitions to a “match started” or “in progress” state and after that point clients may not join until the session is ended (e.g. back to the lobby or waiting for more players) unless the session specifically allows joining in progress. A session is fully cleaned up and deregistered by using DestroySession
, and this is usually done outside of AGameSession
as well, such as in the GameInstance
.
Thank you for your continued support,