If you spin up multiple headless servers each with their own maps, by default the server will automatically get the next available port starting with 7777.
I try returning this value on the server, but using GetWorld()->GetLocalURL() returns a cached version of the loaded URL.
Calling it during the GameMode’s constructor returned the entry location with initial port (7777) but the server is hosted on 7779 based off the IPNetDriver. I tried triggering the GetLocalURL() during the BeginPlay, but I got a value for the map without port as you can see on the last line of this log extract.
How do you get the port information of the IPNetDriver?
This is what I’m getting in the logs:
[2018.04.20-17.15.01:518][ 0]GameLog: [GameMode] Local Address: :7777//Engine/Maps/Entry
[2018.04.20-17.15.01:519][ 0]LogTemp: Display: ParseSettings for GameNetDriver
[2018.04.20-17.15.01:519][ 0]LogTemp: Display: ParseSettings for IpNetDriver_0
[2018.04.20-17.15.01:519][ 0]LogTemp: Display: ParseSettings for GameNetDriver
[2018.04.20-17.15.01:520][ 0]LogInit: WinSock: Socket queue 131072 / 131072
[2018.04.20-17.15.01:643][ 0]LogInit: WinSock: I am ABuilderMachine (192.168.1.121:0)
[2018.04.20-17.15.01:643][ 0]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2018.04.20-17.15.01:644][ 0]LogNet: GameNetDriver IpNetDriver_0 IpNetDriver listening on port 7779
[2018.04.20-17.15.01:682][ 0]LogWorld: Bringing World /Game/MyMap.MyMap up for play (max tick rate 30) at 2018.04.20-13.15.01
[2018.04.20-17.15.01:683][ 0]LogWorld: Bringing up level for play took: 0.037252
[2018.04.20-17.15.01:684][ 0]GameLog: [GameMode] Begin Play Local Address: /Game/MyMap?Name=Player