Steam servertravel not taking clients

I’m working on a networked multiplayer game. We have a working game as is, are able to connect to a listen server, travel between maps, etc. But I’m trying to switch us over to connecting via Steam sockets now, and hitting a problem. All of my Steam SDK stuff is up and working, and I’m able to get my Steam ID through UE4 via GetResolvedConnectString after I create a game session. Other players are then able to join my game by the console command “Open steam.######################” with the given ID.

I was having some trouble with the OnlineSubsystem interface for finding sessions, so simplified (for the moment) to connecting manually by console command. This works, but when I use ServerTravel to relocate everyone to another map, only the server changes map. The clients disconnect.

I’m making the ServerTravel call in a PlayerController function as follows:

 FString StartStr = "/Game/HIT_Maps/Main_Level";

 GetWorld()->ServerTravel(StartStr);

The same thing happens if I use the ServerTravel console command. Before I started switching the project’s networking to Steam, both worked perfectly. Of note, I was also not using the Online Subsystem interface before, instead saving off IP addresses to a web database when hosting and pulling them down when joining. We could ServerTravel without problem then.

Would the fact that I’m creating a Game Session, then joining directly via console commands somehow be affecting this? Or is it a Steam thing? Or am I crazy?

#ShooterGame GameSession

Check out ShooterGame/Online/GameSession.h!

There’s a ClientTravel function that you should probably be using somehow :slight_smile:

bool AShooterGameSession::TravelToSession(int32 ControllerId, FName SessionName)
{
	IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
	if (OnlineSub)
	{
		FString URL;
		IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
		if (Sessions.IsValid() && Sessions->GetResolvedConnectString(SessionName, URL))
		{
			APlayerController* PC = UGameplayStatics::GetPlayerController(GetWorld(), ControllerId);
			if (PC)
			{
				PC->ClientTravel(URL, TRAVEL_Absolute);
				return true;
			}
		}
		else
		{
			UE_LOG(LogOnlineGame, Warning, TEXT("Failed to join session %s"), *SessionName.ToString());
		}
	}
#if !UE_BUILD_SHIPPING
	else
	{
		APlayerController* PC = UGameplayStatics::GetPlayerController(GetWorld(), ControllerId);
		if (PC)
		{
			FString LocalURL(TEXT("127.0.0.1"));
			PC->ClientTravel(LocalURL, TRAVEL_Absolute);
			return true;
		}
	}
#endif //!UE_BUILD_SHIPPING

	return false;
}

Thanks for the reply, Rama. I believe ClientTravel is used here (and in my code as well) to connect a client to the server steam ID / game session. But I think ClientTravel only affects the local player, so if called on the server it would disconnect all clients, and if called on a client, will disconnect that client, in the process doing the map change requested, just locally. Of course, I could be totally wrong. :slight_smile: But that’s what I’ve gathered.

I’ve made some progress, though. For one, I have players hosting, searching for, and connecting to games through the steam subsystem interface completely now, so no more shouting steam IDs at each other or posting and pulling them from our SQL database.

Also, I turned on bUseSeamlessTravel on my game mode, and now when I call ServerTravel, both players change map–but! Half a second later, the client disconnects and returns to the starting map. I had been having a similar problem even connecting players through the steam online subsystem–clients would join, then immediately get kicked. That was due to the bug indicated here by Josh Markiewicz and when I fixed that players connected no problem. I don’t think this is especially related, because I don’t get the logged error from before:

 LogNet:Error: ReceivedBunch: RPC_GetLastFailedReason: ServerUnmutePlayer_Validate

But the effect is very similar. However, if instead of ServerTraveling to my main game map (which is the goal), I travel to a basic map with a basic game mode and no pawns, this actually works. Both players get there. So I’m currently testing to figure out whether it’s a problem with the other map or the game mode or what. I’ll post error logs or info as I get them.

My hyperlink doesn’t seem to be working. For anyone curious, the bug I was talking about is here: Why does ServerUnmutePlayer() fail on client connect? - Platform & Builds - Epic Developer Community Forums

I have encountered the same problem. But I’m using 4.5.1, there’s no bug in my case. My dedicated server can’t do seamless travel with client. Have you managed to do this?

Hi, we are encountering the same issue with 4.7

Were you able to find a solution?

Thanks,

We had a problem with server travel and steam but solved it by switching to 4.8 and turning on seamless travel in our GameMode

Same issue here, both with UE4.10 and UE4.11…

https://answers.unrealengine.com/questions/381639/clients-lose-connection-during-servertravel-with-o.html

Hi,

Since we have the same issue with 4.10 and 4.11, did you find any solution in the meantime?
Would be most helpful!

Thank you

Seamless server travel! Thank you!!!