Hello everybody,
So that’s the thing, How the lobbies works in UE4?. Well, we’ve using some code of the Shooter game for implementing the basics of an online game. We get working, the Creation, the Find and the Join of any online Session, but now, we want to implement a lobby before a match starts. By the way, I’m using Steam, NOT Null system, because the Null system doesn’t has support for lobbies (Correct me If I’m wrong).
I’ve been trying to leave the session creation in a kind of pending state. How?, well, taking as example the ShooterGame, in the ShooterGameSession, we have a code similiar to this:
void OnCreateSessionComplete(FName SessionName, bool bWasSuccessful)
{
IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
Sessions->ClearOnCreateSessionCompleteDelegate(OnCreateSessionCompleteDelegate);
}
CreatePresenceSessionCompleteEvent.Broadcast(sessionName, bSuccesfully);
if (!bWasSuccessful)
{
OnDelayedSessionComplete();
}
}
The way I’ve been trying to implement a lobby (in a dirty way) is postponing the broadcast message. We try this first because the broadcast message was the one that triggers all the Travel sentences in the code.
It didn’t work.
Like I can’t get any documentation about the subject, I’d like to get any clue before continuing with other heavy implementation. I thought that the way to achieve a
lobby state (represented as a UI) is doing an explicit Travel to an Empty map. For example:
I begin the game in my Menu.umap, from here when I click on “Create match”, the game travels to a Lobby.umap. This .umap is just an empty map that is displaying a Menu with all the lobby stuff. Finally, when the players has joined in the lobby (i.e., the Login method of the GameSession has been executed in the client-Host side for each player), then the host, clicks on ‘Start Match’. Finally all the players travel to the Desired.umap with all specific parameters in the URL.
Am I having a good understanding? or maybe sor far of it?
Cheers