Binding server to IP
by Thomas Salisbury · in Torque Game Engine Advanced · 07/30/2009 (2:41 pm) · 11 replies
I am curious if there is an engine function to bind a dedicated server to a specific IP. I notice the logs binds to the default IP, can someone post the file reference in the source that I would be looking for, to modify that if it doesn't already have that option.
Thanks
Thanks
About the author
Managing Partner DarkForge LLC
#3
If you don't have these concepts, it's better to read a beginning book of C++, before trying to understand the code and change it.
Anyways. Pref::Net::BinAddress, is a script variable, you should find it in the .cs files and see its content. I'm not sure if it is the address of the dedicated server, but if it is, you can just change its value in script.
08/03/2009 (1:07 am)
Well, the type returned from that function is char*, not char, that is a pointer to a char, this usually means a pointer to the first char of a string that can be made of a single char or also empty.If you don't have these concepts, it's better to read a beginning book of C++, before trying to understand the code and change it.
Anyways. Pref::Net::BinAddress, is a script variable, you should find it in the .cs files and see its content. I'm not sure if it is the address of the dedicated server, but if it is, you can just change its value in script.
#4
I am doing that. Have been for a while now, I guess I just hadn't got to that part yet.
I can't find it anywhere in the scripts. I guess I need to look though all the example projects and see if I can find it in one, and see how they used it, because I can't find any reference to it except that one place.
08/03/2009 (1:47 am)
Quote:If you don't have these concepts, it's better to read a beginning book of C++, before trying to understand the code and change it.
I am doing that. Have been for a while now, I guess I just hadn't got to that part yet.
Quote:Anyways. Pref::Net::BinAddress, is a script variable, you should find it in the .cs files and see its content. I'm not sure if it is the address of the dedicated server, but if it is, you can just change its value in script.
I can't find it anywhere in the scripts. I guess I need to look though all the example projects and see if I can find it in one, and see how they used it, because I can't find any reference to it except that one place.
#5
But, what you are trying to do, is to know at which address the server will reply? Do I have understood correctly?
08/03/2009 (2:05 am)
I haven't the code here, so I can't help you more for now.But, what you are trying to do, is to know at which address the server will reply? Do I have understood correctly?
#6
08/03/2009 (4:33 am)
I wish one of the GG guys would reply since they are the ones the coded this stuff.
#7
What I am trying t do is tell a dedicated server which IP address to run on. When your on a dedicated server, you usually have at least 5 IP address for that box. I never like to use the main IP address for game servers, because most of the traffic comes in on that IP. So I am trying to tell the server (when using -dedicated) which IP address to "bind" to, much the same you do with the port.
08/03/2009 (5:34 am)
@davidWhat I am trying t do is tell a dedicated server which IP address to run on. When your on a dedicated server, you usually have at least 5 IP address for that box. I never like to use the main IP address for game servers, because most of the traffic comes in on that IP. So I am trying to tell the server (when using -dedicated) which IP address to "bind" to, much the same you do with the port.
#8
Looks like you can change the port being bound to with setNetPort(). This command is used in game/common/game/Scripts/common.cs, line 37. If you add
08/03/2009 (10:30 am)
I just made a quick test, maybe it's helpful.Looks like you can change the port being bound to with setNetPort(). This command is used in game/common/game/Scripts/common.cs, line 37. If you add
$Pref::Net::BindAddress = "xxx.xxx.xxx.xxx"; // set your address hereabove that line, it seems like a dedicated server is bound to that IP and port.
#10
08/03/2009 (10:32 pm)
I only had put the $pref variable stuff it in that file because I knew there was that setNetPort() call. That doesn't mean you have to add the $pref variable in that file as well. It was just a quick test and should be good enough to get you started finding a cleaner solution :)
#11
08/04/2009 (1:01 pm)
yeah. I find that in the source files, but I have been unable to make the scripting pass it back.
Torque Owner Thomas Salisbury
Three Forge Games
Now my limited knowledge of C++ isn't a char only a single character?