Hi!!
I’m currently working (and learning about) on a multiplayer game and i’m still a bit confused. Can I create a new session without open a new map?? I’m using as code base the Shooter Example and it uses this:
IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
if (Sessions.IsValid() && CurrentSessionParams.UserId.IsValid())
{
HostSettings = MakeShareable(new FAPOnlineSessionSettings(bIsLAN, bIsPresence, MaxPlayers));
HostSettings->Set(SETTING_GAMEMODE, GameType, EOnlineDataAdvertisementType::ViaOnlineService);
HostSettings->Set(SETTING_MAPNAME, MapName, EOnlineDataAdvertisementType::ViaOnlineService);
HostSettings->Set(SETTING_MATCHING_HOPPER, FString("TeamDeathmatch"), EOnlineDataAdvertisementType::DontAdvertise);
HostSettings->Set(SETTING_MATCHING_TIMEOUT, 120.0f, EOnlineDataAdvertisementType::ViaOnlineService);
HostSettings->Set(SETTING_SESSION_TEMPLATE_NAME, FString("GameSession"), EOnlineDataAdvertisementType::DontAdvertise);
HostSettings->Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineDataAdvertisementType::ViaOnlineService);
OnCreateSessionCompleteDelegateHandle = Sessions->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
return Sessions->CreateSession(*CurrentSessionParams.UserId, CurrentSessionParams.SessionName, *HostSettings);
}
My idea is about manage the host session in the main menu, showing a window where the host can setup the map, match time and other settings, wait for people who join to this session and then choose one of these connected users (the game will be 1vs1 but a lot of players can connect until the host choose the oponent). Finally when the oponent is choosen the host push the “start” button and both travel to the gameplay map.
Is that possible?? or I should open a new level and the show the host settings window??
Thanks!