Game Development Community

Which IP address to use?

by Nicolai Dutka · in Torque Game Builder · 05/06/2008 (2:38 pm) · 8 replies

I have a debug build of my game so I can run 2 instances at once. Let's call them WI2.exe and WI2_d.exe. I have both running.

I enter createServer(1); in my console on WI2 and it creates it successfully. I can see "Sending heartbeat to master server [IP:69.64.50.217:28002]" and the following line "Received info request from a master server [IP:69.64.50.217:28002]".

I can run commandToClient and commandToServer with no problems.

I can't get WI2_d to connect to the server.

My PC has 4 network devices including: router, 2 onboard LAN connections (one is used, one is not), 1 Wireless network connection

There are other PC's on the router as well. I connect via Wireless AND 1 ethernet. My local IP addresses are: 192.168.254.10 and 192.168.254.50.

I tried using both of those as well as 127.0.0.1 and my router's IP address for the internet (which changes once in a while because I have DSL for now).

No matter what address I try, the WI2_d won't connect to the server. I have the server unblocked on the firewall and the ports forwarded on the router to my active Wireless network address.

WI2_d says "Sending connect challenge request" and then nothing happens. WI2 says nothing about receiving a connection and echo(clientGroup.getCount()) returns a "1" which is WI2 connected to its own server as a client (player 1).

I don't know if I explained that very well, let me know if you need more info to help...

#1
05/06/2008 (3:36 pm)
Ok, so turns out my WI2_d was not executing the serverConnection.cs file. I fixed that and now I get server timed out errors after only 10 seconds of trying...

"Your connection to the server timed out"
#2
05/07/2008 (10:10 am)
Nobody knows what to try here?
#3
05/07/2008 (10:42 am)
For some reason, I tried having WI2 connect to itself. (Yes, it is ALREADY connected). I tried using connectToServer("192.168.254.10"); and for some reason, it actually gets an answer (right before disconnecting itself since there was already a connection).

So the point is, WI2 can connect to itself using connectToServer but WI2_d will NOT connect to it. It just times out right away.

I triple checked all my router and firewall settings and everything is good to go. I am 100% confident in this aspect as I am skilled in getting ports through a router/firewall.
#4
05/08/2008 (6:48 am)
I tried doing this as simple as possible. I used the tutorial.base folder and made ZERO changes to it. I added the DEBUG build of TorqueGameBuilder.exe.

I ran both TGB and TGB_debug. I had TGB create a server and got a message that server was created succussfully and that I am in fact connected. I try to connect with TGB_debug and it WILL NOT connect. I don't know if it is not sending out the connection request properly or if TGB is not listening/receiving properly and have no idea how to diagnose this.

Any suggestions would be helpful!
#5
05/08/2008 (7:20 am)
I personally haven't looked at the network components of TGB since its not robust enough for anything I would use it for. Pershaps someone who has used it can help out here.

If I WERE to try and work with it, I'd use two complete different systems for testing. Make sure that there are no software/hardware controls in place to prevent the applications from communicating. Then from that point fire up Ethereal/Wireshark, sniff the communication, sort it by the stream and find out where the breakdown is. That would be enough to determine which of the two apps/clients was having issues.
#6
05/08/2008 (7:32 am)
I'll look into Ethereal and Wireshark.

I certainly have tried running this on 2 seperate computers both on local networks and over the internet with no change in results.

I just now tried using the built-in networking gui:

canvas.pushDialog(networkmenu)
canvas.pushDialog(startservergui)
canvas.pushDialog(joinservergui)

Using those, I created a server and my console echos look a little different. I then used those on my debug build to try and connect and they do NOT see the game in the server list (LAN or Master).

Remember, this is a fresh install of TGB 1.7.2 and using the tutorial.base folder with NO changes.
#7
05/08/2008 (7:59 am)
WOOT! I got the server listed and got my client to connect!

I went back through the checkers tutorial and found I was missing an important line of code in common.cs:

$Game::UsesNetwork = true;

I wasn't ever told about the checkers tutorial and had been executing my own network scripts by reading through the server.cs and client.cs codes and seeing what is needed. I guess I did it all the way the built-in network stuff was doing it, but I missed a line somewhere. So, I took out my code and reverted to all built-in stuff and am taking it from there.

At any rate, I am on back on track!
#8
05/08/2008 (12:19 pm)
Aha! Thanks for reminding me, Nicolai. I went through the same problem but couldn't remember how I fixed it. :) I'm sticking this on the wiki...