Download

Dedicated Server Retrieve Session Port

Hello,

I have created a dedicated server and I am able to connect to it successfully from the game.
I’m using node.js to open the dedicated server session. My problem is that I need to either retrieve the automatically generated port for the session that I open, or to specify the port right before opening the session.

Is there a way to do one of these two? or maybe another way to get hold of the port?

Thanks in advance

Elie

Since you using Node.js, can’t you catch it with a regexp by checking the output.log file ? Alternatively you could create myself a function that dumps the output into a txt file.

Thank you for your reply Burnz.

Well first of all I can’t seem to find the file you mentioned “output.log”, and I can’t even find any file that is logging the ports of the server.
Second of all I would implement a function that outputs into a txt file, but that was my question, How to do it?

All I need is to get my hands on the port so I can return it to the players, and the reason I am using Node.js is because I am using it as a webserver between the clients and GameSparks.

Any ideas are appreciated.

I think the output.log is located under the Saved/Logs folder of your project. Another idea here :

Simply do a “netstat -aon”, it shows the PID of all connections which you can compare with the output from “tasklist” (under windows).

Also note, that in your DefaultEngine.ini you can specify the port in use (Default is 27015). (GameServerQueryPort=27015)

Thanks for the tips Burnz.
I guess this is a matter of cmd and not unreal engine.
I’ll try them in about a week because I’m working on another module at the moment.

If someone has any ideas please do share.
Thanks in advance!