Hi,
Is it possible for the clients to jump (separately) back and forth in every available levels ? (think of an mmo with different continents, or with outside world / inside buildings, etc.)
Can the server follow everything that is going on ?
What would be the best strategy to achieve that ?
So far i have tried my hands on 3 functions:
//UGameplayStatics::OpenLevel(GetWorld(), "World'/Game/maps/NightMap.NightMap'", 0, "");
//GetWorld()->GetFirstPlayerController()->ClientTravel("/Game/maps/NightMap", TRAVEL_MAX, true, FGuid());
//GetWorld()->ServerTravel("World'/Game/maps/NightMap.NightMap'");
using local calls, then client-rpc, then server-rpc, trying various values of ETravelType among the 4 available, trying references, full path and simple name for the levels.
Not sure i exactly tried every possible combinations though (some work partially, some give crash…), so maybe i missed the right one.
Also, I couldn’t test GEngine->LoadMap because i could never find a way to have it compiled. Maybe it is the one ?
The best i could come up with was this:
void AYagMenuWelcomeHUD::LoadOneMap()
{
GetWorld()->GetFirstPlayerController()->ClientTravel("/Game/maps/WelcomeMap", TRAVEL_MAX, true, FGuid());
}
void AYagMenuWelcomeHUD::LoadOtherMap()
{
GetWorld()->GetFirstPlayerController()->ClientTravel("/Game/maps/NightMap", TRAVEL_MAX, true, FGuid());
}
Those functions are called from within my HUD on button click for test purposes.
Clients and server can switch map, but as soon as they teleport, they loose trace of each other and i end up with several single player games.
Not sure i am using the right strategy, so any pointer is welcome.
Thanks
Cedric