Creating an MMORPG - Connecting/Opening Ports?

Started by
4 comments, last by Khatharr 11 years, 1 month ago

Hi, I was working on a mmo project a few months back, and I've been testing it out with a port with some problems. For some reason I couldn't connect to the internet for my game to access my server. I created a system where I can send a string text (done in java), and the server would respond confirming a connection to my game to the server.

I affirmed that the coding is fine with no errors, but maybe it's because I have been using a random port instead of one that could be used by more common online games.

Is there any suggested ports that I should use for my MMORPG? I need one that isn't firewalled and can connect accross the web using the string of text I'm sending through it.

Someone suggested I use port 80, but my concern is that hackers can access my files by using a browser with easy access to the data. Given that the database won't be part of the transmission, but logged seperately for security, I still don't think an HTTP port is the best option... I could be wrong.

Any suggestions?

Advertisement
The port you use shouldn't have any impact on security. for a browser to be able to access your server files your server has to explicitly make those available through the HTTP protocol.

clients should be able to connect to any port so the most likely issue is that your server (or a router between your server and the internet) is misconfigured
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

Here's a list of ports that are known to be used for various applications: http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

I'd not recommend using port 80 though, or any other port that are known to be used for obvious reasons. It wont cause any troubles for the clients though.

Yeah, I checked that out before. I guess I just need to keep testing.

I opened a port from the server-side, and tried to get a response from my game client. It didn't seem to work, and I checked my code over a few times (for both applications), and they seem to be fine.

I used a reference to make sure the connection protocol was correctly called too.

Is it possible that, even if I opened the port, that there could be something else I need to make the connection work?

Someone suggested I use port 80, but my concern is that hackers can access my files by using a browser with easy access to the data.


That's not how ports work, don't worry. Ports are just numbers, and don't give anybody any special mode of access. If you are listening on port 80 with your application then there can't be a web server also listening on port 80, which means there is no way a browser can get any web data from your machine, never mind access any files.

Is there any suggested ports that I should use for my MMORPG? I need one that isn't firewalled and can connect accross the web using the string of text I'm sending through it.

Technically you don't connect to MMOs across the web, you connect across the internet. The web is the subset of the internet that uses HTTP and web pages.

As for which ports are firewalled, any or all of them could be. Really you just have to pick an arbitrary number (above 1024, preferably) and let the client know which one it is.

Regarding debugging your problem - add plenty of logging on both sides to see if the connection gets made at all. There should be no doubt - either the connection is made, or it is not, and you need to check the error values to find out what is happening. That will usually give you some idea of what the problem is. (eg. bad host name, connection refused, connection timed out, some other exception). Ideally you test with both client and server on a local machine to verify that the logic is correct, then try remotely, opening firewalls and enabling port forwarding on the server end as necessary.

As for which ports are firewalled, any or all of them could be. Really you just have to pick an arbitrary number (above 1024, preferably) and let the client know which one it is.

This is the accepted method. Port numbers lower than 1024 are 'reserved' for specific purposes. In terms of programming and socket access this means almost nothing. You can use those port numbers just like any other. It just means that when people see those numbers they may expect the associated service on that port, so typically you want to use one that's not in the reserved range. Port numbers are 16 bits and unsigned. The maximum value is typically not used, so any number between 1024 and 65534 is available to you.

You may want to look into WireShark if you're working with networking. It will let you peek at what's actually going over the wire.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement