Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm making an XNA game. When I started, I had a broadband connection with real IP, so I could host servers of any kind without any problem, but now I don't have that connection any more and I want to be able to let players from outside my local network connect to my server again. How do I do that? How do big guys at studios do that?

UPD: I guess it isn't fair to ask two questions in one, I just wanted to know if it's still possible for me to host a server on my connection, and if it's not an option, then how to do it without it (my connection). I believe I got my answers, though.


If I had an external dynamic address, I could use dynamic DNS service, but I don't, so I'll have to host my server on another machine (probably rent a server).

share|improve this question
    
Are you sure your new ISP even allows that? Some ISPs control traffic, and doesn't allow many kinds of incoming connections. –  William 'MindWorX' Mariager Jul 16 '12 at 2:12
    
It works over Hamachi, but it isn't a very good solution for many players. I want to be able to fix this without third party software if possible, and I know it must be. –  user1306322 Jul 16 '12 at 2:16
1  
I'm confused by your question. For any data to be routed over the internet it needs at very minimum a destination IP if you aren't on the same physical link. Are you asking what to do when you IP changes a lot, or are you really trying to do routing without an IP –  brandon Jul 16 '12 at 3:14
1  
@user1306322, Not being able to ping you doesn't mean your computer is unreachable. Ping is a service that can be either blocked or disabled by your new hardware or your ISP. –  William 'MindWorX' Mariager Jul 16 '12 at 7:22
2  
At best this should probably be on SuperUser... –  Nate Jul 26 '12 at 20:51
show 6 more comments

4 Answers 4

up vote 10 down vote accepted

The big guys, and even quite small guys, buy space on real servers with public IP addresses and real DNS service. It's not very expensive to rent a cloud server.

Services like http://dyndns.org can give your server a stable name, even though it doesn't have a stable IP address. Note that running servers with any significant amount of traffic on your home machine probably violates your terms of service, and will get you in trouble if you attract the attention of your ISP.

share|improve this answer
2  
Not to mention that it doesn't work. Good luck getting reasonable upstream to support your players. –  bobobobo Jul 26 '12 at 16:53
    
@bobobobo I have 35Mbps up and down at home on a fairly inexpensive residential account, and a web server on a dynamic IP via DynDns. Works great, and Verizon doesn't have any issues with it. –  David Lively Jul 27 '12 at 19:30
add comment

This is a general networking issue, not really game development, but it is usually easy to solve.

I assume that you are now behind a router(or anything similar), and when typing ipconfig in the console you only are able to see your LAN IP address.

If you are connected to the internet, you have an IP, that is for sure. Or better, your router device has an IP, and acts as a bridge between the network computers and the external internet, filtering all connections.

If you access the router configuration page, usually accessible by the browser at somewhere like http:\192.168.1.254\, depending on the device, you probably will find a section for port forwarding, or virtual servers, or anything like that, also depending on the manufacturer and model of the equipment.

By associating a port with your internal ip, you will have the router redirecting all connections to that port, directly to your computer. After this bypass is done, it should work normally.

Some routers also support a feature that actually maps the external ip to your machine, for every port and connection. Careful with this one, but if you feel safe with it, ipconfig will actually show the real ip. A ipconfig/release followed by a ipconfig/renew may be needed to finalize the changes.

Sorry for the clumsy answer, hope it helps.

share|improve this answer
    
No, I tried that and it doesn't work. It worked when I got behind a router on my real IP connection back then, but now it doesn't matter - behind router or not, there's no incoming connection from other players. –  user1306322 Jul 16 '12 at 1:37
    
It would help if you're behind a router on real IP connection though. –  user1306322 Jul 16 '12 at 1:44
add comment

I didn't downvote but I can assume you have downvotes because your question seems a little confusing.

It seems like you're asking one of two things, either you don't have an internet connection anymore and you still want to host a game server, in which case you cant, or you have a dynamic IP.

If it's a dynamic IP you need to search the web for a "Dynamic DNS tool". I think "DNS exit" is probably a good choice. What that will do is constantly update your IP to your DNS host. That way you can have some url example.com and the server that tells users what IP to go to will know your current IP.

Being that you're on the internet posting this, people are probably confused. You have an IP. It's either static or dynamic. Since you are likely on a residential internet service provider, it's likely dynamic, meaning your IP changes. That's not so good if you're hosting a server so you need a tool like dnsexit.

Go to whatismyip.com. That's your current IP. You can atleast give that to users for now and test out what you're working on.

All of that said, get a server. Liquidweb, godaddy, rackspace, anything. The big guys have their own data centers with three independant internet providers. The little guys like most on this site have one or more virtual private servers they use from hosting companies. I started using a VPS when I was 12, and they weren't well known at all then. No reason not to.

share|improve this answer
4  
A side note. If you have the IP and give it to your friends who are testing your game and it's still not working. You are either messing up the server and not actually listening on the ports you think you are, your router isn't forwarding the ports to your computer, or you have a firewall thats blocking the connection. –  brandon Jul 26 '12 at 16:39
add comment

Looking at DevilWithin and reading all the comments you've made so far, I'm going to have to agree with him. I can't upvote him because I have no rep, but...

The fact that you have access to the internet MUST MEAN you have a "real IP". Visit whatsmyip.org for it.

So what IP address are you giving the users? Since you claim it's not a "real IP" I'm assuming (and I may be wrong, but just an example) you're giving them 192.168.x.x or 10.x.x.x, and in either case... it would make perfect sense that they can't connect unless tunneling through Hamachi, because those are local addresses that don't exist on the internet, and won't exist on the internet. The fact that they can use Hamachi though means you're connected to the internet means you're still exposed to the outside world. What you need to do for clients to connect to you:

Take your local IP (192.168.whatever) and go to your router port forwarding page. How you do this is based on what router you have.

Open and forward whatever port you need. Let's say you open port 25040 and forward it to 192.168.whatever. Once you save those settings, you should be able to take your "Real IP" (again, open whatsmyip.org from the computer that's running the server to find out this number) along with the port, and the router will redirect it to your local ip, and clients should be able to connect.

Really hope this helps because this sounds exactly what you're doing from the posts you've made.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.