I have started working with making a game meant to be played by several persons across the web.
I have it working and all, you can open it and play in a LAN but I have a problem. When I want to connect to another computer through the internet, not a LAN, the NAT in the router gets in the way (of course, it doesn’t know that an incomming call is for my computer and not my brother’s).
So, I know there are ways to configure a router, from your computer, so that it sends all calls to a certain Port to the same computer in the house. What I’m wondering is if there is a way to do this with Java and in that case I’d love to see some code with a function that takes an Integer (a port number) and makes the router send all received messages with that destination port to the computer that used this function. That way I’ll be able to set up a connection and let the game clients communicate with each other.
I hope this wasn’t confusing, I don’t know how to write it better I’m afraid.