Working with the shootergame example on the server browser and dedicated server, I have noticed it is showing the owning playerID in the browser, not the servername. I can change the servername there in the engine code, etc, but I don’t see where to get at the server name from the session object in the server browser code. Here’s the bit of code I’m talking about in the “ShooterServerList.cpp”:
for (int32 IdxResult = 0; IdxResult < NumSearchResults; ++IdxResult)
{
TSharedPtr<FServerEntry> NewServerEntry = MakeShareable(new FServerEntry());
const FOnlineSessionSearchResult& Result = SearchResults[IdxResult];
NewServerEntry->ServerName = Result.Session.OwningUserName;
NewServerEntry->Ping = FString::FromInt(Result.PingInMs);
NewServerEntry->CurrentPlayers = FString::FromInt(Result.Session.SessionSettings.NumPublicConnections
+ Result.Session.SessionSettings.NumPrivateConnections
- Result.Session.NumOpenPublicConnections
- Result.Session.NumOpenPrivateConnections);
NewServerEntry->MaxPlayers = FString::FromInt(Result.Session.SessionSettings.NumPublicConnections
+ Result.Session.SessionSettings.NumPrivateConnections);
NewServerEntry->SearchResultsIndex = IdxResult;
Result.Session.SessionSettings.Get(SETTING_GAMEMODE, NewServerEntry->GameType);
Result.Session.SessionSettings.Get(SETTING_MAPNAME, NewServerEntry->MapName);
ServerList.Add(NewServerEntry);
}
}
You can see it is populating the “ServerName” with “Result.Session.OwningUserName” instead of the server name. Can anyone point me to the best way to get the server name? I don’t see it as a property of “FOnlineSessionSearchResult”.
Thank you!