Direct Connect to a Gameserver
The game server offers several ports to connect to. In most cases, you can differ between Gameport and (Steam) Query Port. If Steam is used to connect, often the Steam Query Port needs to be used. If the connection is made within the game itself, the Gameport is used.
Difference between Gameport and Query Port
The Gameport primary is used to play on the server. The Query Port just reports some information about the Gameservers status. Depending on the connection type it appears, that the Query Port is used for connection as well. In some cases, there is no difference between Gameport and Query Port. Unless there is no specific port defined on the Web interface they should be the same.
The Gameserver itself is running on the Gameport. So after connecting to any Gameserver, the traffic is using this port. For attempting to direct connect this port is usually used to connect.
The Query Port delivers some information about the current Gameservers state. It delivers information like the current player count, the servers name, and some other information. Steam is using this port for filling the server list for example. If you try to add this Gameserver to the Steam favorites this port needs to be used here.