Hi,
I have a Windows container build in Playfab set up where the UnrealServerGsdkHostPort is set to 56100.
I assumed this would be overridden to whatever value the server instance gets allocated when getting initialized.
However, the port is never overridden and is kept at 56100.
Example log:
[2022.03.24-13.16.46:036][ 0]LogPlayFabGSDK: Warning: GSDK Game server listening port: 56100
[2022.03.24-13.16.46:036][ 0]LogPlayFabGSDK: Warning: GSDK Game client connection port: 30000
[2022.03.24-13.16.46:036][ 0]LogPlayFabGSDK: Warning: Assigning Unreal Server Host Port to MPS port: 56100
Here, the server instance gets the connection port 30000 allocated from Playfab.
But it is not used in GSDK to override the connecting port, instead we use the game server listening port 56100.
As a result, the session gets hosted on port 56100, and if you try to connect, it simply fails since that is not the actual port that is opened to the instance. Another result is that multiple servers with the same IP and Port show up in our backend session list (EOS).
Is this intended, or are these variables mixed up?
if (GamePorts.Name == TEXT("UnrealServerGsdkHostPort")) { UE_LOG(LogPlayFabGSDK, Warning, TEXT("GSDK Game server listening port: %d"), GamePorts.ServerListeningPort); UE_LOG(LogPlayFabGSDK, Warning, TEXT("GSDK Game client connection port: %d"), GamePorts.ClientConnectionPort); UnrealServerGsdkHostPort = GamePorts.ServerListeningPort; break; }
The comments are a bit confusing:
/// <summary> /// The port at which the game server should listen on (maps externally to <see cref="m_clientConnectionPort" />). /// For process based servers, this is determined by Control Plane, based on the ports available on the VM. /// For containers, this is specified by the game developer in the Build configuration. /// </summary> UPROPERTY(BlueprintReadOnly) int32 ServerListeningPort = 0; /// <summary> /// The public port to which clients should connect (maps internally to <see cref="m_serverListeningPort" />). /// </summary> UPROPERTY(BlueprintReadOnly) int32 ClientConnectionPort = 0;
The comment for ClientConnectionPort says "see cref="m_serverListeningPort" and vice versa.
Is this code bugged and actually supposed to be the other way around?
I am also a bit unsure of the difference between these variables, even after reading around here and there from where I can find information about these variables.
My suspicion is that the GSDK code assumes that both of these variables will have the same value, and therefore just picking one of them to represent the bound port, but I might be completely wrong there.
If I swap the code around, it properly binds to the overridden port instead, but client won't connect.
Cheers,
Linus