RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
Running a game server - Questions
 
Post new topic Reply to topic Goto page 1, 2  Next 
View previous topic - View next topic  
Author Message
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Wed Jun 13, 2007 3:11 pm    Post subject: Running a game server - Questions [quote]

Hello,

after a long break (anyone remember H-World ?) I once more want try to make a game. More precisely I'd like to make a multiuser game this time.

I came across The Mana World and saw you run your own game server. Sooner or later I'll need my own server for my game, too, well at the point when it's playable a bit.

Since you already have experiences with The Mana World I want to ask for advice. What do I have to care about if I run a game server? I mean mostly legal stuff. Can I just put up a server and run my game there, or is this too naive? Do I need some special "user agreement" for palyers to sign, to avoid problems?

Any pointers or advice will be highly appreaciated. Thanks in advance :)

/Hajo
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Tue Jun 19, 2007 3:31 pm    Post subject: [quote]

Noone here has any experiences with running a game server?

Sorry for double posting. I'm really looking for advice. I might be able to get a share of a friends server (hosted in Canada) or get a server in Germany.

Before I decide I'd like to know what I should care about, beyond pure technical issues like bandwidth and load on the server.
Back to top  
BadMrBox
Bringer of Apocalypse


Joined: 26 Jun 2002
Posts: 1022
Location: Dark Forest's of Sweden

PostPosted: Tue Jun 19, 2007 3:50 pm    Post subject: [quote]

I guess Bjorn would know. He has been busy awhile now but perhaps he will swing by here soon.
_________________
Back to top  
Terry
Spectral Form


Joined: 16 Jun 2002
Posts: 798
Location: Dublin, Ireland

PostPosted: Tue Jun 19, 2007 4:29 pm    Post subject: [quote]

Sorry, I would have replied but I really don't know very much about this. The Mana World project actually have a fairly active forum of their own - maybe you'll have more luck asking there?

Good to see you back, Hajo :)
_________________
http://www.distractionware.com
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Wed Jun 20, 2007 9:44 am    Post subject: [quote]

Thank you. It's good to be back :)

Although I used The Mana World as example, I meant to ask about running a game server in general.

It'll not be another Mana World server, but my own project. Today I got confirmation that I can host it on the canadian server.

My project is too young and incomplete to make much publicity yet. This is why I didn't want to post in The Mana World forums, they are very busy and there might spawn a lot of talk about the project itself which I don't want yet.

Part of this is to ask about issues that can come up from running a game server, and what one might do to prepare for that.

So if one of you ever had his/her own game server running (any game), I'm very interested in hearing about your experiences :)
Back to top  
Adam
Mage


Joined: 30 Dec 2002
Posts: 416
Location: Australia

PostPosted: Wed Jun 20, 2007 12:49 pm    Post subject: [quote]

I've had a simple server up for my multiplayer game in very early development. Wasnt much too it apart from opening the firewall.

I think you're only really going to have issues once you get a huge ammount of people playing. And i thing you should be more worried about finishing to a decient level first before you worry about that.
_________________
https://numbatlogic.com
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Thu Jun 21, 2007 11:47 am    Post subject: [quote]

Adam wrote:
I've had a simple server up for my multiplayer game in very early development. Wasnt much too it apart from opening the firewall.


I've done that, too. Had the server running on my own PC and invited a few friends to log in, mostly for testing if it really works.

Adam wrote:

I think you're only really going to have issues once you get a huge ammount of people playing. And i thing you should be more worried about finishing to a decient level first before you worry about that.


I agree. I finished the core components, basically people can log in, walk around and chat with each other. So I had the proof of concept, that the basic ideas indeed will work. I'm fairly sure there will be no showstoppers from here, technically, I mean in the sense of unsolveable problems. It's just work to complete all features and to create all needed graphics.

It seemed to be the right point to ask about the problems of running a server. It might be weeks, it might be some more months, but I wanted to know early if I must take care of something. Be it coding-wise or by preparing documents or anything. I just didn't know, and thus I thought I better ask, before I spend too much time on something that I cannot run later.

Another thing that I feel very uncertain about is scalability. It works well with 3 players, doesn't cause much load on the server, but will it still work with 30? Or 300? I have no idea how to test that. Any ideas?
Back to top  
MDS-MU
Monkey-Butler


Joined: 24 Oct 2006
Posts: 52
Location: sto dgo, DR.

PostPosted: Thu Jun 28, 2007 4:32 pm    Post subject: [quote]

Hajo wrote:
Adam wrote:
I've had a simple server up for my multiplayer game in very early development. Wasnt much too it apart from opening the firewall.


I've done that, too. Had the server running on my own PC and invited a few friends to log in, mostly for testing if it really works.

Adam wrote:

