Dear Sirs,
I have a problem. I’m working on a multiplayer game right now that is using UE 4.14.1. We’re sticking to C++ (not templates) for most of the development.
We’ve started implementing a barebone multiplayer based on the ShooterGame.
Just like the shooter game, we have our GameInstance (GI) call methods within our Session class / instance, with backpropogation of callbacks.
We have our Menus done in 3D, so we have a game mode for that. When a player chooses to host a game from the menu, the MenuGameMode calls on GI to host a session. The code for that is basically identical to the shooter game, i.e. in the FinishSessionCreation method of the GI we call
GetWorld()->ServerTravel(TravelURL);
When we test this in the editor, the hosting (server) instance of the game transitions to a different map, which switches it from MenuGameMode to ArenaGameMode.
When the “joining” player on the other machine chooses to join a game from the menu, the same operations for FindSession and JoinSession are used as in the ShooterGame.
As a result of joining the session, this travel function is called from the joining GI:
PlayerController->ClientTravel(URL, TRAVEL_Absolute);
We know the connection succeeds, i.e. we can see “Sending hello” to the IP of the hosting machine in the logs.
However, for the joining player nothing changes, i.e. he remains in the menu and does not transition to the other map.
Now, we have PreLogin and PostLogin implemented for our base GameMode class, the code is exactly the same as in the ShooterGame.
However, these functions are not getting called on the hosting machine when the other player is joining.
What am I doing wrong?
P.S. some background: we’re running both instances of the game from within the editor. We cannot do the same for the ShooterGame in its current state and try to trace its logs, since trying to host or join while running it from the editor crashed every time so far.