Sign in to follow this  
NetCoaster

Network Programming.

Recommended Posts

My IP adddress is a private (local?) number "192.168.**.***". And I want to be able to host multiplayer games. How can I make it so that others can connect? (I'm living in a hotel where the interent is shared amongst everyone.)

Share this post


Link to post
Share on other sites
To do this you'd have to have port forwarding setup on whatever router is doing NAT at the hotel so any requests to the game server port get forwarded to your computer. To do this you'll have to ask the network admin very very nicely [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by NetCoaster
My IP adddress is a private (local?) number "192.168.**.***".

And I want to be able to host multiplayer games.

How can I make it so that others can connect?

(I'm living in a hotel where the interent is shared amongst everyone.)


You should probably be able to allow other on the same subnet (192.168.*) to be able to connect, but if you want people outside to connect, you'll probably be SOL, unless you have access to the Hotel's routers so you can open up a forwarding port to your computer...

Share this post


Link to post
Share on other sites
Quote:
how am I able to play this MMORPG called Tibia.

You are able to connect to other servers (allowing you to join games or view a web site), however a computer cannot connect to you unless you use that port forwarding thing mentioned above.

Share this post


Link to post
Share on other sites
Is there no way around it?

I don't have access to my Hotels' routers, and I dare not ask, since 'Server Software' is strictly against the rules (I really don't feel like explaining to them that Multiplayer games take up almost no bandwidth).

Share this post


Link to post
Share on other sites
pWn3d... *grin*

forwarding is the only way... it's rather simple if you think about it. if somebody connects from outside it arrives at the router first... where shall he send to request? => forwarding.

Share this post


Link to post
Share on other sites
Quote:
Original post by NetCoaster
Is there no way around it?

Well, it's not necessarily impossible. But there's no easy solution eighter.
You could set up an external server (i.e. a computer with a public ip or port forwarding) as an introducer and use NAT punch-through.
It might also be possible to setup an ip-tunnel with the other players.

Share this post


Link to post
Share on other sites
Quote:
forwarding is the only way


Not true. Proper multi-player games support NAT peer-to-peer punch-through.

As, might I add, is explained in the Networking forum FAQ, so perhaps moving to this forum was exactly the right thing to do.

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
Quote:
forwarding is the only way


Not true. Proper multi-player games support NAT peer-to-peer punch-through.

As, might I add, is explained in the Networking forum FAQ, so perhaps moving to this forum was exactly the right thing to do.


Yes, but to be able to do the punch through you have to go through a host. Otherwise both sides don't know to open the connection simultaneusly. So, hosting behind the NAT is out of question, unless you have a third server outside the NAT that initates the connection. That is usually true if you use some kind of master server or other matchmaking system, that you have control of and integrated into your game properly. However if you are writing a standalone server, then port-forwarding is the only way to go.

Share this post


Link to post
Share on other sites
That's why services like GameSpy.net exist, as well as Battle.net (although they don't actually use Battle.net to do UDP punch-through).

Anyway, wouldn't you want the game registration server to run under your control anyway? That way, you can ban stolen registration codes and stuff, as well as keep a good gauge on what your game community is up to.

Share this post


Link to post
Share on other sites
That's certainly true for commercial games. But if you are writing an independent game, then you might not have the luxury of having a contract with "one of the big" or being able to host your own matchmaking service.

And now slightly off-topic.
Even if you are in a commercial game project, there might be problems, as those services are EXPENSIVE. And getting the publisher convinced is not the easiest project in the world. It really hurts to program a game that works with XBox Live. And then be forced to just support LAN on PC, even if almost everything is done, just the matchmaking part is missing. The only thing I could do was to make some commandline options so that you at least can play online if you want, and know your friends ip. And yes the actual network code supports NAT punch-through.

Share this post


Link to post
Share on other sites
Maybe you could bring Open Source to the rescue? Write a simple matchmaking protocol, and document it. Then release an open-source matchmaker server that people can compile and run on open hardware they have available. If the game is any good, servers are likely to show up.

Have a dialog box where the user can enter the name and port of a matchmaker, and remember it when re-launching the application, so it won't have to be done more than once.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this