Let's Make Robots!

I need help for game testing - solved

Okay, I'm delighted to say that my latest project, a python online multiplayer game is almost done! All works as expected (except that my masterserver keeps resetting its server list every half-hour, and that the Server.exe bypasses its interface and runs as an invisible process... hey at least it still runs!)

One more thing, NAT. NAT traversal is some nasty business. On LANs the game works just fine, it's the external connections that I haven't been able to debug yet, because I honestly don't have anyone with enough know-how to test with. 

So, I'm looking for someone to run the game, and I'll just wireshark the session to see wot the hell is going wrong. If that fails I'd like the other person to port forward 6385, then test again. If that doesn't work, then I suspect it's my own setup that won't allow inbound connections to the server. I'd then like the volunteer to host the server and I'll check if I can connect to it. If all this goes to hell then I think we can try the pwnat program I nicely compiled to an exe. All in all it's a 150 around ten mb download and like five minutes of time. 

I would greatly appreciate someone's help with this, because it's really frustrating to have the project hanging on this one point. 

Windows branch (I have a source branch too, but it has dependencies involved):

https://github.com/Ohmnivore/Frenzy/tree/Windows

Here's the boiled down code:

https://drive.google.com/folderview?id=0B54p-Cx0oMPgbWYta2VHdEplWVU&usp=sharing

You can either run the source (python 2.7 + legume) or run ServerTest.exe or ClientTest.exe. ServerIP.txt is the IP to bind to, and ClientIP.txt is the IP to connect to. If you're running the exes make sure you download all the contents of the folder. 

One more thing I noticed is that everytime I connect to the server, the client port seems to vary for some reason. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Wow. Screw windows. In the end I got sick of asking people to test, so I left my laptop at my grandpa's and teamviewed it from my ubuntu desktop at home. Turns out port forwarding worked fine on ubuntu. I can't belive how much time I lost trying to get it working with Windows. I had even disabled every bit of security to allow NAT traversal, but to no avail.

PS Thanks mogul! I didn't consider UPnP in the past, but it's gonna be my last resort if anything happens.

Port forwarding should be done from your router not from the OS itself. I've never had issues forwarding ports to windows based machines except remembering to update the forwarding rules when I moved a terraria server from desktop to laptop :P

I know, but for some reason the changes I did from my router seemed to not affect my windows laptop. I even DMZed it all to hell but that didn't work. However port forwarding to a linux machine solved it all. It's bizarre. I have also tried adding rules to the firefall, and disabling mcafee.

I swear mcafee is a virus in its own right (ok malware, it doesnt actually reach the definition of a virus). Which reminds me: http://www.youtube.com/watch?v=bKgf5PaBzyg

I know! I keep telling my dad it's a piece of crap but he's blinded by it's wonderful facade. The power of marketing...

That video is hilarious. Maybe my dad will change his mind after all.

I just passed my eyes through the code, but legume seems to create new sockets for each client and then bind, could it be those port adrresses you are seeing???

Thanks a lot! It turned out that the client socket was binding to, err, well whatever the OS felt was appropriate. Legume was passing 0 as port number for some reason which caused the OS to choose for itself. Now port forwarding should actually have effect :)

Hooray

Normally clients use a fixed, in your case 6385, value as destination and then a random value as the source port. That's a way to avoid conflicts, the server owns the destination port space, and the client owns the source port space.

Then, when the server gonna answer the client, it is supposed to swap these values to the outgoing packet has 6385 as source and the client's selected random value as the destination.

The typical NAT device in front of a residential PC will record the outgoing request from client to server, and put the ip-source-dest and port-source-dest int a table, and then when seeing the answer know which local client will need it.

On the other hand, if the server alså is situated behind a NAT device you will need something to help that router, it could be STUN, UPnP of some config. 

I don't know if your game will be centralized or p2p. If all players connect to a central server it will be easier for your clients. If it's true p2p, where clients communicate directly to each other you are looking int the same communication issues as they have with SIP and bittorrent

Here's the boiled down code:

https://drive.google.com/folderview?id=0B54p-Cx0oMPgbWYta2VHdEplWVU&usp=sharing

You can either run the source (python 2.7 + legume) or run ServerTest.exe or ClientTest.exe. ServerIP.txt is the IP to bind to, and ClientIP.txt is the IP to connect to. If you're running the exes make sure you download all the contents of the folder. 

One more thing I noticed is that everytime I connect to the server, the client port seems to vary for some reason. 

 

That am I supposed to see with that example code? After I changed serverip and clientip files to my local ip I start first the server and then the client. Then server says "New guy connected from: ('192.168.6.10', 51161)" and on the client I get "Connected successfully!"

After that, nothing happens. 

I notice that both server and client are chewing CPU cycles as fast as they can, but that might be due to the over simplified code we are playing with.

Ah yes, I'm on linux: Python 2.7.4