I think you're only really going to have issues once you get a huge ammount of people playing. And i thing you should be more worried about finishing to a decient level first before you worry about that.


I agree. I finished the core components, basically people can log in, walk around and chat with each other. So I had the proof of concept, that the basic ideas indeed will work. I'm fairly sure there will be no showstoppers from here, technically, I mean in the sense of unsolveable problems. It's just work to complete all features and to create all needed graphics.

It seemed to be the right point to ask about the problems of running a server. It might be weeks, it might be some more months, but I wanted to know early if I must take care of something. Be it coding-wise or by preparing documents or anything. I just didn't know, and thus I thought I better ask, before I spend too much time on something that I cannot run later.

Another thing that I feel very uncertain about is scalability. It works well with 3 players, doesn't cause much load on the server, but will it still work with 30? Or 300? I have no idea how to test that. Any ideas?


i´m also making a multiplayer game or 2. maybe i can share a few ideas with you.
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Mon Jul 23, 2007 10:24 am    Post subject: [quote]

mu_ds wrote:

i´m also making a multiplayer game or 2. maybe i can share a few ideas with you.


Would be very much appreciated :)

A few of the questions that I've been pondering about lately:

- What to do about hack attempts or denial of service attacks?
- What to do about users who deserve a ban but try to circumvent that?

My hosting options seem to have vanished, but on my own PC via dynamic DNS. Maybe it's better to have this on my own PC first, up a few hours a day for a groups of testers ... if I ever get testers, that is. Progress is real slow, I have way too many other interests, too, lately.
Back to top  
Verious
Mage


Joined: 06 Jan 2004
Posts: 409
Location: Online

PostPosted: Tue Jul 24, 2007 12:41 pm    Post subject: [quote]

Quote:
- What to do about hack attempts or denial of service attacks?


The key is to discard invalid connections as quickly as possible. I generally code the client to initiate the connection and send an initial packet. If the initial packet does not conform to the expected dataset, the connection can be immediately dropped without allocating further resources. Additionally, it can be valuable to setup lists of blocked IP addresses. If an IP sends too many bad requests, it gets added to the blocked list. Hack attempts can work the same way, too many invalid packets and the IP address / client is disconnected and added to the blocked list.

Quote:
- What to do about users who deserve a ban but try to circumvent that?


The simplest method that is fairly effective is to assign a GUID (globally unique identifier) or other guaranteed unique number to the game client when it is installed. Send this number during the initial handshake and check it against a list of blocked clients. Obviously this is not a foolproof method, but it will catch most people who try to create a new account. The key to this method is to ensure the GUID is always protected and not overwritten if the application is reinstalled. This method should effectively prevent the banned user from using the same computer to reconnect.

I generally combine this with other techniques to create a robust solution.
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Tue Jul 24, 2007 3:03 pm    Post subject: [quote]

Thanks, these are quite helpful ideas :)

I have started to implement ban-lists by IP and by name. What I do not have yet is a client ID that is more than that. I'll think about how to create such. Now I'd like Intel's "processor number feature" back ;)

One problem is, that the clients and the server are open source, so it's easy to have a modified client log in correctly and then just run a recorded set of moves/actions against the server, all valid. The idea of denial of service attacks came up with my tries to have an automated test for the client. The test suite runs the player around, let's him sit, stand, turn, equip items, take them off, drop and pick up items, basically I tried to have each basic action in there at least once.

These are all allowed moves. But if this kind of test is run repeatedly against the server, with low delays between the moves it will cause problems. The only way to prevent this seems to be to check the number of actions from a client over a certain timeframe, and first delay responses to that client, and in a second step disconnect the client if the backlog of messages becomes too big?

Real hacks, like creating items that the player did not have before, of duping items that he has, I hope to avoid by design of the communications layer. But I assume by time I'll be taught by ingenious players about the loopholes in my design ;P

Thanks again :)
Back to top  
Verious
Mage


Joined: 06 Jan 2004
Posts: 409
Location: Online

PostPosted: Tue Jul 24, 2007 4:27 pm    Post subject: [quote]

Never leave item creation or other sensitive actions to the client; always handle tasks that could lead to system compromise on the server. Always validate client supplied data/packets and include sanity/reality checks whenever possible. Always store game state data server-side.

Even with an open source client/server, you may want to limit the connections to the server to official clients otherwise you may find your world over-run by bots.
Back to top  
Bjorn
Demon Hunter


Joined: 29 May 2002
Posts: 1425
Location: Germany

PostPosted: Sat Jul 28, 2007 12:17 pm    Post subject: [quote]

I haven't been here for a long time, so I only just noticed this thread. The questions you ask about denial of service attacks and abuse by players are about problems that we are facing right now, and the answer as far as I see is to continually take action as players find new ways to abuse. Of course forward thinking, like putting logic at the server and designing the protocol in a way that minimizes possiblities of abuse, gives you a good headstart.

