How to manually force a client to connect to specific port?
by Stephen Zepp · in Torque Game Engine · 06/24/2004 (7:18 pm) · 1 replies
Goal: We have one primary server that we use as our development and testing "server". We want to be able to have multiple copies of the "same" server process running--one that is our "stable" release, so testing group can pound on it, and one or more "deve" versions so that each developer can pound on their own server during implementation/development.
Short Version: Same $JoinAddress, different $Pref::Server::Port's.
As far as I can tell, there are multiple references in many (> 5) init/default.cs files for the client, but there doesn't seem to be any way to actually use these in a connect string. None of the $pref::Net::Port variables stored in any of these files are actually used in an assignment statement or method call, and digging through the code I keep referring back to ConsoleMethods and direct socket code that seems to only allow an address to be passed to the connection initialization.
The platform socket code seems to have 28000 hard coded, at least from the client side, as a UDP port to connect to (winNet.cc(38): static S32 defaultPort = 28000; , etc).
Am I missing something really obvious here, or is 28000 really hard coded, and a different port can't be assigned via script for a client to connect to?
Short Version: Same $JoinAddress, different $Pref::Server::Port's.
As far as I can tell, there are multiple references in many (> 5) init/default.cs files for the client, but there doesn't seem to be any way to actually use these in a connect string. None of the $pref::Net::Port variables stored in any of these files are actually used in an assignment statement or method call, and digging through the code I keep referring back to ConsoleMethods and direct socket code that seems to only allow an address to be passed to the connection initialization.
The platform socket code seems to have 28000 hard coded, at least from the client side, as a UDP port to connect to (winNet.cc(38): static S32 defaultPort = 28000; , etc).
Am I missing something really obvious here, or is 28000 really hard coded, and a different port can't be assigned via script for a client to connect to?
Torque 3D Owner Stephen Zepp
You can simply add the requested port number to the end of the $JoinAddress with a colon separator:
111.222.33.444:28010 works great!
FYI, the server does use $Pref::Server::Port directly (the client does not use $pref::Net::Port however), so all you have to do to configure the server is change your $Pref::Server::Port.