Hi Aren,
I was trying to create a game server locally & register it on a remote lobby server which means I have to use the following script:
--
TNServerInstance.Start(5127, udpPort, "server.dat", TNServerInstance.Type.Udp, Tools.ResolveEndPoint("ip", lobbyPort));
--
This will in turn fire the instance.StartRemote function instead of the default instance.StartLocal function.
I found out that unlike on instance.StartLocal where both tcp and upd ports are being opened, these ports were not being opened on instance.StartRemote.
---
mUp.OpenTCP(tcpPort);
mUp.OpenUDP(udpPort);
---
On instance.StartRemote the 2 lines above is missing so even though I will be able fetch the server info from the lobby server, I wont be able to connect because the ports are open.
The solution is to add these 2 lines inside the instance.StartRemote function like this: (which is exactly the same thing you did on instance.StartLocal)
--
if (mGame.Start(tcpPort, udpPort))
{
// - added lines
mUp.OpenTCP(tcpPort);
mUp.OpenUDP(udpPort);
// - added lines
if (!string.IsNullOrEmpty(fileName)) mGame.LoadFrom(fileName);
return true;
}
--
Doing so fixed my issue, so I just want to know if what I did was right and that maybe it needs to be included in the official package?
Thanks,
Junjet