Problems we've been having relating to this area:

* A long time ago we introduced some special skills at a test, and one of them allowed you to make better deals in shops. At the casino, however, we had used a shop for exchanging money for casino coins at equal rates. Pretty soon, somebody figured out that using the skill, he could sell coins at a higher price than they costed. This opened the way to infinite money. The problem existed for long enough that we had little choice but to cap everybody's money to a reasonable amount after deleting all characters which had obtained the skill.

* About a year ago, somebody discovered that the rate at which you fire your bow is only limited at the client and not at the server. A simple client hack (very simple, since it's open source) thus allows you to use your bow as a machine gun. We are at the moment still using eAthena, which nobody of us wants to work on, so this problem was never solved. Once we have switched to our own server, tmwserv, this problem can easily be avoided.

* Recently, somebody figured out that you could crash the client of another player by sending it a big amount of trade requests. One part of the solution would be server side, in that one player should only receive one trade request at a time, but again, nobody wants to fix eAthena. The solution will thus be to fix this problem in the next version of our client.

Our efforts towards preventing this kind of abuse are minimal at the moment, and generally have a very low priority. This will probably change as soon as we switch to using our own server. We have currently no policy against bots and no "user agreement". This is mostly so that we can forward any complaints about behaviour of other players to the garbage bin as fast as possible.

About scalability, we generally keep efficiency in mind while programming but it's very hard to say how far a server can scale. In our case, we have splitted up responsibilities among multiple servers: account server, chat server and game server. The account server handles basically only logins (and doesn't stay connected to the client afterwards) while the chat server handles chat channels, guild chat and team chat. The game server handles the logic of everything that moves in the world. Since the world consists of many maps, which are otherwise independent of each other, multiple game servers can be run that each take care of a subset of the maps that make up the world. At the moment, we run the account, chat and game servers all on the same host, but they can be distributed as necessary later.

Lastly there is the question of availability. A server is bound to go down or be unavailable some of the time, so redundancy also needs to be taken into account. We haven't given this much thought yet, but later on this will probably mean that it should be possible to run multiple account and chat servers as well, which take over the job from one another once problems occur. For the game servers it will mean that they should be able to dynamically change the part of the world that they manage.
Back to top  
Verious
Mage


Joined: 06 Jan 2004
Posts: 409
Location: Online

PostPosted: Sun Jul 29, 2007 4:44 pm    Post subject: [quote]

Bjørn, as you mentioned, many of the issues you are facing could be eliminated at the server if you were running your own software. Have you considered writing a simple proxy server to inspect and validate incoming packets before forwarding them to the eAthena server while TMW server is in development.

The proxy server could apply sanity checks to incoming packets such rate limiting attack packets. Packets exceeding predefined rates could be discarded. The proxy could also rewrite or block specific packet types (such as those used to crash TMW client) providing an additional layer of isolation.
Back to top  
MDS-MU
Monkey-Butler


Joined: 24 Oct 2006
Posts: 52
Location: sto dgo, DR.

PostPosted: Sun Jul 29, 2007 6:09 pm    Post subject: [quote]

Hajo wrote:
mu_ds wrote:

i´m also making a multiplayer game or 2. maybe i can share a few ideas with you.


Would be very much appreciated :)

A few of the questions that I've been pondering about lately:

- What to do about hack attempts or denial of service attacks?
- What to do about users who deserve a ban but try to circumvent that?

My hosting options seem to have vanished, but on my own PC via dynamic DNS. Maybe it's better to have this on my own PC first, up a few hours a day for a groups of testers ... if I ever get testers, that is. Progress is real slow, I have way too many other interests, too, lately.


well what my server does is..
-check for illegal connections and get them auto banned
-illegal msg=auto banned
-if they don't send packets in some time..kicked
-encrypt and compress your msgs
-i made separated game servers and a master server
-game servers can ban any player and i can ban any game server
-get a site or something so ppl can report cheaters and have a couple of admins(maybe payed)
-remove error trapping(for testing) from the client and server for a while and try to hack em-crash em until you can't.
-make sure you can't inject code into your server option or maps,etc.
-no illegal chars(delimitors and others)
-don't make the client take control of anything
will tell u more when i remember..

test in your own comp for now.. when the game is decent enough to dl then get virtual servers(30$ a month) and you have total control of em. dedicated servers for later if it becomes VERY popular(100$ a month) and u have to pay even to reset em..

i want to look at your game and you can also test mine so maybe we can learn from what we've done.. laters
Back to top  
Post new topic Reply to topic Page 1 of 2 All times are GMT
Goto page 1, 2  Next 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum